Class ZodEnum<T>

Type Parameters

  • T extends [string, ...string[]]

Hierarchy (View Summary)

Constructors

Properties

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

Alias of safeParseAsync

create: {
    <U extends string, T extends readonly [U, U]>(
        values: T,
        params?: Zod.z.RawCreateParams,
    ): Zod.z.ZodEnum<Zod.z.Writeable<T>>;
    <U extends string, T extends [U, ...U[]]>(
        values: T,
        params?: Zod.z.RawCreateParams,
    ): Zod.z.ZodEnum<T>;
}

Accessors

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

  • get options(): T
  • Returns T

Methods

  • Parameters

    • description: string

    Returns this

  • Returns boolean

  • Returns boolean

  • Parameters

    Returns T[number]

  • Parameters

    Returns Promise<T[number]>