title: Core.z. Zod Effects
A2A Node SDK - v0.1.0 / Modules / Core / z / ZodEffects
Class: ZodEffects<T, Output, Input>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Output | output<T> |
Input | input<T> |
Hierarchy
-
ZodType<Output,ZodEffectsDef<T>,Input>↳
ZodEffects
Table of contents
Constructors
Properties
Accessors
Methods
- _getOrReturnCtx
- _getType
- _parse
- _parseAsync
- _parseSync
- _processInputParams
- _refinement
- and
- array
- brand
- catch
- default
- describe
- innerType
- isNullable
- isOptional
- nullable
- nullish
- optional
- or
- parse
- parseAsync
- pipe
- promise
- readonly
- refine
- refinement
- safeParse
- safeParseAsync
- sourceType
- superRefine
- transform
- ~validate
Constructors
constructor
• new ZodEffects<T, Output, Input>(def): ZodEffects<T, Output, Input>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Output | output<T> |
Input | input<T> |
Parameters
| Name | Type |
|---|---|
def | ZodEffectsDef<T> |
Returns
ZodEffects<T, Output, Input>
Inherited from
Properties
_def
• Readonly _def: ZodEffectsDef<T>
Inherited from
_input
• Readonly _input: Input
Inherited from
_output
• Readonly _output: Output
Inherited from
_type
• Readonly _type: Output
Inherited from
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
| Name | Type |
|---|---|
I | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
schema | I |
effect | Effect<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
| Name | Type |
|---|---|
I | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
preprocess | (arg: unknown, ctx: RefinementCtx) => unknown |
schema | I |
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
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
Promise<SafeParseReturnType<Input, Output>>
Inherited from
~standard
• ~standard: Props<Input, Output>
Inherited from
Accessors
description
• get description(): undefined | string
Returns
undefined | string
Inherited from
ZodType.description
Methods
_getOrReturnCtx
▸ _getOrReturnCtx(input, ctx?): ParseContext
Parameters
| Name | Type |
|---|---|
input | ParseInput |
ctx? | ParseContext |
Returns
Inherited from
_getType
▸ _getType(input): string
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
string
Inherited from
_parse
▸ _parse(input): ParseReturnType<Output>
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
ParseReturnType<Output>
Overrides
_parseAsync
▸ _parseAsync(input): AsyncParseReturnType<Output>
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
AsyncParseReturnType<Output>
Inherited from
_parseSync
▸ _parseSync(input): SyncParseReturnType<Output>
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
SyncParseReturnType<Output>
Inherited from
_processInputParams
▸ _processInputParams(input): Object
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
Object
| Name | Type |
|---|---|
ctx | ParseContext |
status | ParseStatus |
Inherited from
_refinement
▸ _refinement(refinement): ZodEffects<ZodEffects<T, Output, Input>, Output, Input>
Parameters
| Name | Type |
|---|---|
refinement | (arg: Output, ctx: RefinementCtx) => any |
Returns
ZodEffects<ZodEffects<T, Output, Input>, Output, Input>
Inherited from
and
▸ and<T>(incoming): ZodIntersection<ZodEffects<T, Output, Input>, T>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
incoming | T |
Returns
ZodIntersection<ZodEffects<T, Output, Input>, T>
Inherited from
array
▸ array(): ZodArray<ZodEffects<T, Output, Input>, "many">
Returns
ZodArray<ZodEffects<T, Output, Input>, "many">
Inherited from
brand
▸ brand<B>(brand?): ZodBranded<ZodEffects<T, Output, Input>, B>
Type parameters
| Name | Type |
|---|---|
B | extends string | number | symbol |
Parameters
| Name | Type |
|---|---|
brand? | B |
Returns
ZodBranded<ZodEffects<T, Output, Input>, B>
Inherited from
catch
▸ catch(def): ZodCatch<ZodEffects<T, Output, Input>>
Parameters
| Name | Type |
|---|---|
def | Output |
Returns
ZodCatch<ZodEffects<T, Output, Input>>
Inherited from
▸ catch(def): ZodCatch<ZodEffects<T, Output, Input>>
Parameters
| Name | Type |
|---|---|
def | (ctx: { error: ZodError<any> ; input: Input }) => Output |
Returns
ZodCatch<ZodEffects<T, Output, Input>>
Inherited from
default
▸ default(def): ZodDefault<ZodEffects<T, Output, Input>>
Parameters
| Name | Type |
|---|---|
def | noUndefined<Input> |
Returns
ZodDefault<ZodEffects<T, Output, Input>>
Inherited from
▸ default(def): ZodDefault<ZodEffects<T, Output, Input>>
Parameters
| Name | Type |
|---|---|
def | () => noUndefined<Input> |
Returns
ZodDefault<ZodEffects<T, Output, Input>>
Inherited from
describe
▸ describe(description): this
Parameters
| Name | Type |
|---|---|
description | string |
Returns
this
Inherited from
innerType
▸ innerType(): T
Returns
T
isNullable
▸ isNullable(): boolean
Returns
boolean
Inherited from
isOptional
▸ isOptional(): boolean
Returns
boolean
Inherited from
nullable
▸ nullable(): ZodNullable<ZodEffects<T, Output, Input>>
Returns
ZodNullable<ZodEffects<T, Output, Input>>
Inherited from
nullish
▸ nullish(): ZodOptional<ZodNullable<ZodEffects<T, Output, Input>>>
Returns
ZodOptional<ZodNullable<ZodEffects<T, Output, Input>>>
Inherited from
optional
▸ optional(): ZodOptional<ZodEffects<T, Output, Input>>
Returns
ZodOptional<ZodEffects<T, Output, Input>>
Inherited from
or
▸ or<T>(option): ZodUnion<[ZodEffects<T, Output, Input>, T]>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
option | T |
Returns
ZodUnion<[ZodEffects<T, Output, Input>, T]>
Inherited from
parse
▸ parse(data, params?): Output
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
Output
Inherited from
parseAsync
▸ parseAsync(data, params?): Promise<Output>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
Promise<Output>
Inherited from
pipe
▸ pipe<T>(target): ZodPipeline<ZodEffects<T, Output, Input>, T>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
target | T |
Returns
ZodPipeline<ZodEffects<T, Output, Input>, T>
Inherited from
promise
▸ promise(): ZodPromise<ZodEffects<T, Output, Input>>
Returns
ZodPromise<ZodEffects<T, Output, Input>>
Inherited from
readonly
▸ readonly(): ZodReadonly<ZodEffects<T, Output, Input>>
Returns
ZodReadonly<ZodEffects<T, Output, Input>>
Inherited from
refine
▸ refine<RefinedOutput>(check, message?): ZodEffects<ZodEffects<T, Output, Input>, RefinedOutput, Input>
Type parameters
| Name |
|---|
RefinedOutput |
Parameters
| Name | Type |
|---|---|
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
▸ refine(check, message?): ZodEffects<ZodEffects<T, Output, Input>, Output, Input>
Parameters
| Name | Type |
|---|---|
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
refinement
▸ refinement<RefinedOutput>(check, refinementData): ZodEffects<ZodEffects<T, Output, Input>, RefinedOutput, Input>
Type parameters
| Name |
|---|
RefinedOutput |
Parameters
| Name | Type |
|---|---|
check | (arg: Output) => arg is RefinedOutput |
refinementData | IssueData | (arg: Output, ctx: RefinementCtx) => IssueData |
Returns
ZodEffects<ZodEffects<T, Output, Input>, RefinedOutput, Input>
Inherited from
▸ refinement(check, refinementData): ZodEffects<ZodEffects<T, Output, Input>, Output, Input>
Parameters
| Name | Type |
|---|---|
check | (arg: Output) => boolean |
refinementData | IssueData | (arg: Output, ctx: RefinementCtx) => IssueData |
Returns
ZodEffects<ZodEffects<T, Output, Input>, Output, Input>
Inherited from
safeParse
▸ safeParse(data, params?): SafeParseReturnType<Input, Output>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
SafeParseReturnType<Input, Output>
Inherited from
safeParseAsync
▸ safeParseAsync(data, params?): Promise<SafeParseReturnType<Input, Output>>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
Promise<SafeParseReturnType<Input, Output>>
Inherited from
sourceType
▸ sourceType(): T
Returns
T
superRefine
▸ superRefine<RefinedOutput>(refinement): ZodEffects<ZodEffects<T, Output, Input>, RefinedOutput, Input>
Type parameters
| Name |
|---|
RefinedOutput |
Parameters
| Name | Type |
|---|---|
refinement | (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput |
Returns
ZodEffects<ZodEffects<T, Output, Input>, RefinedOutput, Input>
Inherited from
▸ superRefine(refinement): ZodEffects<ZodEffects<T, Output, Input>, Output, Input>
Parameters
| Name | Type |
|---|---|
refinement | (arg: Output, ctx: RefinementCtx) => void |
Returns
ZodEffects<ZodEffects<T, Output, Input>, Output, Input>
Inherited from
▸ superRefine(refinement): ZodEffects<ZodEffects<T, Output, Input>, Output, Input>
Parameters
| Name | Type |
|---|---|
refinement | (arg: Output, ctx: RefinementCtx) => Promise<void> |
Returns
ZodEffects<ZodEffects<T, Output, Input>, Output, Input>
Inherited from
transform
▸ transform<NewOut>(transform): ZodEffects<ZodEffects<T, Output, Input>, NewOut, Input>
Type parameters
| Name |
|---|
NewOut |
Parameters
| Name | Type |
|---|---|
transform | (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut> |
Returns
ZodEffects<ZodEffects<T, Output, Input>, NewOut, Input>
Inherited from
~validate
▸ ~validate(data): Result<Output> | Promise<Result<Output>>
Parameters
| Name | Type |
|---|---|
data | unknown |
Returns
Result<Output> | Promise<Result<Output>>