Type Parameters

Hierarchy

Constructors

Properties

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

Type declaration

    • (data: unknown, params?: Partial<ParseParams>): Promise<SafeParseReturnType<undefined | T["_input"], undefined | T["_output"]>>
    • Alias of safeParseAsync

      Parameters

      Returns Promise<SafeParseReturnType<undefined | T["_input"], undefined | T["_output"]>>

superRefine: ((refinement: ((arg: undefined | T["_output"], ctx: RefinementCtx) => any)) => ZodEffects<ZodOptional<T>, undefined | T["_output"], undefined | T["_input"]>)

Type declaration

create: (<T_1>(type: T_1, params?: RawCreateParams) => ZodOptional<T_1>)

Type declaration

    • <T_1>(type: T_1, params?: RawCreateParams): ZodOptional<T_1>
    • Type Parameters

      Type Parameters

      • T_1 extends ZodType<any, any, any, T_1>

      Parameters

      • type: T_1
      • Optional params: RawCreateParams

      Returns ZodOptional<T_1>

Accessors

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

Methods

  • Parameters

    Returns string

  • Parameters

    • refinement: ((arg: undefined | T["_output"], ctx: RefinementCtx) => any)

    Returns ZodEffects<ZodOptional<T>, undefined | T["_output"], undefined | T["_input"]>

  • Parameters

    • def: noUndefined<T["_input"]>

    Returns ZodDefault<ZodOptional<T>>

  • Parameters

    • def: (() => noUndefined<T["_input"]>)
        • (): noUndefined<T["_input"]>
        • Returns noUndefined<T["_input"]>

    Returns ZodDefault<ZodOptional<T>>

  • Parameters

    • description: string

    Returns ZodOptional<T>

  • Returns boolean

  • Returns boolean

  • Type Parameters

    Type Parameters

    • T extends ZodType<any, any, any, T>

    Parameters

    • option: T

    Returns ZodUnion<[ZodOptional<T>, T]>

  • Parameters

    Returns undefined | T["_output"]

  • Parameters

    Returns Promise<undefined | T["_output"]>

  • Type Parameters

    Type Parameters

    • RefinedOutput extends any

    Parameters

    • check: ((arg: undefined | T["_output"]) => arg is RefinedOutput)
        • (arg: undefined | T["_output"]): arg is RefinedOutput
        • Parameters

          • arg: undefined | T["_output"]

          Returns arg is RefinedOutput

    • Optional message: string | Partial<Omit<ZodCustomIssue, "code">> | ((arg: undefined | T["_output"]) => Partial<Omit<ZodCustomIssue, "code">>)

    Returns ZodEffects<ZodOptional<T>, RefinedOutput, RefinedOutput>

  • Parameters

    • check: ((arg: undefined | T["_output"]) => unknown)
        • (arg: undefined | T["_output"]): unknown
        • Parameters

          • arg: undefined | T["_output"]

          Returns unknown

    • Optional message: string | Partial<Omit<ZodCustomIssue, "code">> | ((arg: undefined | T["_output"]) => Partial<Omit<ZodCustomIssue, "code">>)

    Returns ZodEffects<ZodOptional<T>, undefined | T["_output"], undefined | T["_input"]>

  • Type Parameters

    Type Parameters

    • RefinedOutput extends any

    Parameters

    • check: ((arg: undefined | T["_output"]) => arg is RefinedOutput)
        • (arg: undefined | T["_output"]): arg is RefinedOutput
        • Parameters

          • arg: undefined | T["_output"]

          Returns arg is RefinedOutput

    • refinementData: IssueData | ((arg: undefined | T["_output"], ctx: RefinementCtx) => IssueData)

    Returns ZodEffects<ZodOptional<T>, RefinedOutput, RefinedOutput>

  • Parameters

    • check: ((arg: undefined | T["_output"]) => boolean)
        • (arg: undefined | T["_output"]): boolean
        • Parameters

          • arg: undefined | T["_output"]

          Returns boolean

    • refinementData: IssueData | ((arg: undefined | T["_output"], ctx: RefinementCtx) => IssueData)

    Returns ZodEffects<ZodOptional<T>, undefined | T["_output"], undefined | T["_input"]>

  • Parameters

    Returns SafeParseReturnType<undefined | T["_input"], undefined | T["_output"]>

  • Parameters

    Returns Promise<SafeParseReturnType<undefined | T["_input"], undefined | T["_output"]>>

  • Type Parameters

    Type Parameters

    • NewOut

    Parameters

    • transform: ((arg: undefined | T["_output"], ctx: RefinementCtx) => NewOut | Promise<NewOut>)
        • (arg: undefined | T["_output"], ctx: RefinementCtx): NewOut | Promise<NewOut>
        • Parameters

          Returns NewOut | Promise<NewOut>

    Returns ZodEffects<ZodOptional<T>, NewOut, undefined | T["_input"]>

  • Returns T

Generated using TypeDoc