zod 3.25.0-canary.20241210T225910 → 4.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/commonjs/checks.d.ts +1 -0
  2. package/dist/commonjs/checks.js +32 -0
  3. package/dist/commonjs/coerce.d.ts +17 -0
  4. package/dist/commonjs/coerce.js +57 -0
  5. package/dist/commonjs/compat.d.ts +47 -0
  6. package/dist/commonjs/compat.js +73 -0
  7. package/dist/commonjs/errors.d.ts +23 -0
  8. package/dist/commonjs/errors.js +57 -0
  9. package/dist/commonjs/external.d.ts +8 -0
  10. package/dist/commonjs/external.js +67 -0
  11. package/dist/commonjs/index.d.ts +4 -0
  12. package/{lib → dist/commonjs}/index.js +19 -9
  13. package/dist/commonjs/iso.d.ts +22 -0
  14. package/dist/commonjs/iso.js +70 -0
  15. package/dist/commonjs/package.json +3 -0
  16. package/dist/commonjs/parse.d.ts +17 -0
  17. package/dist/commonjs/parse.js +44 -0
  18. package/dist/commonjs/schemas.d.ts +738 -0
  19. package/dist/commonjs/schemas.js +1171 -0
  20. package/dist/esm/checks.d.ts +1 -0
  21. package/dist/esm/checks.js +1 -0
  22. package/dist/esm/coerce.d.ts +17 -0
  23. package/dist/esm/coerce.js +17 -0
  24. package/dist/esm/compat.d.ts +47 -0
  25. package/dist/esm/compat.js +33 -0
  26. package/dist/esm/errors.d.ts +23 -0
  27. package/dist/esm/errors.js +20 -0
  28. package/dist/esm/external.d.ts +8 -0
  29. package/dist/esm/external.js +11 -0
  30. package/dist/esm/index.d.ts +4 -0
  31. package/dist/esm/index.js +4 -0
  32. package/dist/esm/iso.d.ts +22 -0
  33. package/dist/esm/iso.js +30 -0
  34. package/dist/esm/package.json +3 -0
  35. package/dist/esm/parse.d.ts +17 -0
  36. package/dist/esm/parse.js +8 -0
  37. package/dist/esm/schemas.d.ts +738 -0
  38. package/dist/esm/schemas.js +1057 -0
  39. package/package.json +59 -99
  40. package/src/checks.ts +30 -0
  41. package/src/coerce.ts +27 -0
  42. package/src/compat.ts +74 -0
  43. package/src/errors.ts +47 -0
  44. package/src/external.ts +29 -0
  45. package/src/index.ts +5 -0
  46. package/src/iso.ts +90 -0
  47. package/src/parse.ts +32 -0
  48. package/src/schemas.ts +2324 -0
  49. package/README.md +0 -3028
  50. package/index.d.ts +0 -2
  51. package/lib/ZodError.d.ts +0 -164
  52. package/lib/ZodError.js +0 -137
  53. package/lib/__tests__/Mocker.d.ts +0 -17
  54. package/lib/__tests__/Mocker.js +0 -57
  55. package/lib/benchmarks/datetime.d.ts +0 -5
  56. package/lib/benchmarks/datetime.js +0 -54
  57. package/lib/benchmarks/discriminatedUnion.d.ts +0 -5
  58. package/lib/benchmarks/discriminatedUnion.js +0 -79
  59. package/lib/benchmarks/index.d.ts +0 -1
  60. package/lib/benchmarks/index.js +0 -59
  61. package/lib/benchmarks/ipv4.d.ts +0 -5
  62. package/lib/benchmarks/ipv4.js +0 -54
  63. package/lib/benchmarks/object.d.ts +0 -5
  64. package/lib/benchmarks/object.js +0 -70
  65. package/lib/benchmarks/primitives.d.ts +0 -5
  66. package/lib/benchmarks/primitives.js +0 -170
  67. package/lib/benchmarks/realworld.d.ts +0 -5
  68. package/lib/benchmarks/realworld.js +0 -56
  69. package/lib/benchmarks/string.d.ts +0 -5
  70. package/lib/benchmarks/string.js +0 -55
  71. package/lib/benchmarks/union.d.ts +0 -5
  72. package/lib/benchmarks/union.js +0 -79
  73. package/lib/errors.d.ts +0 -5
  74. package/lib/errors.js +0 -17
  75. package/lib/external.d.ts +0 -6
  76. package/lib/external.js +0 -22
  77. package/lib/helpers/enumUtil.d.ts +0 -8
  78. package/lib/helpers/enumUtil.js +0 -2
  79. package/lib/helpers/errorUtil.d.ts +0 -9
  80. package/lib/helpers/errorUtil.js +0 -8
  81. package/lib/helpers/parseUtil.d.ts +0 -78
  82. package/lib/helpers/parseUtil.js +0 -125
  83. package/lib/helpers/partialUtil.d.ts +0 -8
  84. package/lib/helpers/partialUtil.js +0 -2
  85. package/lib/helpers/typeAliases.d.ts +0 -2
  86. package/lib/helpers/typeAliases.js +0 -2
  87. package/lib/helpers/util.d.ts +0 -82
  88. package/lib/helpers/util.js +0 -142
  89. package/lib/index.d.ts +0 -4
  90. package/lib/index.mjs +0 -4382
  91. package/lib/index.umd.js +0 -4497
  92. package/lib/locales/en.d.ts +0 -3
  93. package/lib/locales/en.js +0 -129
  94. package/lib/standard-schema.d.ts +0 -102
  95. package/lib/standard-schema.js +0 -2
  96. package/lib/types.d.ts +0 -1062
  97. package/lib/types.js +0 -3823
