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