@paragrav/rhf-utils 0.76.0 → 0.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1674 @@
1
+ import { i as RhfUtilsFormOptions, r as SafeFieldValues, t as RhfUtilsContext } from "./RhfUtilsContextType-DBOvBnPF.js";
2
+ import React$1 from "react";
3
+ import { ControllerProps, FieldError, FieldPath, UseFormProps, UseFormReturn } from "react-hook-form";
4
+ //#region src/errors/output/types.d.ts
5
+ /**
6
+ * Config object for error output.
7
+ */
8
+ type RhfUtilsErrorsOutputConsoleConfig = {
9
+ type?: 'debug' | 'error';
10
+ message?: string;
11
+ };
12
+ //#endregion
13
+ //#region src/errors/flat/types.d.ts
14
+ /**
15
+ * Flattened field errors object.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * {
20
+ * 'address.street': FieldError
21
+ * }
22
+ * ```
23
+ */
24
+ type FlatFieldErrors = Record<string, FieldError>;
25
+ //#endregion
26
+ //#region src/errors/flat/context/useFlatFieldErrorsContext.d.ts
27
+ type FlatFieldErrorsContext = {
28
+ all: FlatFieldErrors;
29
+ fields: FlatFieldErrors;
30
+ roots: FlatFieldErrors;
31
+ orphans: FlatFieldErrors;
32
+ hasErrors: boolean;
33
+ hasOrphans: boolean;
34
+ };
35
+ declare const _FormErrorsFlatContextProvider: import("react").Provider<FlatFieldErrorsContext | undefined>, useFlatFieldErrorsContext: () => FlatFieldErrorsContext;
36
+ //#endregion
37
+ //#region src/errors/flat/context/FlatFieldErrorsOutputConfig.d.ts
38
+ type FlatFieldErrorsOutputConfig = {
39
+ /**
40
+ * Configure how/if errors should be outputted to console.
41
+ *
42
+ * Example use cases:
43
+ * - console.debug errors in development environment.
44
+ * - console.error certain errors in production environment.
45
+ */
46
+ console?: (context: FlatFieldErrorsContext) => RhfUtilsErrorsOutputConsoleConfig | null | false | undefined;
47
+ /**
48
+ * Configure how/if errors should be thrown.
49
+ *
50
+ * Example use case:
51
+ * - bring attention to certain errors in development environment.
52
+ */
53
+ throw?: (context: FlatFieldErrorsContext) => true | string | false | undefined;
54
+ };
55
+ //#endregion
56
+ //#region src/form/rhf/UseFormPropsType.d.ts
57
+ type RhfUseFormGlobalProps = Pick<UseFormProps, 'mode' | 'reValidateMode' | 'resetOptions' | 'context' | 'shouldFocusError' | 'shouldUnregister' | 'shouldUseNativeValidation' | 'progressive' | 'criteriaMode' | 'delayError'>;
58
+ type RhfUseFormInstanceProps<TFieldValues extends SafeFieldValues, TTransformedValues extends SafeFieldValues> = Omit<UseFormProps<TFieldValues, unknown, TTransformedValues>, 'defaultValues' | 'resolver'>;
59
+ //#endregion
60
+ //#region src/form/defaults/UseRhfUtilsFormGlobalDefaults.d.ts
61
+ /**
62
+ * Globally-relevant subset of defaults.
63
+ */
64
+ type UseRhfUtilsFormGlobalDefaults = {
65
+ /**
66
+ * Default RHF `useForm` settings.
67
+ *
68
+ * (Exposes only non-local props.)
69
+ */
70
+ rhf?: RhfUseFormGlobalProps;
71
+ /**
72
+ * Global settings and defaults.
73
+ *
74
+ * (Extend this type via `Register` type to inject custom options/functionality via `Children` component.)
75
+ */
76
+ options?: RhfUtilsFormOptions;
77
+ /**
78
+ * Default props for form element.
79
+ */
80
+ form?: Pick<React$1.PropsWithoutRef<React$1.JSX.IntrinsicElements['form']>, 'className' | 'noValidate' | 'role'>;
81
+ };
82
+ //#endregion
83
+ //#region src/submit/error/FormSubmitFieldErrors.d.ts
84
+ /**
85
+ * Field errors structure based on RHF's `FieldErrors`.
86
+ *
87
+ * - Uses {@link SafeFieldValues} instead of more permissive `FieldValues`.
88
+ * - `root.<string>` keys allowed.
89
+ * - `root` is reserved for special use cases.
90
+ * - simplified `ErrorOption` value.
91
+ */
92
+ type FormSubmitFieldErrors<TFieldValues extends SafeFieldValues = SafeFieldValues, TApiValues extends undefined | SafeFieldValues = undefined, TAllValues extends SafeFieldValues = TApiValues extends undefined ? TFieldValues : TFieldValues & TApiValues> = Record<FieldPath<TAllValues> | `root.${string}`, {
93
+ message: string;
94
+ type?: string;
95
+ }>;
96
+ //#endregion
97
+ //#region src/submit/error/FormSubmitError.d.ts
98
+ declare class FormSubmitError<TFieldValues extends SafeFieldValues = SafeFieldValues, TApiValues extends undefined | SafeFieldValues = undefined> extends Error {
99
+ errors: FormSubmitFieldErrors<TFieldValues, TApiValues>;
100
+ constructor(errors: FormSubmitFieldErrors<TFieldValues, TApiValues>, message?: string);
101
+ }
102
+ //#endregion
103
+ //#region src/submit/last/error/LastSubmitErrorType.d.ts
104
+ type LastSubmitError = {
105
+ error: unknown;
106
+ event: React.BaseSyntheticEvent;
107
+ };
108
+ //#endregion
109
+ //#region src/submit/last/status/LastSubmitStatusType.d.ts
110
+ /** Last submit state. */
111
+ type LastSubmitStatus = null | 'submitting' | 'success' | 'error';
112
+ //#endregion
113
+ //#region src/submit/last/context/LastSubmitContextType.d.ts
114
+ type LastSubmitContext = {
115
+ status: {
116
+ ref: React.RefObject<LastSubmitStatus | null>;
117
+ };
118
+ error: {
119
+ /** Last submit error (with event). */
120
+ state: LastSubmitError | undefined;
121
+ set: (error: unknown, event: React.BaseSyntheticEvent) => void;
122
+ reset: () => void;
123
+ };
124
+ };
125
+ type LastSubmitContextRead = {
126
+ statusRef: LastSubmitContext['status']['ref'];
127
+ error: LastSubmitContext['error']['state'];
128
+ };
129
+ //#endregion
130
+ //#region src/submit/UseRhfUtilsFormOnSubmitContextType.d.ts
131
+ /**
132
+ * Props for onSubmit other than `data` and `event`.
133
+ *
134
+ * Consider keeping shape in line with `UseRhfUtilsFormChildrenProps` and `UseRhfUtilsFormReturn`.
135
+ */
136
+ type UseRhfUtilsFormOnSubmitContext<TFieldValues extends SafeFieldValues = SafeFieldValues, TTransformedValues extends SafeFieldValues = TFieldValues, TApiValues extends undefined | SafeFieldValues = undefined> = {
137
+ utils: RhfUtilsContext;
138
+ lastSubmit: LastSubmitContextRead;
139
+ rhf: UseFormReturn<TFieldValues, unknown, TTransformedValues>;
140
+ FormSubmitError: typeof FormSubmitError<TFieldValues, TApiValues>;
141
+ };
142
+ /**
143
+ * Props for onSubmitError other than `error` and `event`.
144
+ */
145
+ type UseRhfUtilsFormOnSubmitErrorContext<TFieldValues extends SafeFieldValues, TTransformedValues extends SafeFieldValues> = {
146
+ utils: RhfUtilsContext;
147
+ lastSubmit: LastSubmitContextRead;
148
+ rhf: UseFormReturn<TFieldValues, unknown, TTransformedValues>;
149
+ errors?: FormSubmitFieldErrors;
150
+ };
151
+ //#endregion
152
+ //#region src/utils/types.d.ts
153
+ type MaybePromise<T> = T | Promise<T>;
154
+ /** Merge {@link C} into {@link B} into {@link A} (last taking highest precedence). */
155
+ type Merge<A, B, C = unknown, D = unknown> = D & Omit<C, keyof D> & Omit<Omit<B, keyof C>, keyof D> & Omit<Omit<Omit<A, keyof B>, keyof C>, keyof D>;
156
+ //#endregion
157
+ //#region src/form/_Controller.d.ts
158
+ type _ControllerProps<TFieldValues extends SafeFieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<ControllerProps<TFieldValues, TName>, 'control'>;
159
+ declare const _Controller: <TFieldValues extends SafeFieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: _ControllerProps<TFieldValues, TName>) => import("react").JSX.Element;
160
+ //#endregion
161
+ //#region src/client/config/RhfUtilsClientConfigUseFormHooksProps.d.ts
162
+ /**
163
+ * RhfUtilsClientConfig's `useFormHooks` props.
164
+ */
165
+ type RhfUtilsClientConfigUseFormHooksProps<TFieldValues extends SafeFieldValues = SafeFieldValues, TTransformedValues extends SafeFieldValues = TFieldValues> = Merge<RhfUtilsContext, {
166
+ lastSubmit: LastSubmitContextRead;
167
+ rhf: UseFormReturn<TFieldValues, unknown, TTransformedValues>;
168
+ }>;
169
+ //#endregion
170
+ //#region src/client/config/RhfUtilsClientConfigFormOutletProps.d.ts
171
+ /**
172
+ * RhfUtilsClientConfig's FormComponent props.
173
+ */
174
+ type RhfUtilsClientConfigFormOutletProps<TFieldValues extends SafeFieldValues = SafeFieldValues, TTransformedValues extends SafeFieldValues = TFieldValues> = Merge<RhfUtilsClientConfigUseFormHooksProps<TFieldValues, TTransformedValues>, {
175
+ /** Form instance children (`RhfUtilsZodForm.Children`) to output amid globally-injected code. */
176
+ Outlet: React.FC;
177
+ /** RHF Controller (SafeFieldValues-typed; no schema at this level). */
178
+ Controller: typeof _Controller<TFieldValues>;
179
+ /** Error class (SafeFieldValues-typed; no schema at this level). */
180
+ FormSubmitError: typeof FormSubmitError<TFieldValues>;
181
+ }>;
182
+ //#endregion
183
+ //#region src/client/config/RhfUtilsClientConfigType.d.ts
184
+ /**
185
+ * Client configuration object.
186
+ *
187
+ * Options under `defaults` can be overridden at form level.
188
+ */
189
+ type RhfUtilsClientConfig = {
190
+ /**
191
+ * Default options for all forms. (Are overridden by form-specific options.)
192
+ */
193
+ defaults?: UseRhfUtilsFormGlobalDefaults;
194
+ /**
195
+ * Supply your own `<form>` component.
196
+ *
197
+ * (By default, a native {@link HTMLFormElement} is used.)
198
+ */
199
+ FormComponent?: React.FC<React.PropsWithChildren<React.HTMLAttributes<HTMLFormElement>>>;
200
+ /**
201
+ * Inject your own hooks across all form instances.
202
+ *
203
+ * @description
204
+ *
205
+ * (NOTE: context params are not schema-typed as not possible at this level.)
206
+ *
207
+ * @example
208
+ *
209
+ * See README.
210
+ */
211
+ useFormHooks?: (props: RhfUtilsClientConfigUseFormHooksProps) => void;
212
+ /**
213
+ * Inject your components across all form instances.
214
+ *
215
+ * @description
216
+ *
217
+ * (NOTE: context params are not schema-typed as not possible at this level.)
218
+ *
219
+ * @example
220
+ *
221
+ * See README.
222
+ */
223
+ FormOutlet?: React.FC<RhfUtilsClientConfigFormOutletProps>;
224
+ /**
225
+ * A hook that returns a callback that determines whether form can be cancelled at event-time.
226
+ *
227
+ * @description
228
+ *
229
+ * Cancellation of forms often doesn't involve navigation, making it more challenging to centrally handle.
230
+ * Your hook's returned callback should internally prompt user and return response as `boolean`
231
+ * indicating whether cancellation should be blocked. See `README.md` for example.
232
+ *
233
+ * @returns Callback that, given {@link RhfUtilsFormContext} at event-time, returns `boolean` value indicating whether form can be cancelled.
234
+ *
235
+ * Callback should return:
236
+ * `true`: if form can be cancelled (e.g., form not dirty or user confirmed via prompt); {@link UseRhfUtilsFormProps.onCancel} is called.
237
+ * `false`: form cannot be cancelled (e.g., user denied); {@link UseRhfUtilsFormProps.onCancel} is not called.
238
+ */
239
+ useCanFormBeCancelled?: () => (props: UseRhfUtilsFormOnSubmitContext) => MaybePromise<boolean>;
240
+ /**
241
+ * Global submit error handler when/if submit handler throws an error other than {@link FormSubmitError}.
242
+ *
243
+ * Example use case:
244
+ * - transform API errors to {@link FormSubmitFieldErrors}.
245
+ *
246
+ * @returns
247
+ * - if {@link FormSubmitFieldErrors}: merge into context errors.
248
+ * - if `undefined`: do nothing.
249
+ */
250
+ onSubmitErrorUnknown?: (error: unknown) => FormSubmitFieldErrors | undefined;
251
+ /**
252
+ * Configuration regarding RHF form state errors (`useFormContext().formState.errors`).
253
+ */
254
+ fieldErrors?: {
255
+ /**
256
+ * Configure how/if errors should be outputted for debugging/reporting (i.e., console and/or throwing).
257
+ */
258
+ output?: FlatFieldErrorsOutputConfig;
259
+ };
260
+ };
261
+ //#endregion
262
+ //#region node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.d.cts
263
+ type Primitive = string | number | symbol | bigint | boolean | null | undefined;
264
+ type Scalars = Primitive | Primitive[];
265
+ //#endregion
266
+ //#region node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.d.cts
267
+ declare namespace util {
268
+ type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends (<V>() => V extends U ? 1 : 2) ? true : false;
269
+ export type isAny<T> = 0 extends 1 & T ? true : false;
270
+ export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
271
+ export function assertIs<T>(_arg: T): void;
272
+ export function assertNever(_x: never): never;
273
+ export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
274
+ export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
275
+ export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
276
+ export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
277
+ export type InexactPartial<T> = { [k in keyof T]?: T[k] | undefined; };
278
+ export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
279
+ export const getValidEnumValues: (obj: any) => any[];
280
+ export const objectValues: (obj: any) => any[];
281
+ export const objectKeys: ObjectConstructor["keys"];
282
+ export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
283
+ export type identity<T> = objectUtil.identity<T>;
284
+ export type flatten<T> = objectUtil.flatten<T>;
285
+ export type noUndefined<T> = T extends undefined ? never : T;
286
+ export const isInteger: NumberConstructor["isInteger"];
287
+ export function joinValues<T extends any[]>(array: T, separator?: string): string;
288
+ export const jsonStringifyReplacer: (_: string, value: any) => any;
289
+ export {};
290
+ }
291
+ declare namespace objectUtil {
292
+ export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : { [k in Exclude<keyof U, keyof V>]: U[k]; } & V;
293
+ type optionalKeys<T extends object> = { [k in keyof T]: undefined extends T[k] ? k : never; }[keyof T];
294
+ type requiredKeys<T extends object> = { [k in keyof T]: undefined extends T[k] ? never : k; }[keyof T];
295
+ export type addQuestionMarks<T extends object, _O = any> = { [K in requiredKeys<T>]: T[K]; } & { [K in optionalKeys<T>]?: T[K]; } & { [k in keyof T]?: unknown; };
296
+ export type identity<T> = T;
297
+ export type flatten<T> = identity<{ [k in keyof T]: T[k]; }>;
298
+ export type noNeverKeys<T> = { [k in keyof T]: [T[k]] extends [never] ? never : k; }[keyof T];
299
+ export type noNever<T> = identity<{ [k in noNeverKeys<T>]: k extends keyof T ? T[k] : never; }>;
300
+ export const mergeShapes: <U, T>(first: U, second: T) => T & U;
301
+ export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K]; } & { [K in keyof B]: B[K]; };
302
+ export {};
303
+ }
304
+ declare const ZodParsedType: {
305
+ string: "string";
306
+ nan: "nan";
307
+ number: "number";
308
+ integer: "integer";
309
+ float: "float";
310
+ boolean: "boolean";
311
+ date: "date";
312
+ bigint: "bigint";
313
+ symbol: "symbol";
314
+ function: "function";
315
+ undefined: "undefined";
316
+ null: "null";
317
+ array: "array";
318
+ object: "object";
319
+ unknown: "unknown";
320
+ promise: "promise";
321
+ void: "void";
322
+ never: "never";
323
+ map: "map";
324
+ set: "set";
325
+ };
326
+ type ZodParsedType = keyof typeof ZodParsedType;
327
+ declare const getParsedType: (data: any) => ZodParsedType;
328
+ //#endregion
329
+ //#region node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.d.cts
330
+ type allKeys<T> = T extends any ? keyof T : never;
331
+ type inferFlattenedErrors<T extends ZodType<any, any, any>, U = string> = typeToFlattenedError<TypeOf<T>, U>;
332
+ type typeToFlattenedError<T, U = string> = {
333
+ formErrors: U[];
334
+ fieldErrors: { [P in allKeys<T>]?: U[]; };
335
+ };
336
+ declare const ZodIssueCode: {
337
+ invalid_type: "invalid_type";
338
+ invalid_literal: "invalid_literal";
339
+ custom: "custom";
340
+ invalid_union: "invalid_union";
341
+ invalid_union_discriminator: "invalid_union_discriminator";
342
+ invalid_enum_value: "invalid_enum_value";
343
+ unrecognized_keys: "unrecognized_keys";
344
+ invalid_arguments: "invalid_arguments";
345
+ invalid_return_type: "invalid_return_type";
346
+ invalid_date: "invalid_date";
347
+ invalid_string: "invalid_string";
348
+ too_small: "too_small";
349
+ too_big: "too_big";
350
+ invalid_intersection_types: "invalid_intersection_types";
351
+ not_multiple_of: "not_multiple_of";
352
+ not_finite: "not_finite";
353
+ };
354
+ type ZodIssueCode = keyof typeof ZodIssueCode;
355
+ type ZodIssueBase = {
356
+ path: (string | number)[];
357
+ message?: string | undefined;
358
+ };
359
+ interface ZodInvalidTypeIssue extends ZodIssueBase {
360
+ code: typeof ZodIssueCode.invalid_type;
361
+ expected: ZodParsedType;
362
+ received: ZodParsedType;
363
+ }
364
+ interface ZodInvalidLiteralIssue extends ZodIssueBase {
365
+ code: typeof ZodIssueCode.invalid_literal;
366
+ expected: unknown;
367
+ received: unknown;
368
+ }
369
+ interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
370
+ code: typeof ZodIssueCode.unrecognized_keys;
371
+ keys: string[];
372
+ }
373
+ interface ZodInvalidUnionIssue extends ZodIssueBase {
374
+ code: typeof ZodIssueCode.invalid_union;
375
+ unionErrors: ZodError[];
376
+ }
377
+ interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
378
+ code: typeof ZodIssueCode.invalid_union_discriminator;
379
+ options: Primitive[];
380
+ }
381
+ interface ZodInvalidEnumValueIssue extends ZodIssueBase {
382
+ received: string | number;
383
+ code: typeof ZodIssueCode.invalid_enum_value;
384
+ options: (string | number)[];
385
+ }
386
+ interface ZodInvalidArgumentsIssue extends ZodIssueBase {
387
+ code: typeof ZodIssueCode.invalid_arguments;
388
+ argumentsError: ZodError;
389
+ }
390
+ interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
391
+ code: typeof ZodIssueCode.invalid_return_type;
392
+ returnTypeError: ZodError;
393
+ }
394
+ interface ZodInvalidDateIssue extends ZodIssueBase {
395
+ code: typeof ZodIssueCode.invalid_date;
396
+ }
397
+ type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | {
398
+ includes: string;
399
+ position?: number | undefined;
400
+ } | {
401
+ startsWith: string;
402
+ } | {
403
+ endsWith: string;
404
+ };
405
+ interface ZodInvalidStringIssue extends ZodIssueBase {
406
+ code: typeof ZodIssueCode.invalid_string;
407
+ validation: StringValidation;
408
+ }
409
+ interface ZodTooSmallIssue extends ZodIssueBase {
410
+ code: typeof ZodIssueCode.too_small;
411
+ minimum: number | bigint;
412
+ inclusive: boolean;
413
+ exact?: boolean;
414
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
415
+ }
416
+ interface ZodTooBigIssue extends ZodIssueBase {
417
+ code: typeof ZodIssueCode.too_big;
418
+ maximum: number | bigint;
419
+ inclusive: boolean;
420
+ exact?: boolean;
421
+ type: "array" | "string" | "number" | "set" | "date" | "bigint";
422
+ }
423
+ interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
424
+ code: typeof ZodIssueCode.invalid_intersection_types;
425
+ }
426
+ interface ZodNotMultipleOfIssue extends ZodIssueBase {
427
+ code: typeof ZodIssueCode.not_multiple_of;
428
+ multipleOf: number | bigint;
429
+ }
430
+ interface ZodNotFiniteIssue extends ZodIssueBase {
431
+ code: typeof ZodIssueCode.not_finite;
432
+ }
433
+ interface ZodCustomIssue extends ZodIssueBase {
434
+ code: typeof ZodIssueCode.custom;
435
+ params?: {
436
+ [k: string]: any;
437
+ };
438
+ }
439
+ type DenormalizedError = {
440
+ [k: string]: DenormalizedError | string[];
441
+ };
442
+ type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
443
+ type ZodIssue = ZodIssueOptionalMessage & {
444
+ fatal?: boolean | undefined;
445
+ message: string;
446
+ };
447
+ declare const quotelessJson: (obj: any) => string;
448
+ type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? { [K in keyof T]?: ZodFormattedError<T[K]>; } : T extends any[] ? {
449
+ [k: number]: ZodFormattedError<T[number]>;
450
+ } : T extends object ? { [K in keyof T]?: ZodFormattedError<T[K]>; } : unknown;
451
+ type ZodFormattedError<T, U = string> = {
452
+ _errors: U[];
453
+ } & recursiveZodFormattedError<NonNullable<T>>;
454
+ type inferFormattedError<T extends ZodType<any, any, any>, U = string> = ZodFormattedError<TypeOf<T>, U>;
455
+ declare class ZodError<T = any> extends Error {
456
+ issues: ZodIssue[];
457
+ get errors(): ZodIssue[];
458
+ constructor(issues: ZodIssue[]);
459
+ format(): ZodFormattedError<T>;
460
+ format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
461
+ static create: (issues: ZodIssue[]) => ZodError<any>;
462
+ static assert(value: unknown): asserts value is ZodError;
463
+ toString(): string;
464
+ get message(): string;
465
+ get isEmpty(): boolean;
466
+ addIssue: (sub: ZodIssue) => void;
467
+ addIssues: (subs?: ZodIssue[]) => void;
468
+ flatten(): typeToFlattenedError<T>;
469
+ flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
470
+ get formErrors(): typeToFlattenedError<T, string>;
471
+ }
472
+ type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
473
+ type IssueData = stripPath<ZodIssueOptionalMessage> & {
474
+ path?: (string | number)[];
475
+ fatal?: boolean | undefined;
476
+ };
477
+ type ErrorMapCtx = {
478
+ defaultError: string;
479
+ data: any;
480
+ };
481
+ type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
482
+ message: string;
483
+ };
484
+ //#endregion
485
+ //#region node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.d.cts
486
+ declare const makeIssue: (params: {
487
+ data: any;
488
+ path: (string | number)[];
489
+ errorMaps: ZodErrorMap[];
490
+ issueData: IssueData;
491
+ }) => ZodIssue;
492
+ type ParseParams = {
493
+ path: (string | number)[];
494
+ errorMap: ZodErrorMap;
495
+ async: boolean;
496
+ };
497
+ type ParsePathComponent = string | number;
498
+ type ParsePath = ParsePathComponent[];
499
+ declare const EMPTY_PATH: ParsePath;
500
+ interface ParseContext {
501
+ readonly common: {
502
+ readonly issues: ZodIssue[];
503
+ readonly contextualErrorMap?: ZodErrorMap | undefined;
504
+ readonly async: boolean;
505
+ };
506
+ readonly path: ParsePath;
507
+ readonly schemaErrorMap?: ZodErrorMap | undefined;
508
+ readonly parent: ParseContext | null;
509
+ readonly data: any;
510
+ readonly parsedType: ZodParsedType;
511
+ }
512
+ type ParseInput = {
513
+ data: any;
514
+ path: (string | number)[];
515
+ parent: ParseContext;
516
+ };
517
+ declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void;
518
+ type ObjectPair = {
519
+ key: SyncParseReturnType<any>;
520
+ value: SyncParseReturnType<any>;
521
+ };
522
+ declare class ParseStatus {
523
+ value: "aborted" | "dirty" | "valid";
524
+ dirty(): void;
525
+ abort(): void;
526
+ static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
527
+ static mergeObjectAsync(status: ParseStatus, pairs: {
528
+ key: ParseReturnType<any>;
529
+ value: ParseReturnType<any>;
530
+ }[]): Promise<SyncParseReturnType<any>>;
531
+ static mergeObjectSync(status: ParseStatus, pairs: {
532
+ key: SyncParseReturnType<any>;
533
+ value: SyncParseReturnType<any>;
534
+ alwaysSet?: boolean;
535
+ }[]): SyncParseReturnType;
536
+ }
537
+ interface ParseResult {
538
+ status: "aborted" | "dirty" | "valid";
539
+ data: any;
540
+ }
541
+ type INVALID = {
542
+ status: "aborted";
543
+ };
544
+ declare const INVALID: INVALID;
545
+ type DIRTY<T> = {
546
+ status: "dirty";
547
+ value: T;
548
+ };
549
+ declare const DIRTY: <T>(value: T) => DIRTY<T>;
550
+ type OK<T> = {
551
+ status: "valid";
552
+ value: T;
553
+ };
554
+ declare const OK: <T>(value: T) => OK<T>;
555
+ type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
556
+ type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
557
+ type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
558
+ declare const isAborted: (x: ParseReturnType<any>) => x is INVALID;
559
+ declare const isDirty: <T>(x: ParseReturnType<T>) => x is OK<T> | DIRTY<T>;
560
+ declare const isValid: <T>(x: ParseReturnType<T>) => x is OK<T>;
561
+ declare const isAsync: <T>(x: ParseReturnType<T>) => x is AsyncParseReturnType<T>;
562
+ //#endregion
563
+ //#region node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/enumUtil.d.cts
564
+ declare namespace enumUtil {
565
+ type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends ((k: infer Intersection) => void) ? Intersection : never;
566
+ type GetUnionLast<T> = UnionToIntersectionFn<T> extends (() => infer Last) ? Last : never;
567
+ type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
568
+ type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
569
+ export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
570
+ export {};
571
+ }
572
+ //#endregion
573
+ //#region node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.d.cts
574
+ declare namespace errorUtil {
575
+ type ErrMessage = string | {
576
+ message?: string | undefined;
577
+ };
578
+ const errToObj: (message?: ErrMessage) => {
579
+ message?: string | undefined;
580
+ };
581
+ const toString: (message?: ErrMessage) => string | undefined;
582
+ }
583
+ //#endregion
584
+ //#region node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/partialUtil.d.cts
585
+ declare namespace partialUtil {
586
+ type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{ [k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>; }, 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> ? { [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never; } extends (infer PI) ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
587
+ }
588
+ //#endregion
589
+ //#region node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/standard-schema.d.cts
590
+ /**
591
+ * The Standard Schema interface.
592
+ */
593
+ type StandardSchemaV1<Input = unknown, Output = Input> = {
594
+ /**
595
+ * The Standard Schema properties.
596
+ */
597
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
598
+ };
599
+ declare namespace StandardSchemaV1 {
600
+ /**
601
+ * The Standard Schema properties interface.
602
+ */
603
+ export interface Props<Input = unknown, Output = Input> {
604
+ /**
605
+ * The version number of the standard.
606
+ */
607
+ readonly version: 1;
608
+ /**
609
+ * The vendor name of the schema library.
610
+ */
611
+ readonly vendor: string;
612
+ /**
613
+ * Validates unknown input values.
614
+ */
615
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
616
+ /**
617
+ * Inferred types associated with the schema.
618
+ */
619
+ readonly types?: Types<Input, Output> | undefined;
620
+ }
621
+ /**
622
+ * The result interface of the validate function.
623
+ */
624
+ export type Result<Output> = SuccessResult<Output> | FailureResult;
625
+ /**
626
+ * The result interface if validation succeeds.
627
+ */
628
+ export interface SuccessResult<Output> {
629
+ /**
630
+ * The typed output value.
631
+ */
632
+ readonly value: Output;
633
+ /**
634
+ * The non-existent issues.
635
+ */
636
+ readonly issues?: undefined;
637
+ }
638
+ /**
639
+ * The result interface if validation fails.
640
+ */
641
+ export interface FailureResult {
642
+ /**
643
+ * The issues of failed validation.
644
+ */
645
+ readonly issues: ReadonlyArray<Issue>;
646
+ }
647
+ /**
648
+ * The issue interface of the failure output.
649
+ */
650
+ export interface Issue {
651
+ /**
652
+ * The error message of the issue.
653
+ */
654
+ readonly message: string;
655
+ /**
656
+ * The path of the issue, if any.
657
+ */
658
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
659
+ }
660
+ /**
661
+ * The path segment interface of the issue.
662
+ */
663
+ export interface PathSegment {
664
+ /**
665
+ * The key representing a path segment.
666
+ */
667
+ readonly key: PropertyKey;
668
+ }
669
+ /**
670
+ * The Standard Schema types interface.
671
+ */
672
+ export interface Types<Input = unknown, Output = Input> {
673
+ /**
674
+ * The input type of the schema.
675
+ */
676
+ readonly input: Input;
677
+ /**
678
+ * The output type of the schema.
679
+ */
680
+ readonly output: Output;
681
+ }
682
+ /**
683
+ * Infers the input type of a Standard Schema.
684
+ */
685
+ export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
686
+ /**
687
+ * Infers the output type of a Standard Schema.
688
+ */
689
+ export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
690
+ export {};
691
+ }
692
+ //#endregion
693
+ //#region node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.d.cts
694
+ interface RefinementCtx {
695
+ addIssue: (arg: IssueData) => void;
696
+ path: (string | number)[];
697
+ }
698
+ type ZodRawShape = {
699
+ [k: string]: ZodTypeAny;
700
+ };
701
+ type ZodTypeAny = ZodType<any, any, any>;
702
+ type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
703
+ type input<T extends ZodType<any, any, any>> = T["_input"];
704
+ type output<T extends ZodType<any, any, any>> = T["_output"];
705
+ type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
706
+ interface ZodTypeDef {
707
+ errorMap?: ZodErrorMap | undefined;
708
+ description?: string | undefined;
709
+ }
710
+ type RawCreateParams = {
711
+ errorMap?: ZodErrorMap | undefined;
712
+ invalid_type_error?: string | undefined;
713
+ required_error?: string | undefined;
714
+ message?: string | undefined;
715
+ description?: string | undefined;
716
+ } | undefined;
717
+ type ProcessedCreateParams = {
718
+ errorMap?: ZodErrorMap | undefined;
719
+ description?: string | undefined;
720
+ };
721
+ type SafeParseSuccess<Output> = {
722
+ success: true;
723
+ data: Output;
724
+ error?: never;
725
+ };
726
+ type SafeParseError<Input> = {
727
+ success: false;
728
+ error: ZodError<Input>;
729
+ data?: never;
730
+ };
731
+ type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
732
+ declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
733
+ readonly _type: Output;
734
+ readonly _output: Output;
735
+ readonly _input: Input;
736
+ readonly _def: Def;
737
+ get description(): string | undefined;
738
+ "~standard": StandardSchemaV1.Props<Input, Output>;
739
+ abstract _parse(input: ParseInput): ParseReturnType<Output>;
740
+ _getType(input: ParseInput): string;
741
+ _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
742
+ _processInputParams(input: ParseInput): {
743
+ status: ParseStatus;
744
+ ctx: ParseContext;
745
+ };
746
+ _parseSync(input: ParseInput): SyncParseReturnType<Output>;
747
+ _parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
748
+ parse(data: unknown, params?: util.InexactPartial<ParseParams>): Output;
749
+ safeParse(data: unknown, params?: util.InexactPartial<ParseParams>): SafeParseReturnType<Input, Output>;
750
+ "~validate"(data: unknown): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>>;
751
+ parseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<Output>;
752
+ safeParseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
753
+ /** Alias of safeParseAsync */
754
+ spa: (data: unknown, params?: util.InexactPartial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
755
+ refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
756
+ refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
757
+ refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
758
+ refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
759
+ _refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
760
+ superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
761
+ superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
762
+ superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
763
+ constructor(def: Def);
764
+ optional(): ZodOptional<this>;
765
+ nullable(): ZodNullable<this>;
766
+ nullish(): ZodOptional<ZodNullable<this>>;
767
+ array(): ZodArray<this>;
768
+ promise(): ZodPromise<this>;
769
+ or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
770
+ and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
771
+ transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
772
+ default(def: util.noUndefined<Input>): ZodDefault<this>;
773
+ default(def: () => util.noUndefined<Input>): ZodDefault<this>;
774
+ brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
775
+ catch(def: Output): ZodCatch<this>;
776
+ catch(def: (ctx: {
777
+ error: ZodError;
778
+ input: Input;
779
+ }) => Output): ZodCatch<this>;
780
+ describe(description: string): this;
781
+ pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
782
+ readonly(): ZodReadonly<this>;
783
+ isOptional(): boolean;
784
+ isNullable(): boolean;
785
+ }
786
+ type IpVersion = "v4" | "v6";
787
+ type ZodStringCheck = {
788
+ kind: "min";
789
+ value: number;
790
+ message?: string | undefined;
791
+ } | {
792
+ kind: "max";
793
+ value: number;
794
+ message?: string | undefined;
795
+ } | {
796
+ kind: "length";
797
+ value: number;
798
+ message?: string | undefined;
799
+ } | {
800
+ kind: "email";
801
+ message?: string | undefined;
802
+ } | {
803
+ kind: "url";
804
+ message?: string | undefined;
805
+ } | {
806
+ kind: "emoji";
807
+ message?: string | undefined;
808
+ } | {
809
+ kind: "uuid";
810
+ message?: string | undefined;
811
+ } | {
812
+ kind: "nanoid";
813
+ message?: string | undefined;
814
+ } | {
815
+ kind: "cuid";
816
+ message?: string | undefined;
817
+ } | {
818
+ kind: "includes";
819
+ value: string;
820
+ position?: number | undefined;
821
+ message?: string | undefined;
822
+ } | {
823
+ kind: "cuid2";
824
+ message?: string | undefined;
825
+ } | {
826
+ kind: "ulid";
827
+ message?: string | undefined;
828
+ } | {
829
+ kind: "startsWith";
830
+ value: string;
831
+ message?: string | undefined;
832
+ } | {
833
+ kind: "endsWith";
834
+ value: string;
835
+ message?: string | undefined;
836
+ } | {
837
+ kind: "regex";
838
+ regex: RegExp;
839
+ message?: string | undefined;
840
+ } | {
841
+ kind: "trim";
842
+ message?: string | undefined;
843
+ } | {
844
+ kind: "toLowerCase";
845
+ message?: string | undefined;
846
+ } | {
847
+ kind: "toUpperCase";
848
+ message?: string | undefined;
849
+ } | {
850
+ kind: "jwt";
851
+ alg?: string;
852
+ message?: string | undefined;
853
+ } | {
854
+ kind: "datetime";
855
+ offset: boolean;
856
+ local: boolean;
857
+ precision: number | null;
858
+ message?: string | undefined;
859
+ } | {
860
+ kind: "date";
861
+ message?: string | undefined;
862
+ } | {
863
+ kind: "time";
864
+ precision: number | null;
865
+ message?: string | undefined;
866
+ } | {
867
+ kind: "duration";
868
+ message?: string | undefined;
869
+ } | {
870
+ kind: "ip";
871
+ version?: IpVersion | undefined;
872
+ message?: string | undefined;
873
+ } | {
874
+ kind: "cidr";
875
+ version?: IpVersion | undefined;
876
+ message?: string | undefined;
877
+ } | {
878
+ kind: "base64";
879
+ message?: string | undefined;
880
+ } | {
881
+ kind: "base64url";
882
+ message?: string | undefined;
883
+ };
884
+ interface ZodStringDef extends ZodTypeDef {
885
+ checks: ZodStringCheck[];
886
+ typeName: ZodFirstPartyTypeKind.ZodString;
887
+ coerce: boolean;
888
+ }
889
+ declare function datetimeRegex(args: {
890
+ precision?: number | null;
891
+ offset?: boolean;
892
+ local?: boolean;
893
+ }): RegExp;
894
+ declare class ZodString extends ZodType<string, ZodStringDef, string> {
895
+ _parse(input: ParseInput): ParseReturnType<string>;
896
+ protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage): ZodEffects<this, string, string>;
897
+ _addCheck(check: ZodStringCheck): ZodString;
898
+ email(message?: errorUtil.ErrMessage): ZodString;
899
+ url(message?: errorUtil.ErrMessage): ZodString;
900
+ emoji(message?: errorUtil.ErrMessage): ZodString;
901
+ uuid(message?: errorUtil.ErrMessage): ZodString;
902
+ nanoid(message?: errorUtil.ErrMessage): ZodString;
903
+ cuid(message?: errorUtil.ErrMessage): ZodString;
904
+ cuid2(message?: errorUtil.ErrMessage): ZodString;
905
+ ulid(message?: errorUtil.ErrMessage): ZodString;
906
+ base64(message?: errorUtil.ErrMessage): ZodString;
907
+ base64url(message?: errorUtil.ErrMessage): ZodString;
908
+ jwt(options?: {
909
+ alg?: string;
910
+ message?: string | undefined;
911
+ }): ZodString;
912
+ ip(options?: string | {
913
+ version?: IpVersion;
914
+ message?: string | undefined;
915
+ }): ZodString;
916
+ cidr(options?: string | {
917
+ version?: IpVersion;
918
+ message?: string | undefined;
919
+ }): ZodString;
920
+ datetime(options?: string | {
921
+ message?: string | undefined;
922
+ precision?: number | null;
923
+ offset?: boolean;
924
+ local?: boolean;
925
+ }): ZodString;
926
+ date(message?: string): ZodString;
927
+ time(options?: string | {
928
+ message?: string | undefined;
929
+ precision?: number | null;
930
+ }): ZodString;
931
+ duration(message?: errorUtil.ErrMessage): ZodString;
932
+ regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
933
+ includes(value: string, options?: {
934
+ message?: string;
935
+ position?: number;
936
+ }): ZodString;
937
+ startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
938
+ endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
939
+ min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
940
+ max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
941
+ length(len: number, message?: errorUtil.ErrMessage): ZodString;
942
+ /**
943
+ * Equivalent to `.min(1)`
944
+ */
945
+ nonempty(message?: errorUtil.ErrMessage): ZodString;
946
+ trim(): ZodString;
947
+ toLowerCase(): ZodString;
948
+ toUpperCase(): ZodString;
949
+ get isDatetime(): boolean;
950
+ get isDate(): boolean;
951
+ get isTime(): boolean;
952
+ get isDuration(): boolean;
953
+ get isEmail(): boolean;
954
+ get isURL(): boolean;
955
+ get isEmoji(): boolean;
956
+ get isUUID(): boolean;
957
+ get isNANOID(): boolean;
958
+ get isCUID(): boolean;
959
+ get isCUID2(): boolean;
960
+ get isULID(): boolean;
961
+ get isIP(): boolean;
962
+ get isCIDR(): boolean;
963
+ get isBase64(): boolean;
964
+ get isBase64url(): boolean;
965
+ get minLength(): number | null;
966
+ get maxLength(): number | null;
967
+ static create: (params?: RawCreateParams & {
968
+ coerce?: true;
969
+ }) => ZodString;
970
+ }
971
+ type ZodNumberCheck = {
972
+ kind: "min";
973
+ value: number;
974
+ inclusive: boolean;
975
+ message?: string | undefined;
976
+ } | {
977
+ kind: "max";
978
+ value: number;
979
+ inclusive: boolean;
980
+ message?: string | undefined;
981
+ } | {
982
+ kind: "int";
983
+ message?: string | undefined;
984
+ } | {
985
+ kind: "multipleOf";
986
+ value: number;
987
+ message?: string | undefined;
988
+ } | {
989
+ kind: "finite";
990
+ message?: string | undefined;
991
+ };
992
+ interface ZodNumberDef extends ZodTypeDef {
993
+ checks: ZodNumberCheck[];
994
+ typeName: ZodFirstPartyTypeKind.ZodNumber;
995
+ coerce: boolean;
996
+ }
997
+ declare class ZodNumber extends ZodType<number, ZodNumberDef, number> {
998
+ _parse(input: ParseInput): ParseReturnType<number>;
999
+ static create: (params?: RawCreateParams & {
1000
+ coerce?: boolean;
1001
+ }) => ZodNumber;
1002
+ gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
1003
+ min: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
1004
+ gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
1005
+ lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
1006
+ max: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
1007
+ lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
1008
+ protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
1009
+ _addCheck(check: ZodNumberCheck): ZodNumber;
1010
+ int(message?: errorUtil.ErrMessage): ZodNumber;
1011
+ positive(message?: errorUtil.ErrMessage): ZodNumber;
1012
+ negative(message?: errorUtil.ErrMessage): ZodNumber;
1013
+ nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
1014
+ nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
1015
+ multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
1016
+ step: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
1017
+ finite(message?: errorUtil.ErrMessage): ZodNumber;
1018
+ safe(message?: errorUtil.ErrMessage): ZodNumber;
1019
+ get minValue(): number | null;
1020
+ get maxValue(): number | null;
1021
+ get isInt(): boolean;
1022
+ get isFinite(): boolean;
1023
+ }
1024
+ type ZodBigIntCheck = {
1025
+ kind: "min";
1026
+ value: bigint;
1027
+ inclusive: boolean;
1028
+ message?: string | undefined;
1029
+ } | {
1030
+ kind: "max";
1031
+ value: bigint;
1032
+ inclusive: boolean;
1033
+ message?: string | undefined;
1034
+ } | {
1035
+ kind: "multipleOf";
1036
+ value: bigint;
1037
+ message?: string | undefined;
1038
+ };
1039
+ interface ZodBigIntDef extends ZodTypeDef {
1040
+ checks: ZodBigIntCheck[];
1041
+ typeName: ZodFirstPartyTypeKind.ZodBigInt;
1042
+ coerce: boolean;
1043
+ }
1044
+ declare class ZodBigInt extends ZodType<bigint, ZodBigIntDef, bigint> {
1045
+ _parse(input: ParseInput): ParseReturnType<bigint>;
1046
+ _getInvalidInput(input: ParseInput): INVALID;
1047
+ static create: (params?: RawCreateParams & {
1048
+ coerce?: boolean;
1049
+ }) => ZodBigInt;
1050
+ gte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
1051
+ min: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
1052
+ gt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
1053
+ lte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
1054
+ max: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
1055
+ lt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
1056
+ protected setLimit(kind: "min" | "max", value: bigint, inclusive: boolean, message?: string): ZodBigInt;
1057
+ _addCheck(check: ZodBigIntCheck): ZodBigInt;
1058
+ positive(message?: errorUtil.ErrMessage): ZodBigInt;
1059
+ negative(message?: errorUtil.ErrMessage): ZodBigInt;
1060
+ nonpositive(message?: errorUtil.ErrMessage): ZodBigInt;
1061
+ nonnegative(message?: errorUtil.ErrMessage): ZodBigInt;
1062
+ multipleOf(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
1063
+ get minValue(): bigint | null;
1064
+ get maxValue(): bigint | null;
1065
+ }
1066
+ interface ZodBooleanDef extends ZodTypeDef {
1067
+ typeName: ZodFirstPartyTypeKind.ZodBoolean;
1068
+ coerce: boolean;
1069
+ }
1070
+ declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef, boolean> {
1071
+ _parse(input: ParseInput): ParseReturnType<boolean>;
1072
+ static create: (params?: RawCreateParams & {
1073
+ coerce?: boolean;
1074
+ }) => ZodBoolean;
1075
+ }
1076
+ type ZodDateCheck = {
1077
+ kind: "min";
1078
+ value: number;
1079
+ message?: string | undefined;
1080
+ } | {
1081
+ kind: "max";
1082
+ value: number;
1083
+ message?: string | undefined;
1084
+ };
1085
+ interface ZodDateDef extends ZodTypeDef {
1086
+ checks: ZodDateCheck[];
1087
+ coerce: boolean;
1088
+ typeName: ZodFirstPartyTypeKind.ZodDate;
1089
+ }
1090
+ declare class ZodDate extends ZodType<Date, ZodDateDef, Date> {
1091
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1092
+ _addCheck(check: ZodDateCheck): ZodDate;
1093
+ min(minDate: Date, message?: errorUtil.ErrMessage): ZodDate;
1094
+ max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate;
1095
+ get minDate(): Date | null;
1096
+ get maxDate(): Date | null;
1097
+ static create: (params?: RawCreateParams & {
1098
+ coerce?: boolean;
1099
+ }) => ZodDate;
1100
+ }
1101
+ interface ZodSymbolDef extends ZodTypeDef {
1102
+ typeName: ZodFirstPartyTypeKind.ZodSymbol;
1103
+ }
1104
+ declare class ZodSymbol extends ZodType<symbol, ZodSymbolDef, symbol> {
1105
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1106
+ static create: (params?: RawCreateParams) => ZodSymbol;
1107
+ }
1108
+ interface ZodUndefinedDef extends ZodTypeDef {
1109
+ typeName: ZodFirstPartyTypeKind.ZodUndefined;
1110
+ }
1111
+ declare class ZodUndefined extends ZodType<undefined, ZodUndefinedDef, undefined> {
1112
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1113
+ params?: RawCreateParams;
1114
+ static create: (params?: RawCreateParams) => ZodUndefined;
1115
+ }
1116
+ interface ZodNullDef extends ZodTypeDef {
1117
+ typeName: ZodFirstPartyTypeKind.ZodNull;
1118
+ }
1119
+ declare class ZodNull extends ZodType<null, ZodNullDef, null> {
1120
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1121
+ static create: (params?: RawCreateParams) => ZodNull;
1122
+ }
1123
+ interface ZodAnyDef extends ZodTypeDef {
1124
+ typeName: ZodFirstPartyTypeKind.ZodAny;
1125
+ }
1126
+ declare class ZodAny extends ZodType<any, ZodAnyDef, any> {
1127
+ _any: true;
1128
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1129
+ static create: (params?: RawCreateParams) => ZodAny;
1130
+ }
1131
+ interface ZodUnknownDef extends ZodTypeDef {
1132
+ typeName: ZodFirstPartyTypeKind.ZodUnknown;
1133
+ }
1134
+ declare class ZodUnknown extends ZodType<unknown, ZodUnknownDef, unknown> {
1135
+ _unknown: true;
1136
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1137
+ static create: (params?: RawCreateParams) => ZodUnknown;
1138
+ }
1139
+ interface ZodNeverDef extends ZodTypeDef {
1140
+ typeName: ZodFirstPartyTypeKind.ZodNever;
1141
+ }
1142
+ declare class ZodNever extends ZodType<never, ZodNeverDef, never> {
1143
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1144
+ static create: (params?: RawCreateParams) => ZodNever;
1145
+ }
1146
+ interface ZodVoidDef extends ZodTypeDef {
1147
+ typeName: ZodFirstPartyTypeKind.ZodVoid;
1148
+ }
1149
+ declare class ZodVoid extends ZodType<void, ZodVoidDef, void> {
1150
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1151
+ static create: (params?: RawCreateParams) => ZodVoid;
1152
+ }
1153
+ interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1154
+ type: T;
1155
+ typeName: ZodFirstPartyTypeKind.ZodArray;
1156
+ exactLength: {
1157
+ value: number;
1158
+ message?: string | undefined;
1159
+ } | null;
1160
+ minLength: {
1161
+ value: number;
1162
+ message?: string | undefined;
1163
+ } | null;
1164
+ maxLength: {
1165
+ value: number;
1166
+ message?: string | undefined;
1167
+ } | null;
1168
+ }
1169
+ type ArrayCardinality = "many" | "atleastone";
1170
+ type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
1171
+ 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"][]> {
1172
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1173
+ get element(): T;
1174
+ min(minLength: number, message?: errorUtil.ErrMessage): this;
1175
+ max(maxLength: number, message?: errorUtil.ErrMessage): this;
1176
+ length(len: number, message?: errorUtil.ErrMessage): this;
1177
+ nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
1178
+ static create: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
1179
+ }
1180
+ type ZodNonEmptyArray<T extends ZodTypeAny> = ZodArray<T, "atleastone">;
1181
+ type UnknownKeysParam = "passthrough" | "strict" | "strip";
1182
+ interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1183
+ typeName: ZodFirstPartyTypeKind.ZodObject;
1184
+ shape: () => T;
1185
+ catchall: Catchall;
1186
+ unknownKeys: UnknownKeys;
1187
+ }
1188
+ type mergeTypes<A, B> = { [k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never; };
1189
+ type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
1190
+ type baseObjectOutputType<Shape extends ZodRawShape> = { [k in keyof Shape]: Shape[k]["_output"]; };
1191
+ type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
1192
+ type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{ [k in keyof Shape]: Shape[k]["_input"]; }>;
1193
+ type CatchallOutput<T extends ZodType> = ZodType extends T ? unknown : {
1194
+ [k: string]: T["_output"];
1195
+ };
1196
+ type CatchallInput<T extends ZodType> = ZodType extends T ? unknown : {
1197
+ [k: string]: T["_input"];
1198
+ };
1199
+ type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
1200
+ [k: string]: unknown;
1201
+ } : unknown;
1202
+ type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
1203
+ type SomeZodObject = ZodObject<ZodRawShape, UnknownKeysParam, ZodTypeAny>;
1204
+ type noUnrecognized<Obj extends object, Shape extends object> = { [k in keyof Obj]: k extends keyof Shape ? Obj[k] : never; };
1205
+ 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> {
1206
+ private _cached;
1207
+ _getCached(): {
1208
+ shape: T;
1209
+ keys: string[];
1210
+ };
1211
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1212
+ get shape(): T;
1213
+ strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
1214
+ strip(): ZodObject<T, "strip", Catchall>;
1215
+ passthrough(): ZodObject<T, "passthrough", Catchall>;
1216
+ /**
1217
+ * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
1218
+ * If you want to pass through unknown properties, use `.passthrough()` instead.
1219
+ */
1220
+ nonstrict: () => ZodObject<T, "passthrough", Catchall>;
1221
+ extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
1222
+ /**
1223
+ * @deprecated Use `.extend` instead
1224
+ * */
1225
+ augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
1226
+ /**
1227
+ * Prior to zod@1.0.12 there was a bug in the
1228
+ * inferred type of merged objects. Please
1229
+ * upgrade if you are experiencing issues.
1230
+ */
1231
+ merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<objectUtil.extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
1232
+ setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & { [k in Key]: Schema; }, UnknownKeys, Catchall>;
1233
+ catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
1234
+ pick<Mask extends util.Exactly<{ [k in keyof T]?: true; }, Mask>>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
1235
+ omit<Mask extends util.Exactly<{ [k in keyof T]?: true; }, Mask>>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
1236
+ /**
1237
+ * @deprecated
1238
+ */
1239
+ deepPartial(): partialUtil.DeepPartial<this>;
1240
+ partial(): ZodObject<{ [k in keyof T]: ZodOptional<T[k]>; }, UnknownKeys, Catchall>;
1241
+ partial<Mask extends util.Exactly<{ [k in keyof T]?: true; }, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{ [k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k]; }>, UnknownKeys, Catchall>;
1242
+ required(): ZodObject<{ [k in keyof T]: deoptional<T[k]>; }, UnknownKeys, Catchall>;
1243
+ required<Mask extends util.Exactly<{ [k in keyof T]?: true; }, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{ [k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k]; }>, UnknownKeys, Catchall>;
1244
+ keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
1245
+ static create: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, objectOutputType<Shape, ZodTypeAny, "strip">, objectInputType<Shape, ZodTypeAny, "strip">>;
1246
+ static strictCreate: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strict">;
1247
+ static lazycreate: <Shape extends ZodRawShape>(shape: () => Shape, params?: RawCreateParams) => ZodObject<Shape, "strip">;
1248
+ }
1249
+ type AnyZodObject = ZodObject<any, any, any>;
1250
+ type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
1251
+ interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>> extends ZodTypeDef {
1252
+ options: T;
1253
+ typeName: ZodFirstPartyTypeKind.ZodUnion;
1254
+ }
1255
+ declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
1256
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1257
+ get options(): T;
1258
+ static create: <Options extends Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
1259
+ }
1260
+ type ZodDiscriminatedUnionOption<Discriminator extends string> = ZodObject<{ [key in Discriminator]: ZodTypeAny; } & ZodRawShape, UnknownKeysParam, ZodTypeAny>;
1261
+ interface ZodDiscriminatedUnionDef<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> extends ZodTypeDef {
1262
+ discriminator: Discriminator;
1263
+ options: Options;
1264
+ optionsMap: Map<Primitive, ZodDiscriminatedUnionOption<any>>;
1265
+ typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion;
1266
+ }
1267
+ declare class ZodDiscriminatedUnion<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<Discriminator>[]> extends ZodType<output<Options[number]>, ZodDiscriminatedUnionDef<Discriminator, Options>, input<Options[number]>> {
1268
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1269
+ get discriminator(): Discriminator;
1270
+ get options(): Options;
1271
+ get optionsMap(): Map<Primitive, ZodDiscriminatedUnionOption<any>>;
1272
+ /**
1273
+ * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
1274
+ * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
1275
+ * have a different value for each object in the union.
1276
+ * @param discriminator the name of the discriminator property
1277
+ * @param types an array of object schemas
1278
+ * @param params
1279
+ */
1280
+ static create<Discriminator extends string, Types extends readonly [ZodDiscriminatedUnionOption<Discriminator>, ...ZodDiscriminatedUnionOption<Discriminator>[]]>(discriminator: Discriminator, options: Types, params?: RawCreateParams): ZodDiscriminatedUnion<Discriminator, Types>;
1281
+ }
1282
+ interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1283
+ left: T;
1284
+ right: U;
1285
+ typeName: ZodFirstPartyTypeKind.ZodIntersection;
1286
+ }
1287
+ declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
1288
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1289
+ static create: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
1290
+ }
1291
+ type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
1292
+ type AssertArray<T> = T extends any[] ? T : never;
1293
+ type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{ [k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_output"] : never; }>;
1294
+ type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
1295
+ type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{ [k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_input"] : never; }>;
1296
+ type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
1297
+ interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
1298
+ items: T;
1299
+ rest: Rest;
1300
+ typeName: ZodFirstPartyTypeKind.ZodTuple;
1301
+ }
1302
+ type AnyZodTuple = ZodTuple<[ZodTypeAny, ...ZodTypeAny[]] | [], ZodTypeAny | null>;
1303
+ declare class ZodTuple<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
1304
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1305
+ get items(): T;
1306
+ rest<RestSchema extends ZodTypeAny>(rest: RestSchema): ZodTuple<T, RestSchema>;
1307
+ static create: <Items extends [ZodTypeAny, ...ZodTypeAny[]] | []>(schemas: Items, params?: RawCreateParams) => ZodTuple<Items, null>;
1308
+ }
1309
+ interface ZodRecordDef<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1310
+ valueType: Value;
1311
+ keyType: Key;
1312
+ typeName: ZodFirstPartyTypeKind.ZodRecord;
1313
+ }
1314
+ type KeySchema = ZodType<string | number | symbol, any, any>;
1315
+ type RecordType<K extends string | number | symbol, V> = [string] 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>>;
1316
+ 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"]>> {
1317
+ get keySchema(): Key;
1318
+ get valueSchema(): Value;
1319
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1320
+ get element(): Value;
1321
+ static create<Value extends ZodTypeAny>(valueType: Value, params?: RawCreateParams): ZodRecord<ZodString, Value>;
1322
+ static create<Keys extends KeySchema, Value extends ZodTypeAny>(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord<Keys, Value>;
1323
+ }
1324
+ interface ZodMapDef<Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1325
+ valueType: Value;
1326
+ keyType: Key;
1327
+ typeName: ZodFirstPartyTypeKind.ZodMap;
1328
+ }
1329
+ 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"]>> {
1330
+ get keySchema(): Key;
1331
+ get valueSchema(): Value;
1332
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1333
+ static create: <KeySchema extends ZodTypeAny = ZodTypeAny, ValueSchema extends ZodTypeAny = ZodTypeAny>(keyType: KeySchema, valueType: ValueSchema, params?: RawCreateParams) => ZodMap<KeySchema, ValueSchema>;
1334
+ }
1335
+ interface ZodSetDef<Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1336
+ valueType: Value;
1337
+ typeName: ZodFirstPartyTypeKind.ZodSet;
1338
+ minSize: {
1339
+ value: number;
1340
+ message?: string | undefined;
1341
+ } | null;
1342
+ maxSize: {
1343
+ value: number;
1344
+ message?: string | undefined;
1345
+ } | null;
1346
+ }
1347
+ declare class ZodSet<Value extends ZodTypeAny = ZodTypeAny> extends ZodType<Set<Value["_output"]>, ZodSetDef<Value>, Set<Value["_input"]>> {
1348
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1349
+ min(minSize: number, message?: errorUtil.ErrMessage): this;
1350
+ max(maxSize: number, message?: errorUtil.ErrMessage): this;
1351
+ size(size: number, message?: errorUtil.ErrMessage): this;
1352
+ nonempty(message?: errorUtil.ErrMessage): ZodSet<Value>;
1353
+ static create: <ValueSchema extends ZodTypeAny = ZodTypeAny>(valueType: ValueSchema, params?: RawCreateParams) => ZodSet<ValueSchema>;
1354
+ }
1355
+ interface ZodFunctionDef<Args extends ZodTuple<any, any> = ZodTuple<any, any>, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1356
+ args: Args;
1357
+ returns: Returns;
1358
+ typeName: ZodFirstPartyTypeKind.ZodFunction;
1359
+ }
1360
+ type OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_input"] extends Array<any> ? (...args: Args["_input"]) => Returns["_output"] : never;
1361
+ type InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_output"] extends Array<any> ? (...args: Args["_output"]) => Returns["_input"] : never;
1362
+ declare class ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> extends ZodType<OuterTypeOfFunction<Args, Returns>, ZodFunctionDef<Args, Returns>, InnerTypeOfFunction<Args, Returns>> {
1363
+ _parse(input: ParseInput): ParseReturnType<any>;
1364
+ parameters(): Args;
1365
+ returnType(): Returns;
1366
+ args<Items extends Parameters<(typeof ZodTuple)["create"]>[0]>(...items: Items): ZodFunction<ZodTuple<Items, ZodUnknown>, Returns>;
1367
+ returns<NewReturnType extends ZodType<any, any, any>>(returnType: NewReturnType): ZodFunction<Args, NewReturnType>;
1368
+ implement<F extends InnerTypeOfFunction<Args, Returns>>(func: F): ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
1369
+ strictImplement(func: InnerTypeOfFunction<Args, Returns>): InnerTypeOfFunction<Args, Returns>;
1370
+ validate: <F extends InnerTypeOfFunction<Args, Returns>>(func: F) => ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
1371
+ static create(): ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>;
1372
+ static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>>(args: T): ZodFunction<T, ZodUnknown>;
1373
+ static create<T extends AnyZodTuple, U extends ZodTypeAny>(args: T, returns: U): ZodFunction<T, U>;
1374
+ static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>, U extends ZodTypeAny = ZodUnknown>(args: T, returns: U, params?: RawCreateParams): ZodFunction<T, U>;
1375
+ }
1376
+ interface ZodLazyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1377
+ getter: () => T;
1378
+ typeName: ZodFirstPartyTypeKind.ZodLazy;
1379
+ }
1380
+ declare class ZodLazy<T extends ZodTypeAny> extends ZodType<output<T>, ZodLazyDef<T>, input<T>> {
1381
+ get schema(): T;
1382
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1383
+ static create: <Inner extends ZodTypeAny>(getter: () => Inner, params?: RawCreateParams) => ZodLazy<Inner>;
1384
+ }
1385
+ interface ZodLiteralDef<T = any> extends ZodTypeDef {
1386
+ value: T;
1387
+ typeName: ZodFirstPartyTypeKind.ZodLiteral;
1388
+ }
1389
+ declare class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>, T> {
1390
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1391
+ get value(): T;
1392
+ static create: <Value extends Primitive>(value: Value, params?: RawCreateParams) => ZodLiteral<Value>;
1393
+ }
1394
+ type ArrayKeys = keyof any[];
1395
+ type Indices<T> = Exclude<keyof T, ArrayKeys>;
1396
+ type EnumValues<T extends string = string> = readonly [T, ...T[]];
1397
+ type Values<T extends EnumValues> = { [k in T[number]]: k; };
1398
+ interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
1399
+ values: T;
1400
+ typeName: ZodFirstPartyTypeKind.ZodEnum;
1401
+ }
1402
+ type Writeable<T> = { -readonly [P in keyof T]: T[P]; };
1403
+ type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
1404
+ type typecast<A, T> = A extends T ? A : never;
1405
+ declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
1406
+ declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
1407
+ declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>, T[number]> {
1408
+ _cache: Set<T[number]> | undefined;
1409
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1410
+ get options(): T;
1411
+ get enum(): Values<T>;
1412
+ get Values(): Values<T>;
1413
+ get Enum(): Values<T>;
1414
+ extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract, newDef?: RawCreateParams): ZodEnum<Writeable<ToExtract>>;
1415
+ exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude, newDef?: RawCreateParams): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
1416
+ static create: typeof createZodEnum;
1417
+ }
1418
+ interface ZodNativeEnumDef<T extends EnumLike = EnumLike> extends ZodTypeDef {
1419
+ values: T;
1420
+ typeName: ZodFirstPartyTypeKind.ZodNativeEnum;
1421
+ }
1422
+ type EnumLike = {
1423
+ [k: string]: string | number;
1424
+ [nu: number]: string;
1425
+ };
1426
+ declare class ZodNativeEnum<T extends EnumLike> extends ZodType<T[keyof T], ZodNativeEnumDef<T>, T[keyof T]> {
1427
+ _cache: Set<T[keyof T]> | undefined;
1428
+ _parse(input: ParseInput): ParseReturnType<T[keyof T]>;
1429
+ get enum(): T;
1430
+ static create: <Elements extends EnumLike>(values: Elements, params?: RawCreateParams) => ZodNativeEnum<Elements>;
1431
+ }
1432
+ interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1433
+ type: T;
1434
+ typeName: ZodFirstPartyTypeKind.ZodPromise;
1435
+ }
1436
+ declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
1437
+ unwrap(): T;
1438
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1439
+ static create: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
1440
+ }
1441
+ type Refinement<T> = (arg: T, ctx: RefinementCtx) => any;
1442
+ type SuperRefinement<T> = (arg: T, ctx: RefinementCtx) => void | Promise<void>;
1443
+ type RefinementEffect<T> = {
1444
+ type: "refinement";
1445
+ refinement: (arg: T, ctx: RefinementCtx) => any;
1446
+ };
1447
+ type TransformEffect<T> = {
1448
+ type: "transform";
1449
+ transform: (arg: T, ctx: RefinementCtx) => any;
1450
+ };
1451
+ type PreprocessEffect<T> = {
1452
+ type: "preprocess";
1453
+ transform: (arg: T, ctx: RefinementCtx) => any;
1454
+ };
1455
+ type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
1456
+ interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1457
+ schema: T;
1458
+ typeName: ZodFirstPartyTypeKind.ZodEffects;
1459
+ effect: Effect<any>;
1460
+ }
1461
+ declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
1462
+ innerType(): T;
1463
+ sourceType(): T;
1464
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1465
+ static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
1466
+ static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
1467
+ }
1468
+ interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1469
+ innerType: T;
1470
+ typeName: ZodFirstPartyTypeKind.ZodOptional;
1471
+ }
1472
+ type ZodOptionalType<T extends ZodTypeAny> = ZodOptional<T>;
1473
+ declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
1474
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1475
+ unwrap(): T;
1476
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
1477
+ }
1478
+ interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1479
+ innerType: T;
1480
+ typeName: ZodFirstPartyTypeKind.ZodNullable;
1481
+ }
1482
+ type ZodNullableType<T extends ZodTypeAny> = ZodNullable<T>;
1483
+ declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
1484
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1485
+ unwrap(): T;
1486
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
1487
+ }
1488
+ interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1489
+ innerType: T;
1490
+ defaultValue: () => util.noUndefined<T["_input"]>;
1491
+ typeName: ZodFirstPartyTypeKind.ZodDefault;
1492
+ }
1493
+ declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
1494
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1495
+ removeDefault(): T;
1496
+ static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
1497
+ default: Inner["_input"] | (() => util.noUndefined<Inner["_input"]>);
1498
+ }) => ZodDefault<Inner>;
1499
+ }
1500
+ interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1501
+ innerType: T;
1502
+ catchValue: (ctx: {
1503
+ error: ZodError;
1504
+ input: unknown;
1505
+ }) => T["_input"];
1506
+ typeName: ZodFirstPartyTypeKind.ZodCatch;
1507
+ }
1508
+ declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
1509
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1510
+ removeCatch(): T;
1511
+ static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
1512
+ catch: Inner["_output"] | (() => Inner["_output"]);
1513
+ }) => ZodCatch<Inner>;
1514
+ }
1515
+ interface ZodNaNDef extends ZodTypeDef {
1516
+ typeName: ZodFirstPartyTypeKind.ZodNaN;
1517
+ }
1518
+ declare class ZodNaN extends ZodType<number, ZodNaNDef, number> {
1519
+ _parse(input: ParseInput): ParseReturnType<any>;
1520
+ static create: (params?: RawCreateParams) => ZodNaN;
1521
+ }
1522
+ interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
1523
+ type: T;
1524
+ typeName: ZodFirstPartyTypeKind.ZodBranded;
1525
+ }
1526
+ declare const BRAND: unique symbol;
1527
+ type BRAND<T extends string | number | symbol> = {
1528
+ [BRAND]: { [k in T]: true; };
1529
+ };
1530
+ declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
1531
+ _parse(input: ParseInput): ParseReturnType<any>;
1532
+ unwrap(): T;
1533
+ }
1534
+ interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
1535
+ in: A;
1536
+ out: B;
1537
+ typeName: ZodFirstPartyTypeKind.ZodPipeline;
1538
+ }
1539
+ declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
1540
+ _parse(input: ParseInput): ParseReturnType<any>;
1541
+ static create<ASchema extends ZodTypeAny, BSchema extends ZodTypeAny>(a: ASchema, b: BSchema): ZodPipeline<ASchema, BSchema>;
1542
+ }
1543
+ type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
1544
+ readonly [Symbol.toStringTag]: string;
1545
+ } | Date | Error | Generator | Promise<unknown> | RegExp;
1546
+ 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>;
1547
+ interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
1548
+ innerType: T;
1549
+ typeName: ZodFirstPartyTypeKind.ZodReadonly;
1550
+ }
1551
+ declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, MakeReadonly<T["_input"]>> {
1552
+ _parse(input: ParseInput): ParseReturnType<this["_output"]>;
1553
+ static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodReadonly<Inner>;
1554
+ unwrap(): T;
1555
+ }
1556
+ type CustomParams = CustomErrorParams & {
1557
+ fatal?: boolean;
1558
+ };
1559
+ declare function custom<T>(check?: (data: any) => any, _params?: string | CustomParams | ((input: any) => CustomParams),
1560
+ /**
1561
+ * @deprecated
1562
+ *
1563
+ * Pass `fatal` into the params object instead:
1564
+ *
1565
+ * ```ts
1566
+ * z.string().custom((val) => val.length > 5, { fatal: false })
1567
+ * ```
1568
+ *
1569
+ */
1570
+ fatal?: boolean): ZodType<T, ZodTypeDef, T>;
1571
+ declare const late: {
1572
+ object: <Shape extends ZodRawShape>(shape: () => Shape, params?: RawCreateParams) => ZodObject<Shape, "strip">;
1573
+ };
1574
+ declare enum ZodFirstPartyTypeKind {
1575
+ ZodString = "ZodString",
1576
+ ZodNumber = "ZodNumber",
1577
+ ZodNaN = "ZodNaN",
1578
+ ZodBigInt = "ZodBigInt",
1579
+ ZodBoolean = "ZodBoolean",
1580
+ ZodDate = "ZodDate",
1581
+ ZodSymbol = "ZodSymbol",
1582
+ ZodUndefined = "ZodUndefined",
1583
+ ZodNull = "ZodNull",
1584
+ ZodAny = "ZodAny",
1585
+ ZodUnknown = "ZodUnknown",
1586
+ ZodNever = "ZodNever",
1587
+ ZodVoid = "ZodVoid",
1588
+ ZodArray = "ZodArray",
1589
+ ZodObject = "ZodObject",
1590
+ ZodUnion = "ZodUnion",
1591
+ ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
1592
+ ZodIntersection = "ZodIntersection",
1593
+ ZodTuple = "ZodTuple",
1594
+ ZodRecord = "ZodRecord",
1595
+ ZodMap = "ZodMap",
1596
+ ZodSet = "ZodSet",
1597
+ ZodFunction = "ZodFunction",
1598
+ ZodLazy = "ZodLazy",
1599
+ ZodLiteral = "ZodLiteral",
1600
+ ZodEnum = "ZodEnum",
1601
+ ZodEffects = "ZodEffects",
1602
+ ZodNativeEnum = "ZodNativeEnum",
1603
+ ZodOptional = "ZodOptional",
1604
+ ZodNullable = "ZodNullable",
1605
+ ZodDefault = "ZodDefault",
1606
+ ZodCatch = "ZodCatch",
1607
+ ZodPromise = "ZodPromise",
1608
+ ZodBranded = "ZodBranded",
1609
+ ZodPipeline = "ZodPipeline",
1610
+ ZodReadonly = "ZodReadonly"
1611
+ }
1612
+ 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;
1613
+ declare abstract class Class {
1614
+ constructor(..._: any[]);
1615
+ }
1616
+ declare const instanceOfType: <T extends typeof Class>(cls: T, params?: CustomParams) => ZodType<InstanceType<T>, ZodTypeDef, InstanceType<T>>;
1617
+ declare const stringType: (params?: RawCreateParams & {
1618
+ coerce?: true;
1619
+ }) => ZodString;
1620
+ declare const numberType: (params?: RawCreateParams & {
1621
+ coerce?: boolean;
1622
+ }) => ZodNumber;
1623
+ declare const nanType: (params?: RawCreateParams) => ZodNaN;
1624
+ declare const bigIntType: (params?: RawCreateParams & {
1625
+ coerce?: boolean;
1626
+ }) => ZodBigInt;
1627
+ declare const booleanType: (params?: RawCreateParams & {
1628
+ coerce?: boolean;
1629
+ }) => ZodBoolean;
1630
+ declare const dateType: (params?: RawCreateParams & {
1631
+ coerce?: boolean;
1632
+ }) => ZodDate;
1633
+ declare const symbolType: (params?: RawCreateParams) => ZodSymbol;
1634
+ declare const undefinedType: (params?: RawCreateParams) => ZodUndefined;
1635
+ declare const nullType: (params?: RawCreateParams) => ZodNull;
1636
+ declare const anyType: (params?: RawCreateParams) => ZodAny;
1637
+ declare const unknownType: (params?: RawCreateParams) => ZodUnknown;
1638
+ declare const neverType: (params?: RawCreateParams) => ZodNever;
1639
+ declare const voidType: (params?: RawCreateParams) => ZodVoid;
1640
+ declare const arrayType: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
1641
+ declare const objectType: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, objectOutputType<Shape, ZodTypeAny, "strip">, objectInputType<Shape, ZodTypeAny, "strip">>;
1642
+ declare const strictObjectType: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strict">;
1643
+ declare const unionType: <Options extends Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
1644
+ declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create;
1645
+ declare const intersectionType: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
1646
+ declare const tupleType: <Items extends [ZodTypeAny, ...ZodTypeAny[]] | []>(schemas: Items, params?: RawCreateParams) => ZodTuple<Items, null>;
1647
+ declare const recordType: typeof ZodRecord.create;
1648
+ declare const mapType: <KeySchema extends ZodTypeAny = ZodTypeAny, ValueSchema extends ZodTypeAny = ZodTypeAny>(keyType: KeySchema, valueType: ValueSchema, params?: RawCreateParams) => ZodMap<KeySchema, ValueSchema>;
1649
+ declare const setType: <ValueSchema extends ZodTypeAny = ZodTypeAny>(valueType: ValueSchema, params?: RawCreateParams) => ZodSet<ValueSchema>;
1650
+ declare const functionType: typeof ZodFunction.create;
1651
+ declare const lazyType: <Inner extends ZodTypeAny>(getter: () => Inner, params?: RawCreateParams) => ZodLazy<Inner>;
1652
+ declare const literalType: <Value extends Primitive>(value: Value, params?: RawCreateParams) => ZodLiteral<Value>;
1653
+ declare const enumType: typeof createZodEnum;
1654
+ declare const nativeEnumType: <Elements extends EnumLike>(values: Elements, params?: RawCreateParams) => ZodNativeEnum<Elements>;
1655
+ declare const promiseType: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
1656
+ declare const effectsType: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
1657
+ declare const optionalType: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
1658
+ declare const nullableType: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
1659
+ declare const preprocessType: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
1660
+ declare const pipelineType: typeof ZodPipeline.create;
1661
+ declare const ostring: () => ZodOptional<ZodString>;
1662
+ declare const onumber: () => ZodOptional<ZodNumber>;
1663
+ declare const oboolean: () => ZodOptional<ZodBoolean>;
1664
+ declare const coerce: {
1665
+ string: (typeof ZodString)["create"];
1666
+ number: (typeof ZodNumber)["create"];
1667
+ boolean: (typeof ZodBoolean)["create"];
1668
+ bigint: (typeof ZodBigInt)["create"];
1669
+ date: (typeof ZodDate)["create"];
1670
+ };
1671
+ declare const NEVER: never;
1672
+ //#endregion
1673
+ export { ZodCatch as $, objectInputType as $n, ZodInvalidIntersectionTypesIssue as $r, ZodRecordDef as $t, RefinementCtx as A, UseRhfUtilsFormOnSubmitErrorContext as Ai, custom as An, ParsePath as Ar, ZodNeverDef as At, Values as B, intersectionType as Bn, isValid as Br, ZodObject as Bt, OutputTypeOfTupleWithRest as C, Primitive as Ci, arrayOutputType as Cn, EMPTY_PATH as Cr, ZodMap as Ct, RawCreateParams as D, _Controller as Di, bigIntType as Dn, ParseContext as Dr, ZodNativeEnum as Dt, ProcessedCreateParams as E, RhfUtilsClientConfigFormOutletProps as Ei, baseObjectOutputType as En, ObjectPair as Er, ZodNaNDef as Et, SomeZodObject as F, FormSubmitFieldErrors as Fi, effectsType as Fn, SyncParseReturnType as Fr, ZodNullableDef as Ft, ZodArrayDef as G, mergeTypes as Gn, StringValidation as Gr, ZodPipeline as Gt, ZodAny as H, lazyType as Hn, DenormalizedError as Hr, ZodOptional as Ht, SuperRefinement as I, RhfUseFormInstanceProps as Ii, enumType as In, addIssueToContext as Ir, ZodNullableType as It, ZodBigIntDef as J, neverType as Jn, ZodErrorMap as Jr, ZodPromiseDef as Jt, ZodBigInt as K, nanType as Kn, ZodCustomIssue as Kr, ZodPipelineDef as Kt, TransformEffect as L, useFlatFieldErrorsContext as Li, functionType as Ln, isAborted as Lr, ZodNumber as Lt, SafeParseError as M, LastSubmitStatus as Mi, datetimeRegex as Mn, ParseResult as Mr, ZodNull as Mt, SafeParseReturnType as N, LastSubmitError as Ni, deoptional as Nn, ParseReturnType as Nr, ZodNullDef as Nt, RecordType as O, MaybePromise as Oi, booleanType as On, ParseInput as Or, ZodNativeEnumDef as Ot, SafeParseSuccess as P, FormSubmitError as Pi, discriminatedUnionType as Pn, ParseStatus as Pr, ZodNullable as Pt, ZodBrandedDef as Q, numberType as Qn, ZodInvalidEnumValueIssue as Qr, ZodRecord as Qt, TypeOf as R, input as Rn, isAsync as Rr, ZodNumberCheck as Rt, OutputTypeOfTuple as S, util as Si, anyType as Sn, DIRTY as Sr, ZodLiteralDef as St, PreprocessEffect as T, RhfUtilsClientConfig as Ti, baseObjectInputType as Tn, OK as Tr, ZodNaN as Tt, ZodAnyDef as U, literalType as Un, ErrorMapCtx as Ur, ZodOptionalDef as Ut, Writeable as V, late as Vn, makeIssue as Vr, ZodObjectDef as Vt, ZodArray as W, mapType as Wn, IssueData as Wr, ZodOptionalType as Wt, ZodBooleanDef as X, nullType as Xn, ZodInvalidArgumentsIssue as Xr, ZodReadonly as Xt, ZodBoolean as Y, noUnrecognized as Yn, ZodFormattedError as Yr, ZodRawShape as Yt, ZodBranded as Z, nullableType as Zn, ZodInvalidDateIssue as Zr, ZodReadonlyDef as Zt, InputTypeOfTupleWithRest as _, quotelessJson as _i, ZodUnionOptions as _n, undefinedType as _r, ZodIntersection as _t, AssertArray as a, ZodInvalidUnionIssue as ai, ZodSymbol as an, ostring as ar, ZodDefaultDef as at, NEVER as b, getParsedType as bi, ZodVoid as bn, voidType as br, ZodLazyDef as bt, CatchallOutput as c, ZodIssueCode as ci, ZodTupleDef as cn, preprocessType as cr, ZodDiscriminatedUnionOption as ct, EnumLike as d, ZodNotMultipleOfIssue as di, ZodTypeAny as dn, setType as dr, ZodEnum as dt, ZodInvalidLiteralIssue as ei, ZodSet as en, objectOutputType as er, ZodCatchDef as et, EnumValues as f, ZodTooBigIssue as fi, ZodTypeDef as fn, strictObjectType as fr, ZodEnumDef as ft, InputTypeOfTuple as g, inferFormattedError as gi, ZodUnionDef as gn, typecast as gr, ZodFunctionDef as gt, InnerTypeOfFunction as h, inferFlattenedErrors as hi, ZodUnion as hn, tupleType as hr, ZodFunction as ht, ArrayKeys as i, ZodInvalidUnionDiscriminatorIssue as ii, ZodStringDef as in, optionalType as ir, ZodDefault as it, RefinementEffect as j, LastSubmitContextRead as ji, dateType as jn, ParsePathComponent as jr, ZodNonEmptyArray as jt, Refinement as k, UseRhfUtilsFormOnSubmitContext as ki, coerce as kn, ParseParams as kr, ZodNever as kt, CustomErrorParams as l, ZodIssueOptionalMessage as li, ZodTupleItems as ln, promiseType as lr, ZodEffects as lt, Indices as m, ZodUnrecognizedKeysIssue as mi, ZodUndefinedDef as mn, symbolType as mr, ZodFirstPartyTypeKind as mt, AnyZodTuple as n, ZodInvalidStringIssue as ni, ZodString as nn, oboolean as nr, ZodDateCheck as nt, BRAND as o, ZodIssue as oi, ZodSymbolDef as on, output as or, ZodDiscriminatedUnion as ot, FilterEnum as p, ZodTooSmallIssue as pi, ZodUndefined as pn, stringType as pr, ZodFirstPartySchemaTypes as pt, ZodBigIntCheck as q, nativeEnumType as qn, ZodError as qr, ZodPromise as qt, ArrayCardinality as r, ZodInvalidTypeIssue as ri, ZodStringCheck as rn, onumber as rr, ZodDateDef as rt, CatchallInput as s, ZodIssueBase as si, ZodTuple as sn, pipelineType as sr, ZodDiscriminatedUnionDef as st, AnyZodObject as t, ZodInvalidReturnTypeIssue as ti, ZodSetDef as tn, objectType as tr, ZodDate as tt, Effect as u, ZodNotFiniteIssue as ui, ZodType as un, recordType as ur, ZodEffectsDef as ut, IpVersion as v, typeToFlattenedError as vi, ZodUnknown as vn, unionType as vr, ZodIntersectionDef as vt, PassthroughType as w, Scalars as wi, arrayType as wn, INVALID as wr, ZodMapDef as wt, OuterTypeOfFunction as x, objectUtil as xi, ZodVoidDef as xn, AsyncParseReturnType as xr, ZodLiteral as xt, KeySchema as y, ZodParsedType as yi, ZodUnknownDef as yn, unknownType as yr, ZodLazy as yt, UnknownKeysParam as z, instanceOfType as zn, isDirty as zr, ZodNumberDef as zt };
1674
+ //# sourceMappingURL=types-DGFncyYT.d.ts.map