x/zod/types.ts

TypeScript-first schema validation with static type inference
Very Popular
Go to Latest
class Schema
Abstract
import { Schema } from "https://deno.land/x/zod@v3.17.3/types.ts?s=Schema";

Constructors

new
Schema(def: Def)
[src]

Type Parameters

optional
Output = any
[src]
optional
Def extends ZodTypeDef = ZodTypeDef
[src]
optional
Input = Output
[src]

Properties

readonly
_def: Def
[src]
readonly
_input: Input
[src]
readonly
_output: Output
[src]
readonly
_type: Output
[src]
readonly
description
[src]

Alias of safeParseAsync

superRefine[src]

Methods

_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext[src]
_getType(input: ParseInput): string[src]
abstract
_parse(input: ParseInput): ParseReturnType<Output>
[src]
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>[src]
_parseSync(input: ParseInput): SyncParseReturnType<Output>[src]
_processInputParams(input: ParseInput): { status: ParseStatus; ctx: ParseContext; }[src]
_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>[src]
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>[src]
array(): ZodArray<this>[src]
default(def: util.noUndefined<Input>): ZodDefault<this>[src]
default(def: () => util.noUndefined<Input>): ZodDefault<this>[src]
default(def: any)[src]
describe(description: string): this[src]
isNullable(): boolean[src]
isOptional(): boolean[src]
nullable(): ZodNullable<this>[src]
nullish(): ZodNullable<ZodOptional<this>>[src]
optional(): ZodOptional<this>[src]
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>[src]
parse(data: unknown, params?: Partial<ParseParams>): Output[src]
parseAsync(data: unknown, params?: Partial<ParseParams>): Promise<Output>[src]
promise(): ZodPromise<this>[src]
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, RefinedOutput>[src]
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>[src]
refine(check: (arg: Output) => unknown, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>[src]
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, RefinedOutput>[src]
refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>[src]
refinement(check: (arg: Output) => unknown, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>[src]
safeParse(data: unknown, params?: Partial<ParseParams>): SafeParseReturnType<Input, Output>[src]
safeParseAsync(data: unknown, params?: Partial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>[src]
transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>[src]