Type Parameters

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

Hierarchy (View Summary)

Constructors

Properties

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

Alias of safeParseAsync

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

Accessors

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

  • get enum(): Values<T>
  • Returns Values<T>

  • get Enum(): Values<T>
  • Returns Values<T>

  • get options(): T
  • Returns T

  • get Values(): Values<T>
  • Returns Values<T>

Methods

  • Parameters

    Returns string

  • Type Parameters

    • B extends string | number | symbol

    Parameters

    • Optionalbrand: B

    Returns ZodBranded<ZodEnum<T>, B>

  • Parameters

    • description: string

    Returns this

  • Returns boolean

  • Returns boolean

  • Parameters

    Returns T[number]

  • Parameters

    Returns Promise<T[number]>