Class ZodEffects<T, Output, Input>

Type Parameters

  • T extends ZodTypeAny

  • Output = T["_output"]

  • Input = T["_input"]

Hierarchy

Constructors

  • Type Parameters

    Type Parameters

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

    • Output = T["_output"]

    • Input = T["_input"]

    Parameters

    Returns ZodEffects<T, Output, Input>

Properties

_def: ZodEffectsDef<T>
_input: Input
_output: Output
_type: Output
spa: ((data: unknown, params?: Partial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>)

Type declaration

superRefine: ((refinement: ((arg: Output, ctx: RefinementCtx) => any)) => ZodEffects<ZodEffects<T, Output, Input>, Output, Input>)

Type declaration

create: (<I>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"], I["_input"]>)

Type declaration

    • <I>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams): ZodEffects<I, I["_output"], I["_input"]>
    • Type Parameters

      Type Parameters

      • I extends ZodType<any, any, any, I>

      Parameters

      • schema: I
      • effect: Effect<I["_output"]>
      • Optional params: RawCreateParams

      Returns ZodEffects<I, I["_output"], I["_input"]>

createWithPreprocess: (<I>(preprocess: ((arg: unknown) => unknown), schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], I["_input"]>)

Type declaration

    • <I>(preprocess: ((arg: unknown) => unknown), schema: I, params?: RawCreateParams): ZodEffects<I, I["_output"], I["_input"]>
    • Type Parameters

      Type Parameters

      • I extends ZodType<any, any, any, I>

      Parameters

      • preprocess: ((arg: unknown) => unknown)
          • (arg: unknown): unknown
          • Parameters

            • arg: unknown

            Returns unknown

      • schema: I
      • Optional params: RawCreateParams

      Returns ZodEffects<I, I["_output"], I["_input"]>

Accessors

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

Methods

  • Parameters

    Returns string

  • Type Parameters

    Type Parameters

    • B extends string | number | symbol

    Returns ZodBranded<ZodEffects<T, Output, Input>, B>

  • Parameters

    • def: noUndefined<Input>

    Returns ZodDefault<ZodEffects<T, Output, Input>>

  • Parameters

    • def: (() => noUndefined<Input>)
        • (): noUndefined<Input>
        • Returns noUndefined<Input>

    Returns ZodDefault<ZodEffects<T, Output, Input>>

  • Parameters

    • description: string

    Returns ZodEffects<T, Output, Input>

  • Returns T

  • Returns boolean

  • Returns boolean

  • Type Parameters

    Type Parameters

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

    Parameters

    • option: T

    Returns ZodUnion<[ZodEffects<T, Output, Input>, T]>

  • Parameters

    Returns Output

  • Parameters

    Returns Promise<Output>

  • Type Parameters

    Type Parameters

    • RefinedOutput

    Parameters

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

          • arg: Output

          Returns arg is RefinedOutput

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

    Returns ZodEffects<ZodEffects<T, Output, Input>, RefinedOutput, RefinedOutput>

  • Parameters

    • check: ((arg: Output) => unknown)
        • (arg: Output): unknown
        • Parameters

          • arg: Output

          Returns unknown

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

    Returns ZodEffects<ZodEffects<T, Output, Input>, Output, Input>

  • Type Parameters

    Type Parameters

    • RefinedOutput

    Parameters

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

          • arg: Output

          Returns arg is RefinedOutput

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

    Returns ZodEffects<ZodEffects<T, Output, Input>, RefinedOutput, RefinedOutput>

  • Parameters

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

          • arg: Output

          Returns boolean

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

    Returns ZodEffects<ZodEffects<T, Output, Input>, Output, Input>

  • Type Parameters

    Type Parameters

    • NewOut

    Parameters

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

          Returns NewOut | Promise<NewOut>

    Returns ZodEffects<ZodEffects<T, Output, Input>, NewOut, Input>

Generated using TypeDoc