@rspack/core 1.2.2 → 1.2.3
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.
- package/compiled/@swc/types/index.d.ts +349 -258
- package/compiled/enhanced-resolve/package.json +1 -1
- package/compiled/zod/index.d.ts +302 -265
- package/compiled/zod/index.js +238 -84
- package/compiled/zod/package.json +1 -1
- package/dist/Chunk.d.ts +2 -0
- package/dist/ChunkGraph.d.ts +3 -0
- package/dist/ChunkGroup.d.ts +1 -0
- package/dist/Compilation.d.ts +0 -6
- package/dist/Dependency.d.ts +1 -0
- package/dist/Module.d.ts +6 -1
- package/dist/ModuleGraph.d.ts +4 -0
- package/dist/ModuleGraphConnection.d.ts +2 -0
- package/dist/NormalModuleFactory.d.ts +4 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +19 -3
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +45 -0
- package/dist/builtin-plugin/html-plugin/options.d.ts +26 -20
- package/dist/builtin-plugin/index.d.ts +1 -0
- package/dist/builtin-plugin/lazy-compilation/backend.d.ts +10 -1
- package/dist/config/defaults.d.ts +1 -0
- package/dist/config/types.d.ts +4 -0
- package/dist/config/zod.d.ts +40 -22
- package/dist/exports.d.ts +4 -1
- package/dist/index.js +6163 -5935
- package/dist/lib/DllReferencePlugin.d.ts +1 -1
- package/package.json +6 -6
package/compiled/zod/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
2
|
+
type Scalars = Primitive | Primitive[];
|
|
3
3
|
|
|
4
4
|
declare namespace util {
|
|
5
5
|
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
|
|
@@ -60,33 +60,33 @@ declare namespace objectUtil {
|
|
|
60
60
|
export { };
|
|
61
61
|
}
|
|
62
62
|
declare const ZodParsedType: {
|
|
63
|
-
function: "function";
|
|
64
|
-
number: "number";
|
|
65
63
|
string: "string";
|
|
64
|
+
number: "number";
|
|
65
|
+
bigint: "bigint";
|
|
66
|
+
boolean: "boolean";
|
|
67
|
+
symbol: "symbol";
|
|
68
|
+
undefined: "undefined";
|
|
69
|
+
object: "object";
|
|
70
|
+
function: "function";
|
|
71
|
+
map: "map";
|
|
66
72
|
nan: "nan";
|
|
67
73
|
integer: "integer";
|
|
68
74
|
float: "float";
|
|
69
|
-
boolean: "boolean";
|
|
70
75
|
date: "date";
|
|
71
|
-
bigint: "bigint";
|
|
72
|
-
symbol: "symbol";
|
|
73
|
-
undefined: "undefined";
|
|
74
76
|
null: "null";
|
|
75
77
|
array: "array";
|
|
76
|
-
object: "object";
|
|
77
78
|
unknown: "unknown";
|
|
78
79
|
promise: "promise";
|
|
79
80
|
void: "void";
|
|
80
81
|
never: "never";
|
|
81
|
-
map: "map";
|
|
82
82
|
set: "set";
|
|
83
83
|
};
|
|
84
|
-
|
|
84
|
+
type ZodParsedType = keyof typeof ZodParsedType;
|
|
85
85
|
declare const getParsedType: (data: any) => ZodParsedType;
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
type allKeys<T> = T extends any ? keyof T : never;
|
|
88
|
+
type inferFlattenedErrors<T extends ZodType<any, any, any>, U = string> = typeToFlattenedError<TypeOf<T>, U>;
|
|
89
|
+
type typeToFlattenedError<T, U = string> = {
|
|
90
90
|
formErrors: U[];
|
|
91
91
|
fieldErrors: {
|
|
92
92
|
[P in allKeys<T>]?: U[];
|
|
@@ -110,8 +110,8 @@ declare const ZodIssueCode: {
|
|
|
110
110
|
not_multiple_of: "not_multiple_of";
|
|
111
111
|
not_finite: "not_finite";
|
|
112
112
|
};
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
type ZodIssueCode = keyof typeof ZodIssueCode;
|
|
114
|
+
type ZodIssueBase = {
|
|
115
115
|
path: (string | number)[];
|
|
116
116
|
message?: string;
|
|
117
117
|
};
|
|
@@ -153,7 +153,7 @@ interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
|
|
|
153
153
|
interface ZodInvalidDateIssue extends ZodIssueBase {
|
|
154
154
|
code: typeof ZodIssueCode.invalid_date;
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | {
|
|
157
157
|
includes: string;
|
|
158
158
|
position?: number;
|
|
159
159
|
} | {
|
|
@@ -195,26 +195,26 @@ interface ZodCustomIssue extends ZodIssueBase {
|
|
|
195
195
|
[k: string]: any;
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
type DenormalizedError = {
|
|
199
199
|
[k: string]: DenormalizedError | string[];
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
|
|
202
|
+
type ZodIssue = ZodIssueOptionalMessage & {
|
|
203
203
|
fatal?: boolean;
|
|
204
204
|
message: string;
|
|
205
205
|
};
|
|
206
206
|
declare const quotelessJson: (obj: any) => string;
|
|
207
|
-
|
|
207
|
+
type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
|
|
208
208
|
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
209
209
|
} : T extends any[] ? {
|
|
210
210
|
[k: number]: ZodFormattedError<T[number]>;
|
|
211
211
|
} : T extends object ? {
|
|
212
212
|
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
213
213
|
} : unknown;
|
|
214
|
-
|
|
214
|
+
type ZodFormattedError<T, U = string> = {
|
|
215
215
|
_errors: U[];
|
|
216
216
|
} & recursiveZodFormattedError<NonNullable<T>>;
|
|
217
|
-
|
|
217
|
+
type inferFormattedError<T extends ZodType<any, any, any>, U = string> = ZodFormattedError<TypeOf<T>, U>;
|
|
218
218
|
declare class ZodError<T = any> extends Error {
|
|
219
219
|
issues: ZodIssue[];
|
|
220
220
|
get errors(): ZodIssue[];
|
|
@@ -232,16 +232,16 @@ declare class ZodError<T = any> extends Error {
|
|
|
232
232
|
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
|
|
233
233
|
get formErrors(): typeToFlattenedError<T, string>;
|
|
234
234
|
}
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
|
|
236
|
+
type IssueData = stripPath<ZodIssueOptionalMessage> & {
|
|
237
237
|
path?: (string | number)[];
|
|
238
238
|
fatal?: boolean;
|
|
239
239
|
};
|
|
240
|
-
|
|
240
|
+
type ErrorMapCtx = {
|
|
241
241
|
defaultError: string;
|
|
242
242
|
data: any;
|
|
243
243
|
};
|
|
244
|
-
|
|
244
|
+
type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
|
|
245
245
|
message: string;
|
|
246
246
|
};
|
|
247
247
|
|
|
@@ -256,13 +256,13 @@ declare const makeIssue: (params: {
|
|
|
256
256
|
errorMaps: ZodErrorMap[];
|
|
257
257
|
issueData: IssueData;
|
|
258
258
|
}) => ZodIssue;
|
|
259
|
-
|
|
259
|
+
type ParseParams = {
|
|
260
260
|
path: (string | number)[];
|
|
261
261
|
errorMap: ZodErrorMap;
|
|
262
262
|
async: boolean;
|
|
263
263
|
};
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
type ParsePathComponent = string | number;
|
|
265
|
+
type ParsePath = ParsePathComponent[];
|
|
266
266
|
declare const EMPTY_PATH: ParsePath;
|
|
267
267
|
interface ParseContext {
|
|
268
268
|
readonly common: {
|
|
@@ -276,13 +276,13 @@ interface ParseContext {
|
|
|
276
276
|
readonly data: any;
|
|
277
277
|
readonly parsedType: ZodParsedType;
|
|
278
278
|
}
|
|
279
|
-
|
|
279
|
+
type ParseInput = {
|
|
280
280
|
data: any;
|
|
281
281
|
path: (string | number)[];
|
|
282
282
|
parent: ParseContext;
|
|
283
283
|
};
|
|
284
284
|
declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void;
|
|
285
|
-
|
|
285
|
+
type ObjectPair = {
|
|
286
286
|
key: SyncParseReturnType<any>;
|
|
287
287
|
value: SyncParseReturnType<any>;
|
|
288
288
|
};
|
|
@@ -305,23 +305,23 @@ interface ParseResult {
|
|
|
305
305
|
status: "aborted" | "dirty" | "valid";
|
|
306
306
|
data: any;
|
|
307
307
|
}
|
|
308
|
-
|
|
308
|
+
type INVALID = {
|
|
309
309
|
status: "aborted";
|
|
310
310
|
};
|
|
311
311
|
declare const INVALID: INVALID;
|
|
312
|
-
|
|
312
|
+
type DIRTY<T> = {
|
|
313
313
|
status: "dirty";
|
|
314
314
|
value: T;
|
|
315
315
|
};
|
|
316
316
|
declare const DIRTY: <T>(value: T) => DIRTY<T>;
|
|
317
|
-
|
|
317
|
+
type OK<T> = {
|
|
318
318
|
status: "valid";
|
|
319
319
|
value: T;
|
|
320
320
|
};
|
|
321
321
|
declare const OK: <T>(value: T) => OK<T>;
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
322
|
+
type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
|
|
323
|
+
type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
|
|
324
|
+
type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
|
|
325
325
|
declare const isAborted: (x: ParseReturnType<any>) => x is INVALID;
|
|
326
326
|
declare const isDirty: <T>(x: ParseReturnType<T>) => x is OK<T> | DIRTY<T>;
|
|
327
327
|
declare const isValid: <T>(x: ParseReturnType<T>) => x is OK<T>;
|
|
@@ -340,10 +340,10 @@ declare namespace errorUtil {
|
|
|
340
340
|
type ErrMessage = string | {
|
|
341
341
|
message?: string;
|
|
342
342
|
};
|
|
343
|
-
const errToObj: (message?: ErrMessage
|
|
343
|
+
const errToObj: (message?: ErrMessage) => {
|
|
344
344
|
message?: string | undefined;
|
|
345
345
|
};
|
|
346
|
-
const toString: (message?: ErrMessage
|
|
346
|
+
const toString: (message?: ErrMessage) => string | undefined;
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
declare namespace partialUtil {
|
|
@@ -354,51 +354,155 @@ declare namespace partialUtil {
|
|
|
354
354
|
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
+
/**
|
|
358
|
+
* The Standard Schema interface.
|
|
359
|
+
*/
|
|
360
|
+
type StandardSchemaV1<Input = unknown, Output = Input> = {
|
|
361
|
+
/**
|
|
362
|
+
* The Standard Schema properties.
|
|
363
|
+
*/
|
|
364
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
365
|
+
};
|
|
366
|
+
declare namespace StandardSchemaV1 {
|
|
367
|
+
/**
|
|
368
|
+
* The Standard Schema properties interface.
|
|
369
|
+
*/
|
|
370
|
+
export interface Props<Input = unknown, Output = Input> {
|
|
371
|
+
/**
|
|
372
|
+
* The version number of the standard.
|
|
373
|
+
*/
|
|
374
|
+
readonly version: 1;
|
|
375
|
+
/**
|
|
376
|
+
* The vendor name of the schema library.
|
|
377
|
+
*/
|
|
378
|
+
readonly vendor: string;
|
|
379
|
+
/**
|
|
380
|
+
* Validates unknown input values.
|
|
381
|
+
*/
|
|
382
|
+
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
383
|
+
/**
|
|
384
|
+
* Inferred types associated with the schema.
|
|
385
|
+
*/
|
|
386
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* The result interface of the validate function.
|
|
390
|
+
*/
|
|
391
|
+
export type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
392
|
+
/**
|
|
393
|
+
* The result interface if validation succeeds.
|
|
394
|
+
*/
|
|
395
|
+
export interface SuccessResult<Output> {
|
|
396
|
+
/**
|
|
397
|
+
* The typed output value.
|
|
398
|
+
*/
|
|
399
|
+
readonly value: Output;
|
|
400
|
+
/**
|
|
401
|
+
* The non-existent issues.
|
|
402
|
+
*/
|
|
403
|
+
readonly issues?: undefined;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* The result interface if validation fails.
|
|
407
|
+
*/
|
|
408
|
+
export interface FailureResult {
|
|
409
|
+
/**
|
|
410
|
+
* The issues of failed validation.
|
|
411
|
+
*/
|
|
412
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* The issue interface of the failure output.
|
|
416
|
+
*/
|
|
417
|
+
export interface Issue {
|
|
418
|
+
/**
|
|
419
|
+
* The error message of the issue.
|
|
420
|
+
*/
|
|
421
|
+
readonly message: string;
|
|
422
|
+
/**
|
|
423
|
+
* The path of the issue, if any.
|
|
424
|
+
*/
|
|
425
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* The path segment interface of the issue.
|
|
429
|
+
*/
|
|
430
|
+
export interface PathSegment {
|
|
431
|
+
/**
|
|
432
|
+
* The key representing a path segment.
|
|
433
|
+
*/
|
|
434
|
+
readonly key: PropertyKey;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* The Standard Schema types interface.
|
|
438
|
+
*/
|
|
439
|
+
export interface Types<Input = unknown, Output = Input> {
|
|
440
|
+
/**
|
|
441
|
+
* The input type of the schema.
|
|
442
|
+
*/
|
|
443
|
+
readonly input: Input;
|
|
444
|
+
/**
|
|
445
|
+
* The output type of the schema.
|
|
446
|
+
*/
|
|
447
|
+
readonly output: Output;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Infers the input type of a Standard Schema.
|
|
451
|
+
*/
|
|
452
|
+
export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
453
|
+
/**
|
|
454
|
+
* Infers the output type of a Standard Schema.
|
|
455
|
+
*/
|
|
456
|
+
export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
457
|
+
export { };
|
|
458
|
+
}
|
|
459
|
+
|
|
357
460
|
interface RefinementCtx {
|
|
358
461
|
addIssue: (arg: IssueData) => void;
|
|
359
462
|
path: (string | number)[];
|
|
360
463
|
}
|
|
361
|
-
|
|
464
|
+
type ZodRawShape = {
|
|
362
465
|
[k: string]: ZodTypeAny;
|
|
363
466
|
};
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
467
|
+
type ZodTypeAny = ZodType<any, any, any>;
|
|
468
|
+
type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
|
|
469
|
+
type input<T extends ZodType<any, any, any>> = T["_input"];
|
|
470
|
+
type output<T extends ZodType<any, any, any>> = T["_output"];
|
|
368
471
|
|
|
369
|
-
|
|
472
|
+
type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
|
|
370
473
|
interface ZodTypeDef {
|
|
371
474
|
errorMap?: ZodErrorMap;
|
|
372
475
|
description?: string;
|
|
373
476
|
}
|
|
374
|
-
|
|
477
|
+
type RawCreateParams = {
|
|
375
478
|
errorMap?: ZodErrorMap;
|
|
376
479
|
invalid_type_error?: string;
|
|
377
480
|
required_error?: string;
|
|
378
481
|
message?: string;
|
|
379
482
|
description?: string;
|
|
380
483
|
} | undefined;
|
|
381
|
-
|
|
484
|
+
type ProcessedCreateParams = {
|
|
382
485
|
errorMap?: ZodErrorMap;
|
|
383
486
|
description?: string;
|
|
384
487
|
};
|
|
385
|
-
|
|
488
|
+
type SafeParseSuccess<Output> = {
|
|
386
489
|
success: true;
|
|
387
490
|
data: Output;
|
|
388
491
|
error?: never;
|
|
389
492
|
};
|
|
390
|
-
|
|
493
|
+
type SafeParseError<Input> = {
|
|
391
494
|
success: false;
|
|
392
495
|
error: ZodError<Input>;
|
|
393
496
|
data?: never;
|
|
394
497
|
};
|
|
395
|
-
|
|
498
|
+
type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
|
|
396
499
|
declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
|
|
397
500
|
readonly _type: Output;
|
|
398
501
|
readonly _output: Output;
|
|
399
502
|
readonly _input: Input;
|
|
400
503
|
readonly _def: Def;
|
|
401
504
|
get description(): string | undefined;
|
|
505
|
+
"~standard": StandardSchemaV1.Props<Input, Output>;
|
|
402
506
|
abstract _parse(input: ParseInput): ParseReturnType<Output>;
|
|
403
507
|
_getType(input: ParseInput): string;
|
|
404
508
|
_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
|
|
@@ -410,10 +514,11 @@ declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef
|
|
|
410
514
|
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
|
|
411
515
|
parse(data: unknown, params?: Partial<ParseParams>): Output;
|
|
412
516
|
safeParse(data: unknown, params?: Partial<ParseParams>): SafeParseReturnType<Input, Output>;
|
|
517
|
+
"~validate"(data: unknown): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>>;
|
|
413
518
|
parseAsync(data: unknown, params?: Partial<ParseParams>): Promise<Output>;
|
|
414
519
|
safeParseAsync(data: unknown, params?: Partial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
|
|
415
520
|
/** Alias of safeParseAsync */
|
|
416
|
-
spa: (data: unknown, params?: Partial<ParseParams>
|
|
521
|
+
spa: (data: unknown, params?: Partial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
|
|
417
522
|
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
|
|
418
523
|
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
|
|
419
524
|
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
|
|
@@ -445,8 +550,8 @@ declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef
|
|
|
445
550
|
isOptional(): boolean;
|
|
446
551
|
isNullable(): boolean;
|
|
447
552
|
}
|
|
448
|
-
|
|
449
|
-
|
|
553
|
+
type IpVersion = "v4" | "v6";
|
|
554
|
+
type ZodStringCheck = {
|
|
450
555
|
kind: "min";
|
|
451
556
|
value: number;
|
|
452
557
|
message?: string;
|
|
@@ -508,6 +613,10 @@ declare type ZodStringCheck = {
|
|
|
508
613
|
} | {
|
|
509
614
|
kind: "toUpperCase";
|
|
510
615
|
message?: string;
|
|
616
|
+
} | {
|
|
617
|
+
kind: "jwt";
|
|
618
|
+
alg?: string;
|
|
619
|
+
message?: string;
|
|
511
620
|
} | {
|
|
512
621
|
kind: "datetime";
|
|
513
622
|
offset: boolean;
|
|
@@ -528,9 +637,16 @@ declare type ZodStringCheck = {
|
|
|
528
637
|
kind: "ip";
|
|
529
638
|
version?: IpVersion;
|
|
530
639
|
message?: string;
|
|
640
|
+
} | {
|
|
641
|
+
kind: "cidr";
|
|
642
|
+
version?: IpVersion;
|
|
643
|
+
message?: string;
|
|
531
644
|
} | {
|
|
532
645
|
kind: "base64";
|
|
533
646
|
message?: string;
|
|
647
|
+
} | {
|
|
648
|
+
kind: "base64url";
|
|
649
|
+
message?: string;
|
|
534
650
|
};
|
|
535
651
|
interface ZodStringDef extends ZodTypeDef {
|
|
536
652
|
checks: ZodStringCheck[];
|
|
@@ -555,8 +671,17 @@ declare class ZodString extends ZodType<string, ZodStringDef, string> {
|
|
|
555
671
|
cuid2(message?: errorUtil.ErrMessage): ZodString;
|
|
556
672
|
ulid(message?: errorUtil.ErrMessage): ZodString;
|
|
557
673
|
base64(message?: errorUtil.ErrMessage): ZodString;
|
|
674
|
+
base64url(message?: errorUtil.ErrMessage): ZodString;
|
|
675
|
+
jwt(options?: {
|
|
676
|
+
alg?: string;
|
|
677
|
+
message?: string;
|
|
678
|
+
}): ZodString;
|
|
558
679
|
ip(options?: string | {
|
|
559
|
-
version?:
|
|
680
|
+
version?: IpVersion;
|
|
681
|
+
message?: string;
|
|
682
|
+
}): ZodString;
|
|
683
|
+
cidr(options?: string | {
|
|
684
|
+
version?: IpVersion;
|
|
560
685
|
message?: string;
|
|
561
686
|
}): ZodString;
|
|
562
687
|
datetime(options?: string | {
|
|
@@ -582,8 +707,7 @@ declare class ZodString extends ZodType<string, ZodStringDef, string> {
|
|
|
582
707
|
max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
|
|
583
708
|
length(len: number, message?: errorUtil.ErrMessage): ZodString;
|
|
584
709
|
/**
|
|
585
|
-
*
|
|
586
|
-
* @see {@link ZodString.min}
|
|
710
|
+
* Equivalent to `.min(1)`
|
|
587
711
|
*/
|
|
588
712
|
nonempty(message?: errorUtil.ErrMessage): ZodString;
|
|
589
713
|
trim(): ZodString;
|
|
@@ -602,20 +726,16 @@ declare class ZodString extends ZodType<string, ZodStringDef, string> {
|
|
|
602
726
|
get isCUID2(): boolean;
|
|
603
727
|
get isULID(): boolean;
|
|
604
728
|
get isIP(): boolean;
|
|
729
|
+
get isCIDR(): boolean;
|
|
605
730
|
get isBase64(): boolean;
|
|
731
|
+
get isBase64url(): boolean;
|
|
606
732
|
get minLength(): number | null;
|
|
607
733
|
get maxLength(): number | null;
|
|
608
|
-
static create: (params?:
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
required_error?: string | undefined;
|
|
612
|
-
message?: string | undefined;
|
|
613
|
-
description?: string | undefined;
|
|
614
|
-
} & {
|
|
615
|
-
coerce?: true | undefined;
|
|
616
|
-
}) | undefined) => ZodString;
|
|
734
|
+
static create: (params?: RawCreateParams & {
|
|
735
|
+
coerce?: true;
|
|
736
|
+
}) => ZodString;
|
|
617
737
|
}
|
|
618
|
-
|
|
738
|
+
type ZodNumberCheck = {
|
|
619
739
|
kind: "min";
|
|
620
740
|
value: number;
|
|
621
741
|
inclusive: boolean;
|
|
@@ -643,20 +763,14 @@ interface ZodNumberDef extends ZodTypeDef {
|
|
|
643
763
|
}
|
|
644
764
|
declare class ZodNumber extends ZodType<number, ZodNumberDef, number> {
|
|
645
765
|
_parse(input: ParseInput): ParseReturnType<number>;
|
|
646
|
-
static create: (params?:
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
required_error?: string | undefined;
|
|
650
|
-
message?: string | undefined;
|
|
651
|
-
description?: string | undefined;
|
|
652
|
-
} & {
|
|
653
|
-
coerce?: boolean | undefined;
|
|
654
|
-
}) | undefined) => ZodNumber;
|
|
766
|
+
static create: (params?: RawCreateParams & {
|
|
767
|
+
coerce?: boolean;
|
|
768
|
+
}) => ZodNumber;
|
|
655
769
|
gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
656
|
-
min: (value: number, message?: errorUtil.ErrMessage
|
|
770
|
+
min: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
|
657
771
|
gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
658
772
|
lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
659
|
-
max: (value: number, message?: errorUtil.ErrMessage
|
|
773
|
+
max: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
|
660
774
|
lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
661
775
|
protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
|
|
662
776
|
_addCheck(check: ZodNumberCheck): ZodNumber;
|
|
@@ -666,7 +780,7 @@ declare class ZodNumber extends ZodType<number, ZodNumberDef, number> {
|
|
|
666
780
|
nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
667
781
|
nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
668
782
|
multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
669
|
-
step: (value: number, message?: errorUtil.ErrMessage
|
|
783
|
+
step: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
|
670
784
|
finite(message?: errorUtil.ErrMessage): ZodNumber;
|
|
671
785
|
safe(message?: errorUtil.ErrMessage): ZodNumber;
|
|
672
786
|
get minValue(): number | null;
|
|
@@ -674,7 +788,7 @@ declare class ZodNumber extends ZodType<number, ZodNumberDef, number> {
|
|
|
674
788
|
get isInt(): boolean;
|
|
675
789
|
get isFinite(): boolean;
|
|
676
790
|
}
|
|
677
|
-
|
|
791
|
+
type ZodBigIntCheck = {
|
|
678
792
|
kind: "min";
|
|
679
793
|
value: bigint;
|
|
680
794
|
inclusive: boolean;
|
|
@@ -696,20 +810,15 @@ interface ZodBigIntDef extends ZodTypeDef {
|
|
|
696
810
|
}
|
|
697
811
|
declare class ZodBigInt extends ZodType<bigint, ZodBigIntDef, bigint> {
|
|
698
812
|
_parse(input: ParseInput): ParseReturnType<bigint>;
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
message?: string | undefined;
|
|
704
|
-
description?: string | undefined;
|
|
705
|
-
} & {
|
|
706
|
-
coerce?: boolean | undefined;
|
|
707
|
-
}) | undefined) => ZodBigInt;
|
|
813
|
+
_getInvalidInput(input: ParseInput): INVALID;
|
|
814
|
+
static create: (params?: RawCreateParams & {
|
|
815
|
+
coerce?: boolean;
|
|
816
|
+
}) => ZodBigInt;
|
|
708
817
|
gte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
|
709
|
-
min: (value: bigint, message?: errorUtil.ErrMessage
|
|
818
|
+
min: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
|
|
710
819
|
gt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
|
711
820
|
lte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
|
712
|
-
max: (value: bigint, message?: errorUtil.ErrMessage
|
|
821
|
+
max: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
|
|
713
822
|
lt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
|
714
823
|
protected setLimit(kind: "min" | "max", value: bigint, inclusive: boolean, message?: string): ZodBigInt;
|
|
715
824
|
_addCheck(check: ZodBigIntCheck): ZodBigInt;
|
|
@@ -727,17 +836,11 @@ interface ZodBooleanDef extends ZodTypeDef {
|
|
|
727
836
|
}
|
|
728
837
|
declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef, boolean> {
|
|
729
838
|
_parse(input: ParseInput): ParseReturnType<boolean>;
|
|
730
|
-
static create: (params?:
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
required_error?: string | undefined;
|
|
734
|
-
message?: string | undefined;
|
|
735
|
-
description?: string | undefined;
|
|
736
|
-
} & {
|
|
737
|
-
coerce?: boolean | undefined;
|
|
738
|
-
}) | undefined) => ZodBoolean;
|
|
839
|
+
static create: (params?: RawCreateParams & {
|
|
840
|
+
coerce?: boolean;
|
|
841
|
+
}) => ZodBoolean;
|
|
739
842
|
}
|
|
740
|
-
|
|
843
|
+
type ZodDateCheck = {
|
|
741
844
|
kind: "min";
|
|
742
845
|
value: number;
|
|
743
846
|
message?: string;
|
|
@@ -758,15 +861,9 @@ declare class ZodDate extends ZodType<Date, ZodDateDef, Date> {
|
|
|
758
861
|
max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
|
759
862
|
get minDate(): Date | null;
|
|
760
863
|
get maxDate(): Date | null;
|
|
761
|
-
static create: (params?:
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
required_error?: string | undefined;
|
|
765
|
-
message?: string | undefined;
|
|
766
|
-
description?: string | undefined;
|
|
767
|
-
} & {
|
|
768
|
-
coerce?: boolean | undefined;
|
|
769
|
-
}) | undefined) => ZodDate;
|
|
864
|
+
static create: (params?: RawCreateParams & {
|
|
865
|
+
coerce?: boolean;
|
|
866
|
+
}) => ZodDate;
|
|
770
867
|
}
|
|
771
868
|
interface ZodSymbolDef extends ZodTypeDef {
|
|
772
869
|
typeName: ZodFirstPartyTypeKind.ZodSymbol;
|
|
@@ -836,8 +933,8 @@ interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
|
836
933
|
message?: string;
|
|
837
934
|
} | null;
|
|
838
935
|
}
|
|
839
|
-
|
|
840
|
-
|
|
936
|
+
type ArrayCardinality = "many" | "atleastone";
|
|
937
|
+
type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
|
|
841
938
|
declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {
|
|
842
939
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
843
940
|
get element(): T;
|
|
@@ -847,37 +944,37 @@ declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinalit
|
|
|
847
944
|
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
|
|
848
945
|
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodArray<T_1, "many">;
|
|
849
946
|
}
|
|
850
|
-
|
|
851
|
-
|
|
947
|
+
type ZodNonEmptyArray<T extends ZodTypeAny> = ZodArray<T, "atleastone">;
|
|
948
|
+
type UnknownKeysParam = "passthrough" | "strict" | "strip";
|
|
852
949
|
interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
853
950
|
typeName: ZodFirstPartyTypeKind.ZodObject;
|
|
854
951
|
shape: () => T;
|
|
855
952
|
catchall: Catchall;
|
|
856
953
|
unknownKeys: UnknownKeys;
|
|
857
954
|
}
|
|
858
|
-
|
|
955
|
+
type mergeTypes<A, B> = {
|
|
859
956
|
[k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never;
|
|
860
957
|
};
|
|
861
|
-
|
|
862
|
-
|
|
958
|
+
type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
|
|
959
|
+
type baseObjectOutputType<Shape extends ZodRawShape> = {
|
|
863
960
|
[k in keyof Shape]: Shape[k]["_output"];
|
|
864
961
|
};
|
|
865
|
-
|
|
866
|
-
|
|
962
|
+
type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
|
|
963
|
+
type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
|
|
867
964
|
[k in keyof Shape]: Shape[k]["_input"];
|
|
868
965
|
}>;
|
|
869
|
-
|
|
966
|
+
type CatchallOutput<T extends ZodType> = ZodType extends T ? unknown : {
|
|
870
967
|
[k: string]: T["_output"];
|
|
871
968
|
};
|
|
872
|
-
|
|
969
|
+
type CatchallInput<T extends ZodType> = ZodType extends T ? unknown : {
|
|
873
970
|
[k: string]: T["_input"];
|
|
874
971
|
};
|
|
875
|
-
|
|
972
|
+
type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
|
|
876
973
|
[k: string]: unknown;
|
|
877
974
|
} : unknown;
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
975
|
+
type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
|
|
976
|
+
type SomeZodObject = ZodObject<ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
|
977
|
+
type noUnrecognized<Obj extends object, Shape extends object> = {
|
|
881
978
|
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;
|
|
882
979
|
};
|
|
883
980
|
declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall, UnknownKeys>, Input = objectInputType<T, Catchall, UnknownKeys>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
|
|
@@ -900,7 +997,7 @@ declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysPa
|
|
|
900
997
|
/**
|
|
901
998
|
* @deprecated Use `.extend` instead
|
|
902
999
|
* */
|
|
903
|
-
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall
|
|
1000
|
+
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
|
904
1001
|
/**
|
|
905
1002
|
* Prior to zod@1.0.12 there was a bug in the
|
|
906
1003
|
* inferred type of merged objects. Please
|
|
@@ -938,12 +1035,12 @@ declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysPa
|
|
|
938
1035
|
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
|
939
1036
|
}>, UnknownKeys, Catchall>;
|
|
940
1037
|
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
|
941
|
-
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny,
|
|
942
|
-
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny,
|
|
943
|
-
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny,
|
|
1038
|
+
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any> extends infer T_2 ? { [k in keyof T_2]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>[k]; } : never, baseObjectInputType<T_1> extends infer T_3 ? { [k_1 in keyof T_3]: baseObjectInputType<T_1>[k_1]; } : never>;
|
|
1039
|
+
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any> extends infer T_2 ? { [k in keyof T_2]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>[k]; } : never, baseObjectInputType<T_1> extends infer T_3 ? { [k_1 in keyof T_3]: baseObjectInputType<T_1>[k_1]; } : never>;
|
|
1040
|
+
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any> extends infer T_2 ? { [k in keyof T_2]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>[k]; } : never, baseObjectInputType<T_1> extends infer T_3 ? { [k_1 in keyof T_3]: baseObjectInputType<T_1>[k_1]; } : never>;
|
|
944
1041
|
}
|
|
945
|
-
|
|
946
|
-
|
|
1042
|
+
type AnyZodObject = ZodObject<any, any, any>;
|
|
1043
|
+
type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
|
|
947
1044
|
interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[
|
|
948
1045
|
ZodTypeAny,
|
|
949
1046
|
ZodTypeAny,
|
|
@@ -957,16 +1054,16 @@ declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_ou
|
|
|
957
1054
|
get options(): T;
|
|
958
1055
|
static create: <T_1 extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T_1, params?: RawCreateParams) => ZodUnion<T_1>;
|
|
959
1056
|
}
|
|
960
|
-
|
|
1057
|
+
type ZodDiscriminatedUnionOption<Discriminator extends string> = ZodObject<{
|
|
961
1058
|
[key in Discriminator]: ZodTypeAny;
|
|
962
1059
|
} & ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
|
963
|
-
interface ZodDiscriminatedUnionDef<Discriminator extends string, Options extends ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> extends ZodTypeDef {
|
|
1060
|
+
interface ZodDiscriminatedUnionDef<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> extends ZodTypeDef {
|
|
964
1061
|
discriminator: Discriminator;
|
|
965
1062
|
options: Options;
|
|
966
1063
|
optionsMap: Map<Primitive, ZodDiscriminatedUnionOption<any>>;
|
|
967
1064
|
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion;
|
|
968
1065
|
}
|
|
969
|
-
declare class ZodDiscriminatedUnion<Discriminator extends string, Options extends ZodDiscriminatedUnionOption<Discriminator>[]> extends ZodType<output<Options[number]>, ZodDiscriminatedUnionDef<Discriminator, Options>, input<Options[number]>> {
|
|
1066
|
+
declare class ZodDiscriminatedUnion<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<Discriminator>[]> extends ZodType<output<Options[number]>, ZodDiscriminatedUnionDef<Discriminator, Options>, input<Options[number]>> {
|
|
970
1067
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
971
1068
|
get discriminator(): Discriminator;
|
|
972
1069
|
get options(): Options;
|
|
@@ -979,7 +1076,7 @@ declare class ZodDiscriminatedUnion<Discriminator extends string, Options extend
|
|
|
979
1076
|
* @param types an array of object schemas
|
|
980
1077
|
* @param params
|
|
981
1078
|
*/
|
|
982
|
-
static create<Discriminator extends string, Types extends [
|
|
1079
|
+
static create<Discriminator extends string, Types extends readonly [
|
|
983
1080
|
ZodDiscriminatedUnionOption<Discriminator>,
|
|
984
1081
|
...ZodDiscriminatedUnionOption<Discriminator>[]
|
|
985
1082
|
]>(discriminator: Discriminator, options: Types, params?: RawCreateParams): ZodDiscriminatedUnion<Discriminator, Types>;
|
|
@@ -993,22 +1090,22 @@ declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extend
|
|
|
993
1090
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
994
1091
|
static create: <T_1 extends ZodTypeAny, U_1 extends ZodTypeAny>(left: T_1, right: U_1, params?: RawCreateParams) => ZodIntersection<T_1, U_1>;
|
|
995
1092
|
}
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1093
|
+
type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
|
|
1094
|
+
type AssertArray<T> = T extends any[] ? T : never;
|
|
1095
|
+
type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
|
999
1096
|
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_output"] : never;
|
|
1000
1097
|
}>;
|
|
1001
|
-
|
|
1002
|
-
|
|
1098
|
+
type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
|
|
1099
|
+
type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
|
1003
1100
|
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_input"] : never;
|
|
1004
1101
|
}>;
|
|
1005
|
-
|
|
1102
|
+
type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
|
|
1006
1103
|
interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
|
|
1007
1104
|
items: T;
|
|
1008
1105
|
rest: Rest;
|
|
1009
1106
|
typeName: ZodFirstPartyTypeKind.ZodTuple;
|
|
1010
1107
|
}
|
|
1011
|
-
|
|
1108
|
+
type AnyZodTuple = ZodTuple<[
|
|
1012
1109
|
ZodTypeAny,
|
|
1013
1110
|
...ZodTypeAny[]
|
|
1014
1111
|
] | [], ZodTypeAny | null>;
|
|
@@ -1023,8 +1120,8 @@ interface ZodRecordDef<Key extends KeySchema = ZodString, Value extends ZodTypeA
|
|
|
1023
1120
|
keyType: Key;
|
|
1024
1121
|
typeName: ZodFirstPartyTypeKind.ZodRecord;
|
|
1025
1122
|
}
|
|
1026
|
-
|
|
1027
|
-
|
|
1123
|
+
type KeySchema = ZodType<string | number | symbol, any, any>;
|
|
1124
|
+
type RecordType<K extends string | number | symbol, V> = [
|
|
1028
1125
|
string
|
|
1029
1126
|
] extends [K] ? Record<K, V> : [number] extends [K] ? Record<K, V> : [symbol] extends [K] ? Record<K, V> : [BRAND<string | number | symbol>] extends [K] ? Record<K, V> : Partial<Record<K, V>>;
|
|
1030
1127
|
declare class ZodRecord<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodType<RecordType<Key["_output"], Value["_output"]>, ZodRecordDef<Key, Value>, RecordType<Key["_input"], Value["_input"]>> {
|
|
@@ -1071,8 +1168,8 @@ interface ZodFunctionDef<Args extends ZodTuple<any, any> = ZodTuple<any, any>, R
|
|
|
1071
1168
|
returns: Returns;
|
|
1072
1169
|
typeName: ZodFirstPartyTypeKind.ZodFunction;
|
|
1073
1170
|
}
|
|
1074
|
-
|
|
1075
|
-
|
|
1171
|
+
type OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_input"] extends Array<any> ? (...args: Args["_input"]) => Returns["_output"] : never;
|
|
1172
|
+
type InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_output"] extends Array<any> ? (...args: Args["_output"]) => Returns["_input"] : never;
|
|
1076
1173
|
declare class ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> extends ZodType<OuterTypeOfFunction<Args, Returns>, ZodFunctionDef<Args, Returns>, InnerTypeOfFunction<Args, Returns>> {
|
|
1077
1174
|
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1078
1175
|
parameters(): Args;
|
|
@@ -1105,21 +1202,21 @@ declare class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>, T> {
|
|
|
1105
1202
|
get value(): T;
|
|
1106
1203
|
static create: <T_1 extends Primitive>(value: T_1, params?: RawCreateParams) => ZodLiteral<T_1>;
|
|
1107
1204
|
}
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1205
|
+
type ArrayKeys = keyof any[];
|
|
1206
|
+
type Indices<T> = Exclude<keyof T, ArrayKeys>;
|
|
1207
|
+
type EnumValues<T extends string = string> = readonly [T, ...T[]];
|
|
1208
|
+
type Values<T extends EnumValues> = {
|
|
1112
1209
|
[k in T[number]]: k;
|
|
1113
1210
|
};
|
|
1114
1211
|
interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
|
|
1115
1212
|
values: T;
|
|
1116
1213
|
typeName: ZodFirstPartyTypeKind.ZodEnum;
|
|
1117
1214
|
}
|
|
1118
|
-
|
|
1215
|
+
type Writeable<T> = {
|
|
1119
1216
|
-readonly [P in keyof T]: T[P];
|
|
1120
1217
|
};
|
|
1121
|
-
|
|
1122
|
-
|
|
1218
|
+
type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
|
|
1219
|
+
type typecast<A, T> = A extends T ? A : never;
|
|
1123
1220
|
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
|
|
1124
1221
|
declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
|
|
1125
1222
|
declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>, T[number]> {
|
|
@@ -1137,7 +1234,7 @@ interface ZodNativeEnumDef<T extends EnumLike = EnumLike> extends ZodTypeDef {
|
|
|
1137
1234
|
values: T;
|
|
1138
1235
|
typeName: ZodFirstPartyTypeKind.ZodNativeEnum;
|
|
1139
1236
|
}
|
|
1140
|
-
|
|
1237
|
+
type EnumLike = {
|
|
1141
1238
|
[k: string]: string | number;
|
|
1142
1239
|
[nu: number]: string;
|
|
1143
1240
|
};
|
|
@@ -1156,21 +1253,21 @@ declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_outpu
|
|
|
1156
1253
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1157
1254
|
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodPromise<T_1>;
|
|
1158
1255
|
}
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1256
|
+
type Refinement<T> = (arg: T, ctx: RefinementCtx) => any;
|
|
1257
|
+
type SuperRefinement<T> = (arg: T, ctx: RefinementCtx) => void | Promise<void>;
|
|
1258
|
+
type RefinementEffect<T> = {
|
|
1162
1259
|
type: "refinement";
|
|
1163
1260
|
refinement: (arg: T, ctx: RefinementCtx) => any;
|
|
1164
1261
|
};
|
|
1165
|
-
|
|
1262
|
+
type TransformEffect<T> = {
|
|
1166
1263
|
type: "transform";
|
|
1167
1264
|
transform: (arg: T, ctx: RefinementCtx) => any;
|
|
1168
1265
|
};
|
|
1169
|
-
|
|
1266
|
+
type PreprocessEffect<T> = {
|
|
1170
1267
|
type: "preprocess";
|
|
1171
1268
|
transform: (arg: T, ctx: RefinementCtx) => any;
|
|
1172
1269
|
};
|
|
1173
|
-
|
|
1270
|
+
type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
|
|
1174
1271
|
interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1175
1272
|
schema: T;
|
|
1176
1273
|
typeName: ZodFirstPartyTypeKind.ZodEffects;
|
|
@@ -1180,7 +1277,7 @@ declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input
|
|
|
1180
1277
|
innerType(): T;
|
|
1181
1278
|
sourceType(): T;
|
|
1182
1279
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1183
|
-
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]
|
|
1280
|
+
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
|
1184
1281
|
static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
|
1185
1282
|
}
|
|
1186
1283
|
|
|
@@ -1188,7 +1285,7 @@ interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
|
1188
1285
|
innerType: T;
|
|
1189
1286
|
typeName: ZodFirstPartyTypeKind.ZodOptional;
|
|
1190
1287
|
}
|
|
1191
|
-
|
|
1288
|
+
type ZodOptionalType<T extends ZodTypeAny> = ZodOptional<T>;
|
|
1192
1289
|
declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
|
|
1193
1290
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1194
1291
|
unwrap(): T;
|
|
@@ -1198,7 +1295,7 @@ interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
|
1198
1295
|
innerType: T;
|
|
1199
1296
|
typeName: ZodFirstPartyTypeKind.ZodNullable;
|
|
1200
1297
|
}
|
|
1201
|
-
|
|
1298
|
+
type ZodNullableType<T extends ZodTypeAny> = ZodNullable<T>;
|
|
1202
1299
|
declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
|
|
1203
1300
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1204
1301
|
unwrap(): T;
|
|
@@ -1255,7 +1352,7 @@ interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
|
|
|
1255
1352
|
typeName: ZodFirstPartyTypeKind.ZodBranded;
|
|
1256
1353
|
}
|
|
1257
1354
|
declare const BRAND: unique symbol;
|
|
1258
|
-
|
|
1355
|
+
type BRAND<T extends string | number | symbol> = {
|
|
1259
1356
|
[BRAND]: {
|
|
1260
1357
|
[k in T]: true;
|
|
1261
1358
|
};
|
|
@@ -1273,10 +1370,10 @@ declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends Zo
|
|
|
1273
1370
|
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1274
1371
|
static create<A extends ZodTypeAny, B extends ZodTypeAny>(a: A, b: B): ZodPipeline<A, B>;
|
|
1275
1372
|
}
|
|
1276
|
-
|
|
1373
|
+
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
|
1277
1374
|
readonly [Symbol.toStringTag]: string;
|
|
1278
1375
|
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
|
1279
|
-
|
|
1376
|
+
type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
|
|
1280
1377
|
interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1281
1378
|
innerType: T;
|
|
1282
1379
|
typeName: ZodFirstPartyTypeKind.ZodReadonly;
|
|
@@ -1286,7 +1383,7 @@ declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["
|
|
|
1286
1383
|
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodReadonly<T_1>;
|
|
1287
1384
|
unwrap(): T;
|
|
1288
1385
|
}
|
|
1289
|
-
|
|
1386
|
+
type CustomParams = CustomErrorParams & {
|
|
1290
1387
|
fatal?: boolean;
|
|
1291
1388
|
};
|
|
1292
1389
|
declare function custom<T>(check?: (data: any) => any, params?: string | CustomParams | ((input: any) => CustomParams),
|
|
@@ -1303,7 +1400,7 @@ declare function custom<T>(check?: (data: any) => any, params?: string | CustomP
|
|
|
1303
1400
|
fatal?: boolean): ZodType<T, ZodTypeDef, T>;
|
|
1304
1401
|
|
|
1305
1402
|
declare const late: {
|
|
1306
|
-
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip"
|
|
1403
|
+
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip">;
|
|
1307
1404
|
};
|
|
1308
1405
|
declare enum ZodFirstPartyTypeKind {
|
|
1309
1406
|
ZodString = "ZodString",
|
|
@@ -1343,57 +1440,27 @@ declare enum ZodFirstPartyTypeKind {
|
|
|
1343
1440
|
ZodPipeline = "ZodPipeline",
|
|
1344
1441
|
ZodReadonly = "ZodReadonly"
|
|
1345
1442
|
}
|
|
1346
|
-
|
|
1443
|
+
type ZodFirstPartySchemaTypes = ZodString | ZodNumber | ZodNaN | ZodBigInt | ZodBoolean | ZodDate | ZodUndefined | ZodNull | ZodAny | ZodUnknown | ZodNever | ZodVoid | ZodArray<any, any> | ZodObject<any, any, any> | ZodUnion<any> | ZodDiscriminatedUnion<any, any> | ZodIntersection<any, any> | ZodTuple<any, any> | ZodRecord<any, any> | ZodMap<any> | ZodSet<any> | ZodFunction<any, any> | ZodLazy<any> | ZodLiteral<any> | ZodEnum<any> | ZodEffects<any, any, any> | ZodNativeEnum<any> | ZodOptional<any> | ZodNullable<any> | ZodDefault<any> | ZodCatch<any> | ZodPromise<any> | ZodBranded<any, any> | ZodPipeline<any, any> | ZodReadonly<any> | ZodSymbol;
|
|
1347
1444
|
declare abstract class Class {
|
|
1348
1445
|
constructor(..._: any[]);
|
|
1349
1446
|
}
|
|
1350
1447
|
declare const instanceOfType: <T extends typeof Class>(cls: T, params?: CustomParams) => ZodType<InstanceType<T>, ZodTypeDef, InstanceType<T>>;
|
|
1351
|
-
declare const stringType: (params?:
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
} & {
|
|
1358
|
-
coerce?: true | undefined;
|
|
1359
|
-
}) | undefined) => ZodString;
|
|
1360
|
-
declare const numberType: (params?: ({
|
|
1361
|
-
errorMap?: ZodErrorMap | undefined;
|
|
1362
|
-
invalid_type_error?: string | undefined;
|
|
1363
|
-
required_error?: string | undefined;
|
|
1364
|
-
message?: string | undefined;
|
|
1365
|
-
description?: string | undefined;
|
|
1366
|
-
} & {
|
|
1367
|
-
coerce?: boolean | undefined;
|
|
1368
|
-
}) | undefined) => ZodNumber;
|
|
1448
|
+
declare const stringType: (params?: RawCreateParams & {
|
|
1449
|
+
coerce?: true;
|
|
1450
|
+
}) => ZodString;
|
|
1451
|
+
declare const numberType: (params?: RawCreateParams & {
|
|
1452
|
+
coerce?: boolean;
|
|
1453
|
+
}) => ZodNumber;
|
|
1369
1454
|
declare const nanType: (params?: RawCreateParams) => ZodNaN;
|
|
1370
|
-
declare const bigIntType: (params?:
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
coerce?: boolean
|
|
1378
|
-
})
|
|
1379
|
-
declare const booleanType: (params?: ({
|
|
1380
|
-
errorMap?: ZodErrorMap | undefined;
|
|
1381
|
-
invalid_type_error?: string | undefined;
|
|
1382
|
-
required_error?: string | undefined;
|
|
1383
|
-
message?: string | undefined;
|
|
1384
|
-
description?: string | undefined;
|
|
1385
|
-
} & {
|
|
1386
|
-
coerce?: boolean | undefined;
|
|
1387
|
-
}) | undefined) => ZodBoolean;
|
|
1388
|
-
declare const dateType: (params?: ({
|
|
1389
|
-
errorMap?: ZodErrorMap | undefined;
|
|
1390
|
-
invalid_type_error?: string | undefined;
|
|
1391
|
-
required_error?: string | undefined;
|
|
1392
|
-
message?: string | undefined;
|
|
1393
|
-
description?: string | undefined;
|
|
1394
|
-
} & {
|
|
1395
|
-
coerce?: boolean | undefined;
|
|
1396
|
-
}) | undefined) => ZodDate;
|
|
1455
|
+
declare const bigIntType: (params?: RawCreateParams & {
|
|
1456
|
+
coerce?: boolean;
|
|
1457
|
+
}) => ZodBigInt;
|
|
1458
|
+
declare const booleanType: (params?: RawCreateParams & {
|
|
1459
|
+
coerce?: boolean;
|
|
1460
|
+
}) => ZodBoolean;
|
|
1461
|
+
declare const dateType: (params?: RawCreateParams & {
|
|
1462
|
+
coerce?: boolean;
|
|
1463
|
+
}) => ZodDate;
|
|
1397
1464
|
declare const symbolType: (params?: RawCreateParams) => ZodSymbol;
|
|
1398
1465
|
declare const undefinedType: (params?: RawCreateParams) => ZodUndefined;
|
|
1399
1466
|
declare const nullType: (params?: RawCreateParams) => ZodNull;
|
|
@@ -1401,9 +1468,9 @@ declare const anyType: (params?: RawCreateParams) => ZodAny;
|
|
|
1401
1468
|
declare const unknownType: (params?: RawCreateParams) => ZodUnknown;
|
|
1402
1469
|
declare const neverType: (params?: RawCreateParams) => ZodNever;
|
|
1403
1470
|
declare const voidType: (params?: RawCreateParams) => ZodVoid;
|
|
1404
|
-
declare const arrayType: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodArray<T
|
|
1405
|
-
declare const objectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny,
|
|
1406
|
-
declare const strictObjectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict"
|
|
1471
|
+
declare const arrayType: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodArray<T>;
|
|
1472
|
+
declare const objectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strip", ZodTypeAny, objectOutputType<T, ZodTypeAny, "strip">, objectInputType<T, ZodTypeAny, "strip">>;
|
|
1473
|
+
declare const strictObjectType: <T extends ZodRawShape>(shape: T, params?: RawCreateParams) => ZodObject<T, "strict">;
|
|
1407
1474
|
declare const unionType: <T extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T, params?: RawCreateParams) => ZodUnion<T>;
|
|
1408
1475
|
declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create;
|
|
1409
1476
|
declare const intersectionType: <T extends ZodTypeAny, U extends ZodTypeAny>(left: T, right: U, params?: RawCreateParams) => ZodIntersection<T, U>;
|
|
@@ -1417,7 +1484,7 @@ declare const literalType: <T extends Primitive>(value: T, params?: RawCreatePar
|
|
|
1417
1484
|
declare const enumType: typeof createZodEnum;
|
|
1418
1485
|
declare const nativeEnumType: <T extends EnumLike>(values: T, params?: RawCreateParams) => ZodNativeEnum<T>;
|
|
1419
1486
|
declare const promiseType: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodPromise<T>;
|
|
1420
|
-
declare const effectsType: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]
|
|
1487
|
+
declare const effectsType: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
|
1421
1488
|
declare const optionalType: <T extends ZodTypeAny>(type: T, params?: RawCreateParams) => ZodOptional<T>;
|
|
1422
1489
|
declare const nullableType: <T extends ZodTypeAny>(type: T, params?: RawCreateParams) => ZodNullable<T>;
|
|
1423
1490
|
declare const preprocessType: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
|
@@ -1426,51 +1493,21 @@ declare const ostring: () => ZodOptional<ZodString>;
|
|
|
1426
1493
|
declare const onumber: () => ZodOptional<ZodNumber>;
|
|
1427
1494
|
declare const oboolean: () => ZodOptional<ZodBoolean>;
|
|
1428
1495
|
declare const coerce: {
|
|
1429
|
-
string: (params?:
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
coerce?:
|
|
1437
|
-
})
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
} & {
|
|
1445
|
-
coerce?: boolean | undefined;
|
|
1446
|
-
}) | undefined) => ZodNumber;
|
|
1447
|
-
boolean: (params?: ({
|
|
1448
|
-
errorMap?: ZodErrorMap | undefined;
|
|
1449
|
-
invalid_type_error?: string | undefined;
|
|
1450
|
-
required_error?: string | undefined;
|
|
1451
|
-
message?: string | undefined;
|
|
1452
|
-
description?: string | undefined;
|
|
1453
|
-
} & {
|
|
1454
|
-
coerce?: boolean | undefined;
|
|
1455
|
-
}) | undefined) => ZodBoolean;
|
|
1456
|
-
bigint: (params?: ({
|
|
1457
|
-
errorMap?: ZodErrorMap | undefined;
|
|
1458
|
-
invalid_type_error?: string | undefined;
|
|
1459
|
-
required_error?: string | undefined;
|
|
1460
|
-
message?: string | undefined;
|
|
1461
|
-
description?: string | undefined;
|
|
1462
|
-
} & {
|
|
1463
|
-
coerce?: boolean | undefined;
|
|
1464
|
-
}) | undefined) => ZodBigInt;
|
|
1465
|
-
date: (params?: ({
|
|
1466
|
-
errorMap?: ZodErrorMap | undefined;
|
|
1467
|
-
invalid_type_error?: string | undefined;
|
|
1468
|
-
required_error?: string | undefined;
|
|
1469
|
-
message?: string | undefined;
|
|
1470
|
-
description?: string | undefined;
|
|
1471
|
-
} & {
|
|
1472
|
-
coerce?: boolean | undefined;
|
|
1473
|
-
}) | undefined) => ZodDate;
|
|
1496
|
+
string: (params?: RawCreateParams & {
|
|
1497
|
+
coerce?: true;
|
|
1498
|
+
}) => ZodString;
|
|
1499
|
+
number: (params?: RawCreateParams & {
|
|
1500
|
+
coerce?: boolean;
|
|
1501
|
+
}) => ZodNumber;
|
|
1502
|
+
boolean: (params?: RawCreateParams & {
|
|
1503
|
+
coerce?: boolean;
|
|
1504
|
+
}) => ZodBoolean;
|
|
1505
|
+
bigint: (params?: RawCreateParams & {
|
|
1506
|
+
coerce?: boolean;
|
|
1507
|
+
}) => ZodBigInt;
|
|
1508
|
+
date: (params?: RawCreateParams & {
|
|
1509
|
+
coerce?: boolean;
|
|
1510
|
+
}) => ZodDate;
|
|
1474
1511
|
};
|
|
1475
1512
|
|
|
1476
1513
|
declare const NEVER: never;
|
|
@@ -1565,9 +1602,9 @@ type z_ZodDateDef = ZodDateDef;
|
|
|
1565
1602
|
type z_ZodDefault<T extends ZodTypeAny> = ZodDefault<T>;
|
|
1566
1603
|
declare const z_ZodDefault: typeof ZodDefault;
|
|
1567
1604
|
type z_ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> = ZodDefaultDef<T>;
|
|
1568
|
-
type z_ZodDiscriminatedUnion<Discriminator extends string, Options extends ZodDiscriminatedUnionOption<Discriminator>[]> = ZodDiscriminatedUnion<Discriminator, Options>;
|
|
1605
|
+
type z_ZodDiscriminatedUnion<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<Discriminator>[]> = ZodDiscriminatedUnion<Discriminator, Options>;
|
|
1569
1606
|
declare const z_ZodDiscriminatedUnion: typeof ZodDiscriminatedUnion;
|
|
1570
|
-
type z_ZodDiscriminatedUnionDef<Discriminator extends string, Options extends ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> = ZodDiscriminatedUnionDef<Discriminator, Options>;
|
|
1607
|
+
type z_ZodDiscriminatedUnionDef<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> = ZodDiscriminatedUnionDef<Discriminator, Options>;
|
|
1571
1608
|
type z_ZodDiscriminatedUnionOption<Discriminator extends string> = ZodDiscriminatedUnionOption<Discriminator>;
|
|
1572
1609
|
type z_ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> = ZodEffects<T, Output, Input>;
|
|
1573
1610
|
declare const z_ZodEffects: typeof ZodEffects;
|