import { enumUtil } from "./helpers/enumUtil"; import { errorUtil } from "./helpers/errorUtil"; import { AsyncParseReturnType, ParseContext, ParseInput, ParseParams, ParseReturnType, ParseStatus, SyncParseReturnType } from "./helpers/parseUtil"; import { partialUtil } from "./helpers/partialUtil"; import { Primitive } from "./helpers/typeAliases"; import { util } from "./helpers/util"; import { IssueData, StringValidation, ZodCustomIssue, ZodError, ZodErrorMap } from "./ZodError"; export declare type RefinementCtx = { addIssue: (arg: IssueData) => void; path: (string | number)[]; }; export declare type ZodRawShape = { [k: string]: ZodTypeAny; }; export declare type ZodTypeAny = ZodType; export declare type TypeOf> = T["_output"]; export declare type input> = T["_input"]; export declare type output> = T["_output"]; export type { TypeOf as infer }; export declare type CustomErrorParams = Partial>; export interface ZodTypeDef { errorMap?: ZodErrorMap; description?: string; } declare type RawCreateParams = { errorMap?: ZodErrorMap; invalid_type_error?: string; required_error?: string; description?: string; } | undefined; export declare type SafeParseSuccess = { success: true; data: Output; }; export declare type SafeParseError = { success: false; error: ZodError; }; export declare type SafeParseReturnType = SafeParseSuccess | SafeParseError; export declare abstract class ZodType { readonly _type: Output; readonly _output: Output; readonly _input: Input; readonly _def: Def; get description(): string | undefined; abstract _parse(input: ParseInput): ParseReturnType; _getType(input: ParseInput): string; _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext; _processInputParams(input: ParseInput): { status: ParseStatus; ctx: ParseContext; }; _parseSync(input: ParseInput): SyncParseReturnType; _parseAsync(input: ParseInput): AsyncParseReturnType; parse(data: unknown, params?: Partial): Output; safeParse(data: unknown, params?: Partial): SafeParseReturnType; parseAsync(data: unknown, params?: Partial): Promise; safeParseAsync(data: unknown, params?: Partial): Promise>; /** Alias of safeParseAsync */ spa: (data: unknown, params?: Partial | undefined) => Promise>; refine(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; refine(check: (arg: Output) => unknown | Promise, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; refinement(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; _refinement(refinement: RefinementEffect["refinement"]): ZodEffects; superRefine: (refinement: RefinementEffect["refinement"]) => ZodEffects; constructor(def: Def); optional(): ZodOptional; nullable(): ZodNullable; nullish(): ZodNullable>; array(): ZodArray; promise(): ZodPromise; asyncIterable(): ZodAsyncIterable; or(option: T): ZodUnion<[this, T]>; and(incoming: T): ZodIntersection; transform(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise): ZodEffects; default(def: util.noUndefined): ZodDefault; default(def: () => util.noUndefined): ZodDefault; describe(description: string): this; isOptional(): boolean; isNullable(): boolean; } declare type ZodStringCheck = { kind: "min"; value: number; message?: string; } | { kind: "max"; value: number; message?: string; } | { kind: "email"; message?: string; } | { kind: "url"; message?: string; } | { kind: "uuid"; message?: string; } | { kind: "cuid"; message?: string; } | { kind: "startsWith"; value: string; message?: string; } | { kind: "endsWith"; value: string; message?: string; } | { kind: "regex"; regex: RegExp; message?: string; } | { kind: "trim"; message?: string; }; export interface ZodStringDef extends ZodTypeDef { checks: ZodStringCheck[]; typeName: ZodFirstPartyTypeKind.ZodString; } export declare class ZodString extends ZodType { _parse(input: ParseInput): ParseReturnType; protected _regex: (regex: RegExp, validation: StringValidation, message?: string | { message?: string | undefined; } | undefined) => ZodEffects; _addCheck(check: ZodStringCheck): ZodString; email(message?: errorUtil.ErrMessage): ZodString; url(message?: errorUtil.ErrMessage): ZodString; uuid(message?: errorUtil.ErrMessage): ZodString; cuid(message?: errorUtil.ErrMessage): ZodString; regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString; startsWith(value: string, message?: errorUtil.ErrMessage): ZodString; endsWith(value: string, message?: errorUtil.ErrMessage): ZodString; min(minLength: number, message?: errorUtil.ErrMessage): ZodString; max(maxLength: number, message?: errorUtil.ErrMessage): ZodString; length(len: number, message?: errorUtil.ErrMessage): ZodString; /** * @deprecated Use z.string().min(1) instead. * @see {@link ZodString.min} */ nonempty: (message?: string | { message?: string | undefined; } | undefined) => ZodString; trim: () => ZodString; get isEmail(): boolean; get isURL(): boolean; get isUUID(): boolean; get isCUID(): boolean; get minLength(): number | null; get maxLength(): number | null; static create: (params?: RawCreateParams) => ZodString; } declare type ZodNumberCheck = { kind: "min"; value: number; inclusive: boolean; message?: string; } | { kind: "max"; value: number; inclusive: boolean; message?: string; } | { kind: "int"; message?: string; } | { kind: "multipleOf"; value: number; message?: string; }; export interface ZodNumberDef extends ZodTypeDef { checks: ZodNumberCheck[]; typeName: ZodFirstPartyTypeKind.ZodNumber; } export declare class ZodNumber extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodNumber; gte(value: number, message?: errorUtil.ErrMessage): ZodNumber; min: (value: number, message?: string | { message?: string | undefined; } | undefined) => ZodNumber; gt(value: number, message?: errorUtil.ErrMessage): ZodNumber; lte(value: number, message?: errorUtil.ErrMessage): ZodNumber; max: (value: number, message?: string | { message?: string | undefined; } | undefined) => ZodNumber; lt(value: number, message?: errorUtil.ErrMessage): ZodNumber; protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber; _addCheck(check: ZodNumberCheck): ZodNumber; int(message?: errorUtil.ErrMessage): ZodNumber; positive(message?: errorUtil.ErrMessage): ZodNumber; negative(message?: errorUtil.ErrMessage): ZodNumber; nonpositive(message?: errorUtil.ErrMessage): ZodNumber; nonnegative(message?: errorUtil.ErrMessage): ZodNumber; multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber; step: (value: number, message?: string | { message?: string | undefined; } | undefined) => ZodNumber; get minValue(): number | null; get maxValue(): number | null; get isInt(): boolean; } export interface ZodBigIntDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodBigInt; } export declare class ZodBigInt extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodBigInt; } export interface ZodBooleanDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodBoolean; } export declare class ZodBoolean extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodBoolean; } declare type ZodDateCheck = { kind: "min"; value: number; message?: string; } | { kind: "max"; value: number; message?: string; }; export interface ZodDateDef extends ZodTypeDef { checks: ZodDateCheck[]; typeName: ZodFirstPartyTypeKind.ZodDate; } export declare class ZodDate extends ZodType { _parse(input: ParseInput): ParseReturnType; _addCheck(check: ZodDateCheck): ZodDate; min(minDate: Date, message?: errorUtil.ErrMessage): ZodDate; max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate; get minDate(): Date | null; get maxDate(): Date | null; static create: (params?: RawCreateParams) => ZodDate; } export interface ZodUndefinedDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodUndefined; } export declare class ZodUndefined extends ZodType { _parse(input: ParseInput): ParseReturnType; params?: RawCreateParams; static create: (params?: RawCreateParams) => ZodUndefined; } export interface ZodNullDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodNull; } export declare class ZodNull extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodNull; } export interface ZodAnyDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodAny; } export declare class ZodAny extends ZodType { _any: true; _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodAny; } export interface ZodUnknownDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodUnknown; } export declare class ZodUnknown extends ZodType { _unknown: true; _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodUnknown; } export interface ZodNeverDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodNever; } export declare class ZodNever extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodNever; } export interface ZodVoidDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodVoid; } export declare class ZodVoid extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodVoid; } export interface ZodArrayDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodArray; minLength: { value: number; message?: string; } | null; maxLength: { value: number; message?: string; } | null; } export declare type ArrayCardinality = "many" | "atleastone"; declare type arrayOutputType = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][]; export declare class ZodArray extends ZodType, ZodArrayDef, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> { _parse(input: ParseInput): ParseReturnType; get element(): T; min(minLength: number, message?: errorUtil.ErrMessage): this; max(maxLength: number, message?: errorUtil.ErrMessage): this; length(len: number, message?: errorUtil.ErrMessage): this; nonempty(message?: errorUtil.ErrMessage): ZodArray; static create: (schema: T_1, params?: RawCreateParams) => ZodArray; } export declare type ZodNonEmptyArray = ZodArray; export declare namespace objectUtil { export type MergeShapes = { [k in Exclude]: U[k]; } & V; type optionalKeys = { [k in keyof T]: undefined extends T[k] ? k : never; }[keyof T]; type requiredKeys = { [k in keyof T]: undefined extends T[k] ? never : k; }[keyof T]; export type addQuestionMarks = Partial>> & Pick>; export type identity = T; export type flatten = identity<{ [k in keyof T]: T[k]; }>; export type noNeverKeys = { [k in keyof T]: [T[k]] extends [never] ? never : k; }[keyof T]; export type noNever = identity<{ [k in noNeverKeys]: k extends keyof T ? T[k] : never; }>; export const mergeShapes: (first: U, second: T) => T & U; export {}; } export declare type extendShape = Omit & B; declare type UnknownKeysParam = "passthrough" | "strict" | "strip"; export interface ZodObjectDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodObject; shape: () => T; catchall: Catchall; unknownKeys: UnknownKeys; } export declare type baseObjectOutputType = objectUtil.flatten>; export declare type objectOutputType = ZodTypeAny extends Catchall ? baseObjectOutputType : objectUtil.flatten & { [k: string]: Catchall["_output"]; }>; export declare type baseObjectInputType = objectUtil.flatten>; export declare type objectInputType = ZodTypeAny extends Catchall ? baseObjectInputType : objectUtil.flatten & { [k: string]: Catchall["_input"]; }>; declare type deoptional = T extends ZodOptional ? deoptional : T; export declare type SomeZodObject = ZodObject; export declare class ZodObject, Input = objectInputType> extends ZodType, Input> { readonly _shape: T; readonly _unknownKeys: UnknownKeys; readonly _catchall: Catchall; private _cached; _getCached(): { shape: T; keys: string[]; }; _parse(input: ParseInput): ParseReturnType; get shape(): T; strict(message?: errorUtil.ErrMessage): ZodObject; strip(): ZodObject; passthrough(): ZodObject; /** * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. * If you want to pass through unknown properties, use `.passthrough()` instead. */ nonstrict: () => ZodObject; augment: (augmentation: Augmentation) => ZodObject, UnknownKeys, Catchall, objectOutputType, Catchall>, objectInputType, Catchall>>; extend: (augmentation: Augmentation) => ZodObject, UnknownKeys, Catchall, objectOutputType, Catchall>, objectInputType, Catchall>>; setKey(key: Key, schema: Schema): ZodObject; /** * Prior to zod@1.0.12 there was a bug in the * inferred type of merged objects. Please * upgrade if you are experiencing issues. */ merge(merging: Incoming): ZodObject, UnknownKeys, Catchall>; catchall(index: Index): ZodObject; pick(mask: Mask): ZodObject>, UnknownKeys, Catchall>; omit(mask: Mask): ZodObject, UnknownKeys, Catchall>; deepPartial(): partialUtil.DeepPartial; partial(): ZodObject<{ [k in keyof T]: ZodOptional; }, UnknownKeys, Catchall>; partial(mask: Mask): ZodObject : T[k]; }>, UnknownKeys, Catchall>; required(): ZodObject<{ [k in keyof T]: deoptional; }, UnknownKeys, Catchall>; keyof(): ZodEnum>; static create: (shape: T_1, params?: RawCreateParams) => ZodObject]: objectUtil.addQuestionMarks<{ [k in keyof T_1]: T_1[k]["_output"]; }>[k_1]; }, { [k_3 in keyof objectUtil.addQuestionMarks<{ [k_2 in keyof T_1]: T_1[k_2]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_2 in keyof T_1]: T_1[k_2]["_input"]; }>[k_3]; }>; static strictCreate: (shape: T_1, params?: RawCreateParams) => ZodObject]: objectUtil.addQuestionMarks<{ [k in keyof T_1]: T_1[k]["_output"]; }>[k_1]; }, { [k_3 in keyof objectUtil.addQuestionMarks<{ [k_2 in keyof T_1]: T_1[k_2]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_2 in keyof T_1]: T_1[k_2]["_input"]; }>[k_3]; }>; static lazycreate: (shape: () => T_1, params?: RawCreateParams) => ZodObject]: objectUtil.addQuestionMarks<{ [k in keyof T_1]: T_1[k]["_output"]; }>[k_1]; }, { [k_3 in keyof objectUtil.addQuestionMarks<{ [k_2 in keyof T_1]: T_1[k_2]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_2 in keyof T_1]: T_1[k_2]["_input"]; }>[k_3]; }>; } export declare type AnyZodObject = ZodObject; declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>; export interface ZodUnionDef> extends ZodTypeDef { options: T; typeName: ZodFirstPartyTypeKind.ZodUnion; } export declare class ZodUnion extends ZodType, T[number]["_input"]> { _parse(input: ParseInput): ParseReturnType; get options(): T; static create: (types: T_1, params?: RawCreateParams) => ZodUnion; } export declare type ZodDiscriminatedUnionOption = ZodObject<{ [key in Discriminator]: ZodLiteral; } & ZodRawShape, any, any>; export interface ZodDiscriminatedUnionDef> extends ZodTypeDef { discriminator: Discriminator; options: Map; typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion; } export declare class ZodDiscriminatedUnion> extends ZodType, Option["_input"]> { _parse(input: ParseInput): ParseReturnType; get discriminator(): Discriminator; get validDiscriminatorValues(): DiscriminatorValue[]; get options(): Map; /** * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. * However, it only allows a union of objects, all of which need to share a discriminator property. This property must * have a different value for each object in the union. * @param discriminator the name of the discriminator property * @param types an array of object schemas * @param params */ static create, ZodDiscriminatedUnionOption, ...ZodDiscriminatedUnionOption[] ]>(discriminator: Discriminator, types: Types, params?: RawCreateParams): ZodDiscriminatedUnion; } export interface ZodIntersectionDef extends ZodTypeDef { left: T; right: U; typeName: ZodFirstPartyTypeKind.ZodIntersection; } export declare class ZodIntersection extends ZodType, T["_input"] & U["_input"]> { _parse(input: ParseInput): ParseReturnType; static create: (left: T_1, right: U_1, params?: RawCreateParams) => ZodIntersection; } export declare type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]]; export declare type AssertArray = T extends any[] ? T : never; export declare type OutputTypeOfTuple = AssertArray<{ [k in keyof T]: T[k] extends ZodType ? T[k]["_output"] : never; }>; export declare type OutputTypeOfTupleWithRest = Rest extends ZodTypeAny ? [...OutputTypeOfTuple, ...Rest["_output"][]] : OutputTypeOfTuple; export declare type InputTypeOfTuple = AssertArray<{ [k in keyof T]: T[k] extends ZodType ? T[k]["_input"] : never; }>; export declare type InputTypeOfTupleWithRest = Rest extends ZodTypeAny ? [...InputTypeOfTuple, ...Rest["_input"][]] : InputTypeOfTuple; export interface ZodTupleDef extends ZodTypeDef { items: T; rest: Rest; typeName: ZodFirstPartyTypeKind.ZodTuple; } export declare class ZodTuple extends ZodType, ZodTupleDef, InputTypeOfTupleWithRest> { _parse(input: ParseInput): ParseReturnType; get items(): T; rest(rest: Rest): ZodTuple; static create: (schemas: T_1, params?: RawCreateParams) => ZodTuple; } export interface ZodRecordDef extends ZodTypeDef { valueType: Value; keyType: Key; typeName: ZodFirstPartyTypeKind.ZodRecord; } declare type KeySchema = ZodType; declare type RecordType = [string] extends [K] ? Record : [number] extends [K] ? Record : [symbol] extends [K] ? Record : Partial>; export declare class ZodRecord extends ZodType, ZodRecordDef, RecordType> { get keySchema(): Key; get valueSchema(): Value; _parse(input: ParseInput): ParseReturnType; get element(): Value; static create(valueType: Value, params?: RawCreateParams): ZodRecord; static create(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord; } export interface ZodMapDef extends ZodTypeDef { valueType: Value; keyType: Key; typeName: ZodFirstPartyTypeKind.ZodMap; } export declare class ZodMap extends ZodType, ZodMapDef, Map> { _parse(input: ParseInput): ParseReturnType; static create: (keyType: Key_1, valueType: Value_1, params?: RawCreateParams) => ZodMap; } export interface ZodSetDef extends ZodTypeDef { valueType: Value; typeName: ZodFirstPartyTypeKind.ZodSet; minSize: { value: number; message?: string; } | null; maxSize: { value: number; message?: string; } | null; } export declare class ZodSet extends ZodType, ZodSetDef, Set> { _parse(input: ParseInput): ParseReturnType; min(minSize: number, message?: errorUtil.ErrMessage): this; max(maxSize: number, message?: errorUtil.ErrMessage): this; size(size: number, message?: errorUtil.ErrMessage): this; nonempty(message?: errorUtil.ErrMessage): ZodSet; static create: (valueType: Value_1, params?: RawCreateParams) => ZodSet; } export interface ZodFunctionDef = ZodTuple, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef { args: Args; returns: Returns; typeName: ZodFirstPartyTypeKind.ZodFunction; } export declare type OuterTypeOfFunction, Returns extends ZodTypeAny> = Args["_input"] extends Array ? (...args: Args["_input"]) => Returns["_output"] : never; export declare type InnerTypeOfFunction, Returns extends ZodTypeAny> = Args["_output"] extends Array ? (...args: Args["_output"]) => Returns["_input"] : never; export declare class ZodFunction, Returns extends ZodTypeAny> extends ZodType, ZodFunctionDef, InnerTypeOfFunction> { _parse(input: ParseInput): ParseReturnType; parameters(): Args; returnType(): Returns; args[0]>(...items: Items): ZodFunction, Returns>; returns>(returnType: NewReturnType): ZodFunction; implement>(func: F): ReturnType extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType : OuterTypeOfFunction; strictImplement(func: InnerTypeOfFunction): InnerTypeOfFunction; validate: >(func: F) => ReturnType extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType : OuterTypeOfFunction; static create: = ZodTuple<[], ZodUnknown>, U extends ZodTypeAny = ZodUnknown>(args?: T | undefined, returns?: U | undefined, params?: RawCreateParams) => ZodFunction; } export interface ZodLazyDef extends ZodTypeDef { getter: () => T; typeName: ZodFirstPartyTypeKind.ZodLazy; } export declare class ZodLazy extends ZodType, ZodLazyDef, input> { get schema(): T; _parse(input: ParseInput): ParseReturnType; static create: (getter: () => T_1, params?: RawCreateParams) => ZodLazy; } export interface ZodLiteralDef extends ZodTypeDef { value: T; typeName: ZodFirstPartyTypeKind.ZodLiteral; } export declare class ZodLiteral extends ZodType> { _parse(input: ParseInput): ParseReturnType; get value(): T; static create: (value: T_1, params?: RawCreateParams) => ZodLiteral; } export declare type ArrayKeys = keyof any[]; export declare type Indices = Exclude; declare type EnumValues = [string, ...string[]]; declare type Values = { [k in T[number]]: k; }; export interface ZodEnumDef extends ZodTypeDef { values: T; typeName: ZodFirstPartyTypeKind.ZodEnum; } declare type Writeable = { -readonly [P in keyof T]: T[P]; }; declare function createZodEnum>(values: T, params?: RawCreateParams): ZodEnum>; declare function createZodEnum(values: T, params?: RawCreateParams): ZodEnum; export declare class ZodEnum extends ZodType> { _parse(input: ParseInput): ParseReturnType; get options(): T; get enum(): Values; get Values(): Values; get Enum(): Values; static create: typeof createZodEnum; } export interface ZodNativeEnumDef extends ZodTypeDef { values: T; typeName: ZodFirstPartyTypeKind.ZodNativeEnum; } declare type EnumLike = { [k: string]: string | number; [nu: number]: string; }; export declare class ZodNativeEnum extends ZodType> { _parse(input: ParseInput): ParseReturnType; get enum(): T; static create: (values: T_1, params?: RawCreateParams) => ZodNativeEnum; } export interface ZodPromiseDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodPromise; } export declare class ZodPromise extends ZodType, ZodPromiseDef, Promise> { _parse(input: ParseInput): ParseReturnType; static create: (schema: T_1, params?: RawCreateParams) => ZodPromise; } export interface ZodAsyncIterableDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodAsyncIterable; } export declare class ZodAsyncIterable extends ZodType, ZodAsyncIterableDef, AsyncIterable> { _parse(input: ParseInput): ParseReturnType; get item(): T; static create: (schema: T_1, params?: RawCreateParams) => ZodAsyncIterable; } export declare type Refinement = (arg: T, ctx: RefinementCtx) => any; export declare type SuperRefinement = (arg: T, ctx: RefinementCtx) => void; export declare type RefinementEffect = { type: "refinement"; refinement: (arg: T, ctx: RefinementCtx) => any; }; export declare type TransformEffect = { type: "transform"; transform: (arg: T, ctx: RefinementCtx) => any; }; export declare type PreprocessEffect = { type: "preprocess"; transform: (arg: T) => any; }; export declare type Effect = RefinementEffect | TransformEffect | PreprocessEffect; export interface ZodEffectsDef extends ZodTypeDef { schema: T; typeName: ZodFirstPartyTypeKind.ZodEffects; effect: Effect; } export declare class ZodEffects extends ZodType, Input> { innerType(): T; _parse(input: ParseInput): ParseReturnType; static create: (schema: I, effect: Effect, params?: RawCreateParams) => ZodEffects; static createWithPreprocess: (preprocess: (arg: unknown) => unknown, schema: I, params?: RawCreateParams) => ZodEffects; } export { ZodEffects as ZodTransformer }; export interface ZodOptionalDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodOptional; } export declare type ZodOptionalType = ZodOptional; export declare class ZodOptional extends ZodType, T["_input"] | undefined> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; static create: (type: T_1, params?: RawCreateParams) => ZodOptional; } export interface ZodNullableDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodNullable; } export declare type ZodNullableType = ZodNullable; export declare class ZodNullable extends ZodType, T["_input"] | null> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; static create: (type: T_1, params?: RawCreateParams) => ZodNullable; } export interface ZodDefaultDef extends ZodTypeDef { innerType: T; defaultValue: () => util.noUndefined; typeName: ZodFirstPartyTypeKind.ZodDefault; } export declare class ZodDefault extends ZodType, ZodDefaultDef, T["_input"] | undefined> { _parse(input: ParseInput): ParseReturnType; removeDefault(): T; static create: (type: T_1, params?: RawCreateParams) => ZodOptional; } export interface ZodNaNDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodNaN; } export declare class ZodNaN extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams) => ZodNaN; } declare type Class = new (...args: any[]) => any; export interface ZodClassInstanceDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodClassInstance; class: T; } export declare class ZodClassInstance extends ZodType, ZodClassInstanceDef> { get class(): T; _parse(input: ParseInput): ParseReturnType>; static create: (cls: T_1, params?: RawCreateParams) => ZodClassInstance; } export declare const custom: (check?: ((data: unknown) => any) | undefined, params?: Parameters[1], fatal?: boolean | undefined) => ZodType; export { ZodType as Schema, ZodType as ZodSchema }; export declare const late: { object: (shape: () => T, params?: RawCreateParams) => ZodObject]: objectUtil.addQuestionMarks<{ [k in keyof T]: T[k]["_output"]; }>[k_1]; }, { [k_3 in keyof objectUtil.addQuestionMarks<{ [k_2 in keyof T]: T[k_2]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_2 in keyof T]: T[k_2]["_input"]; }>[k_3]; }>; }; export declare enum ZodFirstPartyTypeKind { ZodString = "ZodString", ZodNumber = "ZodNumber", ZodNaN = "ZodNaN", ZodBigInt = "ZodBigInt", ZodBoolean = "ZodBoolean", ZodDate = "ZodDate", ZodUndefined = "ZodUndefined", ZodNull = "ZodNull", ZodAny = "ZodAny", ZodUnknown = "ZodUnknown", ZodNever = "ZodNever", ZodVoid = "ZodVoid", ZodArray = "ZodArray", ZodObject = "ZodObject", ZodUnion = "ZodUnion", ZodDiscriminatedUnion = "ZodDiscriminatedUnion", ZodIntersection = "ZodIntersection", ZodTuple = "ZodTuple", ZodRecord = "ZodRecord", ZodMap = "ZodMap", ZodSet = "ZodSet", ZodFunction = "ZodFunction", ZodLazy = "ZodLazy", ZodLiteral = "ZodLiteral", ZodEnum = "ZodEnum", ZodEffects = "ZodEffects", ZodNativeEnum = "ZodNativeEnum", ZodOptional = "ZodOptional", ZodNullable = "ZodNullable", ZodDefault = "ZodDefault", ZodPromise = "ZodPromise", ZodClassInstance = "ZodClassInstance", ZodAsyncIterable = "ZodAsyncIterable" } export declare type ZodFirstPartySchemaTypes = ZodString | ZodNumber | ZodNaN | ZodBigInt | ZodBoolean | ZodDate | ZodUndefined | ZodNull | ZodAny | ZodUnknown | ZodNever | ZodVoid | ZodArray | ZodObject | ZodUnion | ZodDiscriminatedUnion | ZodIntersection | ZodTuple | ZodRecord | ZodMap | ZodSet | ZodFunction | ZodLazy | ZodLiteral | ZodEnum | ZodEffects | ZodNativeEnum | ZodOptional | ZodNullable | ZodDefault | ZodPromise | ZodAsyncIterable | ZodClassInstance; declare const instanceOfType: (cls: T, params?: RawCreateParams) => ZodClassInstance; declare const stringType: (params?: RawCreateParams) => ZodString; declare const numberType: (params?: RawCreateParams) => ZodNumber; declare const nanType: (params?: RawCreateParams) => ZodNaN; declare const bigIntType: (params?: RawCreateParams) => ZodBigInt; declare const booleanType: (params?: RawCreateParams) => ZodBoolean; declare const dateType: (params?: RawCreateParams) => ZodDate; declare const undefinedType: (params?: RawCreateParams) => ZodUndefined; declare const nullType: (params?: RawCreateParams) => ZodNull; declare const anyType: (params?: RawCreateParams) => ZodAny; declare const unknownType: (params?: RawCreateParams) => ZodUnknown; declare const neverType: (params?: RawCreateParams) => ZodNever; declare const voidType: (params?: RawCreateParams) => ZodVoid; declare const arrayType: (schema: T, params?: RawCreateParams) => ZodArray; declare const objectType: (shape: T, params?: RawCreateParams) => ZodObject]: objectUtil.addQuestionMarks<{ [k in keyof T]: T[k]["_output"]; }>[k_1]; }, { [k_3 in keyof objectUtil.addQuestionMarks<{ [k_2 in keyof T]: T[k_2]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_2 in keyof T]: T[k_2]["_input"]; }>[k_3]; }>; declare const strictObjectType: (shape: T, params?: RawCreateParams) => ZodObject]: objectUtil.addQuestionMarks<{ [k in keyof T]: T[k]["_output"]; }>[k_1]; }, { [k_3 in keyof objectUtil.addQuestionMarks<{ [k_2 in keyof T]: T[k_2]["_input"]; }>]: objectUtil.addQuestionMarks<{ [k_2 in keyof T]: T[k_2]["_input"]; }>[k_3]; }>; declare const unionType: (types: T, params?: RawCreateParams) => ZodUnion; declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create; declare const intersectionType: (left: T, right: U, params?: RawCreateParams) => ZodIntersection; declare const tupleType: (schemas: T, params?: RawCreateParams) => ZodTuple; declare const recordType: typeof ZodRecord.create; declare const mapType: (keyType: Key, valueType: Value, params?: RawCreateParams) => ZodMap; declare const setType: (valueType: Value, params?: RawCreateParams) => ZodSet; declare const functionType: = ZodTuple<[], ZodUnknown>, U extends ZodTypeAny = ZodUnknown>(args?: T | undefined, returns?: U | undefined, params?: RawCreateParams) => ZodFunction; declare const lazyType: (getter: () => T, params?: RawCreateParams) => ZodLazy; declare const literalType: (value: T, params?: RawCreateParams) => ZodLiteral; declare const enumType: typeof createZodEnum; declare const nativeEnumType: (values: T, params?: RawCreateParams) => ZodNativeEnum; declare const promiseType: (schema: T, params?: RawCreateParams) => ZodPromise; declare const asyncIterableType: (schema: T, params?: RawCreateParams) => ZodAsyncIterable; declare const effectsType: (schema: I, effect: Effect, params?: RawCreateParams) => ZodEffects; declare const optionalType: (type: T, params?: RawCreateParams) => ZodOptional; declare const nullableType: (type: T, params?: RawCreateParams) => ZodNullable; declare const preprocessType: (preprocess: (arg: unknown) => unknown, schema: I, params?: RawCreateParams) => ZodEffects; declare const ostring: () => ZodOptional; declare const onumber: () => ZodOptional; declare const oboolean: () => ZodOptional; export { anyType as any, arrayType as array, asyncIterableType as asyncIterable, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, };