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