@@ -0,0 +1,738 @@
1
+ import * as core from "@zod/core";
2
+ import * as util from "@zod/core/util";
3
+ import * as parse from "./parse.js";
4
+ export * as iso from "./iso.js";
5
+ export * as coerce from "./coerce.js";
6
+ type SomeType = core.$ZodType;
7
+ export interface RefinementCtx<T = unknown> extends core.ParsePayload<T> {
8
+ addIssue(arg: string | core.$ZodRawIssue | Partial<core.$ZodIssueCustom>): void;
9
+ }
10
+ export interface ZodType<out Output = unknown, out Input = unknown> extends core.$ZodType<Output, Input> {
11
+ def: this["_zod"]["def"];
12
+ /** @deprecated Use `.def` instead. */
13
+ _def: this["_zod"]["def"];
14
+ check(...checks: (core.CheckFn<this["_zod"]["output"]> | core.$ZodCheck<this["_zod"]["output"]>)[]): this;
15
+ clone(def?: this["_zod"]["def"]): this;
16
+ register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$ZodRegistry<R["_meta"], this>["_meta"]?] : [core.$ZodRegistry<R["_meta"], this>["_meta"]] : ["Incompatible schema"]): this;
17
+ brand<T extends PropertyKey = PropertyKey>(value?: T): this & Record<"_zod", Record<"output", this["_zod"]["output"] & core.$brand<T>>>;
18
+ parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
19
+ safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): parse.ZodSafeParseResult<core.output<this>>;
20
+ parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
21
+ safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.output<this>>>;
22
+ spa: (data: unknown, params?: core.ParseContext<core.$ZodIssue>) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
23
+ refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
24
+ /** @deprecated Use `.check()` instead. */
25
+ superRefine(refinement: (arg: core.output<this>, ctx: RefinementCtx<this["_zod"]["output"]>) => void | Promise<void>): this;
26
+ overwrite(fn: (x: core.output<this>) => core.output<this>): this;
27
+ optional(params?: core.$ZodOptionalParams): ZodOptional<this>;
28
+ nonoptional(params?: core.$ZodNonOptionalParams): ZodNonOptional<this>;
29
+ nullable(params?: core.$ZodNullableParams): ZodNullable<this>;
30
+ nullish(): ZodOptional<ZodNullable<this>>;
31
+ default(def: util.NoUndefined<core.output<this>>, params?: core.$ZodDefaultParams): ZodDefault<this>;
32
+ default(def: () => util.NoUndefined<core.output<this>>, params?: core.$ZodDefaultParams): ZodDefault<this>;
33
+ array(): ZodArray<this>;
34
+ or<T extends core.$ZodType>(option: T): ZodUnion<[this, T]>;
35
+ and<T extends core.$ZodType>(incoming: T): ZodIntersection<this, T>;
36
+ transform<NewOut>(transform: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
37
+ catch(def: core.output<this>): ZodCatch<this>;
38
+ catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
39
+ pipe<T extends core.$ZodType<any, this["_zod"]["output"]>>(target: T | core.$ZodType<any, this["_zod"]["output"]>): ZodPipe<this, T>;
40
+ readonly(): ZodReadonly<this>;
41
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
42
+ describe(description: string): this;
43
+ description?: string;
44
+ /** Returns the metadata associated with this instance in `z.globalRegistry` */
45
+ meta(): core.$replace<core.GlobalMeta, this> | undefined;
46
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
47
+ meta(data: core.$replace<core.GlobalMeta, this>): this;
48
+ isOptional(): boolean;
49
+ isNullable(): boolean;
50
+ }
51
+ export declare const ZodType: core.$constructor<ZodType>;
52
+ export interface _ZodString<Input = unknown> extends ZodType {
53
+ _zod: core.$ZodStringInternals<Input>;
54
+ format: string | null;
55
+ minLength: number | null;
56
+ maxLength: number | null;
57
+ /** @deprecated Use `z.email()` instead. */
58
+ email(params?: string | core.$ZodCheckEmailParams): this;
59
+ /** @deprecated Use `z.url()` instead. */
60
+ url(params?: string | core.$ZodCheckURLParams): this;
61
+ /** @deprecated Use `z.jwt()` instead. */
62
+ jwt(params?: string | core.$ZodCheckJWTParams): this;
63
+ /** @deprecated Use `z.emoji()` instead. */
64
+ emoji(params?: string | core.$ZodCheckEmojiParams): this;
65
+ /** @deprecated Use `z.guid()` instead. */
66
+ guid(params?: string | core.$ZodCheckGUIDParams): this;
67
+ /** @deprecated Use `z.uuid()` instead. */
68
+ uuid(params?: string | core.$ZodCheckUUIDParams): this;
69
+ /** @deprecated Use `z.uuid()` instead. */
70
+ uuidv4(params?: string | core.$ZodCheckUUIDParams): this;
71
+ /** @deprecated Use `z.uuid()` instead. */
72
+ uuidv6(params?: string | core.$ZodCheckUUIDParams): this;
73
+ /** @deprecated Use `z.uuid()` instead. */
74
+ uuidv7(params?: string | core.$ZodCheckUUIDParams): this;
75
+ /** @deprecated Use `z.nanoid()` instead. */
76
+ nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
77
+ /** @deprecated Use `z.guid()` instead. */
78
+ guid(params?: string | core.$ZodCheckGUIDParams): this;
79
+ /** @deprecated Use `z.cuid()` instead. */
80
+ cuid(params?: string | core.$ZodCheckCUIDParams): this;
81
+ /** @deprecated Use `z.cuid2()` instead. */
82
+ cuid2(params?: string | core.$ZodCheckCUID2Params): this;
83
+ /** @deprecated Use `z.ulid()` instead. */
84
+ ulid(params?: string | core.$ZodCheckULIDParams): this;
85
+ /** @deprecated Use `z.base64()` instead. */
86
+ base64(params?: string | core.$ZodCheckBase64Params): this;
87
+ /** @deprecated Use `z.xid()` instead. */
88
+ xid(params?: string | core.$ZodCheckXIDParams): this;
89
+ /** @deprecated Use `z.ksuid()` instead. */
90
+ ksuid(params?: string | core.$ZodCheckKSUIDParams): this;
91
+ /** @deprecated Use `z.ipv4()` instead. */
92
+ ipv4(params?: string | core.$ZodCheckIPv4Params): this;
93
+ /** @deprecated Use `z.ipv6()` instead. */
94
+ ipv6(params?: string | core.$ZodCheckIPv6Params): this;
95
+ /** @deprecated Use `z.e164()` instead. */
96
+ e164(params?: string | core.$ZodCheckE164Params): this;
97
+ /** @deprecated Use `z.iso.datetime()` instead. */
98
+ datetime(params?: string | core.$ZodCheckISODateTimeParams): this;
99
+ /** @deprecated Use `z.iso.date()` instead. */
100
+ date(params?: string | core.$ZodCheckISODateParams): this;
101
+ /** @deprecated Use `z.iso.time()` instead. */
102
+ time(params?: string | core.$ZodCheckISOTimeParams): this;
103
+ /** @deprecated Use `z.iso.duration()` instead. */
104
+ duration(params?: string | core.$ZodCheckISODurationParams): this;
105
+ regex(regex: RegExp, params?: core.$ZodCheckRegexParams): this;
106
+ includes(value: string, params?: {
107
+ message?: string;
108
+ position?: number;
109
+ }): this;
110
+ startsWith(value: string, params?: string | core.$ZodCheckStartsWithParams): this;
111
+ endsWith(value: string, params?: string | core.$ZodCheckEndsWithParams): this;
112
+ min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
113
+ max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
114
+ length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
115
+ nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
116
+ lowercase(params?: string | core.$ZodCheckLowerCaseParams): this;
117
+ uppercase(params?: string | core.$ZodCheckUpperCaseParams): this;
118
+ trim(): this;
119
+ normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
120
+ toLowerCase(): this;
121
+ toUpperCase(): this;
122
+ }
123
+ export interface ZodString extends _ZodString<string> {
124
+ }
125
+ export declare const ZodString: core.$constructor<ZodString>;
126
+ export declare function string(params?: string | core.$ZodStringParams): ZodString;
127
+ export interface ZodStringFormat<Format extends core.$ZodStringFormats = core.$ZodStringFormats> extends ZodString {
128
+ _zod: core.$ZodStringFormatInternals<Format>;
129
+ }
130
+ export declare const ZodStringFormat: core.$constructor<ZodStringFormat>;
131
+ export interface ZodEmail extends ZodStringFormat<"email"> {
132
+ _zod: core.$ZodEmailInternals;
133
+ }
134
+ export declare const ZodEmail: core.$constructor<ZodEmail>;
135
+ export declare function email(params?: string | core.$ZodEmailParams): ZodEmail;
136
+ export interface ZodGUID extends ZodStringFormat<"guid"> {
137
+ _zod: core.$ZodGUIDInternals;
138
+ }
139
+ export declare const ZodGUID: core.$constructor<ZodGUID>;
140
+ export declare function guid(params?: string | core.$ZodGUIDParams): ZodGUID;
141
+ export interface ZodUUID extends ZodStringFormat<"uuid"> {
142
+ _zod: core.$ZodUUIDInternals;
143
+ }
144
+ export declare const ZodUUID: core.$constructor<ZodUUID>;
145
+ export declare function uuid(params?: string | core.$ZodUUIDParams): ZodUUID;
146
+ export declare function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodUUID;
147
+ export declare function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodUUID;
148
+ export declare function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodUUID;
149
+ export interface ZodURL extends ZodStringFormat<"url"> {
150
+ _zod: core.$ZodURLInternals;
151
+ }
152
+ export declare const ZodURL: core.$constructor<ZodURL>;
153
+ export declare function url(params?: string | core.$ZodURLParams): ZodURL;
154
+ export interface ZodEmoji extends ZodStringFormat<"emoji"> {
155
+ _zod: core.$ZodEmojiInternals;
156
+ }
157
+ export declare const ZodEmoji: core.$constructor<ZodEmoji>;
158
+ export declare function emoji(params?: string | core.$ZodEmojiParams): ZodEmoji;
159
+ export interface ZodNanoID extends ZodStringFormat<"nanoid"> {
160
+ _zod: core.$ZodNanoIDInternals;
161
+ }
162
+ export declare const ZodNanoID: core.$constructor<ZodNanoID>;
163
+ export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodNanoID;
164
+ export interface ZodCUID extends ZodStringFormat<"cuid"> {
165
+ _zod: core.$ZodCUIDInternals;
166
+ }
167
+ export declare const ZodCUID: core.$constructor<ZodCUID>;
168
+ export declare function cuid(params?: string | core.$ZodCUIDParams): ZodCUID;
169
+ export interface ZodCUID2 extends ZodStringFormat<"cuid2"> {
170
+ _zod: core.$ZodCUID2Internals;
171
+ }
172
+ export declare const ZodCUID2: core.$constructor<ZodCUID2>;
173
+ export declare function cuid2(params?: string | core.$ZodCUID2Params): ZodCUID2;
174
+ export interface ZodULID extends ZodStringFormat<"ulid"> {
175
+ _zod: core.$ZodULIDInternals;
176
+ }
177
+ export declare const ZodULID: core.$constructor<ZodULID>;
178
+ export declare function ulid(params?: string | core.$ZodULIDParams): ZodULID;
179
+ export interface ZodXID extends ZodStringFormat<"xid"> {
180
+ _zod: core.$ZodXIDInternals;
181
+ }
182
+ export declare const ZodXID: core.$constructor<ZodXID>;
183
+ export declare function xid(params?: string | core.$ZodXIDParams): ZodXID;
184
+ export interface ZodKSUID extends ZodStringFormat<"ksuid"> {
185
+ _zod: core.$ZodKSUIDInternals;
186
+ }
187
+ export declare const ZodKSUID: core.$constructor<ZodKSUID>;
188
+ export declare function ksuid(params?: string | core.$ZodKSUIDParams): ZodKSUID;
189
+ export interface ZodIPv4 extends ZodStringFormat<"ipv4"> {
190
+ _zod: core.$ZodIPv4Internals;
191
+ }
192
+ export declare const ZodIPv4: core.$constructor<ZodIPv4>;
193
+ export declare function ipv4(params?: string | core.$ZodIPv4Params): ZodIPv4;
194
+ export interface ZodIPv6 extends ZodStringFormat<"ipv6"> {
195
+ _zod: core.$ZodIPv6Internals;
196
+ }
197
+ export declare const ZodIPv6: core.$constructor<ZodIPv6>;
198
+ export declare function ipv6(params?: string | core.$ZodIPv6Params): ZodIPv6;
199
+ export interface ZodBase64 extends ZodStringFormat<"base64"> {
200
+ _zod: core.$ZodBase64Internals;
201
+ }
202
+ export declare const ZodBase64: core.$constructor<ZodBase64>;
203
+ export declare function base64(params?: string | core.$ZodBase64Params): ZodBase64;
204
+ export interface ZodE164 extends ZodStringFormat<"e164"> {
205
+ _zod: core.$ZodE164Internals;
206
+ }
207
+ export declare const ZodE164: core.$constructor<ZodE164>;
208
+ export declare function e164(params?: string | core.$ZodE164Params): ZodE164;
209
+ export interface ZodJWT extends ZodStringFormat<"jwt"> {
210
+ _zod: core.$ZodJWTInternals;
211
+ }
212
+ export declare const ZodJWT: core.$constructor<ZodJWT>;
213
+ export declare function jwt(params?: string | core.$ZodJWTParams): ZodJWT;
214
+ export interface _ZodNumber<Input = unknown> extends ZodType {
215
+ _zod: core.$ZodNumberInternals<Input>;
216
+ gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
217
+ /** Identical to .min() */
218
+ gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
219
+ min(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
220
+ lt(value: number, params?: string | core.$ZodCheckLessThanParams): this;
221
+ /** Identical to .max() */
222
+ lte(value: number, params?: string | core.$ZodCheckLessThanParams): this;
223
+ max(value: number, params?: string | core.$ZodCheckLessThanParams): this;
224
+ /** @deprecated Use `z.int()` instead. */
225
+ int(params?: string | core.$ZodCheckNumberFormatParams): this;
226
+ /** @deprecated This is now identical to `.int()` instead. Only numbers in the safe integer range are accepted. */
227
+ safe(params?: string | core.$ZodCheckNumberFormatParams): this;
228
+ positive(params?: string | core.$ZodCheckGreaterThanParams): this;
229
+ nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
230
+ negative(params?: string | core.$ZodCheckLessThanParams): this;
231
+ nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
232
+ multipleOf(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
233
+ /** @deprecated Use `.multipleOf()` instead. */
234
+ step(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
235
+ /** @deprecated In v4 and later, z.number() does not allow infinite values. This is a no-op. */
236
+ finite(params?: any): this;
237
+ minValue: number | null;
238
+ maxValue: number | null;
239
+ /** @deprecated Check `format` property instead. */
240
+ isInt: boolean;
241
+ /** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
242
+ isFinite: boolean;
243
+ format: string | null;
244
+ }
245
+ export interface ZodNumber extends _ZodNumber<number> {
246
+ }
247
+ export declare const ZodNumber: core.$constructor<ZodNumber>;
248
+ export declare function number(params?: string | core.$ZodNumberParams): ZodNumber;
249
+ export interface ZodNumberFormat extends ZodNumber {
250
+ _zod: core.$ZodNumberFormatInternals;
251
+ }
252
+ export declare const ZodNumberFormat: core.$constructor<ZodNumberFormat>;
253
+ interface ZodInt extends ZodNumberFormat {
254
+ }
255
+ export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt;
256
+ interface ZodFloat32 extends ZodNumberFormat {
257
+ }
258
+ export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32;
259
+ interface ZodFloat64 extends ZodNumberFormat {
260
+ }
261
+ export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64;
262
+ interface ZodInt32 extends ZodNumberFormat {
263
+ }
264
+ export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32;
265
+ interface ZodUInt32 extends ZodNumberFormat {
266
+ }
267
+ export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32;
268
+ export interface _ZodBoolean<T = unknown> extends ZodType {
269
+ _zod: core.$ZodBooleanInternals<T>;
270
+ }
271
+ export interface ZodBoolean extends _ZodBoolean<boolean> {
272
+ }
273
+ export declare const ZodBoolean: core.$constructor<ZodBoolean>;
274
+ export declare function boolean(params?: string | core.$ZodBooleanParams): ZodBoolean;
275
+ export interface _ZodBigInt<T = unknown> extends ZodType {
276
+ _zod: core.$ZodBigIntInternals<T>;
277
+ gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
278
+ /** Alias of `.gte()` */
279
+ min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
280
+ gt(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
281
+ /** Alias of `.lte()` */
282
+ lte(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
283
+ max(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
284
+ lt(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
285
+ positive(params?: string | core.$ZodCheckGreaterThanParams): this;
286
+ negative(params?: string | core.$ZodCheckLessThanParams): this;
287
+ nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
288
+ nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
289
+ multipleOf(value: bigint, params?: string | core.$ZodCheckMultipleOfParams): this;
290
+ minValue: bigint | null;
291
+ maxValue: bigint | null;
292
+ format: string | null;
293
+ }
294
+ export interface ZodBigInt extends _ZodBigInt<bigint> {
295
+ }
296
+ export declare const ZodBigInt: core.$constructor<ZodBigInt>;
297
+ export declare function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt;
298
+ export interface ZodBigIntFormat extends ZodBigInt {
299
+ _zod: core.$ZodBigIntFormatInternals;
300
+ }
301
+ export declare const ZodBigIntFormat: core.$constructor<ZodBigIntFormat>;
302
+ export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat;
303
+ export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat;
304
+ export interface ZodSymbol extends ZodType {
305
+ _zod: core.$ZodSymbolInternals;
306
+ }
307
+ export declare const ZodSymbol: core.$constructor<ZodSymbol>;
308
+ export declare function symbol(params?: string | core.$ZodSymbolParams): ZodSymbol;
309
+ export interface ZodUndefined extends ZodType {
310
+ _zod: core.$ZodUndefinedInternals;
311
+ }
312
+ export declare const ZodUndefined: core.$constructor<ZodUndefined>;
313
+ declare function _undefined(params?: string | core.$ZodUndefinedParams): ZodUndefined;
314
+ export { _undefined as undefined };
315
+ export interface ZodNull extends ZodType {
316
+ _zod: core.$ZodNullInternals;
317
+ }
318
+ export declare const ZodNull: core.$constructor<ZodNull>;
319
+ declare function _null(params?: string | core.$ZodNullParams): ZodNull;
320
+ export { _null as null };
321
+ export interface ZodAny extends ZodType {
322
+ _zod: core.$ZodAnyInternals;
323
+ }
324
+ export declare const ZodAny: core.$constructor<ZodAny>;
325
+ export declare function any(params?: string | core.$ZodAnyParams): ZodAny;
326
+ export interface ZodUnknown extends ZodType {
327
+ _zod: core.$ZodUnknownInternals;
328
+ }
329
+ export declare const ZodUnknown: core.$constructor<ZodUnknown>;
330
+ export declare function unknown(params?: string | core.$ZodUnknownParams): ZodUnknown;
331
+ export interface ZodNever extends ZodType {
332
+ _zod: core.$ZodNeverInternals;
333
+ }
334
+ export declare const ZodNever: core.$constructor<ZodNever>;
335
+ export declare function never(params?: string | core.$ZodNeverParams): ZodNever;
336
+ export interface ZodVoid extends ZodType {
337
+ _zod: core.$ZodVoidInternals;
338
+ }
339
+ export declare const ZodVoid: core.$constructor<ZodVoid>;
340
+ declare function _void(params?: string | core.$ZodVoidParams): ZodVoid;
341
+ export { _void as void };
342
+ export interface _ZodDate<T = unknown> extends ZodType {
343
+ _zod: core.$ZodDateInternals<T>;
344
+ min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
345
+ max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
346
+ /** @deprecated Not recommended. */
347
+ minDate: Date | null;
348
+ /** @deprecated Not recommended. */
349
+ maxDate: Date | null;
350
+ }
351
+ export interface ZodDate extends _ZodDate<Date> {
352
+ }
353
+ export declare const ZodDate: core.$constructor<ZodDate>;
354
+ export declare function date(params?: string | core.$ZodDateParams): ZodDate;
355
+ export interface ZodArray<T extends SomeType = SomeType> extends ZodType {
356
+ _zod: core.$ZodArrayInternals<T>;
357
+ element: T;
358
+ min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
359
+ nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
360
+ max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
361
+ length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
362
+ }
363
+ export declare const ZodArray: core.$constructor<ZodArray>;
364
+ export declare function array<T extends SomeType>(element: T, params?: core.$ZodArrayParams): ZodArray<T>;
365
+ export interface ZodObjectLike<out O = object, out I = object> extends ZodType {
366
+ _zod: core.$ZodObjectLikeInternals<O, I>;
367
+ }
368
+ export declare const ZodObjectLike: core.$constructor<ZodObjectLike>;
369
+ export declare function keyof<T extends ZodObject>(schema: T): ZodLiteral<keyof T["_zod"]["shape"]>;
370
+ export declare function keyof<T extends ZodInterface>(schema: T): ZodLiteral<keyof T["_zod"]["output"]>;
371
+ type ZodInterfacePartial<T extends ZodInterface, Keys extends keyof T["_zod"]["shape"] = keyof T["_zod"]["shape"]> = ZodInterface<util.ExtendShape<T["_zod"]["shape"], {
372
+ [k in Keys]: ZodOptional<T["_zod"]["shape"][k]>;
373
+ }>, {
374
+ optional: T["_zod"]["optional"] | (string & Keys);
375
+ defaulted: T["_zod"]["defaulted"];
376
+ extra: T["_zod"]["extra"];
377
+ }>;
378
+ type ZodInterfaceRequired<T extends ZodInterface, Keys extends keyof T["_zod"]["shape"] = keyof T["_zod"]["shape"]> = ZodInterface<util.ExtendShape<T["_zod"]["shape"], {
379
+ [k in Keys]: ZodNonOptional<T["_zod"]["shape"][k]>;
380
+ }>, {
381
+ optional: never;
382
+ defaulted: T["_zod"]["defaulted"];
383
+ extra: T["_zod"]["extra"];
384
+ }>;
385
+ type MergeInterfaces<A extends ZodInterface, B extends ZodInterface> = ZodInterface<util.ExtendShape<A["_zod"]["shape"], B["_zod"]["shape"]>, util.MergeInterfaceParams<A, B>>;
386
+ export interface ZodInterface<out Shape extends core.$ZodLooseShape = core.$ZodLooseShape, out Params extends core.$ZodInterfaceNamedParams = core.$ZodInterfaceNamedParams> extends ZodType {
387
+ _zod: core.$ZodInterfaceInternals<Shape, Params>;
388
+ keyof(): ZodEnum<util.ToEnum<util.InterfaceKeys<string & keyof Shape>>>;
389
+ catchall<T extends core.$ZodType>(schema: T): ZodInterface<Shape, {
390
+ optional: Params["optional"];
391
+ defaulted: Params["defaulted"];
392
+ extra: Record<string, T["_zod"]["output"]>;
393
+ }>;
394
+ strict(): ZodInterface<Shape, {
395
+ optional: Params["optional"];
396
+ defaulted: Params["defaulted"];
397
+ extra: {};
398
+ }>;
399
+ loose(): ZodInterface<Shape, {
400
+ optional: Params["optional"];
401
+ defaulted: Params["defaulted"];
402
+ extra: Record<string, unknown>;
403
+ }>;
404
+ strip(): ZodInterface<Shape, {
405
+ optional: Params["optional"];
406
+ defaulted: Params["defaulted"];
407
+ extra: {};
408
+ }>;
409
+ extend<U extends ZodInterface>(int: U): MergeInterfaces<this, U>;
410
+ extend<U extends core.$ZodLooseShape>(shape: U): MergeInterfaces<this, ZodInterface<U, util.InitInterfaceParams<U, {}>>>;
411
+ /** @deprecated Use `.extend()` */
412
+ merge<U extends ZodInterface>(incoming: U): MergeInterfaces<this, U>;
413
+ pick<const M extends util.Exactly<util.Mask<string & keyof Shape>, M>>(mask: M): ZodInterface<util.Flatten<Pick<Shape, keyof Shape & keyof M>>, {
414
+ optional: Extract<Params["optional"], keyof M>;
415
+ defaulted: Extract<Params["defaulted"], keyof M>;
416
+ extra: Params["extra"];
417
+ }>;
418
+ omit<const M extends util.Exactly<util.Mask<string & keyof Shape>, M>>(mask: M): ZodInterface<util.Flatten<Omit<Shape, keyof M>>, {
419
+ optional: Exclude<Params["optional"], keyof M>;
420
+ defaulted: Exclude<Params["defaulted"], keyof M>;
421
+ extra: Params["extra"];
422
+ }>;
423
+ partial(): ZodInterfacePartial<this>;
424
+ partial<M extends util.Mask<string & keyof Shape>>(mask: M): ZodInterfacePartial<this, string & keyof M>;
425
+ required(): ZodInterfaceRequired<this, string & keyof Shape>;
426
+ required<M extends util.Mask<string & keyof Shape>>(mask: M): ZodInterfaceRequired<this, string & keyof M>;
427
+ }
428
+ export declare const ZodInterface: core.$constructor<ZodInterface>;
429
+ declare function _interface<T extends core.$ZodLooseShape>(shape: T, params?: core.$ZodInterfaceParams, Class?: util.Constructor<ZodInterface>): ZodInterface<util.CleanInterfaceShape<T>, util.InitInterfaceParams<T, {}>>;
430
+ export { _interface as interface };
431
+ export declare function strictInterface<T extends core.$ZodLooseShape>(shape: T, params?: core.$ZodInterfaceParams): ZodInterface<util.CleanInterfaceShape<T>, util.InitInterfaceParams<T, {}>>;
432
+ export declare function looseInterface<T extends core.$ZodLooseShape>(shape: T, params?: core.$ZodInterfaceParams): ZodInterface<util.CleanInterfaceShape<T>, util.InitInterfaceParams<T, Record<string, unknown>>>;
433
+ type MergeObjects<A extends ZodObject, B extends ZodObject> = ZodObject<util.ExtendShape<A["_zod"]["shape"], B["_zod"]["shape"]>, A["_zod"]["extra"]>;
434
+ export interface ZodObject<out Shape extends core.$ZodShape = core.$ZodShape, Extra extends Record<string, unknown> = Record<string, unknown>> extends ZodType {
435
+ _zod: core.$ZodObjectInternals<Shape, Extra>;
436
+ /** @deprecated In Zod 4, you can pass `ZodObject` instances directly into `.extend()`. */
437
+ shape: Shape;
438
+ keyof(): ZodEnum<util.ToEnum<keyof Shape & string>>;
439
+ catchall<T extends core.$ZodType>(schema: T): ZodObject<Shape, Record<string, T["_zod"]["output"]>>;
440
+ /** @deprecated Use `z.looseObject()` instead. */
441
+ passthrough(): ZodObject<Shape, Record<string, unknown>>;
442
+ /** @deprecated Use `z.looseObject()` instead. */
443
+ loose(): ZodObject<Shape, Record<string, unknown>>;
444
+ /** @deprecated Use `z.strictObject()` instead. */
445
+ strict(): ZodObject<Shape, {}>;
446
+ /** @deprecated This is the default behavior. This method call is likely unnecessary. */
447
+ strip(): ZodObject<Shape, {}>;
448
+ extend<U extends ZodObject>(shape: U): MergeObjects<this, U>;
449
+ extend<U extends core.$ZodShape>(shape: U): MergeObjects<this, ZodObject<U, {}>>;
450
+ /** @deprecated Use `A.extend(B)` */
451
+ merge<U extends ZodObject<any, any>>(other: U): ZodObject<util.Flatten<util.Overwrite<Shape, U["_zod"]["def"]["shape"]>>, Extra>;
452
+ pick<M extends util.Exactly<util.Mask<string & keyof Shape>, M>>(mask: M): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Extra>;
453
+ omit<M extends util.Exactly<util.Mask<string & keyof Shape>, M>>(mask: M): ZodObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Extra>;
454
+ partial(): ZodObject<{
455
+ [k in keyof Shape]: ZodOptional<Shape[k]>;
456
+ }, Extra>;
457
+ partial<M extends util.Exactly<util.Mask<string & keyof Shape>, M>>(mask: M): ZodObject<{
458
+ [k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k];
459
+ }, Extra>;
460
+ required(): ZodObject<{
461
+ [k in keyof Shape]: ZodNonOptional<Shape[k]>;
462
+ }, Extra>;
463
+ required<M extends util.Exactly<util.Mask<string & keyof Shape>, M>>(mask: M): ZodObject<{
464
+ [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
465
+ }, Extra>;
466
+ }
467
+ export declare const ZodObject: core.$constructor<ZodObject>;
468
+ export declare function object<T extends core.$ZodShape = Record<never, SomeType>>(shape?: T, params?: core.$ZodObjectLikeParams): ZodObject<T, {}>;
469
+ export declare function strictObject<T extends core.$ZodShape>(shape: T, params?: core.$ZodObjectParams): ZodObject<T, {}>;
470
+ export declare function looseObject<T extends core.$ZodShape>(shape: T, params?: core.$ZodObjectParams): ZodObject<T, {
471
+ [k: string]: unknown;
472
+ }>;
473
+ export declare function extend<T extends ZodInterface, U extends ZodInterface>(a: T, b: U): ZodInterface<util.ExtendShape<T["_zod"]["shape"], U["_zod"]["shape"]>, util.MergeInterfaceParams<T, U>>;
474
+ export declare function extend<T extends ZodObject, U extends ZodObject>(a: T, b: U): ZodObject<util.ExtendObject<T["_zod"]["shape"], U["_zod"]["shape"]>, U["_zod"]["extra"] & T["_zod"]["extra"]>;
475
+ export declare function extend<T extends ZodObjectLike, U extends core.$ZodLooseShape>(schema: T, shape: U): T extends ZodInterface<infer TShape, infer TParams> ? ZodInterface<util.ExtendInterfaceShape<TShape, U>, util.ExtendInterfaceParams<ZodInterface<TShape, TParams>, U>> : ZodObject<util.ExtendObject<T["_zod"]["shape"], U>, T["_zod"]["extra"]>;
476
+ export declare function merge<T extends ZodObjectLike, U extends core.$ZodLooseShape>(schema: T, shape: U): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.ExtendShape<T["_zod"]["shape"], U["_zod"]["shape"]>, {
477
+ extra: T["_zod"]["extra"] & U["_zod"]["extra"];
478
+ optional: Exclude<T["_zod"]["optional"], keyof U["_zod"]["shape"]> | U["_zod"]["optional"];
479
+ defaulted: Exclude<T["_zod"]["defaulted"], keyof U["_zod"]["shape"]> | U["_zod"]["defaulted"];
480
+ }> : ZodObject<util.ExtendObject<T["_zod"]["shape"], U>, T["_zod"]["extra"]>;
481
+ export declare function pick<T extends ZodObjectLike, M extends util.Exactly<util.Mask<keyof T["_zod"]["shape"]>, M>>(schema: T, mask: M): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.Flatten<Pick<T["_zod"]["shape"], keyof T["_zod"]["shape"] & keyof M>>, {
482
+ optional: Extract<T["_zod"]["optional"], keyof M>;
483
+ defaulted: Extract<T["_zod"]["defaulted"], keyof M>;
484
+ extra: T["_zod"]["extra"];
485
+ }> : ZodObject<util.Flatten<Pick<T["_zod"]["shape"], keyof T["_zod"]["shape"] & keyof M>>, T["_zod"]["extra"]>;
486
+ export declare function omit<T extends ZodObjectLike, const M extends util.Exactly<util.Mask<keyof T["_zod"]["shape"]>, M>>(schema: T, mask: M): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.Flatten<Omit<T["_zod"]["shape"], keyof M>>, {
487
+ optional: Exclude<T["_zod"]["optional"], keyof M>;
488
+ defaulted: Exclude<T["_zod"]["defaulted"], keyof M>;
489
+ extra: T["_zod"]["extra"];
490
+ }> : ZodObject<util.Flatten<Omit<T["_zod"]["shape"], keyof M>>, T["_zod"]["extra"]>;
491
+ export declare function partial<T extends ZodObjectLike>(schema: T): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<{
492
+ [k in keyof T["_zod"]["shape"]]: ZodOptional<T["_zod"]["shape"][k]>;
493
+ }, {
494
+ optional: string & keyof T["_zod"]["shape"];
495
+ defaulted: never;
496
+ extra: T["_zod"]["extra"];
497
+ }> : ZodObject<{
498
+ [k in keyof T["_zod"]["shape"]]: ZodOptional<T["_zod"]["shape"][k]>;
499
+ }, T["_zod"]["extra"]>;
500
+ export declare function partial<T extends ZodObjectLike, M extends util.Exactly<util.Mask<keyof T["_zod"]["shape"]>, M>>(schema: T, mask: M): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.ExtendShape<T["_zod"]["shape"], {
501
+ [k in keyof M & keyof T["_zod"]["shape"]]: ZodOptional<T["_zod"]["shape"][k]>;
502
+ }>, {
503
+ optional: string & (T["_zod"]["optional"] | keyof M);
504
+ defaulted: T["_zod"]["defaulted"];
505
+ extra: T["_zod"]["extra"];
506
+ }> : ZodObject<{
507
+ [k in keyof T["_zod"]["shape"]]: k extends keyof M ? ZodOptional<T["_zod"]["shape"][k]> : T["_zod"]["shape"][k];
508
+ }, T["_zod"]["extra"]>;
509
+ export declare function required<T extends {
510
+ _subtype: "object";
511
+ } & ZodObject>(schema: T): ZodObject<{
512
+ [k in keyof T["_zod"]["shape"]]: ZodNonOptional<T["_zod"]["shape"][k]>;
513
+ }>;
514
+ export declare function required<T extends {
515
+ _subtype: "object";
516
+ } & ZodObject, M extends util.Exactly<util.Mask<keyof T["_zod"]["shape"]>, M>>(schema: T, mask: M): ZodObject<util.ExtendShape<T["_zod"]["shape"], {
517
+ [k in keyof M & keyof T["_zod"]["shape"]]: ZodNonOptional<T["_zod"]["shape"][k]>;
518
+ }>>;
519
+ export declare function required<T extends {
520
+ _subtype: "interface";
521
+ } & ZodInterface>(schema: T): ZodInterface<{
522
+ [k in keyof T["_zod"]["shape"]]: ZodNonOptional<T["_zod"]["shape"][k]>;
523
+ }, {
524
+ optional: never;
525
+ defaulted: T["_zod"]["defaulted"];
526
+ extra: T["_zod"]["extra"];
527
+ }>;
528
+ export declare function required<T extends {
529
+ _subtype: "interface";
530
+ } & ZodInterface, M extends util.Mask<keyof T["_zod"]["output"]>>(schema: T, mask: M): ZodInterface<util.ExtendShape<T["_zod"]["shape"], {
531
+ [k in keyof M & keyof T["_zod"]["shape"]]: ZodNonOptional<T["_zod"]["shape"][k]>;
532
+ }>, {
533
+ optional: Exclude<T["_zod"]["optional"], keyof M>;
534
+ defaulted: T["_zod"]["defaulted"];
535
+ extra: T["_zod"]["extra"];
536
+ }>;
537
+ export interface ZodUnion<T extends readonly SomeType[] = readonly SomeType[]> extends ZodType {
538
+ _zod: core.$ZodUnionInternals<T>;
539
+ options: T;
540
+ }
541
+ export declare const ZodUnion: core.$constructor<ZodUnion>;
542
+ export declare function union<const T extends readonly SomeType[]>(options: T, params?: core.$ZodUnionParams): ZodUnion<T>;
543
+ export interface ZodDiscriminatedUnion<Options extends readonly SomeType[] = readonly SomeType[]> extends ZodUnion<Options> {
544
+ _zod: core.$ZodDiscriminatedUnionInternals<Options>;
545
+ }
546
+ export declare const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion>;
547
+ export interface $ZodTypeDiscriminableInternals extends core.$ZodTypeInternals {
548
+ disc: util.DiscriminatorMap;
549
+ }
550
+ export interface $ZodTypeDiscriminable extends ZodType {
551
+ _zod: $ZodTypeDiscriminableInternals;
552
+ }
553
+ export declare function discriminatedUnion<Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]]>(disc: string, options: Types, params?: core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
554
+ export declare function discriminatedUnion<Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]]>(options: Types, params?: core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
555
+ export interface ZodIntersection<A extends SomeType = SomeType, B extends SomeType = SomeType> extends ZodType {
556
+ _zod: core.$ZodIntersectionInternals<A, B>;
557
+ }
558
+ export declare const ZodIntersection: core.$constructor<ZodIntersection>;
559
+ export declare function intersection<T extends SomeType, U extends SomeType>(left: T, right: U, params?: core.$ZodIntersectionParams): ZodIntersection<T, U>;
560
+ export interface ZodTuple<T extends util.TupleItems = util.TupleItems, Rest extends SomeType | null = SomeType | null> extends ZodType {
561
+ _zod: core.$ZodTupleInternals<T, Rest>;
562
+ rest<Rest extends core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
563
+ }
564
+ export declare const ZodTuple: core.$constructor<ZodTuple>;
565
+ export declare function tuple<T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: core.$ZodTupleParams): ZodTuple<T, null>;
566
+ export declare function tuple<T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: core.$ZodTupleParams): ZodTuple<T, Rest>;
567
+ export declare function tuple(items: [], params?: core.$ZodTupleParams): ZodTuple<[], null>;
568
+ export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType = SomeType> extends ZodType {
569
+ _zod: core.$ZodRecordInternals<Key, Value>;
570
+ keyType: Key;
571
+ valueType: Value;
572
+ }
573
+ export declare const ZodRecord: core.$constructor<ZodRecord>;
574
+ export declare function record<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: core.$ZodRecordParams): ZodRecord<Key, Value>;
575
+ export interface ZodMap<Key extends SomeType = SomeType, Value extends SomeType = SomeType> extends ZodType {
576
+ _zod: core.$ZodMapInternals<Key, Value>;
577
+ keyType: Key;
578
+ valueType: Value;
579
+ }
580
+ export declare const ZodMap: core.$constructor<ZodMap>;
581
+ export declare function map<Key extends SomeType, Value extends SomeType>(keyType: Key, valueType: Value, params?: core.$ZodMapParams): ZodMap<Key, Value>;
582
+ export interface ZodSet<T extends SomeType = SomeType> extends ZodType {
583
+ _zod: core.$ZodSetInternals<T>;
584
+ min(minSize: number, params?: core.$ZodCheckMinSizeParams): this;
585
+ /** */
586
+ nonempty(params?: core.$ZodCheckMinSizeParams): this;
587
+ max(maxSize: number, params?: core.$ZodCheckMaxSizeParams): this;
588
+ size(size: number, params?: core.$ZodCheckSizeEqualsParams): this;
589
+ }
590
+ export declare const ZodSet: core.$constructor<ZodSet>;
591
+ export declare function set<Value extends SomeType>(valueType: Value, params?: core.$ZodSetParams): ZodSet<Value>;
592
+ export interface ZodEnum<T extends util.EnumLike = util.EnumLike> extends ZodType {
593
+ _zod: core.$ZodEnumInternals<T>;
594
+ enum: T;
595
+ options: Array<T[keyof T]>;
596
+ extract<const U extends readonly (keyof T)[]>(values: U, params?: core.$ZodEnumParams): ZodEnum<util.Flatten<Pick<T, U[number]>>>;
597
+ exclude<const U extends readonly (keyof T)[]>(values: U, params?: core.$ZodEnumParams): ZodEnum<util.Flatten<Omit<T, U[number]>>>;
598
+ }
599
+ export declare const ZodEnum: core.$constructor<ZodEnum>;
600
+ declare function _enum<const T extends string[]>(values: T, params?: core.$ZodEnumParams): ZodEnum<util.ToEnum<T[number]>>;
601
+ declare function _enum<T extends util.EnumLike>(entries: T, params?: core.$ZodEnumParams): ZodEnum<T>;
602
+ export { _enum as enum };
603
+ /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
604
+ *
605
+ * ```ts
606
+ * enum Colors { red, green, blue }
607
+ * z.enum(Colors);
608
+ * ```
609
+ */
610
+ export declare function nativeEnum<T extends util.EnumLike>(entries: T, params?: core.$ZodEnumParams): ZodEnum<T>;
611
+ export interface ZodLiteral<T extends util.Primitive = util.Primitive> extends ZodType {
612
+ _zod: core.$ZodLiteralInternals<T>;
613
+ values: Set<T>;
614
+ }
615
+ export declare const ZodLiteral: core.$constructor<ZodLiteral>;
616
+ export declare function literal<const T extends Array<util.Literal>>(value: T, params?: core.$ZodLiteralParams): ZodLiteral<T[number]>;
617
+ export declare function literal<const T extends util.Literal>(value: T, params?: core.$ZodLiteralParams): ZodLiteral<T>;
618
+ export interface ZodFile extends ZodType {
619
+ _zod: core.$ZodFileInternals;
620
+ min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
621
+ max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
622
+ mime(types: Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
623
+ }
624
+ export declare const ZodFile: core.$constructor<ZodFile>;
625
+ export declare function file(params?: string | core.$ZodFileParams): ZodFile;
626
+ export interface ZodTransform<O = unknown, I = unknown> extends ZodType {
627
+ _zod: core.$ZodTransformInternals<O, I>;
628
+ }
629
+ export declare const ZodTransform: core.$constructor<ZodTransform>;
630
+ export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O, params?: core.$ZodTransformParams): ZodTransform<Awaited<O>, I>;
631
+ export interface ZodOptional<T extends SomeType = SomeType> extends ZodType {
632
+ _zod: core.$ZodOptionalInternals<T>;
633
+ unwrap(): T;
634
+ }
635
+ export declare const ZodOptional: core.$constructor<ZodOptional>;
636
+ export declare function optional<T extends SomeType>(innerType: T, params?: core.$ZodOptionalParams): ZodOptional<T>;
637
+ export interface ZodNullable<T extends SomeType = SomeType> extends ZodType {
638
+ _zod: core.$ZodNullableInternals<T>;
639
+ unwrap(): T;
640
+ }
641
+ export declare const ZodNullable: core.$constructor<ZodNullable>;
642
+ export declare function nullable<T extends SomeType>(innerType: T, params?: core.$ZodNullableParams): ZodNullable<T>;
643
+ export declare function nullish<T extends SomeType>(innerType: T): ZodOptional<ZodNullable<T>>;
644
+ export interface ZodDefault<T extends SomeType = SomeType> extends ZodType {
645
+ _zod: core.$ZodDefaultInternals<T>;
646
+ unwrap(): T;
647
+ /** @deprecated Use `.unwrap()` instead. */
648
+ removeDefault(): T;
649
+ }
650
+ export declare const ZodDefault: core.$constructor<ZodDefault>;
651
+ export declare function _default<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>), params?: core.$ZodDefaultParams): ZodDefault<T>;
652
+ export interface ZodNonOptional<T extends SomeType = SomeType> extends ZodType {
653
+ _zod: core.$ZodNonOptionalInternals<T>;
654
+ unwrap(): T;
655
+ }
656
+ export declare const ZodNonOptional: core.$constructor<ZodNonOptional>;
657
+ export declare function nonoptional<T extends SomeType>(innerType: T, params?: core.$ZodNonOptionalParams): ZodNonOptional<T>;
658
+ export interface ZodSuccess<T extends SomeType = SomeType> extends ZodType {
659
+ _zod: core.$ZodSuccessInternals<T>;
660
+ unwrap(): T;
661
+ }
662
+ export declare const ZodSuccess: core.$constructor<ZodSuccess>;
663
+ export declare function success<T extends SomeType>(innerType: T, params?: core.$ZodSuccessParams): ZodSuccess<T>;
664
+ export interface ZodCatch<T extends SomeType = SomeType> extends ZodType {
665
+ _zod: core.$ZodCatchInternals<T>;
666
+ unwrap(): T;
667
+ /** @deprecated Use `.unwrap()` instead. */
668
+ removeCatch(): T;
669
+ }
670
+ export declare const ZodCatch: core.$constructor<ZodCatch>;
671
+ declare function _catch<T extends SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>), params?: core.$ZodCatchParams): ZodCatch<T>;
672
+ export { _catch as catch };
673
+ export interface ZodNaN extends ZodType {
674
+ _zod: core.$ZodNaNInternals;
675
+ }
676
+ export declare const ZodNaN: core.$constructor<ZodNaN>;
677
+ export declare function nan(params?: string | core.$ZodNaNParams): ZodNaN;
678
+ export interface ZodPipe<A extends SomeType = SomeType, B extends SomeType = SomeType> extends ZodType {
679
+ _zod: core.$ZodPipeInternals<A, B>;
680
+ in: A;
681
+ out: B;
682
+ }
683
+ export declare const ZodPipe: core.$constructor<ZodPipe>;
684
+ export declare function pipe<const A extends core.$ZodType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>, params?: core.$ZodPipeParams): ZodPipe<A, B>;
685
+ export interface ZodReadonly<T extends SomeType = SomeType> extends ZodType {
686
+ _zod: core.$ZodReadonlyInternals<T>;
687
+ }
688
+ export declare const ZodReadonly: core.$constructor<ZodReadonly>;
689
+ export declare function readonly<T extends SomeType>(innerType: T, params?: core.$ZodReadonlyParams): ZodReadonly<T>;
690
+ export interface ZodTemplateLiteral<Template extends string = string> extends ZodType {
691
+ _zod: core.$ZodTemplateLiteralInternals<Template>;
692
+ }
693
+ export declare const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral>;
694
+ export declare function templateLiteral<const Parts extends core.$TemplateLiteralPart[]>(parts: Parts, params?: core.$ZodTemplateLiteralParams): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
695
+ export interface ZodLazy<T extends SomeType = SomeType> extends ZodType {
696
+ _zod: core.$ZodLazyInternals<T>;
697
+ unwrap(): T;
698
+ }
699
+ export declare const ZodLazy: core.$constructor<ZodLazy>;
700
+ export declare function lazy<T extends SomeType>(getter: () => T): ZodLazy<T>;
701
+ export interface ZodPromise<T extends SomeType = SomeType> extends ZodType {
702
+ _zod: core.$ZodPromiseInternals<T>;
703
+ unwrap(): T;
704
+ }
705
+ export declare const ZodPromise: core.$constructor<ZodPromise>;
706
+ export declare function promise<T extends SomeType>(innerType: T, params?: core.$ZodPromiseParams): ZodPromise<T>;
707
+ export interface ZodCustom<O = unknown, I = unknown> extends ZodType {
708
+ _zod: core.$ZodCustomInternals<O, I>;
709
+ }
710
+ export declare const ZodCustom: core.$constructor<ZodCustom>;
711
+ export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: core.$ZodCustomParams): core.$ZodCheck<O>;
712
+ export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodCustom<O, I>;
713
+ export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
714
+ export declare function superRefine<T>(fn: (arg: T, payload: RefinementCtx<T>) => void | Promise<void>, params?: core.$ZodCustomParams): core.$ZodCheck<T>;
715
+ declare abstract class Class {
716
+ constructor(..._args: any[]);
717
+ }
718
+ type ZodInstanceOfParams = util.Params<ZodCustom, core.$ZodIssueCustom, "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path">;
719
+ declare function _instanceof<T extends typeof Class>(cls: T, params?: ZodInstanceOfParams): ZodCustom<InstanceType<T>>;
720
+ export { _instanceof as instanceof };
721
+ export declare const stringbool: (_params?: core.$ZodStringBoolParams) => ZodPipe<ZodUnknown, ZodBoolean>;
722
+ export type ZodJSONSchema = ZodUnion<[
723
+ ZodString,
724
+ ZodNumber,
725
+ ZodBoolean,
726
+ ZodNull,
727
+ ZodArray<ZodJSONSchema>,
728
+ ZodRecord<ZodString, ZodJSONSchema>
729
+ ]> & {
730
+ _zod: {
731
+ input: util.JSONType;
732
+ output: util.JSONType;
733
+ };
734
+ };
735
+ export declare function json(params?: core.$ZodCustomParams): ZodJSONSchema;
736
+ interface ZodPreprocessParams extends core.$ZodTransformParams, core.$ZodPipeParams {
737
+ }
738
+ export declare function preprocess<A, U extends core.$ZodType>(fn: (arg: unknown, ctx: RefinementCtx) => A, schema: U, params?: ZodPreprocessParams): ZodPipe<ZodTransform<A, unknown>, U>;