title: Core.z. Zod Effects

A2A Node SDK - v0.1.0 / Modules / Core / z / ZodEffects

Class: ZodEffects<T, Output, Input>

Core.z.ZodEffects

Type parameters

NameType
Textends ZodTypeAny
Outputoutput<T>
Inputinput<T>

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ZodEffects<T, Output, Input>(def): ZodEffects<T, Output, Input>

Type parameters

NameType
Textends ZodTypeAny
Outputoutput<T>
Inputinput<T>

Parameters

NameType
defZodEffectsDef<T>

Returns

ZodEffects<T, Output, Input>

Inherited from

ZodType.constructor

Properties

_def

Readonly _def: ZodEffectsDef<T>

Inherited from

ZodType._def


_input

Readonly _input: Input

Inherited from

ZodType._input


_output

Readonly _output: Output

Inherited from

ZodType._output


_type

Readonly _type: Output

Inherited from

ZodType._type


create

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

Type declaration

▸ <I>(schema, effect, params?): ZodEffects<I, I["_output"], input<I>>

Type parameters
NameType
Iextends ZodTypeAny
Parameters
NameType
schemaI
effectEffect<I["_output"]>
params?RawCreateParams
Returns

ZodEffects<I, I["_output"], input<I>>


createWithPreprocess

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

Type declaration

▸ <I>(preprocess, schema, params?): ZodEffects<I, I["_output"], unknown>

Type parameters
NameType
Iextends ZodTypeAny
Parameters
NameType
preprocess(arg: unknown, ctx: RefinementCtx) => unknown
schemaI
params?RawCreateParams
Returns

ZodEffects<I, I["_output"], unknown>


spa

