• Asynchronously parses the input using the provided Zod schema (v3 or v4) and returns the parsed value. Throws an error if parsing fails or if the schema is not a recognized Zod v3 or v4 schema.

    Type Parameters

    • T

      The expected output type of the schema.

    Parameters

    • schema: InteropZodType<T, T>

      The Zod schema (v3 or v4) to use for parsing.

    • input: unknown

      The input value to parse.

    Returns Promise<T>

    A promise that resolves to the parsed value.

    If parsing fails or the schema is not a recognized Zod v3 or v4 schema.