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