spa: (data: unknown, params?: InexactPartial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>

Alias of safeParseAsync

Type declaration

▸ (data, params?): Promise<SafeParseReturnType<Input, Output>>

Parameters
NameType
dataunknown
params?InexactPartial<ParseParams>
Returns

Promise<SafeParseReturnType<Input, Output>>

Inherited from

ZodType.spa


~standard

~standard: Props<Input, Output>

Inherited from

ZodType.~standard

Accessors

description

get description(): undefined | string

Returns

undefined | string

Inherited from

ZodType.description

Methods

_getOrReturnCtx

_getOrReturnCtx(input, ctx?): ParseContext

Parameters

NameType
inputParseInput
ctx?ParseContext

Returns

ParseContext

Inherited from

ZodType._getOrReturnCtx


_getType

_getType(input): string

Parameters

NameType
inputParseInput

Returns

string

Inherited from

ZodType._getType


_parse

_parse(input): ParseReturnType<Output>

Parameters

NameType
inputParseInput

Returns

ParseReturnType<Output>

Overrides

ZodType._parse


_parseAsync

_parseAsync(input): AsyncParseReturnType<Output>

Parameters

NameType
inputParseInput

Returns

AsyncParseReturnType<Output>

Inherited from

ZodType._parseAsync


_parseSync

_parseSync(input): SyncParseReturnType<Output>

Parameters

NameType
inputParseInput

Returns

SyncParseReturnType<Output>

Inherited from

ZodType._parseSync


_processInputParams

_processInputParams(input): Object

Parameters

NameType
inputParseInput

Returns

Object

NameType
ctxParseContext
statusParseStatus

Inherited from

ZodType._processInputParams


_refinement

_refinement(refinement): ZodEffects<ZodEffects<T, Output, Input>, Output, Input>

Parameters

NameType
refinement(arg: Output, ctx: RefinementCtx) => any

Returns

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

Inherited from

ZodType._refinement


and

and<T>(incoming): ZodIntersection<ZodEffects<T, Output, Input>, T>

Type parameters

NameType
Textends ZodTypeAny

Parameters

NameType
incomingT

Returns

ZodIntersection<ZodEffects<T, Output, Input>, T>

Inherited from

ZodType.and


array

array(): ZodArray<ZodEffects<T, Output, Input>, "many">

Returns

ZodArray<ZodEffects<T, Output, Input>, "many">

Inherited from

ZodType.array


brand

brand<B>(brand?): ZodBranded<ZodEffects<T, Output, Input>, B>

Type parameters

NameType
Bextends string | number | symbol

Parameters

NameType
brand?B

Returns

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

Inherited from

ZodType.brand


catch

catch(def): ZodCatch<ZodEffects<T, Output, Input>>

Parameters

NameType
defOutput

Returns

ZodCatch<ZodEffects<T, Output, Input>>

Inherited from

ZodType.catch

catch(def): ZodCatch<ZodEffects<T, Output, Input>>

Parameters

NameType
def(ctx: { error: ZodError<any> ; input: Input }) => Output

Returns

ZodCatch<ZodEffects<T, Output, Input>>

Inherited from

ZodType.catch


default

default(def): ZodDefault<ZodEffects<T, Output, Input>>

Parameters

NameType
defnoUndefined<Input>

Returns

ZodDefault<ZodEffects<T, Output, Input>>

Inherited from

ZodType.default

default(def): ZodDefault<ZodEffects<T, Output, Input>>

Parameters

NameType
def() => noUndefined<Input>

Returns

ZodDefault<ZodEffects<T, Output, Input>>

Inherited from

ZodType.default


describe

describe(description): this

Parameters

NameType
descriptionstring

Returns

this

Inherited from

ZodType.describe


innerType

innerType(): T

Returns

T


isNullable

isNullable(): boolean

Returns

boolean

Inherited from

ZodType.isNullable


isOptional

isOptional(): boolean

Returns

boolean

Inherited from

ZodType.isOptional


nullable

nullable(): ZodNullable<ZodEffects<T, Output, Input>>

Returns

ZodNullable<ZodEffects<T, Output, Input>>

Inherited from

ZodType.nullable


nullish

nullish(): ZodOptional<ZodNullable<ZodEffects<T, Output, Input>>>

Returns

ZodOptional<ZodNullable<ZodEffects<T, Output, Input>>>

Inherited from

ZodType.nullish


optional

optional(): ZodOptional<ZodEffects<T, Output, Input>>

Returns

ZodOptional<ZodEffects<T, Output, Input>>

Inherited from

ZodType.optional


or

or<T>(option): ZodUnion<[ZodEffects<T, Output, Input>, T]>

Type parameters

NameType
Textends ZodTypeAny

Parameters

NameType
optionT

Returns

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

Inherited from

ZodType.or


parse

parse(data, params?): Output

Parameters

NameType
dataunknown
params?InexactPartial<ParseParams>

Returns

Output

Inherited from

ZodType.parse


parseAsync

parseAsync(data, params?): Promise<Output>

Parameters

NameType
dataunknown
params?InexactPartial<ParseParams>

Returns

Promise<Output>

Inherited from

ZodType.parseAsync


pipe

pipe<T>(target): ZodPipeline<ZodEffects<T, Output, Input>, T>

Type parameters

NameType
Textends ZodTypeAny

Parameters

NameType
targetT

Returns

ZodPipeline<ZodEffects<T, Output, Input>, T>

Inherited from

ZodType.pipe


promise

promise(): ZodPromise<ZodEffects<T, Output, Input>>

Returns

ZodPromise<ZodEffects<T, Output, Input>>

Inherited from

ZodType.promise


readonly

readonly(): ZodReadonly<ZodEffects<T, Output, Input>>

Returns

ZodReadonly<ZodEffects<T, Output, Input>>

Inherited from

ZodType.readonly


refine

refine<RefinedOutput>(check, message?): ZodEffects<ZodEffects<T, Output, Input>, RefinedOutput, Input>

Type parameters

Name
RefinedOutput

Parameters

NameType
check(arg: Output) => arg is RefinedOutput
message?string | Partial<Omit<ZodCustomIssue, "code">> | (arg: Output) => Partial<Omit<ZodCustomIssue, "code">>

Returns

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

Inherited from

ZodType.refine

refine(check, message?): ZodEffects<ZodEffects<T, Output, Input>, Output, Input>

Parameters

NameType
check(arg: Output) => unknown
message?string | Partial<Omit<ZodCustomIssue, "code">> | (arg: Output) => Partial<Omit<ZodCustomIssue, "code">>

Returns

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

Inherited from

ZodType.refine


refinement

refinement<RefinedOutput>(check, refinementData): ZodEffects<ZodEffects<T, Output, Input>, RefinedOutput, Input>

Type parameters

Name
RefinedOutput

Parameters

NameType
check(arg: Output) => arg is RefinedOutput
refinementDataIssueData | (arg: Output, ctx: RefinementCtx) => IssueData

Returns

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

Inherited from

ZodType.refinement

refinement(check, refinementData): ZodEffects<ZodEffects<T, Output, Input>, Output, Input>

Parameters

NameType
check(arg: Output) => boolean
refinementDataIssueData | (arg: Output, ctx: RefinementCtx) => IssueData

Returns

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

Inherited from

ZodType.refinement


safeParse

safeParse(data, params?): SafeParseReturnType<Input, Output>

Parameters

NameType
dataunknown
params?InexactPartial<ParseParams>

Returns

SafeParseReturnType<Input, Output>

Inherited from

ZodType.safeParse


safeParseAsync

safeParseAsync(data, params?): Promise<SafeParseReturnType<Input, Output>>

Parameters

NameType
dataunknown
params?InexactPartial<ParseParams>

Returns

Promise<SafeParseReturnType<Input, Output>>

Inherited from

ZodType.safeParseAsync


sourceType

sourceType(): T

Returns

T


superRefine

superRefine<RefinedOutput>(refinement): ZodEffects<ZodEffects<T, Output, Input>, RefinedOutput, Input>

Type parameters

Name
RefinedOutput

Parameters

NameType
refinement(arg: Output, ctx: RefinementCtx) => arg is RefinedOutput

Returns

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

Inherited from

ZodType.superRefine

superRefine(refinement): ZodEffects<ZodEffects<T, Output, Input>, Output, Input>

Parameters

NameType
refinement(arg: Output, ctx: RefinementCtx) => void

Returns

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

Inherited from

ZodType.superRefine

superRefine(refinement): ZodEffects<ZodEffects<T, Output, Input>, Output, Input>

Parameters

NameType
refinement(arg: Output, ctx: RefinementCtx) => Promise<void>

Returns

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

Inherited from

ZodType.superRefine


transform

transform<NewOut>(transform): ZodEffects<ZodEffects<T, Output, Input>, NewOut, Input>

Type parameters

Name
NewOut

Parameters

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

Returns

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

Inherited from

ZodType.transform


~validate

~validate(data): Result<Output> | Promise<Result<Output>>

Parameters

NameType
dataunknown

Returns

Result<Output> | Promise<Result<Output>>

Inherited from

ZodType.~validate