Class ZodType<Output, Def, Input>Abstract
Constructors
Properties
Readonly
_def
Readonly
_input
Readonly
_output
Readonly
_type
spa
Accessors
description
- get description(): undefined | string
Returns undefined | string
Methods
_getType
- _getType(input: ParseInput): string
Returns string
brand
- brand<B extends string | number | symbol>(
brand?: B,
): ZodBranded<ZodType<Output, Def, Input>, B> Type Parameters
- B extends string | number | symbol
describe
- describe(description: string): this
Returns this
isNullable
- isNullable(): boolean
Returns boolean
isOptional
- isOptional(): boolean
Returns boolean
parse
- parse(data: unknown, params?: Partial<ParseParams>): Output
parseAsync
- parseAsync(data: unknown, params?: Partial<ParseParams>): Promise<Output>
Returns Promise<Output>
refine
- refine<RefinedOutput>(
check: (arg: Output) => arg is RefinedOutput,
message?:
| string
| (arg: Output) => Partial<Omit<ZodCustomIssue, "code">>
| Partial<Omit<ZodCustomIssue, "code">>,
): ZodEffects<ZodType<Output, Def, Input>, RefinedOutput, Input> - refine(
check: (arg: Output) => unknown,
message?:
| string
| Partial<Omit<ZodCustomIssue, "code">>
| (arg: Output) => Partial<Omit<ZodCustomIssue, "code">>,
): ZodEffects<ZodType<Output, Def, Input>, Output, Input>
refinement
- refinement<RefinedOutput>(
check: (arg: Output) => arg is RefinedOutput,
refinementData: IssueData | (arg: Output, ctx: RefinementCtx) => IssueData,
): ZodEffects<ZodType<Output, Def, Input>, RefinedOutput, Input> - refinement(
check: (arg: Output) => boolean,
refinementData: IssueData | (arg: Output, ctx: RefinementCtx) => IssueData,
): ZodEffects<ZodType<Output, Def, Input>, Output, Input>
superRefine
- superRefine<RefinedOutput>(
refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput,
): ZodEffects<ZodType<Output, Def, Input>, RefinedOutput, Input> - superRefine(
refinement: (arg: Output, ctx: RefinementCtx) => void,
): ZodEffects<ZodType<Output, Def, Input>, Output, Input> - superRefine(
refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>,
): ZodEffects<ZodType<Output, Def, Input>, Output, Input>
Alias of safeParseAsync