@rspack/core 1.3.7 → 1.3.9
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/browserslist/index.js +77 -57
- package/compiled/browserslist/package.json +1 -1
- package/compiled/graceful-fs/index.js +8 -8
- package/compiled/zod/index.d.ts +2 -1772
- package/compiled/zod/index.js +35 -35
- package/compiled/zod/lib/ZodError.d.ts +164 -0
- package/compiled/zod/lib/__tests__/Mocker.d.ts +17 -0
- package/compiled/zod/lib/benchmarks/datetime.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/discriminatedUnion.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/index.d.ts +1 -0
- package/compiled/zod/lib/benchmarks/ipv4.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/object.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/primitives.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/realworld.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/string.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/union.d.ts +5 -0
- package/compiled/zod/lib/errors.d.ts +5 -0
- package/compiled/zod/lib/external.d.ts +6 -0
- package/compiled/zod/lib/helpers/enumUtil.d.ts +8 -0
- package/compiled/zod/lib/helpers/errorUtil.d.ts +9 -0
- package/compiled/zod/lib/helpers/parseUtil.d.ts +78 -0
- package/compiled/zod/lib/helpers/partialUtil.d.ts +8 -0
- package/compiled/zod/lib/helpers/typeAliases.d.ts +2 -0
- package/compiled/zod/lib/helpers/util.d.ts +82 -0
- package/compiled/zod/lib/index.d.ts +4 -0
- package/compiled/zod/lib/locales/en.d.ts +3 -0
- package/compiled/zod/lib/standard-schema.d.ts +102 -0
- package/compiled/zod/lib/types.d.ts +1062 -0
- package/compiled/zod/package.json +1 -1
- package/dist/ChunkGroup.d.ts +10 -0
- package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
- package/dist/builtin-loader/swc/types.d.ts +632 -631
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +3 -1
- package/dist/builtin-plugin/html-plugin/options.d.ts +7 -3
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +0 -1
- package/dist/config/types.d.ts +11 -3
- package/dist/config/utils.d.ts +1 -1
- package/dist/config/zod.d.ts +77 -77
- package/dist/exports.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +644 -597
- package/dist/setupEnv.d.ts +1 -0
- package/dist/stats/statsFactoryUtils.d.ts +1 -0
- package/dist/swc.d.ts +5 -0
- package/package.json +11 -11
package/compiled/zod/index.d.ts
CHANGED
@@ -1,1772 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
declare namespace util {
|
5
|
-
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
|
6
|
-
export type isAny<T> = 0 extends 1 & T ? true : false;
|
7
|
-
export const assertEqual: <A, B>(val: AssertEqual<A, B>) => AssertEqual<A, B>;
|
8
|
-
export function assertIs<T>(_arg: T): void;
|
9
|
-
export function assertNever(_x: never): never;
|
10
|
-
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
11
|
-
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
|
12
|
-
export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
13
|
-
export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
|
14
|
-
export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
|
15
|
-
export const getValidEnumValues: (obj: any) => any[];
|
16
|
-
export const objectValues: (obj: any) => any[];
|
17
|
-
export const objectKeys: ObjectConstructor["keys"];
|
18
|
-
export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
|
19
|
-
export type identity<T> = objectUtil.identity<T>;
|
20
|
-
export type flatten<T> = objectUtil.flatten<T>;
|
21
|
-
export type noUndefined<T> = T extends undefined ? never : T;
|
22
|
-
export const isInteger: NumberConstructor["isInteger"];
|
23
|
-
export function joinValues<T extends any[]>(array: T, separator?: string): string;
|
24
|
-
export const jsonStringifyReplacer: (_: string, value: any) => any;
|
25
|
-
export {};
|
26
|
-
}
|
27
|
-
declare namespace objectUtil {
|
28
|
-
export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : {
|
29
|
-
[k in Exclude<keyof U, keyof V>]: U[k];
|
30
|
-
} & V;
|
31
|
-
type optionalKeys<T extends object> = {
|
32
|
-
[k in keyof T]: undefined extends T[k] ? k : never;
|
33
|
-
}[keyof T];
|
34
|
-
type requiredKeys<T extends object> = {
|
35
|
-
[k in keyof T]: undefined extends T[k] ? never : k;
|
36
|
-
}[keyof T];
|
37
|
-
export type addQuestionMarks<T extends object, _O = any> = {
|
38
|
-
[K in requiredKeys<T>]: T[K];
|
39
|
-
} & {
|
40
|
-
[K in optionalKeys<T>]?: T[K];
|
41
|
-
} & {
|
42
|
-
[k in keyof T]?: unknown;
|
43
|
-
};
|
44
|
-
export type identity<T> = T;
|
45
|
-
export type flatten<T> = identity<{
|
46
|
-
[k in keyof T]: T[k];
|
47
|
-
}>;
|
48
|
-
export type noNeverKeys<T> = {
|
49
|
-
[k in keyof T]: [T[k]] extends [never] ? never : k;
|
50
|
-
}[keyof T];
|
51
|
-
export type noNever<T> = identity<{
|
52
|
-
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
53
|
-
}>;
|
54
|
-
export const mergeShapes: <U, T>(first: U, second: T) => T & U;
|
55
|
-
export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : {
|
56
|
-
[K in keyof A as K extends keyof B ? never : K]: A[K];
|
57
|
-
} & {
|
58
|
-
[K in keyof B]: B[K];
|
59
|
-
};
|
60
|
-
export {};
|
61
|
-
}
|
62
|
-
declare const ZodParsedType: {
|
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";
|
72
|
-
nan: "nan";
|
73
|
-
integer: "integer";
|
74
|
-
float: "float";
|
75
|
-
date: "date";
|
76
|
-
null: "null";
|
77
|
-
array: "array";
|
78
|
-
unknown: "unknown";
|
79
|
-
promise: "promise";
|
80
|
-
void: "void";
|
81
|
-
never: "never";
|
82
|
-
set: "set";
|
83
|
-
};
|
84
|
-
type ZodParsedType = keyof typeof ZodParsedType;
|
85
|
-
declare const getParsedType: (data: any) => ZodParsedType;
|
86
|
-
|
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
|
-
formErrors: U[];
|
91
|
-
fieldErrors: {
|
92
|
-
[P in allKeys<T>]?: U[];
|
93
|
-
};
|
94
|
-
};
|
95
|
-
declare const ZodIssueCode: {
|
96
|
-
invalid_type: "invalid_type";
|
97
|
-
invalid_literal: "invalid_literal";
|
98
|
-
custom: "custom";
|
99
|
-
invalid_union: "invalid_union";
|
100
|
-
invalid_union_discriminator: "invalid_union_discriminator";
|
101
|
-
invalid_enum_value: "invalid_enum_value";
|
102
|
-
unrecognized_keys: "unrecognized_keys";
|
103
|
-
invalid_arguments: "invalid_arguments";
|
104
|
-
invalid_return_type: "invalid_return_type";
|
105
|
-
invalid_date: "invalid_date";
|
106
|
-
invalid_string: "invalid_string";
|
107
|
-
too_small: "too_small";
|
108
|
-
too_big: "too_big";
|
109
|
-
invalid_intersection_types: "invalid_intersection_types";
|
110
|
-
not_multiple_of: "not_multiple_of";
|
111
|
-
not_finite: "not_finite";
|
112
|
-
};
|
113
|
-
type ZodIssueCode = keyof typeof ZodIssueCode;
|
114
|
-
type ZodIssueBase = {
|
115
|
-
path: (string | number)[];
|
116
|
-
message?: string;
|
117
|
-
};
|
118
|
-
interface ZodInvalidTypeIssue extends ZodIssueBase {
|
119
|
-
code: typeof ZodIssueCode.invalid_type;
|
120
|
-
expected: ZodParsedType;
|
121
|
-
received: ZodParsedType;
|
122
|
-
}
|
123
|
-
interface ZodInvalidLiteralIssue extends ZodIssueBase {
|
124
|
-
code: typeof ZodIssueCode.invalid_literal;
|
125
|
-
expected: unknown;
|
126
|
-
received: unknown;
|
127
|
-
}
|
128
|
-
interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
|
129
|
-
code: typeof ZodIssueCode.unrecognized_keys;
|
130
|
-
keys: string[];
|
131
|
-
}
|
132
|
-
interface ZodInvalidUnionIssue extends ZodIssueBase {
|
133
|
-
code: typeof ZodIssueCode.invalid_union;
|
134
|
-
unionErrors: ZodError[];
|
135
|
-
}
|
136
|
-
interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
|
137
|
-
code: typeof ZodIssueCode.invalid_union_discriminator;
|
138
|
-
options: Primitive[];
|
139
|
-
}
|
140
|
-
interface ZodInvalidEnumValueIssue extends ZodIssueBase {
|
141
|
-
received: string | number;
|
142
|
-
code: typeof ZodIssueCode.invalid_enum_value;
|
143
|
-
options: (string | number)[];
|
144
|
-
}
|
145
|
-
interface ZodInvalidArgumentsIssue extends ZodIssueBase {
|
146
|
-
code: typeof ZodIssueCode.invalid_arguments;
|
147
|
-
argumentsError: ZodError;
|
148
|
-
}
|
149
|
-
interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
|
150
|
-
code: typeof ZodIssueCode.invalid_return_type;
|
151
|
-
returnTypeError: ZodError;
|
152
|
-
}
|
153
|
-
interface ZodInvalidDateIssue extends ZodIssueBase {
|
154
|
-
code: typeof ZodIssueCode.invalid_date;
|
155
|
-
}
|
156
|
-
type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | {
|
157
|
-
includes: string;
|
158
|
-
position?: number;
|
159
|
-
} | {
|
160
|
-
startsWith: string;
|
161
|
-
} | {
|
162
|
-
endsWith: string;
|
163
|
-
};
|
164
|
-
interface ZodInvalidStringIssue extends ZodIssueBase {
|
165
|
-
code: typeof ZodIssueCode.invalid_string;
|
166
|
-
validation: StringValidation;
|
167
|
-
}
|
168
|
-
interface ZodTooSmallIssue extends ZodIssueBase {
|
169
|
-
code: typeof ZodIssueCode.too_small;
|
170
|
-
minimum: number | bigint;
|
171
|
-
inclusive: boolean;
|
172
|
-
exact?: boolean;
|
173
|
-
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
174
|
-
}
|
175
|
-
interface ZodTooBigIssue extends ZodIssueBase {
|
176
|
-
code: typeof ZodIssueCode.too_big;
|
177
|
-
maximum: number | bigint;
|
178
|
-
inclusive: boolean;
|
179
|
-
exact?: boolean;
|
180
|
-
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
181
|
-
}
|
182
|
-
interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
|
183
|
-
code: typeof ZodIssueCode.invalid_intersection_types;
|
184
|
-
}
|
185
|
-
interface ZodNotMultipleOfIssue extends ZodIssueBase {
|
186
|
-
code: typeof ZodIssueCode.not_multiple_of;
|
187
|
-
multipleOf: number | bigint;
|
188
|
-
}
|
189
|
-
interface ZodNotFiniteIssue extends ZodIssueBase {
|
190
|
-
code: typeof ZodIssueCode.not_finite;
|
191
|
-
}
|
192
|
-
interface ZodCustomIssue extends ZodIssueBase {
|
193
|
-
code: typeof ZodIssueCode.custom;
|
194
|
-
params?: {
|
195
|
-
[k: string]: any;
|
196
|
-
};
|
197
|
-
}
|
198
|
-
type DenormalizedError = {
|
199
|
-
[k: string]: DenormalizedError | string[];
|
200
|
-
};
|
201
|
-
type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
|
202
|
-
type ZodIssue = ZodIssueOptionalMessage & {
|
203
|
-
fatal?: boolean;
|
204
|
-
message: string;
|
205
|
-
};
|
206
|
-
declare const quotelessJson: (obj: any) => string;
|
207
|
-
type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
|
208
|
-
[K in keyof T]?: ZodFormattedError<T[K]>;
|
209
|
-
} : T extends any[] ? {
|
210
|
-
[k: number]: ZodFormattedError<T[number]>;
|
211
|
-
} : T extends object ? {
|
212
|
-
[K in keyof T]?: ZodFormattedError<T[K]>;
|
213
|
-
} : unknown;
|
214
|
-
type ZodFormattedError<T, U = string> = {
|
215
|
-
_errors: U[];
|
216
|
-
} & recursiveZodFormattedError<NonNullable<T>>;
|
217
|
-
type inferFormattedError<T extends ZodType<any, any, any>, U = string> = ZodFormattedError<TypeOf<T>, U>;
|
218
|
-
declare class ZodError<T = any> extends Error {
|
219
|
-
issues: ZodIssue[];
|
220
|
-
get errors(): ZodIssue[];
|
221
|
-
constructor(issues: ZodIssue[]);
|
222
|
-
format(): ZodFormattedError<T>;
|
223
|
-
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
|
224
|
-
static create: (issues: ZodIssue[]) => ZodError<any>;
|
225
|
-
static assert(value: unknown): asserts value is ZodError;
|
226
|
-
toString(): string;
|
227
|
-
get message(): string;
|
228
|
-
get isEmpty(): boolean;
|
229
|
-
addIssue: (sub: ZodIssue) => void;
|
230
|
-
addIssues: (subs?: ZodIssue[]) => void;
|
231
|
-
flatten(): typeToFlattenedError<T>;
|
232
|
-
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
|
233
|
-
get formErrors(): typeToFlattenedError<T, string>;
|
234
|
-
}
|
235
|
-
type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
|
236
|
-
type IssueData = stripPath<ZodIssueOptionalMessage> & {
|
237
|
-
path?: (string | number)[];
|
238
|
-
fatal?: boolean;
|
239
|
-
};
|
240
|
-
type ErrorMapCtx = {
|
241
|
-
defaultError: string;
|
242
|
-
data: any;
|
243
|
-
};
|
244
|
-
type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
|
245
|
-
message: string;
|
246
|
-
};
|
247
|
-
|
248
|
-
declare const errorMap: ZodErrorMap;
|
249
|
-
|
250
|
-
declare function setErrorMap(map: ZodErrorMap): void;
|
251
|
-
declare function getErrorMap(): ZodErrorMap;
|
252
|
-
|
253
|
-
declare const makeIssue: (params: {
|
254
|
-
data: any;
|
255
|
-
path: (string | number)[];
|
256
|
-
errorMaps: ZodErrorMap[];
|
257
|
-
issueData: IssueData;
|
258
|
-
}) => ZodIssue;
|
259
|
-
type ParseParams = {
|
260
|
-
path: (string | number)[];
|
261
|
-
errorMap: ZodErrorMap;
|
262
|
-
async: boolean;
|
263
|
-
};
|
264
|
-
type ParsePathComponent = string | number;
|
265
|
-
type ParsePath = ParsePathComponent[];
|
266
|
-
declare const EMPTY_PATH: ParsePath;
|
267
|
-
interface ParseContext {
|
268
|
-
readonly common: {
|
269
|
-
readonly issues: ZodIssue[];
|
270
|
-
readonly contextualErrorMap?: ZodErrorMap;
|
271
|
-
readonly async: boolean;
|
272
|
-
};
|
273
|
-
readonly path: ParsePath;
|
274
|
-
readonly schemaErrorMap?: ZodErrorMap;
|
275
|
-
readonly parent: ParseContext | null;
|
276
|
-
readonly data: any;
|
277
|
-
readonly parsedType: ZodParsedType;
|
278
|
-
}
|
279
|
-
type ParseInput = {
|
280
|
-
data: any;
|
281
|
-
path: (string | number)[];
|
282
|
-
parent: ParseContext;
|
283
|
-
};
|
284
|
-
declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void;
|
285
|
-
type ObjectPair = {
|
286
|
-
key: SyncParseReturnType<any>;
|
287
|
-
value: SyncParseReturnType<any>;
|
288
|
-
};
|
289
|
-
declare class ParseStatus {
|
290
|
-
value: "aborted" | "dirty" | "valid";
|
291
|
-
dirty(): void;
|
292
|
-
abort(): void;
|
293
|
-
static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
|
294
|
-
static mergeObjectAsync(status: ParseStatus, pairs: {
|
295
|
-
key: ParseReturnType<any>;
|
296
|
-
value: ParseReturnType<any>;
|
297
|
-
}[]): Promise<SyncParseReturnType<any>>;
|
298
|
-
static mergeObjectSync(status: ParseStatus, pairs: {
|
299
|
-
key: SyncParseReturnType<any>;
|
300
|
-
value: SyncParseReturnType<any>;
|
301
|
-
alwaysSet?: boolean;
|
302
|
-
}[]): SyncParseReturnType;
|
303
|
-
}
|
304
|
-
interface ParseResult {
|
305
|
-
status: "aborted" | "dirty" | "valid";
|
306
|
-
data: any;
|
307
|
-
}
|
308
|
-
type INVALID = {
|
309
|
-
status: "aborted";
|
310
|
-
};
|
311
|
-
declare const INVALID: INVALID;
|
312
|
-
type DIRTY<T> = {
|
313
|
-
status: "dirty";
|
314
|
-
value: T;
|
315
|
-
};
|
316
|
-
declare const DIRTY: <T>(value: T) => DIRTY<T>;
|
317
|
-
type OK<T> = {
|
318
|
-
status: "valid";
|
319
|
-
value: T;
|
320
|
-
};
|
321
|
-
declare const OK: <T>(value: T) => OK<T>;
|
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
|
-
declare const isAborted: (x: ParseReturnType<any>) => x is INVALID;
|
326
|
-
declare const isDirty: <T>(x: ParseReturnType<T>) => x is OK<T> | DIRTY<T>;
|
327
|
-
declare const isValid: <T>(x: ParseReturnType<T>) => x is OK<T>;
|
328
|
-
declare const isAsync: <T>(x: ParseReturnType<T>) => x is AsyncParseReturnType<T>;
|
329
|
-
|
330
|
-
declare namespace enumUtil {
|
331
|
-
type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
332
|
-
type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
|
333
|
-
type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
|
334
|
-
type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
|
335
|
-
export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
|
336
|
-
export {};
|
337
|
-
}
|
338
|
-
|
339
|
-
declare namespace errorUtil {
|
340
|
-
type ErrMessage = string | {
|
341
|
-
message?: string;
|
342
|
-
};
|
343
|
-
const errToObj: (message?: ErrMessage) => {
|
344
|
-
message?: string | undefined;
|
345
|
-
};
|
346
|
-
const toString: (message?: ErrMessage) => string | undefined;
|
347
|
-
}
|
348
|
-
|
349
|
-
declare namespace partialUtil {
|
350
|
-
type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
|
351
|
-
[k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
|
352
|
-
}, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
|
353
|
-
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
|
354
|
-
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
|
355
|
-
}
|
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
|
-
|
460
|
-
interface RefinementCtx {
|
461
|
-
addIssue: (arg: IssueData) => void;
|
462
|
-
path: (string | number)[];
|
463
|
-
}
|
464
|
-
type ZodRawShape = {
|
465
|
-
[k: string]: ZodTypeAny;
|
466
|
-
};
|
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"];
|
471
|
-
|
472
|
-
type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
|
473
|
-
interface ZodTypeDef {
|
474
|
-
errorMap?: ZodErrorMap;
|
475
|
-
description?: string;
|
476
|
-
}
|
477
|
-
type RawCreateParams = {
|
478
|
-
errorMap?: ZodErrorMap;
|
479
|
-
invalid_type_error?: string;
|
480
|
-
required_error?: string;
|
481
|
-
message?: string;
|
482
|
-
description?: string;
|
483
|
-
} | undefined;
|
484
|
-
type ProcessedCreateParams = {
|
485
|
-
errorMap?: ZodErrorMap;
|
486
|
-
description?: string;
|
487
|
-
};
|
488
|
-
type SafeParseSuccess<Output> = {
|
489
|
-
success: true;
|
490
|
-
data: Output;
|
491
|
-
error?: never;
|
492
|
-
};
|
493
|
-
type SafeParseError<Input> = {
|
494
|
-
success: false;
|
495
|
-
error: ZodError<Input>;
|
496
|
-
data?: never;
|
497
|
-
};
|
498
|
-
type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
|
499
|
-
declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
|
500
|
-
readonly _type: Output;
|
501
|
-
readonly _output: Output;
|
502
|
-
readonly _input: Input;
|
503
|
-
readonly _def: Def;
|
504
|
-
get description(): string | undefined;
|
505
|
-
"~standard": StandardSchemaV1.Props<Input, Output>;
|
506
|
-
abstract _parse(input: ParseInput): ParseReturnType<Output>;
|
507
|
-
_getType(input: ParseInput): string;
|
508
|
-
_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
|
509
|
-
_processInputParams(input: ParseInput): {
|
510
|
-
status: ParseStatus;
|
511
|
-
ctx: ParseContext;
|
512
|
-
};
|
513
|
-
_parseSync(input: ParseInput): SyncParseReturnType<Output>;
|
514
|
-
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
|
515
|
-
parse(data: unknown, params?: Partial<ParseParams>): Output;
|
516
|
-
safeParse(data: unknown, params?: Partial<ParseParams>): SafeParseReturnType<Input, Output>;
|
517
|
-
"~validate"(data: unknown): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>>;
|
518
|
-
parseAsync(data: unknown, params?: Partial<ParseParams>): Promise<Output>;
|
519
|
-
safeParseAsync(data: unknown, params?: Partial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
|
520
|
-
/** Alias of safeParseAsync */
|
521
|
-
spa: (data: unknown, params?: Partial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
|
522
|
-
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
|
523
|
-
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
|
524
|
-
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
|
525
|
-
refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
|
526
|
-
_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
|
527
|
-
superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
|
528
|
-
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
|
529
|
-
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
|
530
|
-
constructor(def: Def);
|
531
|
-
optional(): ZodOptional<this>;
|
532
|
-
nullable(): ZodNullable<this>;
|
533
|
-
nullish(): ZodOptional<ZodNullable<this>>;
|
534
|
-
array(): ZodArray<this>;
|
535
|
-
promise(): ZodPromise<this>;
|
536
|
-
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
|
537
|
-
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
|
538
|
-
transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
|
539
|
-
default(def: util.noUndefined<Input>): ZodDefault<this>;
|
540
|
-
default(def: () => util.noUndefined<Input>): ZodDefault<this>;
|
541
|
-
brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
|
542
|
-
catch(def: Output): ZodCatch<this>;
|
543
|
-
catch(def: (ctx: {
|
544
|
-
error: ZodError;
|
545
|
-
input: Input;
|
546
|
-
}) => Output): ZodCatch<this>;
|
547
|
-
describe(description: string): this;
|
548
|
-
pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
|
549
|
-
readonly(): ZodReadonly<this>;
|
550
|
-
isOptional(): boolean;
|
551
|
-
isNullable(): boolean;
|
552
|
-
}
|
553
|
-
type IpVersion = "v4" | "v6";
|
554
|
-
type ZodStringCheck = {
|
555
|
-
kind: "min";
|
556
|
-
value: number;
|
557
|
-
message?: string;
|
558
|
-
} | {
|
559
|
-
kind: "max";
|
560
|
-
value: number;
|
561
|
-
message?: string;
|
562
|
-
} | {
|
563
|
-
kind: "length";
|
564
|
-
value: number;
|
565
|
-
message?: string;
|
566
|
-
} | {
|
567
|
-
kind: "email";
|
568
|
-
message?: string;
|
569
|
-
} | {
|
570
|
-
kind: "url";
|
571
|
-
message?: string;
|
572
|
-
} | {
|
573
|
-
kind: "emoji";
|
574
|
-
message?: string;
|
575
|
-
} | {
|
576
|
-
kind: "uuid";
|
577
|
-
message?: string;
|
578
|
-
} | {
|
579
|
-
kind: "nanoid";
|
580
|
-
message?: string;
|
581
|
-
} | {
|
582
|
-
kind: "cuid";
|
583
|
-
message?: string;
|
584
|
-
} | {
|
585
|
-
kind: "includes";
|
586
|
-
value: string;
|
587
|
-
position?: number;
|
588
|
-
message?: string;
|
589
|
-
} | {
|
590
|
-
kind: "cuid2";
|
591
|
-
message?: string;
|
592
|
-
} | {
|
593
|
-
kind: "ulid";
|
594
|
-
message?: string;
|
595
|
-
} | {
|
596
|
-
kind: "startsWith";
|
597
|
-
value: string;
|
598
|
-
message?: string;
|
599
|
-
} | {
|
600
|
-
kind: "endsWith";
|
601
|
-
value: string;
|
602
|
-
message?: string;
|
603
|
-
} | {
|
604
|
-
kind: "regex";
|
605
|
-
regex: RegExp;
|
606
|
-
message?: string;
|
607
|
-
} | {
|
608
|
-
kind: "trim";
|
609
|
-
message?: string;
|
610
|
-
} | {
|
611
|
-
kind: "toLowerCase";
|
612
|
-
message?: string;
|
613
|
-
} | {
|
614
|
-
kind: "toUpperCase";
|
615
|
-
message?: string;
|
616
|
-
} | {
|
617
|
-
kind: "jwt";
|
618
|
-
alg?: string;
|
619
|
-
message?: string;
|
620
|
-
} | {
|
621
|
-
kind: "datetime";
|
622
|
-
offset: boolean;
|
623
|
-
local: boolean;
|
624
|
-
precision: number | null;
|
625
|
-
message?: string;
|
626
|
-
} | {
|
627
|
-
kind: "date";
|
628
|
-
message?: string;
|
629
|
-
} | {
|
630
|
-
kind: "time";
|
631
|
-
precision: number | null;
|
632
|
-
message?: string;
|
633
|
-
} | {
|
634
|
-
kind: "duration";
|
635
|
-
message?: string;
|
636
|
-
} | {
|
637
|
-
kind: "ip";
|
638
|
-
version?: IpVersion;
|
639
|
-
message?: string;
|
640
|
-
} | {
|
641
|
-
kind: "cidr";
|
642
|
-
version?: IpVersion;
|
643
|
-
message?: string;
|
644
|
-
} | {
|
645
|
-
kind: "base64";
|
646
|
-
message?: string;
|
647
|
-
} | {
|
648
|
-
kind: "base64url";
|
649
|
-
message?: string;
|
650
|
-
};
|
651
|
-
interface ZodStringDef extends ZodTypeDef {
|
652
|
-
checks: ZodStringCheck[];
|
653
|
-
typeName: ZodFirstPartyTypeKind.ZodString;
|
654
|
-
coerce: boolean;
|
655
|
-
}
|
656
|
-
declare function datetimeRegex(args: {
|
657
|
-
precision?: number | null;
|
658
|
-
offset?: boolean;
|
659
|
-
local?: boolean;
|
660
|
-
}): RegExp;
|
661
|
-
declare class ZodString extends ZodType<string, ZodStringDef, string> {
|
662
|
-
_parse(input: ParseInput): ParseReturnType<string>;
|
663
|
-
protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage): ZodEffects<this, string, string>;
|
664
|
-
_addCheck(check: ZodStringCheck): ZodString;
|
665
|
-
email(message?: errorUtil.ErrMessage): ZodString;
|
666
|
-
url(message?: errorUtil.ErrMessage): ZodString;
|
667
|
-
emoji(message?: errorUtil.ErrMessage): ZodString;
|
668
|
-
uuid(message?: errorUtil.ErrMessage): ZodString;
|
669
|
-
nanoid(message?: errorUtil.ErrMessage): ZodString;
|
670
|
-
cuid(message?: errorUtil.ErrMessage): ZodString;
|
671
|
-
cuid2(message?: errorUtil.ErrMessage): ZodString;
|
672
|
-
ulid(message?: errorUtil.ErrMessage): ZodString;
|
673
|
-
base64(message?: errorUtil.ErrMessage): ZodString;
|
674
|
-
base64url(message?: errorUtil.ErrMessage): ZodString;
|
675
|
-
jwt(options?: {
|
676
|
-
alg?: string;
|
677
|
-
message?: string;
|
678
|
-
}): ZodString;
|
679
|
-
ip(options?: string | {
|
680
|
-
version?: IpVersion;
|
681
|
-
message?: string;
|
682
|
-
}): ZodString;
|
683
|
-
cidr(options?: string | {
|
684
|
-
version?: IpVersion;
|
685
|
-
message?: string;
|
686
|
-
}): ZodString;
|
687
|
-
datetime(options?: string | {
|
688
|
-
message?: string | undefined;
|
689
|
-
precision?: number | null;
|
690
|
-
offset?: boolean;
|
691
|
-
local?: boolean;
|
692
|
-
}): ZodString;
|
693
|
-
date(message?: string): ZodString;
|
694
|
-
time(options?: string | {
|
695
|
-
message?: string | undefined;
|
696
|
-
precision?: number | null;
|
697
|
-
}): ZodString;
|
698
|
-
duration(message?: errorUtil.ErrMessage): ZodString;
|
699
|
-
regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
|
700
|
-
includes(value: string, options?: {
|
701
|
-
message?: string;
|
702
|
-
position?: number;
|
703
|
-
}): ZodString;
|
704
|
-
startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
705
|
-
endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
706
|
-
min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
|
707
|
-
max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
|
708
|
-
length(len: number, message?: errorUtil.ErrMessage): ZodString;
|
709
|
-
/**
|
710
|
-
* Equivalent to `.min(1)`
|
711
|
-
*/
|
712
|
-
nonempty(message?: errorUtil.ErrMessage): ZodString;
|
713
|
-
trim(): ZodString;
|
714
|
-
toLowerCase(): ZodString;
|
715
|
-
toUpperCase(): ZodString;
|
716
|
-
get isDatetime(): boolean;
|
717
|
-
get isDate(): boolean;
|
718
|
-
get isTime(): boolean;
|
719
|
-
get isDuration(): boolean;
|
720
|
-
get isEmail(): boolean;
|
721
|
-
get isURL(): boolean;
|
722
|
-
get isEmoji(): boolean;
|
723
|
-
get isUUID(): boolean;
|
724
|
-
get isNANOID(): boolean;
|
725
|
-
get isCUID(): boolean;
|
726
|
-
get isCUID2(): boolean;
|
727
|
-
get isULID(): boolean;
|
728
|
-
get isIP(): boolean;
|
729
|
-
get isCIDR(): boolean;
|
730
|
-
get isBase64(): boolean;
|
731
|
-
get isBase64url(): boolean;
|
732
|
-
get minLength(): number | null;
|
733
|
-
get maxLength(): number | null;
|
734
|
-
static create: (params?: RawCreateParams & {
|
735
|
-
coerce?: true;
|
736
|
-
}) => ZodString;
|
737
|
-
}
|
738
|
-
type ZodNumberCheck = {
|
739
|
-
kind: "min";
|
740
|
-
value: number;
|
741
|
-
inclusive: boolean;
|
742
|
-
message?: string;
|
743
|
-
} | {
|
744
|
-
kind: "max";
|
745
|
-
value: number;
|
746
|
-
inclusive: boolean;
|
747
|
-
message?: string;
|
748
|
-
} | {
|
749
|
-
kind: "int";
|
750
|
-
message?: string;
|
751
|
-
} | {
|
752
|
-
kind: "multipleOf";
|
753
|
-
value: number;
|
754
|
-
message?: string;
|
755
|
-
} | {
|
756
|
-
kind: "finite";
|
757
|
-
message?: string;
|
758
|
-
};
|
759
|
-
interface ZodNumberDef extends ZodTypeDef {
|
760
|
-
checks: ZodNumberCheck[];
|
761
|
-
typeName: ZodFirstPartyTypeKind.ZodNumber;
|
762
|
-
coerce: boolean;
|
763
|
-
}
|
764
|
-
declare class ZodNumber extends ZodType<number, ZodNumberDef, number> {
|
765
|
-
_parse(input: ParseInput): ParseReturnType<number>;
|
766
|
-
static create: (params?: RawCreateParams & {
|
767
|
-
coerce?: boolean;
|
768
|
-
}) => ZodNumber;
|
769
|
-
gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
770
|
-
min: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
771
|
-
gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
772
|
-
lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
773
|
-
max: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
774
|
-
lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
775
|
-
protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
|
776
|
-
_addCheck(check: ZodNumberCheck): ZodNumber;
|
777
|
-
int(message?: errorUtil.ErrMessage): ZodNumber;
|
778
|
-
positive(message?: errorUtil.ErrMessage): ZodNumber;
|
779
|
-
negative(message?: errorUtil.ErrMessage): ZodNumber;
|
780
|
-
nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
|
781
|
-
nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
|
782
|
-
multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
783
|
-
step: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
784
|
-
finite(message?: errorUtil.ErrMessage): ZodNumber;
|
785
|
-
safe(message?: errorUtil.ErrMessage): ZodNumber;
|
786
|
-
get minValue(): number | null;
|
787
|
-
get maxValue(): number | null;
|
788
|
-
get isInt(): boolean;
|
789
|
-
get isFinite(): boolean;
|
790
|
-
}
|
791
|
-
type ZodBigIntCheck = {
|
792
|
-
kind: "min";
|
793
|
-
value: bigint;
|
794
|
-
inclusive: boolean;
|
795
|
-
message?: string;
|
796
|
-
} | {
|
797
|
-
kind: "max";
|
798
|
-
value: bigint;
|
799
|
-
inclusive: boolean;
|
800
|
-
message?: string;
|
801
|
-
} | {
|
802
|
-
kind: "multipleOf";
|
803
|
-
value: bigint;
|
804
|
-
message?: string;
|
805
|
-
};
|
806
|
-
interface ZodBigIntDef extends ZodTypeDef {
|
807
|
-
checks: ZodBigIntCheck[];
|
808
|
-
typeName: ZodFirstPartyTypeKind.ZodBigInt;
|
809
|
-
coerce: boolean;
|
810
|
-
}
|
811
|
-
declare class ZodBigInt extends ZodType<bigint, ZodBigIntDef, bigint> {
|
812
|
-
_parse(input: ParseInput): ParseReturnType<bigint>;
|
813
|
-
_getInvalidInput(input: ParseInput): INVALID;
|
814
|
-
static create: (params?: RawCreateParams & {
|
815
|
-
coerce?: boolean;
|
816
|
-
}) => ZodBigInt;
|
817
|
-
gte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
818
|
-
min: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
|
819
|
-
gt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
820
|
-
lte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
821
|
-
max: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
|
822
|
-
lt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
823
|
-
protected setLimit(kind: "min" | "max", value: bigint, inclusive: boolean, message?: string): ZodBigInt;
|
824
|
-
_addCheck(check: ZodBigIntCheck): ZodBigInt;
|
825
|
-
positive(message?: errorUtil.ErrMessage): ZodBigInt;
|
826
|
-
negative(message?: errorUtil.ErrMessage): ZodBigInt;
|
827
|
-
nonpositive(message?: errorUtil.ErrMessage): ZodBigInt;
|
828
|
-
nonnegative(message?: errorUtil.ErrMessage): ZodBigInt;
|
829
|
-
multipleOf(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
830
|
-
get minValue(): bigint | null;
|
831
|
-
get maxValue(): bigint | null;
|
832
|
-
}
|
833
|
-
interface ZodBooleanDef extends ZodTypeDef {
|
834
|
-
typeName: ZodFirstPartyTypeKind.ZodBoolean;
|
835
|
-
coerce: boolean;
|
836
|
-
}
|
837
|
-
declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef, boolean> {
|
838
|
-
_parse(input: ParseInput): ParseReturnType<boolean>;
|
839
|
-
static create: (params?: RawCreateParams & {
|
840
|
-
coerce?: boolean;
|
841
|
-
}) => ZodBoolean;
|
842
|
-
}
|
843
|
-
type ZodDateCheck = {
|
844
|
-
kind: "min";
|
845
|
-
value: number;
|
846
|
-
message?: string;
|
847
|
-
} | {
|
848
|
-
kind: "max";
|
849
|
-
value: number;
|
850
|
-
message?: string;
|
851
|
-
};
|
852
|
-
interface ZodDateDef extends ZodTypeDef {
|
853
|
-
checks: ZodDateCheck[];
|
854
|
-
coerce: boolean;
|
855
|
-
typeName: ZodFirstPartyTypeKind.ZodDate;
|
856
|
-
}
|
857
|
-
declare class ZodDate extends ZodType<Date, ZodDateDef, Date> {
|
858
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
859
|
-
_addCheck(check: ZodDateCheck): ZodDate;
|
860
|
-
min(minDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
861
|
-
max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
862
|
-
get minDate(): Date | null;
|
863
|
-
get maxDate(): Date | null;
|
864
|
-
static create: (params?: RawCreateParams & {
|
865
|
-
coerce?: boolean;
|
866
|
-
}) => ZodDate;
|
867
|
-
}
|
868
|
-
interface ZodSymbolDef extends ZodTypeDef {
|
869
|
-
typeName: ZodFirstPartyTypeKind.ZodSymbol;
|
870
|
-
}
|
871
|
-
declare class ZodSymbol extends ZodType<symbol, ZodSymbolDef, symbol> {
|
872
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
873
|
-
static create: (params?: RawCreateParams) => ZodSymbol;
|
874
|
-
}
|
875
|
-
interface ZodUndefinedDef extends ZodTypeDef {
|
876
|
-
typeName: ZodFirstPartyTypeKind.ZodUndefined;
|
877
|
-
}
|
878
|
-
declare class ZodUndefined extends ZodType<undefined, ZodUndefinedDef, undefined> {
|
879
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
880
|
-
params?: RawCreateParams;
|
881
|
-
static create: (params?: RawCreateParams) => ZodUndefined;
|
882
|
-
}
|
883
|
-
interface ZodNullDef extends ZodTypeDef {
|
884
|
-
typeName: ZodFirstPartyTypeKind.ZodNull;
|
885
|
-
}
|
886
|
-
declare class ZodNull extends ZodType<null, ZodNullDef, null> {
|
887
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
888
|
-
static create: (params?: RawCreateParams) => ZodNull;
|
889
|
-
}
|
890
|
-
interface ZodAnyDef extends ZodTypeDef {
|
891
|
-
typeName: ZodFirstPartyTypeKind.ZodAny;
|
892
|
-
}
|
893
|
-
declare class ZodAny extends ZodType<any, ZodAnyDef, any> {
|
894
|
-
_any: true;
|
895
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
896
|
-
static create: (params?: RawCreateParams) => ZodAny;
|
897
|
-
}
|
898
|
-
interface ZodUnknownDef extends ZodTypeDef {
|
899
|
-
typeName: ZodFirstPartyTypeKind.ZodUnknown;
|
900
|
-
}
|
901
|
-
declare class ZodUnknown extends ZodType<unknown, ZodUnknownDef, unknown> {
|
902
|
-
_unknown: true;
|
903
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
904
|
-
static create: (params?: RawCreateParams) => ZodUnknown;
|
905
|
-
}
|
906
|
-
interface ZodNeverDef extends ZodTypeDef {
|
907
|
-
typeName: ZodFirstPartyTypeKind.ZodNever;
|
908
|
-
}
|
909
|
-
declare class ZodNever extends ZodType<never, ZodNeverDef, never> {
|
910
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
911
|
-
static create: (params?: RawCreateParams) => ZodNever;
|
912
|
-
}
|
913
|
-
interface ZodVoidDef extends ZodTypeDef {
|
914
|
-
typeName: ZodFirstPartyTypeKind.ZodVoid;
|
915
|
-
}
|
916
|
-
declare class ZodVoid extends ZodType<void, ZodVoidDef, void> {
|
917
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
918
|
-
static create: (params?: RawCreateParams) => ZodVoid;
|
919
|
-
}
|
920
|
-
interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
921
|
-
type: T;
|
922
|
-
typeName: ZodFirstPartyTypeKind.ZodArray;
|
923
|
-
exactLength: {
|
924
|
-
value: number;
|
925
|
-
message?: string;
|
926
|
-
} | null;
|
927
|
-
minLength: {
|
928
|
-
value: number;
|
929
|
-
message?: string;
|
930
|
-
} | null;
|
931
|
-
maxLength: {
|
932
|
-
value: number;
|
933
|
-
message?: string;
|
934
|
-
} | null;
|
935
|
-
}
|
936
|
-
type ArrayCardinality = "many" | "atleastone";
|
937
|
-
type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
|
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"][]> {
|
939
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
940
|
-
get element(): T;
|
941
|
-
min(minLength: number, message?: errorUtil.ErrMessage): this;
|
942
|
-
max(maxLength: number, message?: errorUtil.ErrMessage): this;
|
943
|
-
length(len: number, message?: errorUtil.ErrMessage): this;
|
944
|
-
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
|
945
|
-
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodArray<T_1, "many">;
|
946
|
-
}
|
947
|
-
type ZodNonEmptyArray<T extends ZodTypeAny> = ZodArray<T, "atleastone">;
|
948
|
-
type UnknownKeysParam = "passthrough" | "strict" | "strip";
|
949
|
-
interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
950
|
-
typeName: ZodFirstPartyTypeKind.ZodObject;
|
951
|
-
shape: () => T;
|
952
|
-
catchall: Catchall;
|
953
|
-
unknownKeys: UnknownKeys;
|
954
|
-
}
|
955
|
-
type mergeTypes<A, B> = {
|
956
|
-
[k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never;
|
957
|
-
};
|
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> = {
|
960
|
-
[k in keyof Shape]: Shape[k]["_output"];
|
961
|
-
};
|
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<{
|
964
|
-
[k in keyof Shape]: Shape[k]["_input"];
|
965
|
-
}>;
|
966
|
-
type CatchallOutput<T extends ZodType> = ZodType extends T ? unknown : {
|
967
|
-
[k: string]: T["_output"];
|
968
|
-
};
|
969
|
-
type CatchallInput<T extends ZodType> = ZodType extends T ? unknown : {
|
970
|
-
[k: string]: T["_input"];
|
971
|
-
};
|
972
|
-
type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
|
973
|
-
[k: string]: unknown;
|
974
|
-
} : unknown;
|
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> = {
|
978
|
-
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;
|
979
|
-
};
|
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> {
|
981
|
-
private _cached;
|
982
|
-
_getCached(): {
|
983
|
-
shape: T;
|
984
|
-
keys: string[];
|
985
|
-
};
|
986
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
987
|
-
get shape(): T;
|
988
|
-
strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
|
989
|
-
strip(): ZodObject<T, "strip", Catchall>;
|
990
|
-
passthrough(): ZodObject<T, "passthrough", Catchall>;
|
991
|
-
/**
|
992
|
-
* @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
|
993
|
-
* If you want to pass through unknown properties, use `.passthrough()` instead.
|
994
|
-
*/
|
995
|
-
nonstrict: () => ZodObject<T, "passthrough", Catchall>;
|
996
|
-
extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
997
|
-
/**
|
998
|
-
* @deprecated Use `.extend` instead
|
999
|
-
* */
|
1000
|
-
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
1001
|
-
/**
|
1002
|
-
* Prior to zod@1.0.12 there was a bug in the
|
1003
|
-
* inferred type of merged objects. Please
|
1004
|
-
* upgrade if you are experiencing issues.
|
1005
|
-
*/
|
1006
|
-
merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<objectUtil.extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
|
1007
|
-
setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
|
1008
|
-
[k in Key]: Schema;
|
1009
|
-
}, UnknownKeys, Catchall>;
|
1010
|
-
catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
|
1011
|
-
pick<Mask extends util.Exactly<{
|
1012
|
-
[k in keyof T]?: true;
|
1013
|
-
}, Mask>>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
|
1014
|
-
omit<Mask extends util.Exactly<{
|
1015
|
-
[k in keyof T]?: true;
|
1016
|
-
}, Mask>>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
|
1017
|
-
/**
|
1018
|
-
* @deprecated
|
1019
|
-
*/
|
1020
|
-
deepPartial(): partialUtil.DeepPartial<this>;
|
1021
|
-
partial(): ZodObject<{
|
1022
|
-
[k in keyof T]: ZodOptional<T[k]>;
|
1023
|
-
}, UnknownKeys, Catchall>;
|
1024
|
-
partial<Mask extends util.Exactly<{
|
1025
|
-
[k in keyof T]?: true;
|
1026
|
-
}, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{
|
1027
|
-
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
|
1028
|
-
}>, UnknownKeys, Catchall>;
|
1029
|
-
required(): ZodObject<{
|
1030
|
-
[k in keyof T]: deoptional<T[k]>;
|
1031
|
-
}, UnknownKeys, Catchall>;
|
1032
|
-
required<Mask extends util.Exactly<{
|
1033
|
-
[k in keyof T]?: true;
|
1034
|
-
}, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{
|
1035
|
-
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
1036
|
-
}>, UnknownKeys, Catchall>;
|
1037
|
-
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
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>;
|
1041
|
-
}
|
1042
|
-
type AnyZodObject = ZodObject<any, any, any>;
|
1043
|
-
type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
|
1044
|
-
interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[
|
1045
|
-
ZodTypeAny,
|
1046
|
-
ZodTypeAny,
|
1047
|
-
...ZodTypeAny[]
|
1048
|
-
]>> extends ZodTypeDef {
|
1049
|
-
options: T;
|
1050
|
-
typeName: ZodFirstPartyTypeKind.ZodUnion;
|
1051
|
-
}
|
1052
|
-
declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
|
1053
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1054
|
-
get options(): T;
|
1055
|
-
static create: <T_1 extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T_1, params?: RawCreateParams) => ZodUnion<T_1>;
|
1056
|
-
}
|
1057
|
-
type ZodDiscriminatedUnionOption<Discriminator extends string> = ZodObject<{
|
1058
|
-
[key in Discriminator]: ZodTypeAny;
|
1059
|
-
} & ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
1060
|
-
interface ZodDiscriminatedUnionDef<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> extends ZodTypeDef {
|
1061
|
-
discriminator: Discriminator;
|
1062
|
-
options: Options;
|
1063
|
-
optionsMap: Map<Primitive, ZodDiscriminatedUnionOption<any>>;
|
1064
|
-
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion;
|
1065
|
-
}
|
1066
|
-
declare class ZodDiscriminatedUnion<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<Discriminator>[]> extends ZodType<output<Options[number]>, ZodDiscriminatedUnionDef<Discriminator, Options>, input<Options[number]>> {
|
1067
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1068
|
-
get discriminator(): Discriminator;
|
1069
|
-
get options(): Options;
|
1070
|
-
get optionsMap(): Map<Primitive, ZodDiscriminatedUnionOption<any>>;
|
1071
|
-
/**
|
1072
|
-
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
1073
|
-
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
1074
|
-
* have a different value for each object in the union.
|
1075
|
-
* @param discriminator the name of the discriminator property
|
1076
|
-
* @param types an array of object schemas
|
1077
|
-
* @param params
|
1078
|
-
*/
|
1079
|
-
static create<Discriminator extends string, Types extends readonly [
|
1080
|
-
ZodDiscriminatedUnionOption<Discriminator>,
|
1081
|
-
...ZodDiscriminatedUnionOption<Discriminator>[]
|
1082
|
-
]>(discriminator: Discriminator, options: Types, params?: RawCreateParams): ZodDiscriminatedUnion<Discriminator, Types>;
|
1083
|
-
}
|
1084
|
-
interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1085
|
-
left: T;
|
1086
|
-
right: U;
|
1087
|
-
typeName: ZodFirstPartyTypeKind.ZodIntersection;
|
1088
|
-
}
|
1089
|
-
declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
|
1090
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1091
|
-
static create: <T_1 extends ZodTypeAny, U_1 extends ZodTypeAny>(left: T_1, right: U_1, params?: RawCreateParams) => ZodIntersection<T_1, U_1>;
|
1092
|
-
}
|
1093
|
-
type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
|
1094
|
-
type AssertArray<T> = T extends any[] ? T : never;
|
1095
|
-
type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
1096
|
-
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_output"] : never;
|
1097
|
-
}>;
|
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<{
|
1100
|
-
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_input"] : never;
|
1101
|
-
}>;
|
1102
|
-
type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
|
1103
|
-
interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
|
1104
|
-
items: T;
|
1105
|
-
rest: Rest;
|
1106
|
-
typeName: ZodFirstPartyTypeKind.ZodTuple;
|
1107
|
-
}
|
1108
|
-
type AnyZodTuple = ZodTuple<[
|
1109
|
-
ZodTypeAny,
|
1110
|
-
...ZodTypeAny[]
|
1111
|
-
] | [], ZodTypeAny | null>;
|
1112
|
-
declare class ZodTuple<T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]], Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
|
1113
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1114
|
-
get items(): T;
|
1115
|
-
rest<Rest extends ZodTypeAny>(rest: Rest): ZodTuple<T, Rest>;
|
1116
|
-
static create: <T_1 extends [] | [ZodTypeAny, ...ZodTypeAny[]]>(schemas: T_1, params?: RawCreateParams) => ZodTuple<T_1, null>;
|
1117
|
-
}
|
1118
|
-
interface ZodRecordDef<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1119
|
-
valueType: Value;
|
1120
|
-
keyType: Key;
|
1121
|
-
typeName: ZodFirstPartyTypeKind.ZodRecord;
|
1122
|
-
}
|
1123
|
-
type KeySchema = ZodType<string | number | symbol, any, any>;
|
1124
|
-
type RecordType<K extends string | number | symbol, V> = [
|
1125
|
-
string
|
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>>;
|
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"]>> {
|
1128
|
-
get keySchema(): Key;
|
1129
|
-
get valueSchema(): Value;
|
1130
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1131
|
-
get element(): Value;
|
1132
|
-
static create<Value extends ZodTypeAny>(valueType: Value, params?: RawCreateParams): ZodRecord<ZodString, Value>;
|
1133
|
-
static create<Keys extends KeySchema, Value extends ZodTypeAny>(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord<Keys, Value>;
|
1134
|
-
}
|
1135
|
-
interface ZodMapDef<Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1136
|
-
valueType: Value;
|
1137
|
-
keyType: Key;
|
1138
|
-
typeName: ZodFirstPartyTypeKind.ZodMap;
|
1139
|
-
}
|
1140
|
-
declare class ZodMap<Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny> extends ZodType<Map<Key["_output"], Value["_output"]>, ZodMapDef<Key, Value>, Map<Key["_input"], Value["_input"]>> {
|
1141
|
-
get keySchema(): Key;
|
1142
|
-
get valueSchema(): Value;
|
1143
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1144
|
-
static create: <Key_1 extends ZodTypeAny = ZodTypeAny, Value_1 extends ZodTypeAny = ZodTypeAny>(keyType: Key_1, valueType: Value_1, params?: RawCreateParams) => ZodMap<Key_1, Value_1>;
|
1145
|
-
}
|
1146
|
-
interface ZodSetDef<Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1147
|
-
valueType: Value;
|
1148
|
-
typeName: ZodFirstPartyTypeKind.ZodSet;
|
1149
|
-
minSize: {
|
1150
|
-
value: number;
|
1151
|
-
message?: string;
|
1152
|
-
} | null;
|
1153
|
-
maxSize: {
|
1154
|
-
value: number;
|
1155
|
-
message?: string;
|
1156
|
-
} | null;
|
1157
|
-
}
|
1158
|
-
declare class ZodSet<Value extends ZodTypeAny = ZodTypeAny> extends ZodType<Set<Value["_output"]>, ZodSetDef<Value>, Set<Value["_input"]>> {
|
1159
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1160
|
-
min(minSize: number, message?: errorUtil.ErrMessage): this;
|
1161
|
-
max(maxSize: number, message?: errorUtil.ErrMessage): this;
|
1162
|
-
size(size: number, message?: errorUtil.ErrMessage): this;
|
1163
|
-
nonempty(message?: errorUtil.ErrMessage): ZodSet<Value>;
|
1164
|
-
static create: <Value_1 extends ZodTypeAny = ZodTypeAny>(valueType: Value_1, params?: RawCreateParams) => ZodSet<Value_1>;
|
1165
|
-
}
|
1166
|
-
interface ZodFunctionDef<Args extends ZodTuple<any, any> = ZodTuple<any, any>, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1167
|
-
args: Args;
|
1168
|
-
returns: Returns;
|
1169
|
-
typeName: ZodFirstPartyTypeKind.ZodFunction;
|
1170
|
-
}
|
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;
|
1173
|
-
declare class ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> extends ZodType<OuterTypeOfFunction<Args, Returns>, ZodFunctionDef<Args, Returns>, InnerTypeOfFunction<Args, Returns>> {
|
1174
|
-
_parse(input: ParseInput): ParseReturnType<any>;
|
1175
|
-
parameters(): Args;
|
1176
|
-
returnType(): Returns;
|
1177
|
-
args<Items extends Parameters<(typeof ZodTuple)["create"]>[0]>(...items: Items): ZodFunction<ZodTuple<Items, ZodUnknown>, Returns>;
|
1178
|
-
returns<NewReturnType extends ZodType<any, any, any>>(returnType: NewReturnType): ZodFunction<Args, NewReturnType>;
|
1179
|
-
implement<F extends InnerTypeOfFunction<Args, Returns>>(func: F): ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
1180
|
-
strictImplement(func: InnerTypeOfFunction<Args, Returns>): InnerTypeOfFunction<Args, Returns>;
|
1181
|
-
validate: <F extends InnerTypeOfFunction<Args, Returns>>(func: F) => ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
1182
|
-
static create(): ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>;
|
1183
|
-
static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>>(args: T): ZodFunction<T, ZodUnknown>;
|
1184
|
-
static create<T extends AnyZodTuple, U extends ZodTypeAny>(args: T, returns: U): ZodFunction<T, U>;
|
1185
|
-
static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>, U extends ZodTypeAny = ZodUnknown>(args: T, returns: U, params?: RawCreateParams): ZodFunction<T, U>;
|
1186
|
-
}
|
1187
|
-
interface ZodLazyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1188
|
-
getter: () => T;
|
1189
|
-
typeName: ZodFirstPartyTypeKind.ZodLazy;
|
1190
|
-
}
|
1191
|
-
declare class ZodLazy<T extends ZodTypeAny> extends ZodType<output<T>, ZodLazyDef<T>, input<T>> {
|
1192
|
-
get schema(): T;
|
1193
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1194
|
-
static create: <T_1 extends ZodTypeAny>(getter: () => T_1, params?: RawCreateParams) => ZodLazy<T_1>;
|
1195
|
-
}
|
1196
|
-
interface ZodLiteralDef<T = any> extends ZodTypeDef {
|
1197
|
-
value: T;
|
1198
|
-
typeName: ZodFirstPartyTypeKind.ZodLiteral;
|
1199
|
-
}
|
1200
|
-
declare class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>, T> {
|
1201
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1202
|
-
get value(): T;
|
1203
|
-
static create: <T_1 extends Primitive>(value: T_1, params?: RawCreateParams) => ZodLiteral<T_1>;
|
1204
|
-
}
|
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> = {
|
1209
|
-
[k in T[number]]: k;
|
1210
|
-
};
|
1211
|
-
interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
|
1212
|
-
values: T;
|
1213
|
-
typeName: ZodFirstPartyTypeKind.ZodEnum;
|
1214
|
-
}
|
1215
|
-
type Writeable<T> = {
|
1216
|
-
-readonly [P in keyof T]: T[P];
|
1217
|
-
};
|
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;
|
1220
|
-
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
|
1221
|
-
declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
|
1222
|
-
declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>, T[number]> {
|
1223
|
-
#private;
|
1224
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1225
|
-
get options(): T;
|
1226
|
-
get enum(): Values<T>;
|
1227
|
-
get Values(): Values<T>;
|
1228
|
-
get Enum(): Values<T>;
|
1229
|
-
extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract, newDef?: RawCreateParams): ZodEnum<Writeable<ToExtract>>;
|
1230
|
-
exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude, newDef?: RawCreateParams): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
|
1231
|
-
static create: typeof createZodEnum;
|
1232
|
-
}
|
1233
|
-
interface ZodNativeEnumDef<T extends EnumLike = EnumLike> extends ZodTypeDef {
|
1234
|
-
values: T;
|
1235
|
-
typeName: ZodFirstPartyTypeKind.ZodNativeEnum;
|
1236
|
-
}
|
1237
|
-
type EnumLike = {
|
1238
|
-
[k: string]: string | number;
|
1239
|
-
[nu: number]: string;
|
1240
|
-
};
|
1241
|
-
declare class ZodNativeEnum<T extends EnumLike> extends ZodType<T[keyof T], ZodNativeEnumDef<T>, T[keyof T]> {
|
1242
|
-
#private;
|
1243
|
-
_parse(input: ParseInput): ParseReturnType<T[keyof T]>;
|
1244
|
-
get enum(): T;
|
1245
|
-
static create: <T_1 extends EnumLike>(values: T_1, params?: RawCreateParams) => ZodNativeEnum<T_1>;
|
1246
|
-
}
|
1247
|
-
interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1248
|
-
type: T;
|
1249
|
-
typeName: ZodFirstPartyTypeKind.ZodPromise;
|
1250
|
-
}
|
1251
|
-
declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
|
1252
|
-
unwrap(): T;
|
1253
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1254
|
-
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodPromise<T_1>;
|
1255
|
-
}
|
1256
|
-
type Refinement<T> = (arg: T, ctx: RefinementCtx) => any;
|
1257
|
-
type SuperRefinement<T> = (arg: T, ctx: RefinementCtx) => void | Promise<void>;
|
1258
|
-
type RefinementEffect<T> = {
|
1259
|
-
type: "refinement";
|
1260
|
-
refinement: (arg: T, ctx: RefinementCtx) => any;
|
1261
|
-
};
|
1262
|
-
type TransformEffect<T> = {
|
1263
|
-
type: "transform";
|
1264
|
-
transform: (arg: T, ctx: RefinementCtx) => any;
|
1265
|
-
};
|
1266
|
-
type PreprocessEffect<T> = {
|
1267
|
-
type: "preprocess";
|
1268
|
-
transform: (arg: T, ctx: RefinementCtx) => any;
|
1269
|
-
};
|
1270
|
-
type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
|
1271
|
-
interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1272
|
-
schema: T;
|
1273
|
-
typeName: ZodFirstPartyTypeKind.ZodEffects;
|
1274
|
-
effect: Effect<any>;
|
1275
|
-
}
|
1276
|
-
declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
|
1277
|
-
innerType(): T;
|
1278
|
-
sourceType(): T;
|
1279
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1280
|
-
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
1281
|
-
static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
1282
|
-
}
|
1283
|
-
|
1284
|
-
interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1285
|
-
innerType: T;
|
1286
|
-
typeName: ZodFirstPartyTypeKind.ZodOptional;
|
1287
|
-
}
|
1288
|
-
type ZodOptionalType<T extends ZodTypeAny> = ZodOptional<T>;
|
1289
|
-
declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
|
1290
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1291
|
-
unwrap(): T;
|
1292
|
-
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodOptional<T_1>;
|
1293
|
-
}
|
1294
|
-
interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1295
|
-
innerType: T;
|
1296
|
-
typeName: ZodFirstPartyTypeKind.ZodNullable;
|
1297
|
-
}
|
1298
|
-
type ZodNullableType<T extends ZodTypeAny> = ZodNullable<T>;
|
1299
|
-
declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
|
1300
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1301
|
-
unwrap(): T;
|
1302
|
-
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodNullable<T_1>;
|
1303
|
-
}
|
1304
|
-
interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1305
|
-
innerType: T;
|
1306
|
-
defaultValue: () => util.noUndefined<T["_input"]>;
|
1307
|
-
typeName: ZodFirstPartyTypeKind.ZodDefault;
|
1308
|
-
}
|
1309
|
-
declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
|
1310
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1311
|
-
removeDefault(): T;
|
1312
|
-
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
1313
|
-
errorMap?: ZodErrorMap | undefined;
|
1314
|
-
invalid_type_error?: string | undefined;
|
1315
|
-
required_error?: string | undefined;
|
1316
|
-
message?: string | undefined;
|
1317
|
-
description?: string | undefined;
|
1318
|
-
} & {
|
1319
|
-
default: T_1["_input"] | (() => util.noUndefined<T_1["_input"]>);
|
1320
|
-
}) => ZodDefault<T_1>;
|
1321
|
-
}
|
1322
|
-
interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1323
|
-
innerType: T;
|
1324
|
-
catchValue: (ctx: {
|
1325
|
-
error: ZodError;
|
1326
|
-
input: unknown;
|
1327
|
-
}) => T["_input"];
|
1328
|
-
typeName: ZodFirstPartyTypeKind.ZodCatch;
|
1329
|
-
}
|
1330
|
-
declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
|
1331
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1332
|
-
removeCatch(): T;
|
1333
|
-
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
1334
|
-
errorMap?: ZodErrorMap | undefined;
|
1335
|
-
invalid_type_error?: string | undefined;
|
1336
|
-
required_error?: string | undefined;
|
1337
|
-
message?: string | undefined;
|
1338
|
-
description?: string | undefined;
|
1339
|
-
} & {
|
1340
|
-
catch: T_1["_output"] | (() => T_1["_output"]);
|
1341
|
-
}) => ZodCatch<T_1>;
|
1342
|
-
}
|
1343
|
-
interface ZodNaNDef extends ZodTypeDef {
|
1344
|
-
typeName: ZodFirstPartyTypeKind.ZodNaN;
|
1345
|
-
}
|
1346
|
-
declare class ZodNaN extends ZodType<number, ZodNaNDef, number> {
|
1347
|
-
_parse(input: ParseInput): ParseReturnType<any>;
|
1348
|
-
static create: (params?: RawCreateParams) => ZodNaN;
|
1349
|
-
}
|
1350
|
-
interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
|
1351
|
-
type: T;
|
1352
|
-
typeName: ZodFirstPartyTypeKind.ZodBranded;
|
1353
|
-
}
|
1354
|
-
declare const BRAND: unique symbol;
|
1355
|
-
type BRAND<T extends string | number | symbol> = {
|
1356
|
-
[BRAND]: {
|
1357
|
-
[k in T]: true;
|
1358
|
-
};
|
1359
|
-
};
|
1360
|
-
declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
|
1361
|
-
_parse(input: ParseInput): ParseReturnType<any>;
|
1362
|
-
unwrap(): T;
|
1363
|
-
}
|
1364
|
-
interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
|
1365
|
-
in: A;
|
1366
|
-
out: B;
|
1367
|
-
typeName: ZodFirstPartyTypeKind.ZodPipeline;
|
1368
|
-
}
|
1369
|
-
declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
|
1370
|
-
_parse(input: ParseInput): ParseReturnType<any>;
|
1371
|
-
static create<A extends ZodTypeAny, B extends ZodTypeAny>(a: A, b: B): ZodPipeline<A, B>;
|
1372
|
-
}
|
1373
|
-
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
1374
|
-
readonly [Symbol.toStringTag]: string;
|
1375
|
-
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
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>;
|
1377
|
-
interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
1378
|
-
innerType: T;
|
1379
|
-
typeName: ZodFirstPartyTypeKind.ZodReadonly;
|
1380
|
-
}
|
1381
|
-
declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, MakeReadonly<T["_input"]>> {
|
1382
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
1383
|
-
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodReadonly<T_1>;
|
1384
|
-
unwrap(): T;
|
1385
|
-
}
|
1386
|
-
type CustomParams = CustomErrorParams & {
|
1387
|
-
fatal?: boolean;
|
1388
|
-
};
|
1389
|
-
declare function custom<T>(check?: (data: any) => any, _params?: string | CustomParams | ((input: any) => CustomParams),
|
1390
|
-
/**
|
1391
|
-
* @deprecated
|
1392
|
-
*
|
1393
|
-
* Pass `fatal` into the params object instead:
|
1394
|
-
*
|
1395
|
-
* ```ts
|
1396
|
-
* z.string().custom((val) => val.length > 5, { fatal: false })
|
1397
|
-
* ```
|
1398
|
-
*
|
1399
|
-
*/
|
1400
|
-
fatal?: boolean): ZodType<T, ZodTypeDef, T>;
|
1401
|
-
|
1402
|
-
declare const late: {
|
1403
|
-
object: <T extends ZodRawShape>(shape: () => T, params?: RawCreateParams) => ZodObject<T, "strip">;
|
1404
|
-
};
|
1405
|
-
declare enum ZodFirstPartyTypeKind {
|
1406
|
-
ZodString = "ZodString",
|
1407
|
-
ZodNumber = "ZodNumber",
|
1408
|
-
ZodNaN = "ZodNaN",
|
1409
|
-
ZodBigInt = "ZodBigInt",
|
1410
|
-
ZodBoolean = "ZodBoolean",
|
1411
|
-
ZodDate = "ZodDate",
|
1412
|
-
ZodSymbol = "ZodSymbol",
|
1413
|
-
ZodUndefined = "ZodUndefined",
|
1414
|
-
ZodNull = "ZodNull",
|
1415
|
-
ZodAny = "ZodAny",
|
1416
|
-
ZodUnknown = "ZodUnknown",
|
1417
|
-
ZodNever = "ZodNever",
|
1418
|
-
ZodVoid = "ZodVoid",
|
1419
|
-
ZodArray = "ZodArray",
|
1420
|
-
ZodObject = "ZodObject",
|
1421
|
-
ZodUnion = "ZodUnion",
|
1422
|
-
ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
|
1423
|
-
ZodIntersection = "ZodIntersection",
|
1424
|
-
ZodTuple = "ZodTuple",
|
1425
|
-
ZodRecord = "ZodRecord",
|
1426
|
-
ZodMap = "ZodMap",
|
1427
|
-
ZodSet = "ZodSet",
|
1428
|
-
ZodFunction = "ZodFunction",
|
1429
|
-
ZodLazy = "ZodLazy",
|
1430
|
-
ZodLiteral = "ZodLiteral",
|
1431
|
-
ZodEnum = "ZodEnum",
|
1432
|
-
ZodEffects = "ZodEffects",
|
1433
|
-
ZodNativeEnum = "ZodNativeEnum",
|
1434
|
-
ZodOptional = "ZodOptional",
|
1435
|
-
ZodNullable = "ZodNullable",
|
1436
|
-
ZodDefault = "ZodDefault",
|
1437
|
-
ZodCatch = "ZodCatch",
|
1438
|
-
ZodPromise = "ZodPromise",
|
1439
|
-
ZodBranded = "ZodBranded",
|
1440
|
-
ZodPipeline = "ZodPipeline",
|
1441
|
-
ZodReadonly = "ZodReadonly"
|
1442
|
-
}
|
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;
|
1444
|
-
declare abstract class Class {
|
1445
|
-
constructor(..._: any[]);
|
1446
|
-
}
|
1447
|
-
declare const instanceOfType: <T extends typeof Class>(cls: T, params?: CustomParams) => ZodType<InstanceType<T>, ZodTypeDef, InstanceType<T>>;
|
1448
|
-
declare const stringType: (params?: RawCreateParams & {
|
1449
|
-
coerce?: true;
|
1450
|
-
}) => ZodString;
|
1451
|
-
declare const numberType: (params?: RawCreateParams & {
|
1452
|
-
coerce?: boolean;
|
1453
|
-
}) => ZodNumber;
|
1454
|
-
declare const nanType: (params?: RawCreateParams) => ZodNaN;
|
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;
|
1464
|
-
declare const symbolType: (params?: RawCreateParams) => ZodSymbol;
|
1465
|
-
declare const undefinedType: (params?: RawCreateParams) => ZodUndefined;
|
1466
|
-
declare const nullType: (params?: RawCreateParams) => ZodNull;
|
1467
|
-
declare const anyType: (params?: RawCreateParams) => ZodAny;
|
1468
|
-
declare const unknownType: (params?: RawCreateParams) => ZodUnknown;
|
1469
|
-
declare const neverType: (params?: RawCreateParams) => ZodNever;
|
1470
|
-
declare const voidType: (params?: RawCreateParams) => ZodVoid;
|
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">;
|
1474
|
-
declare const unionType: <T extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T, params?: RawCreateParams) => ZodUnion<T>;
|
1475
|
-
declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create;
|
1476
|
-
declare const intersectionType: <T extends ZodTypeAny, U extends ZodTypeAny>(left: T, right: U, params?: RawCreateParams) => ZodIntersection<T, U>;
|
1477
|
-
declare const tupleType: <T extends [] | [ZodTypeAny, ...ZodTypeAny[]]>(schemas: T, params?: RawCreateParams) => ZodTuple<T, null>;
|
1478
|
-
declare const recordType: typeof ZodRecord.create;
|
1479
|
-
declare const mapType: <Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny>(keyType: Key, valueType: Value, params?: RawCreateParams) => ZodMap<Key, Value>;
|
1480
|
-
declare const setType: <Value extends ZodTypeAny = ZodTypeAny>(valueType: Value, params?: RawCreateParams) => ZodSet<Value>;
|
1481
|
-
declare const functionType: typeof ZodFunction.create;
|
1482
|
-
declare const lazyType: <T extends ZodTypeAny>(getter: () => T, params?: RawCreateParams) => ZodLazy<T>;
|
1483
|
-
declare const literalType: <T extends Primitive>(value: T, params?: RawCreateParams) => ZodLiteral<T>;
|
1484
|
-
declare const enumType: typeof createZodEnum;
|
1485
|
-
declare const nativeEnumType: <T extends EnumLike>(values: T, params?: RawCreateParams) => ZodNativeEnum<T>;
|
1486
|
-
declare const promiseType: <T extends ZodTypeAny>(schema: T, params?: RawCreateParams) => ZodPromise<T>;
|
1487
|
-
declare const effectsType: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
1488
|
-
declare const optionalType: <T extends ZodTypeAny>(type: T, params?: RawCreateParams) => ZodOptional<T>;
|
1489
|
-
declare const nullableType: <T extends ZodTypeAny>(type: T, params?: RawCreateParams) => ZodNullable<T>;
|
1490
|
-
declare const preprocessType: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
1491
|
-
declare const pipelineType: typeof ZodPipeline.create;
|
1492
|
-
declare const ostring: () => ZodOptional<ZodString>;
|
1493
|
-
declare const onumber: () => ZodOptional<ZodNumber>;
|
1494
|
-
declare const oboolean: () => ZodOptional<ZodBoolean>;
|
1495
|
-
declare const coerce: {
|
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;
|
1511
|
-
};
|
1512
|
-
|
1513
|
-
declare const NEVER: never;
|
1514
|
-
|
1515
|
-
type z_AnyZodObject = AnyZodObject;
|
1516
|
-
type z_AnyZodTuple = AnyZodTuple;
|
1517
|
-
type z_ArrayCardinality = ArrayCardinality;
|
1518
|
-
type z_ArrayKeys = ArrayKeys;
|
1519
|
-
type z_AssertArray<T> = AssertArray<T>;
|
1520
|
-
type z_AsyncParseReturnType<T> = AsyncParseReturnType<T>;
|
1521
|
-
type z_BRAND<T extends string | number | symbol> = BRAND<T>;
|
1522
|
-
type z_CatchallInput<T extends ZodType> = CatchallInput<T>;
|
1523
|
-
type z_CatchallOutput<T extends ZodType> = CatchallOutput<T>;
|
1524
|
-
type z_CustomErrorParams = CustomErrorParams;
|
1525
|
-
declare const z_DIRTY: typeof DIRTY;
|
1526
|
-
type z_DenormalizedError = DenormalizedError;
|
1527
|
-
declare const z_EMPTY_PATH: typeof EMPTY_PATH;
|
1528
|
-
type z_Effect<T> = Effect<T>;
|
1529
|
-
type z_EnumLike = EnumLike;
|
1530
|
-
type z_EnumValues<T extends string = string> = EnumValues<T>;
|
1531
|
-
type z_ErrorMapCtx = ErrorMapCtx;
|
1532
|
-
type z_FilterEnum<Values, ToExclude> = FilterEnum<Values, ToExclude>;
|
1533
|
-
declare const z_INVALID: typeof INVALID;
|
1534
|
-
type z_Indices<T> = Indices<T>;
|
1535
|
-
type z_InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = InnerTypeOfFunction<Args, Returns>;
|
1536
|
-
type z_InputTypeOfTuple<T extends ZodTupleItems | []> = InputTypeOfTuple<T>;
|
1537
|
-
type z_InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = InputTypeOfTupleWithRest<T, Rest>;
|
1538
|
-
type z_IpVersion = IpVersion;
|
1539
|
-
type z_IssueData = IssueData;
|
1540
|
-
type z_KeySchema = KeySchema;
|
1541
|
-
declare const z_NEVER: typeof NEVER;
|
1542
|
-
declare const z_OK: typeof OK;
|
1543
|
-
type z_ObjectPair = ObjectPair;
|
1544
|
-
type z_OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = OuterTypeOfFunction<Args, Returns>;
|
1545
|
-
type z_OutputTypeOfTuple<T extends ZodTupleItems | []> = OutputTypeOfTuple<T>;
|
1546
|
-
type z_OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = OutputTypeOfTupleWithRest<T, Rest>;
|
1547
|
-
type z_ParseContext = ParseContext;
|
1548
|
-
type z_ParseInput = ParseInput;
|
1549
|
-
type z_ParseParams = ParseParams;
|
1550
|
-
type z_ParsePath = ParsePath;
|
1551
|
-
type z_ParsePathComponent = ParsePathComponent;
|
1552
|
-
type z_ParseResult = ParseResult;
|
1553
|
-
type z_ParseReturnType<T> = ParseReturnType<T>;
|
1554
|
-
type z_ParseStatus = ParseStatus;
|
1555
|
-
declare const z_ParseStatus: typeof ParseStatus;
|
1556
|
-
type z_PassthroughType<T extends UnknownKeysParam> = PassthroughType<T>;
|
1557
|
-
type z_PreprocessEffect<T> = PreprocessEffect<T>;
|
1558
|
-
type z_Primitive = Primitive;
|
1559
|
-
type z_ProcessedCreateParams = ProcessedCreateParams;
|
1560
|
-
type z_RawCreateParams = RawCreateParams;
|
1561
|
-
type z_RecordType<K extends string | number | symbol, V> = RecordType<K, V>;
|
1562
|
-
type z_Refinement<T> = Refinement<T>;
|
1563
|
-
type z_RefinementCtx = RefinementCtx;
|
1564
|
-
type z_RefinementEffect<T> = RefinementEffect<T>;
|
1565
|
-
type z_SafeParseError<Input> = SafeParseError<Input>;
|
1566
|
-
type z_SafeParseReturnType<Input, Output> = SafeParseReturnType<Input, Output>;
|
1567
|
-
type z_SafeParseSuccess<Output> = SafeParseSuccess<Output>;
|
1568
|
-
type z_Scalars = Scalars;
|
1569
|
-
type z_SomeZodObject = SomeZodObject;
|
1570
|
-
type z_StringValidation = StringValidation;
|
1571
|
-
type z_SuperRefinement<T> = SuperRefinement<T>;
|
1572
|
-
type z_SyncParseReturnType<T = any> = SyncParseReturnType<T>;
|
1573
|
-
type z_TransformEffect<T> = TransformEffect<T>;
|
1574
|
-
type z_TypeOf<T extends ZodType<any, any, any>> = TypeOf<T>;
|
1575
|
-
type z_UnknownKeysParam = UnknownKeysParam;
|
1576
|
-
type z_Values<T extends EnumValues> = Values<T>;
|
1577
|
-
type z_Writeable<T> = Writeable<T>;
|
1578
|
-
type z_ZodAny = ZodAny;
|
1579
|
-
declare const z_ZodAny: typeof ZodAny;
|
1580
|
-
type z_ZodAnyDef = ZodAnyDef;
|
1581
|
-
type z_ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = ZodArray<T, Cardinality>;
|
1582
|
-
declare const z_ZodArray: typeof ZodArray;
|
1583
|
-
type z_ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> = ZodArrayDef<T>;
|
1584
|
-
type z_ZodBigInt = ZodBigInt;
|
1585
|
-
declare const z_ZodBigInt: typeof ZodBigInt;
|
1586
|
-
type z_ZodBigIntCheck = ZodBigIntCheck;
|
1587
|
-
type z_ZodBigIntDef = ZodBigIntDef;
|
1588
|
-
type z_ZodBoolean = ZodBoolean;
|
1589
|
-
declare const z_ZodBoolean: typeof ZodBoolean;
|
1590
|
-
type z_ZodBooleanDef = ZodBooleanDef;
|
1591
|
-
type z_ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> = ZodBranded<T, B>;
|
1592
|
-
declare const z_ZodBranded: typeof ZodBranded;
|
1593
|
-
type z_ZodBrandedDef<T extends ZodTypeAny> = ZodBrandedDef<T>;
|
1594
|
-
type z_ZodCatch<T extends ZodTypeAny> = ZodCatch<T>;
|
1595
|
-
declare const z_ZodCatch: typeof ZodCatch;
|
1596
|
-
type z_ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> = ZodCatchDef<T>;
|
1597
|
-
type z_ZodCustomIssue = ZodCustomIssue;
|
1598
|
-
type z_ZodDate = ZodDate;
|
1599
|
-
declare const z_ZodDate: typeof ZodDate;
|
1600
|
-
type z_ZodDateCheck = ZodDateCheck;
|
1601
|
-
type z_ZodDateDef = ZodDateDef;
|
1602
|
-
type z_ZodDefault<T extends ZodTypeAny> = ZodDefault<T>;
|
1603
|
-
declare const z_ZodDefault: typeof ZodDefault;
|
1604
|
-
type z_ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> = ZodDefaultDef<T>;
|
1605
|
-
type z_ZodDiscriminatedUnion<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<Discriminator>[]> = ZodDiscriminatedUnion<Discriminator, Options>;
|
1606
|
-
declare const z_ZodDiscriminatedUnion: typeof ZodDiscriminatedUnion;
|
1607
|
-
type z_ZodDiscriminatedUnionDef<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> = ZodDiscriminatedUnionDef<Discriminator, Options>;
|
1608
|
-
type z_ZodDiscriminatedUnionOption<Discriminator extends string> = ZodDiscriminatedUnionOption<Discriminator>;
|
1609
|
-
type z_ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> = ZodEffects<T, Output, Input>;
|
1610
|
-
declare const z_ZodEffects: typeof ZodEffects;
|
1611
|
-
type z_ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> = ZodEffectsDef<T>;
|
1612
|
-
type z_ZodEnum<T extends [string, ...string[]]> = ZodEnum<T>;
|
1613
|
-
declare const z_ZodEnum: typeof ZodEnum;
|
1614
|
-
type z_ZodEnumDef<T extends EnumValues = EnumValues> = ZodEnumDef<T>;
|
1615
|
-
type z_ZodError<T = any> = ZodError<T>;
|
1616
|
-
declare const z_ZodError: typeof ZodError;
|
1617
|
-
type z_ZodErrorMap = ZodErrorMap;
|
1618
|
-
type z_ZodFirstPartySchemaTypes = ZodFirstPartySchemaTypes;
|
1619
|
-
type z_ZodFirstPartyTypeKind = ZodFirstPartyTypeKind;
|
1620
|
-
declare const z_ZodFirstPartyTypeKind: typeof ZodFirstPartyTypeKind;
|
1621
|
-
type z_ZodFormattedError<T, U = string> = ZodFormattedError<T, U>;
|
1622
|
-
type z_ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = ZodFunction<Args, Returns>;
|
1623
|
-
declare const z_ZodFunction: typeof ZodFunction;
|
1624
|
-
type z_ZodFunctionDef<Args extends ZodTuple<any, any> = ZodTuple<any, any>, Returns extends ZodTypeAny = ZodTypeAny> = ZodFunctionDef<Args, Returns>;
|
1625
|
-
type z_ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> = ZodIntersection<T, U>;
|
1626
|
-
declare const z_ZodIntersection: typeof ZodIntersection;
|
1627
|
-
type z_ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> = ZodIntersectionDef<T, U>;
|
1628
|
-
type z_ZodInvalidArgumentsIssue = ZodInvalidArgumentsIssue;
|
1629
|
-
type z_ZodInvalidDateIssue = ZodInvalidDateIssue;
|
1630
|
-
type z_ZodInvalidEnumValueIssue = ZodInvalidEnumValueIssue;
|
1631
|
-
type z_ZodInvalidIntersectionTypesIssue = ZodInvalidIntersectionTypesIssue;
|
1632
|
-
type z_ZodInvalidLiteralIssue = ZodInvalidLiteralIssue;
|
1633
|
-
type z_ZodInvalidReturnTypeIssue = ZodInvalidReturnTypeIssue;
|
1634
|
-
type z_ZodInvalidStringIssue = ZodInvalidStringIssue;
|
1635
|
-
type z_ZodInvalidTypeIssue = ZodInvalidTypeIssue;
|
1636
|
-
type z_ZodInvalidUnionDiscriminatorIssue = ZodInvalidUnionDiscriminatorIssue;
|
1637
|
-
type z_ZodInvalidUnionIssue = ZodInvalidUnionIssue;
|
1638
|
-
type z_ZodIssue = ZodIssue;
|
1639
|
-
type z_ZodIssueBase = ZodIssueBase;
|
1640
|
-
type z_ZodIssueCode = ZodIssueCode;
|
1641
|
-
type z_ZodIssueOptionalMessage = ZodIssueOptionalMessage;
|
1642
|
-
type z_ZodLazy<T extends ZodTypeAny> = ZodLazy<T>;
|
1643
|
-
declare const z_ZodLazy: typeof ZodLazy;
|
1644
|
-
type z_ZodLazyDef<T extends ZodTypeAny = ZodTypeAny> = ZodLazyDef<T>;
|
1645
|
-
type z_ZodLiteral<T> = ZodLiteral<T>;
|
1646
|
-
declare const z_ZodLiteral: typeof ZodLiteral;
|
1647
|
-
type z_ZodLiteralDef<T = any> = ZodLiteralDef<T>;
|
1648
|
-
type z_ZodMap<Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny> = ZodMap<Key, Value>;
|
1649
|
-
declare const z_ZodMap: typeof ZodMap;
|
1650
|
-
type z_ZodMapDef<Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny> = ZodMapDef<Key, Value>;
|
1651
|
-
type z_ZodNaN = ZodNaN;
|
1652
|
-
declare const z_ZodNaN: typeof ZodNaN;
|
1653
|
-
type z_ZodNaNDef = ZodNaNDef;
|
1654
|
-
type z_ZodNativeEnum<T extends EnumLike> = ZodNativeEnum<T>;
|
1655
|
-
declare const z_ZodNativeEnum: typeof ZodNativeEnum;
|
1656
|
-
type z_ZodNativeEnumDef<T extends EnumLike = EnumLike> = ZodNativeEnumDef<T>;
|
1657
|
-
type z_ZodNever = ZodNever;
|
1658
|
-
declare const z_ZodNever: typeof ZodNever;
|
1659
|
-
type z_ZodNeverDef = ZodNeverDef;
|
1660
|
-
type z_ZodNonEmptyArray<T extends ZodTypeAny> = ZodNonEmptyArray<T>;
|
1661
|
-
type z_ZodNotFiniteIssue = ZodNotFiniteIssue;
|
1662
|
-
type z_ZodNotMultipleOfIssue = ZodNotMultipleOfIssue;
|
1663
|
-
type z_ZodNull = ZodNull;
|
1664
|
-
declare const z_ZodNull: typeof ZodNull;
|
1665
|
-
type z_ZodNullDef = ZodNullDef;
|
1666
|
-
type z_ZodNullable<T extends ZodTypeAny> = ZodNullable<T>;
|
1667
|
-
declare const z_ZodNullable: typeof ZodNullable;
|
1668
|
-
type z_ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> = ZodNullableDef<T>;
|
1669
|
-
type z_ZodNullableType<T extends ZodTypeAny> = ZodNullableType<T>;
|
1670
|
-
type z_ZodNumber = ZodNumber;
|
1671
|
-
declare const z_ZodNumber: typeof ZodNumber;
|
1672
|
-
type z_ZodNumberCheck = ZodNumberCheck;
|
1673
|
-
type z_ZodNumberDef = ZodNumberDef;
|
1674
|
-
type z_ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall, UnknownKeys>, Input = objectInputType<T, Catchall, UnknownKeys>> = ZodObject<T, UnknownKeys, Catchall, Output, Input>;
|
1675
|
-
declare const z_ZodObject: typeof ZodObject;
|
1676
|
-
type z_ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> = ZodObjectDef<T, UnknownKeys, Catchall>;
|
1677
|
-
type z_ZodOptional<T extends ZodTypeAny> = ZodOptional<T>;
|
1678
|
-
declare const z_ZodOptional: typeof ZodOptional;
|
1679
|
-
type z_ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> = ZodOptionalDef<T>;
|
1680
|
-
type z_ZodOptionalType<T extends ZodTypeAny> = ZodOptionalType<T>;
|
1681
|
-
type z_ZodParsedType = ZodParsedType;
|
1682
|
-
type z_ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> = ZodPipeline<A, B>;
|
1683
|
-
declare const z_ZodPipeline: typeof ZodPipeline;
|
1684
|
-
type z_ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> = ZodPipelineDef<A, B>;
|
1685
|
-
type z_ZodPromise<T extends ZodTypeAny> = ZodPromise<T>;
|
1686
|
-
declare const z_ZodPromise: typeof ZodPromise;
|
1687
|
-
type z_ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> = ZodPromiseDef<T>;
|
1688
|
-
type z_ZodRawShape = ZodRawShape;
|
1689
|
-
type z_ZodReadonly<T extends ZodTypeAny> = ZodReadonly<T>;
|
1690
|
-
declare const z_ZodReadonly: typeof ZodReadonly;
|
1691
|
-
type z_ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> = ZodReadonlyDef<T>;
|
1692
|
-
type z_ZodRecord<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> = ZodRecord<Key, Value>;
|
1693
|
-
declare const z_ZodRecord: typeof ZodRecord;
|
1694
|
-
type z_ZodRecordDef<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> = ZodRecordDef<Key, Value>;
|
1695
|
-
type z_ZodSet<Value extends ZodTypeAny = ZodTypeAny> = ZodSet<Value>;
|
1696
|
-
declare const z_ZodSet: typeof ZodSet;
|
1697
|
-
type z_ZodSetDef<Value extends ZodTypeAny = ZodTypeAny> = ZodSetDef<Value>;
|
1698
|
-
type z_ZodString = ZodString;
|
1699
|
-
declare const z_ZodString: typeof ZodString;
|
1700
|
-
type z_ZodStringCheck = ZodStringCheck;
|
1701
|
-
type z_ZodStringDef = ZodStringDef;
|
1702
|
-
type z_ZodSymbol = ZodSymbol;
|
1703
|
-
declare const z_ZodSymbol: typeof ZodSymbol;
|
1704
|
-
type z_ZodSymbolDef = ZodSymbolDef;
|
1705
|
-
type z_ZodTooBigIssue = ZodTooBigIssue;
|
1706
|
-
type z_ZodTooSmallIssue = ZodTooSmallIssue;
|
1707
|
-
type z_ZodTuple<T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]], Rest extends ZodTypeAny | null = null> = ZodTuple<T, Rest>;
|
1708
|
-
declare const z_ZodTuple: typeof ZodTuple;
|
1709
|
-
type z_ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> = ZodTupleDef<T, Rest>;
|
1710
|
-
type z_ZodTupleItems = ZodTupleItems;
|
1711
|
-
type z_ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> = ZodType<Output, Def, Input>;
|
1712
|
-
declare const z_ZodType: typeof ZodType;
|
1713
|
-
type z_ZodTypeAny = ZodTypeAny;
|
1714
|
-
type z_ZodTypeDef = ZodTypeDef;
|
1715
|
-
type z_ZodUndefined = ZodUndefined;
|
1716
|
-
declare const z_ZodUndefined: typeof ZodUndefined;
|
1717
|
-
type z_ZodUndefinedDef = ZodUndefinedDef;
|
1718
|
-
type z_ZodUnion<T extends ZodUnionOptions> = ZodUnion<T>;
|
1719
|
-
declare const z_ZodUnion: typeof ZodUnion;
|
1720
|
-
type z_ZodUnionDef<T extends ZodUnionOptions = Readonly<[
|
1721
|
-
ZodTypeAny,
|
1722
|
-
ZodTypeAny,
|
1723
|
-
...ZodTypeAny[]
|
1724
|
-
]>> = ZodUnionDef<T>;
|
1725
|
-
type z_ZodUnionOptions = ZodUnionOptions;
|
1726
|
-
type z_ZodUnknown = ZodUnknown;
|
1727
|
-
declare const z_ZodUnknown: typeof ZodUnknown;
|
1728
|
-
type z_ZodUnknownDef = ZodUnknownDef;
|
1729
|
-
type z_ZodUnrecognizedKeysIssue = ZodUnrecognizedKeysIssue;
|
1730
|
-
type z_ZodVoid = ZodVoid;
|
1731
|
-
declare const z_ZodVoid: typeof ZodVoid;
|
1732
|
-
type z_ZodVoidDef = ZodVoidDef;
|
1733
|
-
declare const z_addIssueToContext: typeof addIssueToContext;
|
1734
|
-
type z_arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = arrayOutputType<T, Cardinality>;
|
1735
|
-
type z_baseObjectInputType<Shape extends ZodRawShape> = baseObjectInputType<Shape>;
|
1736
|
-
type z_baseObjectOutputType<Shape extends ZodRawShape> = baseObjectOutputType<Shape>;
|
1737
|
-
declare const z_coerce: typeof coerce;
|
1738
|
-
declare const z_custom: typeof custom;
|
1739
|
-
declare const z_datetimeRegex: typeof datetimeRegex;
|
1740
|
-
type z_deoptional<T extends ZodTypeAny> = deoptional<T>;
|
1741
|
-
declare const z_getErrorMap: typeof getErrorMap;
|
1742
|
-
declare const z_getParsedType: typeof getParsedType;
|
1743
|
-
type z_inferFlattenedErrors<T extends ZodType<any, any, any>, U = string> = inferFlattenedErrors<T, U>;
|
1744
|
-
type z_inferFormattedError<T extends ZodType<any, any, any>, U = string> = inferFormattedError<T, U>;
|
1745
|
-
type z_input<T extends ZodType<any, any, any>> = input<T>;
|
1746
|
-
declare const z_isAborted: typeof isAborted;
|
1747
|
-
declare const z_isAsync: typeof isAsync;
|
1748
|
-
declare const z_isDirty: typeof isDirty;
|
1749
|
-
declare const z_isValid: typeof isValid;
|
1750
|
-
declare const z_late: typeof late;
|
1751
|
-
declare const z_makeIssue: typeof makeIssue;
|
1752
|
-
type z_mergeTypes<A, B> = mergeTypes<A, B>;
|
1753
|
-
type z_noUnrecognized<Obj extends object, Shape extends object> = noUnrecognized<Obj, Shape>;
|
1754
|
-
type z_objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectInputType<Shape, Catchall, UnknownKeys>;
|
1755
|
-
type z_objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectOutputType<Shape, Catchall, UnknownKeys>;
|
1756
|
-
import z_objectUtil = objectUtil;
|
1757
|
-
declare const z_oboolean: typeof oboolean;
|
1758
|
-
declare const z_onumber: typeof onumber;
|
1759
|
-
declare const z_ostring: typeof ostring;
|
1760
|
-
type z_output<T extends ZodType<any, any, any>> = output<T>;
|
1761
|
-
declare const z_quotelessJson: typeof quotelessJson;
|
1762
|
-
declare const z_setErrorMap: typeof setErrorMap;
|
1763
|
-
type z_typeToFlattenedError<T, U = string> = typeToFlattenedError<T, U>;
|
1764
|
-
type z_typecast<A, T> = typecast<A, T>;
|
1765
|
-
import z_util = util;
|
1766
|
-
declare namespace z {
|
1767
|
-
export { z_DIRTY as DIRTY, z_EMPTY_PATH as EMPTY_PATH, z_INVALID as INVALID, z_NEVER as NEVER, z_OK as OK, z_ParseStatus as ParseStatus, ZodType as Schema, z_ZodAny as ZodAny, z_ZodArray as ZodArray, z_ZodBigInt as ZodBigInt, z_ZodBoolean as ZodBoolean, z_ZodBranded as ZodBranded, z_ZodCatch as ZodCatch, z_ZodDate as ZodDate, z_ZodDefault as ZodDefault, z_ZodDiscriminatedUnion as ZodDiscriminatedUnion, z_ZodEffects as ZodEffects, z_ZodEnum as ZodEnum, z_ZodError as ZodError, z_ZodFirstPartyTypeKind as ZodFirstPartyTypeKind, z_ZodFunction as ZodFunction, z_ZodIntersection as ZodIntersection, z_ZodLazy as ZodLazy, z_ZodLiteral as ZodLiteral, z_ZodMap as ZodMap, z_ZodNaN as ZodNaN, z_ZodNativeEnum as ZodNativeEnum, z_ZodNever as ZodNever, z_ZodNull as ZodNull, z_ZodNullable as ZodNullable, z_ZodNumber as ZodNumber, z_ZodObject as ZodObject, z_ZodOptional as ZodOptional, z_ZodPipeline as ZodPipeline, z_ZodPromise as ZodPromise, z_ZodReadonly as ZodReadonly, z_ZodRecord as ZodRecord, ZodType as ZodSchema, z_ZodSet as ZodSet, z_ZodString as ZodString, z_ZodSymbol as ZodSymbol, ZodEffects as ZodTransformer, z_ZodTuple as ZodTuple, z_ZodType as ZodType, z_ZodUndefined as ZodUndefined, z_ZodUnion as ZodUnion, z_ZodUnknown as ZodUnknown, z_ZodVoid as ZodVoid, z_addIssueToContext as addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, z_coerce as coerce, z_custom as custom, dateType as date, z_datetimeRegex as datetimeRegex, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, z_getErrorMap as getErrorMap, z_getParsedType as getParsedType, instanceOfType as instanceof, intersectionType as intersection, z_isAborted as isAborted, z_isAsync as isAsync, z_isDirty as isDirty, z_isValid as isValid, z_late as late, lazyType as lazy, literalType as literal, z_makeIssue as makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, z_objectUtil as objectUtil, z_oboolean as oboolean, z_onumber as onumber, optionalType as optional, z_ostring as ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, z_quotelessJson as quotelessJson, recordType as record, setType as set, z_setErrorMap as setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, z_util as util, voidType as void };
|
1768
|
-
export type { z_AnyZodObject as AnyZodObject, z_AnyZodTuple as AnyZodTuple, z_ArrayCardinality as ArrayCardinality, z_ArrayKeys as ArrayKeys, z_AssertArray as AssertArray, z_AsyncParseReturnType as AsyncParseReturnType, z_BRAND as BRAND, z_CatchallInput as CatchallInput, z_CatchallOutput as CatchallOutput, z_CustomErrorParams as CustomErrorParams, z_DenormalizedError as DenormalizedError, z_Effect as Effect, z_EnumLike as EnumLike, z_EnumValues as EnumValues, z_ErrorMapCtx as ErrorMapCtx, z_FilterEnum as FilterEnum, z_Indices as Indices, z_InnerTypeOfFunction as InnerTypeOfFunction, z_InputTypeOfTuple as InputTypeOfTuple, z_InputTypeOfTupleWithRest as InputTypeOfTupleWithRest, z_IpVersion as IpVersion, z_IssueData as IssueData, z_KeySchema as KeySchema, z_ObjectPair as ObjectPair, z_OuterTypeOfFunction as OuterTypeOfFunction, z_OutputTypeOfTuple as OutputTypeOfTuple, z_OutputTypeOfTupleWithRest as OutputTypeOfTupleWithRest, z_ParseContext as ParseContext, z_ParseInput as ParseInput, z_ParseParams as ParseParams, z_ParsePath as ParsePath, z_ParsePathComponent as ParsePathComponent, z_ParseResult as ParseResult, z_ParseReturnType as ParseReturnType, z_PassthroughType as PassthroughType, z_PreprocessEffect as PreprocessEffect, z_Primitive as Primitive, z_ProcessedCreateParams as ProcessedCreateParams, z_RawCreateParams as RawCreateParams, z_RecordType as RecordType, z_Refinement as Refinement, z_RefinementCtx as RefinementCtx, z_RefinementEffect as RefinementEffect, z_SafeParseError as SafeParseError, z_SafeParseReturnType as SafeParseReturnType, z_SafeParseSuccess as SafeParseSuccess, z_Scalars as Scalars, z_SomeZodObject as SomeZodObject, z_StringValidation as StringValidation, z_SuperRefinement as SuperRefinement, z_SyncParseReturnType as SyncParseReturnType, z_TransformEffect as TransformEffect, z_TypeOf as TypeOf, z_UnknownKeysParam as UnknownKeysParam, z_Values as Values, z_Writeable as Writeable, z_ZodAnyDef as ZodAnyDef, z_ZodArrayDef as ZodArrayDef, z_ZodBigIntCheck as ZodBigIntCheck, z_ZodBigIntDef as ZodBigIntDef, z_ZodBooleanDef as ZodBooleanDef, z_ZodBrandedDef as ZodBrandedDef, z_ZodCatchDef as ZodCatchDef, z_ZodCustomIssue as ZodCustomIssue, z_ZodDateCheck as ZodDateCheck, z_ZodDateDef as ZodDateDef, z_ZodDefaultDef as ZodDefaultDef, z_ZodDiscriminatedUnionDef as ZodDiscriminatedUnionDef, z_ZodDiscriminatedUnionOption as ZodDiscriminatedUnionOption, z_ZodEffectsDef as ZodEffectsDef, z_ZodEnumDef as ZodEnumDef, z_ZodErrorMap as ZodErrorMap, z_ZodFirstPartySchemaTypes as ZodFirstPartySchemaTypes, z_ZodFormattedError as ZodFormattedError, z_ZodFunctionDef as ZodFunctionDef, z_ZodIntersectionDef as ZodIntersectionDef, z_ZodInvalidArgumentsIssue as ZodInvalidArgumentsIssue, z_ZodInvalidDateIssue as ZodInvalidDateIssue, z_ZodInvalidEnumValueIssue as ZodInvalidEnumValueIssue, z_ZodInvalidIntersectionTypesIssue as ZodInvalidIntersectionTypesIssue, z_ZodInvalidLiteralIssue as ZodInvalidLiteralIssue, z_ZodInvalidReturnTypeIssue as ZodInvalidReturnTypeIssue, z_ZodInvalidStringIssue as ZodInvalidStringIssue, z_ZodInvalidTypeIssue as ZodInvalidTypeIssue, z_ZodInvalidUnionDiscriminatorIssue as ZodInvalidUnionDiscriminatorIssue, z_ZodInvalidUnionIssue as ZodInvalidUnionIssue, z_ZodIssue as ZodIssue, z_ZodIssueBase as ZodIssueBase, z_ZodIssueCode as ZodIssueCode, z_ZodIssueOptionalMessage as ZodIssueOptionalMessage, z_ZodLazyDef as ZodLazyDef, z_ZodLiteralDef as ZodLiteralDef, z_ZodMapDef as ZodMapDef, z_ZodNaNDef as ZodNaNDef, z_ZodNativeEnumDef as ZodNativeEnumDef, z_ZodNeverDef as ZodNeverDef, z_ZodNonEmptyArray as ZodNonEmptyArray, z_ZodNotFiniteIssue as ZodNotFiniteIssue, z_ZodNotMultipleOfIssue as ZodNotMultipleOfIssue, z_ZodNullDef as ZodNullDef, z_ZodNullableDef as ZodNullableDef, z_ZodNullableType as ZodNullableType, z_ZodNumberCheck as ZodNumberCheck, z_ZodNumberDef as ZodNumberDef, z_ZodObjectDef as ZodObjectDef, z_ZodOptionalDef as ZodOptionalDef, z_ZodOptionalType as ZodOptionalType, z_ZodParsedType as ZodParsedType, z_ZodPipelineDef as ZodPipelineDef, z_ZodPromiseDef as ZodPromiseDef, z_ZodRawShape as ZodRawShape, z_ZodReadonlyDef as ZodReadonlyDef, z_ZodRecordDef as ZodRecordDef, z_ZodSetDef as ZodSetDef, z_ZodStringCheck as ZodStringCheck, z_ZodStringDef as ZodStringDef, z_ZodSymbolDef as ZodSymbolDef, z_ZodTooBigIssue as ZodTooBigIssue, z_ZodTooSmallIssue as ZodTooSmallIssue, z_ZodTupleDef as ZodTupleDef, z_ZodTupleItems as ZodTupleItems, z_ZodTypeAny as ZodTypeAny, z_ZodTypeDef as ZodTypeDef, z_ZodUndefinedDef as ZodUndefinedDef, z_ZodUnionDef as ZodUnionDef, z_ZodUnionOptions as ZodUnionOptions, z_ZodUnknownDef as ZodUnknownDef, z_ZodUnrecognizedKeysIssue as ZodUnrecognizedKeysIssue, z_ZodVoidDef as ZodVoidDef, z_arrayOutputType as arrayOutputType, z_baseObjectInputType as baseObjectInputType, z_baseObjectOutputType as baseObjectOutputType, z_deoptional as deoptional, TypeOf as infer, z_inferFlattenedErrors as inferFlattenedErrors, z_inferFormattedError as inferFormattedError, z_input as input, z_mergeTypes as mergeTypes, z_noUnrecognized as noUnrecognized, z_objectInputType as objectInputType, z_objectOutputType as objectOutputType, z_output as output, z_typeToFlattenedError as typeToFlattenedError, z_typecast as typecast };
|
1769
|
-
}
|
1770
|
-
|
1771
|
-
export { BRAND, DIRTY, EMPTY_PATH, INVALID, NEVER, OK, ParseStatus, ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodError, ZodFirstPartyTypeKind, ZodFunction, ZodIntersection, ZodIssueCode, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodParsedType, ZodPipeline, ZodPromise, ZodReadonly, ZodRecord, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, datetimeRegex, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, getErrorMap, getParsedType, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setType as set, setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void, z };
|
1772
|
-
export type { AnyZodObject, AnyZodTuple, ArrayCardinality, ArrayKeys, AssertArray, AsyncParseReturnType, CatchallInput, CatchallOutput, CustomErrorParams, DenormalizedError, Effect, EnumLike, EnumValues, ErrorMapCtx, FilterEnum, Indices, InnerTypeOfFunction, InputTypeOfTuple, InputTypeOfTupleWithRest, IpVersion, IssueData, KeySchema, ObjectPair, OuterTypeOfFunction, OutputTypeOfTuple, OutputTypeOfTupleWithRest, ParseContext, ParseInput, ParseParams, ParsePath, ParsePathComponent, ParseResult, ParseReturnType, PassthroughType, PreprocessEffect, Primitive, ProcessedCreateParams, RawCreateParams, RecordType, Refinement, RefinementCtx, RefinementEffect, SafeParseError, SafeParseReturnType, SafeParseSuccess, Scalars, SomeZodObject, StringValidation, SuperRefinement, SyncParseReturnType, TransformEffect, TypeOf, UnknownKeysParam, Values, Writeable, ZodAnyDef, ZodArrayDef, ZodBigIntCheck, ZodBigIntDef, ZodBooleanDef, ZodBrandedDef, ZodCatchDef, ZodCustomIssue, ZodDateCheck, ZodDateDef, ZodDefaultDef, ZodDiscriminatedUnionDef, ZodDiscriminatedUnionOption, ZodEffectsDef, ZodEnumDef, ZodErrorMap, ZodFirstPartySchemaTypes, ZodFormattedError, ZodFunctionDef, ZodIntersectionDef, ZodInvalidArgumentsIssue, ZodInvalidDateIssue, ZodInvalidEnumValueIssue, ZodInvalidIntersectionTypesIssue, ZodInvalidLiteralIssue, ZodInvalidReturnTypeIssue, ZodInvalidStringIssue, ZodInvalidTypeIssue, ZodInvalidUnionDiscriminatorIssue, ZodInvalidUnionIssue, ZodIssue, ZodIssueBase, ZodIssueOptionalMessage, ZodLazyDef, ZodLiteralDef, ZodMapDef, ZodNaNDef, ZodNativeEnumDef, ZodNeverDef, ZodNonEmptyArray, ZodNotFiniteIssue, ZodNotMultipleOfIssue, ZodNullDef, ZodNullableDef, ZodNullableType, ZodNumberCheck, ZodNumberDef, ZodObjectDef, ZodOptionalDef, ZodOptionalType, ZodPipelineDef, ZodPromiseDef, ZodRawShape, ZodReadonlyDef, ZodRecordDef, ZodSetDef, ZodStringCheck, ZodStringDef, ZodSymbolDef, ZodTooBigIssue, ZodTooSmallIssue, ZodTupleDef, ZodTupleItems, ZodTypeAny, ZodTypeDef, ZodUndefinedDef, ZodUnionDef, ZodUnionOptions, ZodUnknownDef, ZodUnrecognizedKeysIssue, ZodVoidDef, arrayOutputType, baseObjectInputType, baseObjectOutputType, deoptional, TypeOf as infer, inferFlattenedErrors, inferFormattedError, input, mergeTypes, noUnrecognized, objectInputType, objectOutputType, output, typeToFlattenedError, typecast };
|
1
|
+
export * from "./lib";
|
2
|
+
export as namespace Zod;
|