Type Parameters

Hierarchy

Constructors

Properties

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

Type declaration

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

Type declaration

Accessors

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

Methods

  • Parameters

    Returns string

  • Parameters

    • refinement: ((arg, ctx) => any)
        • (arg, ctx): any
        • Parameters

          Returns any

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

  • Type Parameters

    • B extends string | number | symbol

    Parameters

    • Optional brand: B

    Returns ZodBranded<ZodOptional<T>, B>

  • Parameters

    • def: undefined | T["_output"]

    Returns ZodCatch<ZodOptional<T>>

  • Parameters

    • def: ((ctx) => undefined | T["_output"])
        • (ctx): undefined | T["_output"]
        • Parameters

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

          Returns undefined | T["_output"]

    Returns ZodCatch<ZodOptional<T>>

  • Parameters

    • description: string

    Returns ZodOptional<T>

  • Returns boolean

  • Returns boolean

  • Parameters

    Returns undefined | T["_output"]

  • Parameters

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

  • Type Parameters

    • RefinedOutput extends any

    Parameters

    • check: ((arg) => arg is RefinedOutput)
        • (arg): arg is RefinedOutput
        • Parameters

          • arg: undefined | T["_output"]

          Returns arg is RefinedOutput

    • Optional message: string | Partial<Omit<ZodCustomIssue, "code">> | ((arg) => Partial<Omit<ZodCustomIssue, "code">>)

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

  • Parameters

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

  • Type Parameters

    • RefinedOutput extends any

    Parameters

    • check: ((arg) => arg is RefinedOutput)
        • (arg): arg is RefinedOutput
        • Parameters

          • arg: undefined | T["_output"]

          Returns arg is RefinedOutput

    • refinementData: IssueData | ((arg, ctx) => IssueData)

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

  • Parameters

    • check: ((arg) => boolean)
        • (arg): boolean
        • Parameters

          • arg: undefined | T["_output"]

          Returns boolean

    • refinementData: IssueData | ((arg, ctx) => IssueData)

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

  • Type Parameters

    • RefinedOutput extends any

    Parameters

    • refinement: ((arg, ctx) => arg is RefinedOutput)
        • (arg, ctx): arg is RefinedOutput
        • Parameters

          Returns arg is RefinedOutput

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

  • Parameters

    • refinement: ((arg, ctx) => void)
        • (arg, ctx): void
        • Parameters

          Returns void

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

  • Type Parameters

    • NewOut

    Parameters

    • transform: ((arg, ctx) => NewOut | Promise<NewOut>)
        • (arg, ctx): NewOut | Promise<NewOut>
        • Parameters

          Returns NewOut | Promise<NewOut>

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

  • Returns T

Generated using TypeDoc