| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739 |
- import * as core from "../core/index.cjs";
- import { util } from "../core/index.cjs";
- import type { StandardSchemaWithJSONProps } from "../core/standard-schema.cjs";
- import * as parse from "./parse.cjs";
- export type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<core.input<T>, core.output<T>>;
- export interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
- def: Internals["def"];
- type: Internals["def"]["type"];
- /** @deprecated Use `.def` instead. */
- _def: Internals["def"];
- /** @deprecated Use `z.output<typeof schema>` instead. */
- _output: Internals["output"];
- /** @deprecated Use `z.input<typeof schema>` instead. */
- _input: Internals["input"];
- "~standard": ZodStandardSchemaWithJSON<this>;
- /** Converts this schema to a JSON Schema representation. */
- toJSONSchema(params?: core.ToJSONSchemaParams): core.ZodStandardJSONSchemaPayload<this>;
- check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
- with(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
- clone(def?: Internals["def"], params?: {
- parent: boolean;
- }): this;
- register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$replace<R["_meta"], this>?] : [core.$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
- brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T, Dir>;
- parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
- safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): parse.ZodSafeParseResult<core.output<this>>;
- parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
- safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.output<this>>>;
- spa: (data: unknown, params?: core.ParseContext<core.$ZodIssue>) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
- encode(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): core.input<this>;
- decode(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
- encodeAsync(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.input<this>>;
- decodeAsync(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
- safeEncode(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): parse.ZodSafeParseResult<core.input<this>>;
- safeDecode(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): parse.ZodSafeParseResult<core.output<this>>;
- safeEncodeAsync(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.input<this>>>;
- safeDecodeAsync(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.output<this>>>;
- refine<Ch extends (arg: core.output<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | core.$ZodCustomParams): Ch extends (arg: any) => arg is infer R ? this & ZodType<R, core.input<this>> : this;
- superRefine(refinement: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => void | Promise<void>): this;
- overwrite(fn: (x: core.output<this>) => core.output<this>): this;
- optional(): ZodOptional<this>;
- exactOptional(): ZodExactOptional<this>;
- nonoptional(params?: string | core.$ZodNonOptionalParams): ZodNonOptional<this>;
- nullable(): ZodNullable<this>;
- nullish(): ZodOptional<ZodNullable<this>>;
- default(def: util.NoUndefined<core.output<this>>): ZodDefault<this>;
- default(def: () => util.NoUndefined<core.output<this>>): ZodDefault<this>;
- prefault(def: () => core.input<this>): ZodPrefault<this>;
- prefault(def: core.input<this>): ZodPrefault<this>;
- array(): ZodArray<this>;
- or<T extends core.SomeType>(option: T): ZodUnion<[this, T]>;
- and<T extends core.SomeType>(incoming: T): ZodIntersection<this, T>;
- transform<NewOut>(transform: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
- catch(def: core.output<this>): ZodCatch<this>;
- catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
- pipe<T extends core.$ZodType<any, core.output<this>>>(target: T | core.$ZodType<any, core.output<this>>): ZodPipe<this, T>;
- readonly(): ZodReadonly<this>;
- /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
- describe(description: string): this;
- description?: string;
- /** Returns the metadata associated with this instance in `z.globalRegistry` */
- meta(): core.$replace<core.GlobalMeta, this> | undefined;
- /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
- meta(data: core.$replace<core.GlobalMeta, this>): this;
- /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
- *
- * ```ts
- * const schema = z.string().optional();
- * const isOptional = schema.safeParse(undefined).success; // true
- * ```
- */
- isOptional(): boolean;
- /**
- * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
- *
- * ```ts
- * const schema = z.string().nullable();
- * const isNullable = schema.safeParse(null).success; // true
- * ```
- */
- isNullable(): boolean;
- apply<T>(fn: (schema: this) => T): T;
- }
- export interface _ZodType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodType<any, any, Internals> {
- }
- export declare const ZodType: core.$constructor<ZodType>;
- export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>> extends _ZodType<T> {
- format: string | null;
- minLength: number | null;
- maxLength: number | null;
- regex(regex: RegExp, params?: string | core.$ZodCheckRegexParams): this;
- includes(value: string, params?: string | core.$ZodCheckIncludesParams): this;
- startsWith(value: string, params?: string | core.$ZodCheckStartsWithParams): this;
- endsWith(value: string, params?: string | core.$ZodCheckEndsWithParams): this;
- min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
- max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
- length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
- nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
- lowercase(params?: string | core.$ZodCheckLowerCaseParams): this;
- uppercase(params?: string | core.$ZodCheckUpperCaseParams): this;
- trim(): this;
- normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
- toLowerCase(): this;
- toUpperCase(): this;
- slugify(): this;
- }
- /** @internal */
- export declare const _ZodString: core.$constructor<_ZodString>;
- export interface ZodString extends _ZodString<core.$ZodStringInternals<string>> {
- /** @deprecated Use `z.email()` instead. */
- email(params?: string | core.$ZodCheckEmailParams): this;
- /** @deprecated Use `z.url()` instead. */
- url(params?: string | core.$ZodCheckURLParams): this;
- /** @deprecated Use `z.jwt()` instead. */
- jwt(params?: string | core.$ZodCheckJWTParams): this;
- /** @deprecated Use `z.emoji()` instead. */
- emoji(params?: string | core.$ZodCheckEmojiParams): this;
- /** @deprecated Use `z.guid()` instead. */
- guid(params?: string | core.$ZodCheckGUIDParams): this;
- /** @deprecated Use `z.uuid()` instead. */
- uuid(params?: string | core.$ZodCheckUUIDParams): this;
- /** @deprecated Use `z.uuid()` instead. */
- uuidv4(params?: string | core.$ZodCheckUUIDParams): this;
- /** @deprecated Use `z.uuid()` instead. */
- uuidv6(params?: string | core.$ZodCheckUUIDParams): this;
- /** @deprecated Use `z.uuid()` instead. */
- uuidv7(params?: string | core.$ZodCheckUUIDParams): this;
- /** @deprecated Use `z.nanoid()` instead. */
- nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
- /** @deprecated Use `z.guid()` instead. */
- guid(params?: string | core.$ZodCheckGUIDParams): this;
- /** @deprecated Use `z.cuid()` instead. */
- cuid(params?: string | core.$ZodCheckCUIDParams): this;
- /** @deprecated Use `z.cuid2()` instead. */
- cuid2(params?: string | core.$ZodCheckCUID2Params): this;
- /** @deprecated Use `z.ulid()` instead. */
- ulid(params?: string | core.$ZodCheckULIDParams): this;
- /** @deprecated Use `z.base64()` instead. */
- base64(params?: string | core.$ZodCheckBase64Params): this;
- /** @deprecated Use `z.base64url()` instead. */
- base64url(params?: string | core.$ZodCheckBase64URLParams): this;
- /** @deprecated Use `z.xid()` instead. */
- xid(params?: string | core.$ZodCheckXIDParams): this;
- /** @deprecated Use `z.ksuid()` instead. */
- ksuid(params?: string | core.$ZodCheckKSUIDParams): this;
- /** @deprecated Use `z.ipv4()` instead. */
- ipv4(params?: string | core.$ZodCheckIPv4Params): this;
- /** @deprecated Use `z.ipv6()` instead. */
- ipv6(params?: string | core.$ZodCheckIPv6Params): this;
- /** @deprecated Use `z.cidrv4()` instead. */
- cidrv4(params?: string | core.$ZodCheckCIDRv4Params): this;
- /** @deprecated Use `z.cidrv6()` instead. */
- cidrv6(params?: string | core.$ZodCheckCIDRv6Params): this;
- /** @deprecated Use `z.e164()` instead. */
- e164(params?: string | core.$ZodCheckE164Params): this;
- /** @deprecated Use `z.iso.datetime()` instead. */
- datetime(params?: string | core.$ZodCheckISODateTimeParams): this;
- /** @deprecated Use `z.iso.date()` instead. */
- date(params?: string | core.$ZodCheckISODateParams): this;
- /** @deprecated Use `z.iso.time()` instead. */
- time(params?: string | core.$ZodCheckISOTimeParams): this;
- /** @deprecated Use `z.iso.duration()` instead. */
- duration(params?: string | core.$ZodCheckISODurationParams): this;
- }
- export declare const ZodString: core.$constructor<ZodString>;
- export declare function string(params?: string | core.$ZodStringParams): ZodString;
- export declare function string<T extends string>(params?: string | core.$ZodStringParams): core.$ZodType<T, T>;
- export interface ZodStringFormat<Format extends string = string> extends _ZodString<core.$ZodStringFormatInternals<Format>> {
- }
- export declare const ZodStringFormat: core.$constructor<ZodStringFormat>;
- export interface ZodEmail extends ZodStringFormat<"email"> {
- _zod: core.$ZodEmailInternals;
- }
- export declare const ZodEmail: core.$constructor<ZodEmail>;
- export declare function email(params?: string | core.$ZodEmailParams): ZodEmail;
- export interface ZodGUID extends ZodStringFormat<"guid"> {
- _zod: core.$ZodGUIDInternals;
- }
- export declare const ZodGUID: core.$constructor<ZodGUID>;
- export declare function guid(params?: string | core.$ZodGUIDParams): ZodGUID;
- export interface ZodUUID extends ZodStringFormat<"uuid"> {
- _zod: core.$ZodUUIDInternals;
- }
- export declare const ZodUUID: core.$constructor<ZodUUID>;
- export declare function uuid(params?: string | core.$ZodUUIDParams): ZodUUID;
- export declare function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodUUID;
- export declare function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodUUID;
- export declare function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodUUID;
- export interface ZodURL extends ZodStringFormat<"url"> {
- _zod: core.$ZodURLInternals;
- }
- export declare const ZodURL: core.$constructor<ZodURL>;
- export declare function url(params?: string | core.$ZodURLParams): ZodURL;
- export declare function httpUrl(params?: string | Omit<core.$ZodURLParams, "protocol" | "hostname">): ZodURL;
- export interface ZodEmoji extends ZodStringFormat<"emoji"> {
- _zod: core.$ZodEmojiInternals;
- }
- export declare const ZodEmoji: core.$constructor<ZodEmoji>;
- export declare function emoji(params?: string | core.$ZodEmojiParams): ZodEmoji;
- export interface ZodNanoID extends ZodStringFormat<"nanoid"> {
- _zod: core.$ZodNanoIDInternals;
- }
- export declare const ZodNanoID: core.$constructor<ZodNanoID>;
- export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodNanoID;
- export interface ZodCUID extends ZodStringFormat<"cuid"> {
- _zod: core.$ZodCUIDInternals;
- }
- export declare const ZodCUID: core.$constructor<ZodCUID>;
- export declare function cuid(params?: string | core.$ZodCUIDParams): ZodCUID;
- export interface ZodCUID2 extends ZodStringFormat<"cuid2"> {
- _zod: core.$ZodCUID2Internals;
- }
- export declare const ZodCUID2: core.$constructor<ZodCUID2>;
- export declare function cuid2(params?: string | core.$ZodCUID2Params): ZodCUID2;
- export interface ZodULID extends ZodStringFormat<"ulid"> {
- _zod: core.$ZodULIDInternals;
- }
- export declare const ZodULID: core.$constructor<ZodULID>;
- export declare function ulid(params?: string | core.$ZodULIDParams): ZodULID;
- export interface ZodXID extends ZodStringFormat<"xid"> {
- _zod: core.$ZodXIDInternals;
- }
- export declare const ZodXID: core.$constructor<ZodXID>;
- export declare function xid(params?: string | core.$ZodXIDParams): ZodXID;
- export interface ZodKSUID extends ZodStringFormat<"ksuid"> {
- _zod: core.$ZodKSUIDInternals;
- }
- export declare const ZodKSUID: core.$constructor<ZodKSUID>;
- export declare function ksuid(params?: string | core.$ZodKSUIDParams): ZodKSUID;
- export interface ZodIPv4 extends ZodStringFormat<"ipv4"> {
- _zod: core.$ZodIPv4Internals;
- }
- export declare const ZodIPv4: core.$constructor<ZodIPv4>;
- export declare function ipv4(params?: string | core.$ZodIPv4Params): ZodIPv4;
- export interface ZodMAC extends ZodStringFormat<"mac"> {
- _zod: core.$ZodMACInternals;
- }
- export declare const ZodMAC: core.$constructor<ZodMAC>;
- export declare function mac(params?: string | core.$ZodMACParams): ZodMAC;
- export interface ZodIPv6 extends ZodStringFormat<"ipv6"> {
- _zod: core.$ZodIPv6Internals;
- }
- export declare const ZodIPv6: core.$constructor<ZodIPv6>;
- export declare function ipv6(params?: string | core.$ZodIPv6Params): ZodIPv6;
- export interface ZodCIDRv4 extends ZodStringFormat<"cidrv4"> {
- _zod: core.$ZodCIDRv4Internals;
- }
- export declare const ZodCIDRv4: core.$constructor<ZodCIDRv4>;
- export declare function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodCIDRv4;
- export interface ZodCIDRv6 extends ZodStringFormat<"cidrv6"> {
- _zod: core.$ZodCIDRv6Internals;
- }
- export declare const ZodCIDRv6: core.$constructor<ZodCIDRv6>;
- export declare function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodCIDRv6;
- export interface ZodBase64 extends ZodStringFormat<"base64"> {
- _zod: core.$ZodBase64Internals;
- }
- export declare const ZodBase64: core.$constructor<ZodBase64>;
- export declare function base64(params?: string | core.$ZodBase64Params): ZodBase64;
- export interface ZodBase64URL extends ZodStringFormat<"base64url"> {
- _zod: core.$ZodBase64URLInternals;
- }
- export declare const ZodBase64URL: core.$constructor<ZodBase64URL>;
- export declare function base64url(params?: string | core.$ZodBase64URLParams): ZodBase64URL;
- export interface ZodE164 extends ZodStringFormat<"e164"> {
- _zod: core.$ZodE164Internals;
- }
- export declare const ZodE164: core.$constructor<ZodE164>;
- export declare function e164(params?: string | core.$ZodE164Params): ZodE164;
- export interface ZodJWT extends ZodStringFormat<"jwt"> {
- _zod: core.$ZodJWTInternals;
- }
- export declare const ZodJWT: core.$constructor<ZodJWT>;
- export declare function jwt(params?: string | core.$ZodJWTParams): ZodJWT;
- export interface ZodCustomStringFormat<Format extends string = string> extends ZodStringFormat<Format>, core.$ZodCustomStringFormat<Format> {
- _zod: core.$ZodCustomStringFormatInternals<Format>;
- "~standard": ZodStandardSchemaWithJSON<this>;
- }
- export declare const ZodCustomStringFormat: core.$constructor<ZodCustomStringFormat>;
- export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<Format>;
- export declare function hostname(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hostname">;
- export declare function hex(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hex">;
- export declare function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(alg: Alg, params?: {
- enc?: Enc;
- } & core.$ZodStringFormatParams): ZodCustomStringFormat<`${Alg}_${Enc}`>;
- export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals> extends _ZodType<Internals> {
- gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
- /** Identical to .min() */
- gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
- min(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
- lt(value: number, params?: string | core.$ZodCheckLessThanParams): this;
- /** Identical to .max() */
- lte(value: number, params?: string | core.$ZodCheckLessThanParams): this;
- max(value: number, params?: string | core.$ZodCheckLessThanParams): this;
- /** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
- int(params?: string | core.$ZodCheckNumberFormatParams): this;
- /** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
- safe(params?: string | core.$ZodCheckNumberFormatParams): this;
- positive(params?: string | core.$ZodCheckGreaterThanParams): this;
- nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
- negative(params?: string | core.$ZodCheckLessThanParams): this;
- nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
- multipleOf(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
- /** @deprecated Use `.multipleOf()` instead. */
- step(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
- /** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
- finite(params?: unknown): this;
- minValue: number | null;
- maxValue: number | null;
- /** @deprecated Check the `format` property instead. */
- isInt: boolean;
- /** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
- isFinite: boolean;
- format: string | null;
- }
- export interface ZodNumber extends _ZodNumber<core.$ZodNumberInternals<number>> {
- }
- export declare const ZodNumber: core.$constructor<ZodNumber>;
- export declare function number(params?: string | core.$ZodNumberParams): ZodNumber;
- export interface ZodNumberFormat extends ZodNumber {
- _zod: core.$ZodNumberFormatInternals;
- }
- export declare const ZodNumberFormat: core.$constructor<ZodNumberFormat>;
- export interface ZodInt extends ZodNumberFormat {
- }
- export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt;
- export interface ZodFloat32 extends ZodNumberFormat {
- }
- export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32;
- export interface ZodFloat64 extends ZodNumberFormat {
- }
- export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64;
- export interface ZodInt32 extends ZodNumberFormat {
- }
- export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32;
- export interface ZodUInt32 extends ZodNumberFormat {
- }
- export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32;
- export interface _ZodBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals> extends _ZodType<T> {
- }
- export interface ZodBoolean extends _ZodBoolean<core.$ZodBooleanInternals<boolean>> {
- }
- export declare const ZodBoolean: core.$constructor<ZodBoolean>;
- export declare function boolean(params?: string | core.$ZodBooleanParams): ZodBoolean;
- export interface _ZodBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInternals> extends _ZodType<T> {
- gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
- /** Alias of `.gte()` */
- min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
- gt(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
- /** Alias of `.lte()` */
- lte(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
- max(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
- lt(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
- positive(params?: string | core.$ZodCheckGreaterThanParams): this;
- negative(params?: string | core.$ZodCheckLessThanParams): this;
- nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
- nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
- multipleOf(value: bigint, params?: string | core.$ZodCheckMultipleOfParams): this;
- minValue: bigint | null;
- maxValue: bigint | null;
- format: string | null;
- }
- export interface ZodBigInt extends _ZodBigInt<core.$ZodBigIntInternals<bigint>> {
- }
- export declare const ZodBigInt: core.$constructor<ZodBigInt>;
- export declare function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt;
- export interface ZodBigIntFormat extends ZodBigInt {
- _zod: core.$ZodBigIntFormatInternals;
- }
- export declare const ZodBigIntFormat: core.$constructor<ZodBigIntFormat>;
- export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat;
- export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat;
- export interface ZodSymbol extends _ZodType<core.$ZodSymbolInternals> {
- }
- export declare const ZodSymbol: core.$constructor<ZodSymbol>;
- export declare function symbol(params?: string | core.$ZodSymbolParams): ZodSymbol;
- export interface ZodUndefined extends _ZodType<core.$ZodUndefinedInternals> {
- }
- export declare const ZodUndefined: core.$constructor<ZodUndefined>;
- declare function _undefined(params?: string | core.$ZodUndefinedParams): ZodUndefined;
- export { _undefined as undefined };
- export interface ZodNull extends _ZodType<core.$ZodNullInternals> {
- }
- export declare const ZodNull: core.$constructor<ZodNull>;
- declare function _null(params?: string | core.$ZodNullParams): ZodNull;
- export { _null as null };
- export interface ZodAny extends _ZodType<core.$ZodAnyInternals> {
- }
- export declare const ZodAny: core.$constructor<ZodAny>;
- export declare function any(): ZodAny;
- export interface ZodUnknown extends _ZodType<core.$ZodUnknownInternals> {
- }
- export declare const ZodUnknown: core.$constructor<ZodUnknown>;
- export declare function unknown(): ZodUnknown;
- export interface ZodNever extends _ZodType<core.$ZodNeverInternals> {
- }
- export declare const ZodNever: core.$constructor<ZodNever>;
- export declare function never(params?: string | core.$ZodNeverParams): ZodNever;
- export interface ZodVoid extends _ZodType<core.$ZodVoidInternals> {
- }
- export declare const ZodVoid: core.$constructor<ZodVoid>;
- declare function _void(params?: string | core.$ZodVoidParams): ZodVoid;
- export { _void as void };
- export interface _ZodDate<T extends core.$ZodDateInternals = core.$ZodDateInternals> extends _ZodType<T> {
- min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
- max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
- /** @deprecated Not recommended. */
- minDate: Date | null;
- /** @deprecated Not recommended. */
- maxDate: Date | null;
- }
- export interface ZodDate extends _ZodDate<core.$ZodDateInternals<Date>> {
- }
- export declare const ZodDate: core.$constructor<ZodDate>;
- export declare function date(params?: string | core.$ZodDateParams): ZodDate;
- export interface ZodArray<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodArrayInternals<T>>, core.$ZodArray<T> {
- element: T;
- min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
- nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
- max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
- length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
- unwrap(): T;
- "~standard": ZodStandardSchemaWithJSON<this>;
- }
- export declare const ZodArray: core.$constructor<ZodArray>;
- export declare function array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodArray<T>;
- export declare function keyof<T extends ZodObject>(schema: T): ZodEnum<util.KeysEnum<T["_zod"]["output"]>>;
- export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
- [K in keyof Ext]: K extends keyof Base ? core.output<Ext[K]> extends core.output<Base[K]> ? core.input<Ext[K]> extends core.input<Base[K]> ? Ext[K] : never : never : Ext[K];
- };
- export interface ZodObject<
- /** @ts-ignore Cast variance */
- out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.$ZodObjectConfig = core.$strip> extends _ZodType<core.$ZodObjectInternals<Shape, Config>>, core.$ZodObject<Shape, Config> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- shape: Shape;
- keyof(): ZodEnum<util.ToEnum<keyof Shape & string>>;
- /** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
- catchall<T extends core.SomeType>(schema: T): ZodObject<Shape, core.$catchall<T>>;
- /** @deprecated Use `z.looseObject()` or `.loose()` instead. */
- passthrough(): ZodObject<Shape, core.$loose>;
- /** Consider `z.looseObject(A.shape)` instead */
- loose(): ZodObject<Shape, core.$loose>;
- /** Consider `z.strictObject(A.shape)` instead */
- strict(): ZodObject<Shape, core.$strict>;
- /** This is the default behavior. This method call is likely unnecessary. */
- strip(): ZodObject<Shape, core.$strip>;
- extend<U extends core.$ZodLooseShape>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
- safeExtend<U extends core.$ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, core.SomeType>>): ZodObject<util.Extend<Shape, U>, Config>;
- /**
- * @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
- */
- merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
- pick<M extends util.Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
- omit<M extends util.Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
- partial(): ZodObject<{
- [k in keyof Shape]: ZodOptional<Shape[k]>;
- }, Config>;
- partial<M extends util.Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{
- [k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k];
- }, Config>;
- required(): ZodObject<{
- [k in keyof Shape]: ZodNonOptional<Shape[k]>;
- }, Config>;
- required<M extends util.Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{
- [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
- }, Config>;
- }
- export declare const ZodObject: core.$constructor<ZodObject>;
- export declare function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(shape?: T, params?: string | core.$ZodObjectParams): ZodObject<util.Writeable<T>, core.$strip>;
- export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<T, core.$strict>;
- export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<T, core.$loose>;
- export interface ZodUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[]> extends _ZodType<core.$ZodUnionInternals<T>>, core.$ZodUnion<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- options: T;
- }
- export declare const ZodUnion: core.$constructor<ZodUnion>;
- export declare function union<const T extends readonly core.SomeType[]>(options: T, params?: string | core.$ZodUnionParams): ZodUnion<T>;
- export interface ZodXor<T extends readonly core.SomeType[] = readonly core.$ZodType[]> extends _ZodType<core.$ZodXorInternals<T>>, core.$ZodXor<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- options: T;
- }
- export declare const ZodXor: core.$constructor<ZodXor>;
- /** Creates an exclusive union (XOR) where exactly one option must match.
- * Unlike regular unions that succeed when any option matches, xor fails if
- * zero or more than one option matches the input. */
- export declare function xor<const T extends readonly core.SomeType[]>(options: T, params?: string | core.$ZodXorParams): ZodXor<T>;
- export interface ZodDiscriminatedUnion<Options extends readonly core.SomeType[] = readonly core.$ZodType[], Disc extends string = string> extends ZodUnion<Options>, core.$ZodDiscriminatedUnion<Options, Disc> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- _zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
- def: core.$ZodDiscriminatedUnionDef<Options, Disc>;
- }
- export declare const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion>;
- export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types, Disc>;
- export interface ZodIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodIntersectionInternals<A, B>>, core.$ZodIntersection<A, B> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- }
- export declare const ZodIntersection: core.$constructor<ZodIntersection>;
- export declare function intersection<T extends core.SomeType, U extends core.SomeType>(left: T, right: U): ZodIntersection<T, U>;
- export interface ZodTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends core.SomeType | null = core.$ZodType | null> extends _ZodType<core.$ZodTupleInternals<T, Rest>>, core.$ZodTuple<T, Rest> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
- }
- export declare const ZodTuple: core.$constructor<ZodTuple>;
- export declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodTuple<T, null>;
- export declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], Rest extends core.SomeType>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): ZodTuple<T, Rest>;
- export declare function tuple(items: [], params?: string | core.$ZodTupleParams): ZodTuple<[], null>;
- export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodRecordInternals<Key, Value>>, core.$ZodRecord<Key, Value> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- keyType: Key;
- valueType: Value;
- }
- export declare const ZodRecord: core.$constructor<ZodRecord>;
- export declare function record<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodRecord<Key, Value>;
- export declare function partialRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodRecord<Key & core.$partial, Value>;
- export declare function looseRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodRecord<Key, Value>;
- export interface ZodMap<Key extends core.SomeType = core.$ZodType, Value extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodMapInternals<Key, Value>>, core.$ZodMap<Key, Value> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- keyType: Key;
- valueType: Value;
- min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
- nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
- max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
- size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
- }
- export declare const ZodMap: core.$constructor<ZodMap>;
- export declare function map<Key extends core.SomeType, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams): ZodMap<Key, Value>;
- export interface ZodSet<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodSetInternals<T>>, core.$ZodSet<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
- nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
- max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
- size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
- }
- export declare const ZodSet: core.$constructor<ZodSet>;
- export declare function set<Value extends core.SomeType>(valueType: Value, params?: string | core.$ZodSetParams): ZodSet<Value>;
- export interface ZodEnum<
- /** @ts-ignore Cast variance */
- out T extends util.EnumLike = util.EnumLike> extends _ZodType<core.$ZodEnumInternals<T>>, core.$ZodEnum<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- enum: T;
- options: Array<T[keyof T]>;
- extract<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): ZodEnum<util.Flatten<Pick<T, U[number]>>>;
- exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): ZodEnum<util.Flatten<Omit<T, U[number]>>>;
- }
- export declare const ZodEnum: core.$constructor<ZodEnum>;
- declare function _enum<const T extends readonly string[]>(values: T, params?: string | core.$ZodEnumParams): ZodEnum<util.ToEnum<T[number]>>;
- declare function _enum<const T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
- export { _enum as enum };
- /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
- *
- * ```ts
- * enum Colors { red, green, blue }
- * z.enum(Colors);
- * ```
- */
- export declare function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
- export interface ZodLiteral<T extends util.Literal = util.Literal> extends _ZodType<core.$ZodLiteralInternals<T>>, core.$ZodLiteral<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- values: Set<T>;
- /** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
- value: T;
- }
- export declare const ZodLiteral: core.$constructor<ZodLiteral>;
- export declare function literal<const T extends ReadonlyArray<util.Literal>>(value: T, params?: string | core.$ZodLiteralParams): ZodLiteral<T[number]>;
- export declare function literal<const T extends util.Literal>(value: T, params?: string | core.$ZodLiteralParams): ZodLiteral<T>;
- export interface ZodFile extends _ZodType<core.$ZodFileInternals>, core.$ZodFile {
- "~standard": ZodStandardSchemaWithJSON<this>;
- min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
- max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
- mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
- }
- export declare const ZodFile: core.$constructor<ZodFile>;
- export declare function file(params?: string | core.$ZodFileParams): ZodFile;
- export interface ZodTransform<O = unknown, I = unknown> extends _ZodType<core.$ZodTransformInternals<O, I>>, core.$ZodTransform<O, I> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- }
- export declare const ZodTransform: core.$constructor<ZodTransform>;
- export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodTransform<Awaited<O>, I>;
- export interface ZodOptional<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodOptionalInternals<T>>, core.$ZodOptional<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- }
- export declare const ZodOptional: core.$constructor<ZodOptional>;
- export declare function optional<T extends core.SomeType>(innerType: T): ZodOptional<T>;
- export interface ZodExactOptional<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodExactOptionalInternals<T>>, core.$ZodExactOptional<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- }
- export declare const ZodExactOptional: core.$constructor<ZodExactOptional>;
- export declare function exactOptional<T extends core.SomeType>(innerType: T): ZodExactOptional<T>;
- export interface ZodNullable<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodNullableInternals<T>>, core.$ZodNullable<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- }
- export declare const ZodNullable: core.$constructor<ZodNullable>;
- export declare function nullable<T extends core.SomeType>(innerType: T): ZodNullable<T>;
- export declare function nullish<T extends core.SomeType>(innerType: T): ZodOptional<ZodNullable<T>>;
- export interface ZodDefault<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodDefaultInternals<T>>, core.$ZodDefault<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- /** @deprecated Use `.unwrap()` instead. */
- removeDefault(): T;
- }
- export declare const ZodDefault: core.$constructor<ZodDefault>;
- export declare function _default<T extends core.SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): ZodDefault<T>;
- export interface ZodPrefault<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPrefaultInternals<T>>, core.$ZodPrefault<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- }
- export declare const ZodPrefault: core.$constructor<ZodPrefault>;
- export declare function prefault<T extends core.SomeType>(innerType: T, defaultValue: core.input<T> | (() => core.input<T>)): ZodPrefault<T>;
- export interface ZodNonOptional<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodNonOptionalInternals<T>>, core.$ZodNonOptional<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- }
- export declare const ZodNonOptional: core.$constructor<ZodNonOptional>;
- export declare function nonoptional<T extends core.SomeType>(innerType: T, params?: string | core.$ZodNonOptionalParams): ZodNonOptional<T>;
- export interface ZodSuccess<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodSuccessInternals<T>>, core.$ZodSuccess<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- }
- export declare const ZodSuccess: core.$constructor<ZodSuccess>;
- export declare function success<T extends core.SomeType>(innerType: T): ZodSuccess<T>;
- export interface ZodCatch<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodCatchInternals<T>>, core.$ZodCatch<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- /** @deprecated Use `.unwrap()` instead. */
- removeCatch(): T;
- }
- export declare const ZodCatch: core.$constructor<ZodCatch>;
- declare function _catch<T extends core.SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)): ZodCatch<T>;
- export { _catch as catch };
- export interface ZodNaN extends _ZodType<core.$ZodNaNInternals>, core.$ZodNaN {
- "~standard": ZodStandardSchemaWithJSON<this>;
- }
- export declare const ZodNaN: core.$constructor<ZodNaN>;
- export declare function nan(params?: string | core.$ZodNaNParams): ZodNaN;
- export interface ZodPipe<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPipeInternals<A, B>>, core.$ZodPipe<A, B> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- in: A;
- out: B;
- }
- export declare const ZodPipe: core.$constructor<ZodPipe>;
- export declare function pipe<const A extends core.SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodPipe<A, B>;
- export interface ZodCodec<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType> extends ZodPipe<A, B>, core.$ZodCodec<A, B> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- _zod: core.$ZodCodecInternals<A, B>;
- def: core.$ZodCodecDef<A, B>;
- }
- export declare const ZodCodec: core.$constructor<ZodCodec>;
- export declare function codec<const A extends core.SomeType, B extends core.SomeType = core.$ZodType>(in_: A, out: B, params: {
- decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
- encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
- }): ZodCodec<A, B>;
- export interface ZodReadonly<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodReadonlyInternals<T>>, core.$ZodReadonly<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- }
- export declare const ZodReadonly: core.$constructor<ZodReadonly>;
- export declare function readonly<T extends core.SomeType>(innerType: T): ZodReadonly<T>;
- export interface ZodTemplateLiteral<Template extends string = string> extends _ZodType<core.$ZodTemplateLiteralInternals<Template>>, core.$ZodTemplateLiteral<Template> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- }
- export declare const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral>;
- export declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
- export interface ZodLazy<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodLazyInternals<T>>, core.$ZodLazy<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- }
- export declare const ZodLazy: core.$constructor<ZodLazy>;
- export declare function lazy<T extends core.SomeType>(getter: () => T): ZodLazy<T>;
- export interface ZodPromise<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPromiseInternals<T>>, core.$ZodPromise<T> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- unwrap(): T;
- }
- export declare const ZodPromise: core.$constructor<ZodPromise>;
- export declare function promise<T extends core.SomeType>(innerType: T): ZodPromise<T>;
- export interface ZodFunction<Args extends core.$ZodFunctionIn = core.$ZodFunctionIn, Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut> extends _ZodType<core.$ZodFunctionInternals<Args, Returns>>, core.$ZodFunction<Args, Returns> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- _def: core.$ZodFunctionDef<Args, Returns>;
- _input: core.$InferInnerFunctionType<Args, Returns>;
- _output: core.$InferOuterFunctionType<Args, Returns>;
- input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(args: Items, rest?: Rest): ZodFunction<core.$ZodTuple<Items, Rest>, Returns>;
- input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): ZodFunction<NewArgs, Returns>;
- input(...args: any[]): ZodFunction<any, Returns>;
- output<NewReturns extends core.$ZodType>(output: NewReturns): ZodFunction<Args, NewReturns>;
- }
- export declare const ZodFunction: core.$constructor<ZodFunction>;
- export declare function _function(): ZodFunction;
- export declare function _function<const In extends ReadonlyArray<core.$ZodType>>(params: {
- input: In;
- }): ZodFunction<ZodTuple<In, null>, core.$ZodFunctionOut>;
- export declare function _function<const In extends ReadonlyArray<core.$ZodType>, const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
- input: In;
- output: Out;
- }): ZodFunction<ZodTuple<In, null>, Out>;
- export declare function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn>(params: {
- input: In;
- }): ZodFunction<In, core.$ZodFunctionOut>;
- export declare function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
- output: Out;
- }): ZodFunction<core.$ZodFunctionIn, Out>;
- export declare function _function<In extends core.$ZodFunctionIn = core.$ZodFunctionIn, Out extends core.$ZodType = core.$ZodType>(params?: {
- input: In;
- output: Out;
- }): ZodFunction<In, Out>;
- export { _function as function };
- export interface ZodCustom<O = unknown, I = unknown> extends _ZodType<core.$ZodCustomInternals<O, I>>, core.$ZodCustom<O, I> {
- "~standard": ZodStandardSchemaWithJSON<this>;
- }
- export declare const ZodCustom: core.$constructor<ZodCustom>;
- export declare function check<O = unknown>(fn: core.CheckFn<O>): core.$ZodCheck<O>;
- export declare function custom<O>(fn?: (data: unknown) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodCustom<O, O>;
- export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
- export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
- export declare const describe: typeof core.describe;
- export declare const meta: typeof core.meta;
- type ZodInstanceOfParams = core.Params<ZodCustom, core.$ZodIssueCustom, "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path">;
- declare function _instanceof<T extends typeof util.Class>(cls: T, params?: ZodInstanceOfParams): ZodCustom<InstanceType<T>, InstanceType<T>>;
- export { _instanceof as instanceof };
- export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodCodec<ZodString, ZodBoolean>;
- type _ZodJSONSchema = ZodUnion<[
- ZodString,
- ZodNumber,
- ZodBoolean,
- ZodNull,
- ZodArray<ZodJSONSchema>,
- ZodRecord<ZodString, ZodJSONSchema>
- ]>;
- type _ZodJSONSchemaInternals = _ZodJSONSchema["_zod"];
- export interface ZodJSONSchemaInternals extends _ZodJSONSchemaInternals {
- output: util.JSONType;
- input: util.JSONType;
- }
- export interface ZodJSONSchema extends _ZodJSONSchema {
- _zod: ZodJSONSchemaInternals;
- }
- export declare function json(params?: string | core.$ZodCustomParams): ZodJSONSchema;
- export declare function preprocess<A, U extends core.SomeType, B = unknown>(fn: (arg: B, ctx: core.$RefinementCtx) => A, schema: U): ZodPipe<ZodTransform<A, B>, U>;
|