Type Parameters

Hierarchy-Diagram

UML class diagram of ZodUnion
Legend
icon for a class in the UML class diagram class
icon for an abstract class in the UML class diagram abstract class
icon for a public property in the UML class diagram public property
icon for a public method in the UML class diagram public method
underlined static property/method
italic abstract property/method

Hierarchy (view full)

Constructors

Properties

_def: ZodUnionDef<T>
_input: T[number]["_input"]
_output: T[number]["_output"]
_type: T[number]["_output"]
spa: ((data: unknown, params?: Partial<ParseParams>) => Promise<SafeParseReturnType<T[number]["_input"], T[number]["_output"]>>)

Alias of safeParseAsync

Type declaration

create: (<T_1 extends readonly [ZodTypeAny, ZodTypeAny, ZodTypeAny]>(types: T_1, params?: RawCreateParams) => ZodUnion<T_1>)

Type declaration

Accessors

  • get description(): undefined | string
  • Returns undefined | string

  • get options(): T
  • Returns T

Methods

  • Parameters

    • def: T[number]["_output"]

    Returns ZodCatch<ZodUnion<T>>

  • Parameters

    • def: ((ctx: {
          error: ZodError<any>;
          input: T[number]["_input"];
      }) => T[number]["_output"])
        • (ctx: {
              error: ZodError<any>;
              input: T[number]["_input"];
          }): T[number]["_output"]
        • Parameters

          • ctx: {
                error: ZodError<any>;
                input: T[number]["_input"];
            }
            • error: ZodError<any>
            • input: T[number]["_input"]

          Returns T[number]["_output"]

    Returns ZodCatch<ZodUnion<T>>

  • Parameters

    • description: string

    Returns this

  • Returns boolean

  • Returns boolean