title: Core.z. Zod Intersection
A2A Node SDK - v0.1.0 / Modules / Core / z / ZodIntersection
Class: ZodIntersection<T, U>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
U | extends ZodTypeAny |
Hierarchy
-
ZodType<T["_output"] &U["_output"],ZodIntersectionDef<T,U>,T["_input"] &U["_input"]>↳
ZodIntersection
Table of contents
Constructors
Properties
Accessors
Methods
- _getOrReturnCtx
- _getType
- _parse
- _parseAsync
- _parseSync
- _processInputParams
- _refinement
- and
- array
- brand
- catch
- default
- describe
- isNullable
- isOptional
- nullable
- nullish
- optional
- or
- parse
- parseAsync
- pipe
- promise
- readonly
- refine
- refinement
- safeParse
- safeParseAsync
- superRefine
- transform
- ~validate
Constructors
constructor
• new ZodIntersection<T, U>(def): ZodIntersection<T, U>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
U | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
def | ZodIntersectionDef<T, U> |
Returns
ZodIntersection<T, U>
Inherited from
Properties
_def
• Readonly _def: ZodIntersectionDef<T, U>
Inherited from
_input
• Readonly _input: T["_input"] & U["_input"]
Inherited from
_output
• Readonly _output: T["_output"] & U["_output"]
Inherited from
_type
• Readonly _type: T["_output"] & U["_output"]
Inherited from
create
▪ Static create: <TSchema, USchema>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>
Type declaration
▸ <TSchema, USchema>(left, right, params?): ZodIntersection<TSchema, USchema>
Type parameters
| Name | Type |
|---|---|
TSchema | extends ZodTypeAny |
USchema | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
left | TSchema |
right | USchema |
params? | RawCreateParams |
Returns
ZodIntersection<TSchema, USchema>
spa
• spa: (data: unknown, params?: InexactPartial<ParseParams>) => Promise<SafeParseReturnType<T["_input"] & U["_input"], T["_output"] & U["_output"]>>
Alias of safeParseAsync
Type declaration
▸ (data, params?): Promise<SafeParseReturnType<T["_input"] & U["_input"], T["_output"] & U["_output"]>>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
Promise<SafeParseReturnType<T["_input"] & U["_input"], T["_output"] & U["_output"]>>
Inherited from
~standard
• ~standard: Props<T["_input"] & U["_input"], T["_output"] & U["_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<T["_output"] & U["_output"]>
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
ParseReturnType<T["_output"] & U["_output"]>
Overrides
_parseAsync
▸ _parseAsync(input): AsyncParseReturnType<T["_output"] & U["_output"]>
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
AsyncParseReturnType<T["_output"] & U["_output"]>
Inherited from
_parseSync
▸ _parseSync(input): SyncParseReturnType<T["_output"] & U["_output"]>
Parameters
| Name | Type |
|---|---|
input | ParseInput |
Returns
SyncParseReturnType<T["_output"] & U["_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<ZodIntersection<T, U>, T["_output"] & U["_output"], T["_input"] & U["_input"]>
Parameters
| Name | Type |
|---|---|
refinement | (arg: T["_output"] & U["_output"], ctx: RefinementCtx) => any |
Returns
ZodEffects<ZodIntersection<T, U>, T["_output"] & U["_output"], T["_input"] & U["_input"]>
Inherited from
and
▸ and<T>(incoming): ZodIntersection<ZodIntersection<T, U>, T>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
incoming | T |
Returns
ZodIntersection<ZodIntersection<T, U>, T>
Inherited from
array
▸ array(): ZodArray<ZodIntersection<T, U>, "many">
Returns
ZodArray<ZodIntersection<T, U>, "many">
Inherited from
brand
▸ brand<B>(brand?): ZodBranded<ZodIntersection<T, U>, B>
Type parameters
| Name | Type |
|---|---|
B | extends string | number | symbol |
Parameters
| Name | Type |
|---|---|
brand? | B |
Returns
ZodBranded<ZodIntersection<T, U>, B>
Inherited from
catch
▸ catch(def): ZodCatch<ZodIntersection<T, U>>
Parameters
| Name | Type |
|---|---|
def | T["_output"] & U["_output"] |
Returns
ZodCatch<ZodIntersection<T, U>>
Inherited from
▸ catch(def): ZodCatch<ZodIntersection<T, U>>
Parameters
| Name | Type |
|---|---|
def | (ctx: { error: ZodError<any> ; input: T["_input"] & U["_input"] }) => T["_output"] & U["_output"] |
Returns
ZodCatch<ZodIntersection<T, U>>
Inherited from
default
▸ default(def): ZodDefault<ZodIntersection<T, U>>
Parameters
| Name | Type |
|---|---|
def | noUndefined<T["_input"] & U["_input"]> |
Returns
ZodDefault<ZodIntersection<T, U>>
Inherited from
▸ default(def): ZodDefault<ZodIntersection<T, U>>
Parameters
| Name | Type |
|---|---|
def | () => noUndefined<T["_input"] & U["_input"]> |
Returns
ZodDefault<ZodIntersection<T, U>>
Inherited from
describe
▸ describe(description): this
Parameters
| Name | Type |
|---|---|
description | string |
Returns
this
Inherited from
isNullable
▸ isNullable(): boolean
Returns
boolean
Inherited from
isOptional
▸ isOptional(): boolean
Returns
boolean
Inherited from
nullable
▸ nullable(): ZodNullable<ZodIntersection<T, U>>
Returns
ZodNullable<ZodIntersection<T, U>>
Inherited from
nullish
▸ nullish(): ZodOptional<ZodNullable<ZodIntersection<T, U>>>
Returns
ZodOptional<ZodNullable<ZodIntersection<T, U>>>
Inherited from
optional
▸ optional(): ZodOptional<ZodIntersection<T, U>>
Returns
ZodOptional<ZodIntersection<T, U>>
Inherited from
or
▸ or<T>(option): ZodUnion<[ZodIntersection<T, U>, T]>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
option | T |
Returns
ZodUnion<[ZodIntersection<T, U>, T]>
Inherited from
parse
▸ parse(data, params?): T["_output"] & U["_output"]
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
T["_output"] & U["_output"]
Inherited from
parseAsync
▸ parseAsync(data, params?): Promise<T["_output"] & U["_output"]>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
Promise<T["_output"] & U["_output"]>
Inherited from
pipe
▸ pipe<T>(target): ZodPipeline<ZodIntersection<T, U>, T>
Type parameters
| Name | Type |
|---|---|
T | extends ZodTypeAny |
Parameters
| Name | Type |
|---|---|
target | T |
Returns
ZodPipeline<ZodIntersection<T, U>, T>
Inherited from
promise
▸ promise(): ZodPromise<ZodIntersection<T, U>>
Returns
ZodPromise<ZodIntersection<T, U>>
Inherited from
readonly
▸ readonly(): ZodReadonly<ZodIntersection<T, U>>
Returns
ZodReadonly<ZodIntersection<T, U>>
Inherited from
refine
▸ refine<RefinedOutput>(check, message?): ZodEffects<ZodIntersection<T, U>, RefinedOutput, T["_input"] & U["_input"]>
Type parameters
| Name | Type |
|---|---|
RefinedOutput | extends any |
Parameters
| Name | Type |
|---|---|
check | (arg: T["_output"] & U["_output"]) => arg is RefinedOutput |
message? | string | Partial<Omit<ZodCustomIssue, "code">> | (arg: T["_output"] & U["_output"]) => Partial<Omit<ZodCustomIssue, "code">> |
Returns
ZodEffects<ZodIntersection<T, U>, RefinedOutput, T["_input"] & U["_input"]>
Inherited from
▸ refine(check, message?): ZodEffects<ZodIntersection<T, U>, T["_output"] & U["_output"], T["_input"] & U["_input"]>
Parameters
| Name | Type |
|---|---|
check | (arg: T["_output"] & U["_output"]) => unknown |
message? | string | Partial<Omit<ZodCustomIssue, "code">> | (arg: T["_output"] & U["_output"]) => Partial<Omit<ZodCustomIssue, "code">> |
Returns
ZodEffects<ZodIntersection<T, U>, T["_output"] & U["_output"], T["_input"] & U["_input"]>
Inherited from
refinement
▸ refinement<RefinedOutput>(check, refinementData): ZodEffects<ZodIntersection<T, U>, RefinedOutput, T["_input"] & U["_input"]>
Type parameters
| Name | Type |
|---|---|
RefinedOutput | extends any |
Parameters
| Name | Type |
|---|---|
check | (arg: T["_output"] & U["_output"]) => arg is RefinedOutput |
refinementData | IssueData | (arg: T["_output"] & U["_output"], ctx: RefinementCtx) => IssueData |
Returns
ZodEffects<ZodIntersection<T, U>, RefinedOutput, T["_input"] & U["_input"]>
Inherited from
▸ refinement(check, refinementData): ZodEffects<ZodIntersection<T, U>, T["_output"] & U["_output"], T["_input"] & U["_input"]>
Parameters
| Name | Type |
|---|---|
check | (arg: T["_output"] & U["_output"]) => boolean |
refinementData | IssueData | (arg: T["_output"] & U["_output"], ctx: RefinementCtx) => IssueData |
Returns
ZodEffects<ZodIntersection<T, U>, T["_output"] & U["_output"], T["_input"] & U["_input"]>
Inherited from
safeParse
▸ safeParse(data, params?): SafeParseReturnType<T["_input"] & U["_input"], T["_output"] & U["_output"]>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
SafeParseReturnType<T["_input"] & U["_input"], T["_output"] & U["_output"]>
Inherited from
safeParseAsync
▸ safeParseAsync(data, params?): Promise<SafeParseReturnType<T["_input"] & U["_input"], T["_output"] & U["_output"]>>
Parameters
| Name | Type |
|---|---|
data | unknown |
params? | InexactPartial<ParseParams> |
Returns
Promise<SafeParseReturnType<T["_input"] & U["_input"], T["_output"] & U["_output"]>>
Inherited from
superRefine
▸ superRefine<RefinedOutput>(refinement): ZodEffects<ZodIntersection<T, U>, RefinedOutput, T["_input"] & U["_input"]>
Type parameters
| Name | Type |
|---|---|
RefinedOutput | extends any |
Parameters
| Name | Type |
|---|---|
refinement | (arg: T["_output"] & U["_output"], ctx: RefinementCtx) => arg is RefinedOutput |
Returns
ZodEffects<ZodIntersection<T, U>, RefinedOutput, T["_input"] & U["_input"]>
Inherited from
▸ superRefine(refinement): ZodEffects<ZodIntersection<T, U>, T["_output"] & U["_output"], T["_input"] & U["_input"]>
Parameters
| Name | Type |
|---|---|
refinement | (arg: T["_output"] & U["_output"], ctx: RefinementCtx) => void |
Returns
ZodEffects<ZodIntersection<T, U>, T["_output"] & U["_output"], T["_input"] & U["_input"]>
Inherited from
▸ superRefine(refinement): ZodEffects<ZodIntersection<T, U>, T["_output"] & U["_output"], T["_input"] & U["_input"]>
Parameters
| Name | Type |
|---|---|
refinement | (arg: T["_output"] & U["_output"], ctx: RefinementCtx) => Promise<void> |
Returns
ZodEffects<ZodIntersection<T, U>, T["_output"] & U["_output"], T["_input"] & U["_input"]>
Inherited from
transform
▸ transform<NewOut>(transform): ZodEffects<ZodIntersection<T, U>, NewOut, T["_input"] & U["_input"]>
Type parameters
| Name |
|---|
NewOut |
Parameters
| Name | Type |
|---|---|
transform | (arg: T["_output"] & U["_output"], ctx: RefinementCtx) => NewOut | Promise<NewOut> |
Returns
ZodEffects<ZodIntersection<T, U>, NewOut, T["_input"] & U["_input"]>
Inherited from
~validate
▸ ~validate(data): Result<T["_output"] & U["_output"]> | Promise<Result<T["_output"] & U["_output"]>>
Parameters
| Name | Type |
|---|---|
data | unknown |
Returns
Result<T["_output"] & U["_output"]> | Promise<Result<T["_output"] & U["_output"]>>