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: Zod.z.ParseInput): string
Returns string
describe
- describe(description: string): this
Returns this
isNullable
- isNullable(): boolean
Returns boolean
isOptional
- isOptional(): boolean
Returns boolean
parse
- parse(data: unknown, params?: Partial<Zod.z.ParseParams>): Output
parseAsync
- parseAsync(data: unknown, params?: Partial<Zod.z.ParseParams>): Promise<Output>
Returns Promise<Output>
refine
- refine<RefinedOutput>(
check: (arg: Output) => arg is RefinedOutput,
message?:
| string
| Partial<Omit<Zod.z.ZodCustomIssue, "code">>
| (arg: Output) => Partial<Omit<Zod.z.ZodCustomIssue, "code">>,
): Zod.z.ZodEffects<Zod.z.ZodType<Output, Def, Input>, RefinedOutput, Input> - refine(
check: (arg: Output) => unknown,
message?:
| string
| Partial<Omit<Zod.z.ZodCustomIssue, "code">>
| (arg: Output) => Partial<Omit<Zod.z.ZodCustomIssue, "code">>,
): Zod.z.ZodEffects<Zod.z.ZodType<Output, Def, Input>, Output, Input>
refinement
- refinement<RefinedOutput>(
check: (arg: Output) => arg is RefinedOutput,
refinementData:
| Zod.z.IssueData
| (arg: Output, ctx: Zod.z.RefinementCtx) => Zod.z.IssueData,
): Zod.z.ZodEffects<Zod.z.ZodType<Output, Def, Input>, RefinedOutput, Input> - refinement(
check: (arg: Output) => boolean,
refinementData:
| Zod.z.IssueData
| (arg: Output, ctx: Zod.z.RefinementCtx) => Zod.z.IssueData,
): Zod.z.ZodEffects<Zod.z.ZodType<Output, Def, Input>, Output, Input>
superRefine
- superRefine<RefinedOutput>(
refinement: (
arg: Output,
ctx: Zod.z.RefinementCtx,
) => arg is RefinedOutput,
): Zod.z.ZodEffects<Zod.z.ZodType<Output, Def, Input>, RefinedOutput, Input> - superRefine(
refinement: (arg: Output, ctx: Zod.z.RefinementCtx) => void,
): Zod.z.ZodEffects<Zod.z.ZodType<Output, Def, Input>, Output, Input> - superRefine(
refinement: (arg: Output, ctx: Zod.z.RefinementCtx) => Promise<void>,
): Zod.z.ZodEffects<Zod.z.ZodType<Output, Def, Input>, Output, Input>
Alias of safeParseAsync