zod 4.0.0-beta.20250411T005215 → 4.0.0-beta.20250411T232125
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/dist/commonjs/coerce.js +7 -17
- package/dist/commonjs/compat.d.ts +1 -0
- package/dist/commonjs/compat.js +7 -17
- package/dist/commonjs/errors.js +7 -17
- package/dist/commonjs/external.js +7 -17
- package/dist/commonjs/index.js +7 -17
- package/dist/commonjs/iso.js +7 -17
- package/dist/commonjs/parse.js +7 -17
- package/dist/commonjs/schemas.d.ts +75 -71
- package/dist/commonjs/schemas.js +9 -19
- package/dist/esm/compat.d.ts +1 -0
- package/dist/esm/schemas.d.ts +75 -71
- package/dist/esm/schemas.js +2 -2
- package/package.json +2 -2
- package/src/compat.ts +2 -0
- package/src/schemas.ts +119 -92
package/dist/commonjs/coerce.js
CHANGED
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
26
|
exports.string = string;
|
|
37
27
|
exports.number = number;
|
package/dist/commonjs/compat.js
CHANGED
|
@@ -16,23 +16,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
16
16
|
}) : function(o, v) {
|
|
17
17
|
o["default"] = v;
|
|
18
18
|
});
|
|
19
|
-
var __importStar = (this && this.__importStar) ||
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
36
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
27
|
exports.config = exports.$brand = exports.NEVER = exports.ZodIssueCode = void 0;
|
|
38
28
|
exports.setErrorMap = setErrorMap;
|
package/dist/commonjs/errors.js
CHANGED
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
26
|
exports.ZodError = void 0;
|
|
37
27
|
const core = __importStar(require("@zod/core"));
|
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
27
|
};
|
package/dist/commonjs/index.js
CHANGED
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
27
|
};
|
package/dist/commonjs/iso.js
CHANGED
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
26
|
exports.ZodISODuration = exports.ZodISOTime = exports.ZodISODate = exports.ZodISODateTime = void 0;
|
|
37
27
|
exports.datetime = datetime;
|
package/dist/commonjs/parse.js
CHANGED
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
26
|
exports.safeParseAsync = exports.parseAsync = exports.safeParse = exports.parse = void 0;
|
|
37
27
|
const core = __importStar(require("@zod/core"));
|
|
@@ -3,7 +3,6 @@ import { util } from "@zod/core";
|
|
|
3
3
|
import * as parse from "./parse.js";
|
|
4
4
|
export * as iso from "./iso.js";
|
|
5
5
|
export * as coerce from "./coerce.js";
|
|
6
|
-
type SomeType = core.$ZodType;
|
|
7
6
|
export interface RefinementCtx<T = unknown> extends core.ParsePayload<T> {
|
|
8
7
|
addIssue(arg: string | core.$ZodRawIssue | Partial<core.$ZodIssueCustom>): void;
|
|
9
8
|
}
|
|
@@ -11,6 +10,10 @@ export interface ZodType<out Output = unknown, out Input = unknown> extends core
|
|
|
11
10
|
def: this["_zod"]["def"];
|
|
12
11
|
/** @deprecated Use `.def` instead. */
|
|
13
12
|
_def: this["_zod"]["def"];
|
|
13
|
+
/** @deprecated Use `z.output<typeof schema>` instead. */
|
|
14
|
+
_output: this["_zod"]["output"];
|
|
15
|
+
/** @deprecated Use `z.input<typeof schema>` instead. */
|
|
16
|
+
_input: this["_zod"]["input"];
|
|
14
17
|
check(...checks: (core.CheckFn<this["_zod"]["output"]> | core.$ZodCheck<this["_zod"]["output"]>)[]): this;
|
|
15
18
|
clone(def?: this["_zod"]["def"]): this;
|
|
16
19
|
register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$ZodRegistry<R["_meta"], this>["_meta"]?] : [core.$ZodRegistry<R["_meta"], this>["_meta"]] : ["Incompatible schema"]): this;
|
|
@@ -32,6 +35,7 @@ export interface ZodType<out Output = unknown, out Input = unknown> extends core
|
|
|
32
35
|
default(def: () => util.NoUndefined<core.output<this>>, params?: core.$ZodDefaultParams): ZodDefault<this>;
|
|
33
36
|
array(): ZodArray<this>;
|
|
34
37
|
or<T extends core.$ZodType>(option: T): ZodUnion<[this, T]>;
|
|
38
|
+
and<T extends core.$ZodType>(incoming: T): ZodIntersection<this, T>;
|
|
35
39
|
transform<NewOut>(transform: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
|
|
36
40
|
catch(def: core.output<this>): ZodCatch<this>;
|
|
37
41
|
catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
|
|
@@ -372,7 +376,7 @@ export interface ZodDate extends _ZodDate<Date> {
|
|
|
372
376
|
}
|
|
373
377
|
export declare const ZodDate: core.$constructor<ZodDate>;
|
|
374
378
|
export declare function date(params?: string | core.$ZodDateParams): ZodDate;
|
|
375
|
-
export interface ZodArray<T extends
|
|
379
|
+
export interface ZodArray<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
376
380
|
_zod: core.$ZodArrayInternals<T>;
|
|
377
381
|
element: T;
|
|
378
382
|
min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
|
|
@@ -381,28 +385,28 @@ export interface ZodArray<T extends SomeType = SomeType> extends ZodType {
|
|
|
381
385
|
length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
|
|
382
386
|
}
|
|
383
387
|
export declare const ZodArray: core.$constructor<ZodArray>;
|
|
384
|
-
export declare function array<T extends
|
|
388
|
+
export declare function array<T extends core.$ZodType>(element: T, params?: core.$ZodArrayParams): ZodArray<T>;
|
|
385
389
|
export interface ZodObjectLike<out O = object, out I = object> extends ZodType {
|
|
386
390
|
_zod: core.$ZodObjectLikeInternals<O, I>;
|
|
387
391
|
}
|
|
388
392
|
export declare const ZodObjectLike: core.$constructor<ZodObjectLike>;
|
|
389
|
-
export declare function keyof<T extends ZodObject>(schema: T): ZodLiteral<keyof T["_zod"]["shape"]>;
|
|
393
|
+
export declare function keyof<T extends ZodObject>(schema: T): ZodLiteral<keyof T["_zod"]["def"]["shape"]>;
|
|
390
394
|
export declare function keyof<T extends ZodInterface>(schema: T): ZodLiteral<keyof T["_zod"]["output"]>;
|
|
391
|
-
type ZodInterfacePartial<T extends ZodInterface, Keys extends keyof T["_zod"]["shape"] = keyof T["_zod"]["shape"]> = ZodInterface<util.ExtendShape<T["_zod"]["shape"], {
|
|
392
|
-
[k in Keys]: ZodOptional<T["_zod"]["shape"][k]>;
|
|
395
|
+
type ZodInterfacePartial<T extends ZodInterface, Keys extends keyof T["_zod"]["def"]["shape"] = keyof T["_zod"]["def"]["shape"]> = ZodInterface<util.ExtendShape<T["_zod"]["def"]["shape"], {
|
|
396
|
+
[k in Keys]: ZodOptional<T["_zod"]["def"]["shape"][k]>;
|
|
393
397
|
}>, {
|
|
394
398
|
optional: T["_zod"]["optional"] | (string & Keys);
|
|
395
399
|
defaulted: T["_zod"]["defaulted"];
|
|
396
400
|
extra: T["_zod"]["extra"];
|
|
397
401
|
}>;
|
|
398
|
-
type ZodInterfaceRequired<T extends ZodInterface, Keys extends keyof T["_zod"]["shape"] = keyof T["_zod"]["shape"]> = ZodInterface<util.ExtendShape<T["_zod"]["shape"], {
|
|
399
|
-
[k in Keys]: ZodNonOptional<T["_zod"]["shape"][k]>;
|
|
402
|
+
type ZodInterfaceRequired<T extends ZodInterface, Keys extends keyof T["_zod"]["def"]["shape"] = keyof T["_zod"]["def"]["shape"]> = ZodInterface<util.ExtendShape<T["_zod"]["def"]["shape"], {
|
|
403
|
+
[k in Keys]: ZodNonOptional<T["_zod"]["def"]["shape"][k]>;
|
|
400
404
|
}>, {
|
|
401
405
|
optional: never;
|
|
402
406
|
defaulted: T["_zod"]["defaulted"];
|
|
403
407
|
extra: T["_zod"]["extra"];
|
|
404
408
|
}>;
|
|
405
|
-
type MergeInterfaces<A extends ZodInterface, B extends ZodInterface> = ZodInterface<util.ExtendShape<A["_zod"]["shape"], B["_zod"]["shape"]>, util.MergeInterfaceParams<A, B>>;
|
|
409
|
+
export type MergeInterfaces<A extends ZodInterface, B extends ZodInterface> = ZodInterface<util.ExtendShape<A["_zod"]["def"]["shape"], B["_zod"]["def"]["shape"]>, util.MergeInterfaceParams<A, B>>;
|
|
406
410
|
export interface ZodInterface<out Shape extends core.$ZodLooseShape = core.$ZodLooseShape, out Params extends core.$ZodInterfaceNamedParams = core.$ZodInterfaceNamedParams> extends ZodType {
|
|
407
411
|
_zod: core.$ZodInterfaceInternals<Shape, Params>;
|
|
408
412
|
keyof(): ZodEnum<util.ToEnum<util.InterfaceKeys<string & keyof Shape>>>;
|
|
@@ -428,7 +432,7 @@ export interface ZodInterface<out Shape extends core.$ZodLooseShape = core.$ZodL
|
|
|
428
432
|
}>;
|
|
429
433
|
extend<U extends ZodInterface>(int: U): MergeInterfaces<this, U>;
|
|
430
434
|
extend<U extends core.$ZodLooseShape>(shape: U): MergeInterfaces<this, ZodInterface<U, util.InitInterfaceParams<U, {}>>>;
|
|
431
|
-
/** @deprecated Use
|
|
435
|
+
/** @deprecated Use `A.extend(B)` */
|
|
432
436
|
merge<U extends ZodInterface>(incoming: U): MergeInterfaces<this, U>;
|
|
433
437
|
pick<const M extends util.Exactly<util.Mask<string & keyof Shape>, M>>(mask: M): ZodInterface<util.Flatten<Pick<Shape, keyof Shape & keyof M>>, {
|
|
434
438
|
optional: Extract<Params["optional"], keyof M>;
|
|
@@ -463,7 +467,7 @@ export interface ZodObject<out Shape extends core.$ZodShape = core.$ZodShape, Ex
|
|
|
463
467
|
strict(): ZodObject<Shape, {}>;
|
|
464
468
|
/** @deprecated This is the default behavior. This method call is likely unnecessary. */
|
|
465
469
|
strip(): ZodObject<Shape, {}>;
|
|
466
|
-
extend<U extends ZodObject>(
|
|
470
|
+
extend<const U extends ZodObject>(schema: U): ZodObject<util.ExtendShape<Shape, U["_zod"]["def"]["shape"]>, Extra>;
|
|
467
471
|
extend<U extends core.$ZodShape>(shape: U): ZodObject<util.ExtendShape<Shape, U>, Extra>;
|
|
468
472
|
/** @deprecated Use `A.extend(B)` */
|
|
469
473
|
merge<U extends ZodObject<any, any>>(other: U): ZodObject<util.Flatten<util.Overwrite<Shape, U["_zod"]["def"]["shape"]>>, Extra>;
|
|
@@ -483,61 +487,61 @@ export interface ZodObject<out Shape extends core.$ZodShape = core.$ZodShape, Ex
|
|
|
483
487
|
}, Extra>;
|
|
484
488
|
}
|
|
485
489
|
export declare const ZodObject: core.$constructor<ZodObject>;
|
|
486
|
-
export declare function object<T extends core.$ZodShape = Record<never,
|
|
490
|
+
export declare function object<T extends core.$ZodShape = Record<never, core.$ZodType>>(shape?: T, params?: core.$ZodObjectLikeParams): ZodObject<T, {}>;
|
|
487
491
|
export declare function strictObject<T extends core.$ZodShape>(shape: T, params?: core.$ZodObjectParams): ZodObject<T, {}>;
|
|
488
492
|
export declare function looseObject<T extends core.$ZodShape>(shape: T, params?: core.$ZodObjectParams): ZodObject<T, {
|
|
489
493
|
[k: string]: unknown;
|
|
490
494
|
}>;
|
|
491
|
-
export declare function extend<T extends ZodInterface, U extends ZodInterface>(a: T, b: U): ZodInterface<util.ExtendShape<T["_zod"]["shape"], U["_zod"]["shape"]>, util.MergeInterfaceParams<T, U>>;
|
|
492
|
-
export declare function extend<T extends ZodObject, U extends ZodObject>(a: T, b: U): ZodObject<util.ExtendObject<T["_zod"]["shape"], U["_zod"]["shape"]>, U["_zod"]["extra"] & T["_zod"]["extra"]>;
|
|
493
|
-
export declare function extend<T extends ZodObjectLike, U extends core.$ZodLooseShape>(schema: T, shape: U): T extends ZodInterface<infer TShape, infer TParams> ? ZodInterface<util.ExtendInterfaceShape<TShape, U>, util.ExtendInterfaceParams<ZodInterface<TShape, TParams>, U>> : ZodObject<util.ExtendObject<T["_zod"]["shape"], U>, T["_zod"]["extra"]>;
|
|
494
|
-
export declare function merge<T extends ZodObjectLike, U extends core.$ZodLooseShape>(schema: T, shape: U): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.ExtendShape<T["_zod"]["shape"], U["_zod"]["shape"]>, {
|
|
495
|
+
export declare function extend<T extends ZodInterface, U extends ZodInterface>(a: T, b: U): ZodInterface<util.ExtendShape<T["_zod"]["def"]["shape"], U["_zod"]["def"]["shape"]>, util.MergeInterfaceParams<T, U>>;
|
|
496
|
+
export declare function extend<T extends ZodObject, U extends ZodObject>(a: T, b: U): ZodObject<util.ExtendObject<T["_zod"]["def"]["shape"], U["_zod"]["def"]["shape"]>, U["_zod"]["extra"] & T["_zod"]["extra"]>;
|
|
497
|
+
export declare function extend<T extends ZodObjectLike, U extends core.$ZodLooseShape>(schema: T, shape: U): T extends ZodInterface<infer TShape, infer TParams> ? ZodInterface<util.ExtendInterfaceShape<TShape, U>, util.ExtendInterfaceParams<ZodInterface<TShape, TParams>, U>> : ZodObject<util.ExtendObject<T["_zod"]["def"]["shape"], U>, T["_zod"]["extra"]>;
|
|
498
|
+
export declare function merge<T extends ZodObjectLike, U extends core.$ZodLooseShape>(schema: T, shape: U): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.ExtendShape<T["_zod"]["def"]["shape"], U["_zod"]["def"]["shape"]>, {
|
|
495
499
|
extra: T["_zod"]["extra"] & U["_zod"]["extra"];
|
|
496
|
-
optional: Exclude<T["_zod"]["optional"], keyof U["_zod"]["shape"]> | U["_zod"]["optional"];
|
|
497
|
-
defaulted: Exclude<T["_zod"]["defaulted"], keyof U["_zod"]["shape"]> | U["_zod"]["defaulted"];
|
|
498
|
-
}> : ZodObject<util.ExtendObject<T["_zod"]["shape"], U>, T["_zod"]["extra"]>;
|
|
499
|
-
export declare function pick<T extends ZodObjectLike, M extends util.Exactly<util.Mask<keyof T["_zod"]["shape"]>, M>>(schema: T, mask: M): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.Flatten<Pick<T["_zod"]["shape"], keyof T["_zod"]["shape"] & keyof M>>, {
|
|
500
|
+
optional: Exclude<T["_zod"]["optional"], keyof U["_zod"]["def"]["shape"]> | U["_zod"]["optional"];
|
|
501
|
+
defaulted: Exclude<T["_zod"]["defaulted"], keyof U["_zod"]["def"]["shape"]> | U["_zod"]["defaulted"];
|
|
502
|
+
}> : ZodObject<util.ExtendObject<T["_zod"]["def"]["shape"], U>, T["_zod"]["extra"]>;
|
|
503
|
+
export declare function pick<T extends ZodObjectLike, M extends util.Exactly<util.Mask<keyof T["_zod"]["def"]["shape"]>, M>>(schema: T, mask: M): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.Flatten<Pick<T["_zod"]["def"]["shape"], keyof T["_zod"]["def"]["shape"] & keyof M>>, {
|
|
500
504
|
optional: Extract<T["_zod"]["optional"], keyof M>;
|
|
501
505
|
defaulted: Extract<T["_zod"]["defaulted"], keyof M>;
|
|
502
506
|
extra: T["_zod"]["extra"];
|
|
503
|
-
}> : ZodObject<util.Flatten<Pick<T["_zod"]["shape"], keyof T["_zod"]["shape"] & keyof M>>, T["_zod"]["extra"]>;
|
|
504
|
-
export declare function omit<T extends ZodObjectLike, const M extends util.Exactly<util.Mask<keyof T["_zod"]["shape"]>, M>>(schema: T, mask: M): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.Flatten<Omit<T["_zod"]["shape"], keyof M>>, {
|
|
507
|
+
}> : ZodObject<util.Flatten<Pick<T["_zod"]["def"]["shape"], keyof T["_zod"]["def"]["shape"] & keyof M>>, T["_zod"]["extra"]>;
|
|
508
|
+
export declare function omit<T extends ZodObjectLike, const M extends util.Exactly<util.Mask<keyof T["_zod"]["def"]["shape"]>, M>>(schema: T, mask: M): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.Flatten<Omit<T["_zod"]["def"]["shape"], keyof M>>, {
|
|
505
509
|
optional: Exclude<T["_zod"]["optional"], keyof M>;
|
|
506
510
|
defaulted: Exclude<T["_zod"]["defaulted"], keyof M>;
|
|
507
511
|
extra: T["_zod"]["extra"];
|
|
508
|
-
}> : ZodObject<util.Flatten<Omit<T["_zod"]["shape"], keyof M>>, T["_zod"]["extra"]>;
|
|
512
|
+
}> : ZodObject<util.Flatten<Omit<T["_zod"]["def"]["shape"], keyof M>>, T["_zod"]["extra"]>;
|
|
509
513
|
export declare function partial<T extends ZodObjectLike>(schema: T): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<{
|
|
510
|
-
[k in keyof T["_zod"]["shape"]]: ZodOptional<T["_zod"]["shape"][k]>;
|
|
514
|
+
[k in keyof T["_zod"]["def"]["shape"]]: ZodOptional<T["_zod"]["def"]["shape"][k]>;
|
|
511
515
|
}, {
|
|
512
|
-
optional: string & keyof T["_zod"]["shape"];
|
|
516
|
+
optional: string & keyof T["_zod"]["def"]["shape"];
|
|
513
517
|
defaulted: never;
|
|
514
518
|
extra: T["_zod"]["extra"];
|
|
515
519
|
}> : ZodObject<{
|
|
516
|
-
[k in keyof T["_zod"]["shape"]]: ZodOptional<T["_zod"]["shape"][k]>;
|
|
520
|
+
[k in keyof T["_zod"]["def"]["shape"]]: ZodOptional<T["_zod"]["def"]["shape"][k]>;
|
|
517
521
|
}, T["_zod"]["extra"]>;
|
|
518
|
-
export declare function partial<T extends ZodObjectLike, M extends util.Exactly<util.Mask<keyof T["_zod"]["shape"]>, M>>(schema: T, mask: M): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.ExtendShape<T["_zod"]["shape"], {
|
|
519
|
-
[k in keyof M & keyof T["_zod"]["shape"]]: ZodOptional<T["_zod"]["shape"][k]>;
|
|
522
|
+
export declare function partial<T extends ZodObjectLike, M extends util.Exactly<util.Mask<keyof T["_zod"]["def"]["shape"]>, M>>(schema: T, mask: M): T["_zod"]["def"]["type"] extends "interface" ? ZodInterface<util.ExtendShape<T["_zod"]["def"]["shape"], {
|
|
523
|
+
[k in keyof M & keyof T["_zod"]["def"]["shape"]]: ZodOptional<T["_zod"]["def"]["shape"][k]>;
|
|
520
524
|
}>, {
|
|
521
525
|
optional: string & (T["_zod"]["optional"] | keyof M);
|
|
522
526
|
defaulted: T["_zod"]["defaulted"];
|
|
523
527
|
extra: T["_zod"]["extra"];
|
|
524
528
|
}> : ZodObject<{
|
|
525
|
-
[k in keyof T["_zod"]["shape"]]: k extends keyof M ? ZodOptional<T["_zod"]["shape"][k]> : T["_zod"]["shape"][k];
|
|
529
|
+
[k in keyof T["_zod"]["def"]["shape"]]: k extends keyof M ? ZodOptional<T["_zod"]["def"]["shape"][k]> : T["_zod"]["def"]["shape"][k];
|
|
526
530
|
}, T["_zod"]["extra"]>;
|
|
527
531
|
export declare function required<T extends {
|
|
528
532
|
_subtype: "object";
|
|
529
533
|
} & ZodObject>(schema: T): ZodObject<{
|
|
530
|
-
[k in keyof T["_zod"]["shape"]]: ZodNonOptional<T["_zod"]["shape"][k]>;
|
|
534
|
+
[k in keyof T["_zod"]["def"]["shape"]]: ZodNonOptional<T["_zod"]["def"]["shape"][k]>;
|
|
531
535
|
}>;
|
|
532
536
|
export declare function required<T extends {
|
|
533
537
|
_subtype: "object";
|
|
534
|
-
} & ZodObject, M extends util.Exactly<util.Mask<keyof T["_zod"]["shape"]>, M>>(schema: T, mask: M): ZodObject<util.ExtendShape<T["_zod"]["shape"], {
|
|
535
|
-
[k in keyof M & keyof T["_zod"]["shape"]]: ZodNonOptional<T["_zod"]["shape"][k]>;
|
|
538
|
+
} & ZodObject, M extends util.Exactly<util.Mask<keyof T["_zod"]["def"]["shape"]>, M>>(schema: T, mask: M): ZodObject<util.ExtendShape<T["_zod"]["def"]["shape"], {
|
|
539
|
+
[k in keyof M & keyof T["_zod"]["def"]["shape"]]: ZodNonOptional<T["_zod"]["def"]["shape"][k]>;
|
|
536
540
|
}>>;
|
|
537
541
|
export declare function required<T extends {
|
|
538
542
|
_subtype: "interface";
|
|
539
543
|
} & ZodInterface>(schema: T): ZodInterface<{
|
|
540
|
-
[k in keyof T["_zod"]["shape"]]: ZodNonOptional<T["_zod"]["shape"][k]>;
|
|
544
|
+
[k in keyof T["_zod"]["def"]["shape"]]: ZodNonOptional<T["_zod"]["def"]["shape"][k]>;
|
|
541
545
|
}, {
|
|
542
546
|
optional: never;
|
|
543
547
|
defaulted: T["_zod"]["defaulted"];
|
|
@@ -545,20 +549,20 @@ export declare function required<T extends {
|
|
|
545
549
|
}>;
|
|
546
550
|
export declare function required<T extends {
|
|
547
551
|
_subtype: "interface";
|
|
548
|
-
} & ZodInterface, M extends util.Mask<keyof T["_zod"]["output"]>>(schema: T, mask: M): ZodInterface<util.ExtendShape<T["_zod"]["shape"], {
|
|
549
|
-
[k in keyof M & keyof T["_zod"]["shape"]]: ZodNonOptional<T["_zod"]["shape"][k]>;
|
|
552
|
+
} & ZodInterface, M extends util.Mask<keyof T["_zod"]["output"]>>(schema: T, mask: M): ZodInterface<util.ExtendShape<T["_zod"]["def"]["shape"], {
|
|
553
|
+
[k in keyof M & keyof T["_zod"]["def"]["shape"]]: ZodNonOptional<T["_zod"]["def"]["shape"][k]>;
|
|
550
554
|
}>, {
|
|
551
555
|
optional: Exclude<T["_zod"]["optional"], keyof M>;
|
|
552
556
|
defaulted: T["_zod"]["defaulted"];
|
|
553
557
|
extra: T["_zod"]["extra"];
|
|
554
558
|
}>;
|
|
555
|
-
export interface ZodUnion<T extends readonly
|
|
559
|
+
export interface ZodUnion<T extends readonly core.$ZodType[] = readonly core.$ZodType[]> extends ZodType {
|
|
556
560
|
_zod: core.$ZodUnionInternals<T>;
|
|
557
561
|
options: T;
|
|
558
562
|
}
|
|
559
563
|
export declare const ZodUnion: core.$constructor<ZodUnion>;
|
|
560
|
-
export declare function union<const T extends readonly
|
|
561
|
-
export interface ZodDiscriminatedUnion<Options extends readonly
|
|
564
|
+
export declare function union<const T extends readonly core.$ZodType[]>(options: T, params?: core.$ZodUnionParams): ZodUnion<T>;
|
|
565
|
+
export interface ZodDiscriminatedUnion<Options extends readonly core.$ZodType[] = readonly core.$ZodType[]> extends ZodUnion<Options> {
|
|
562
566
|
_zod: core.$ZodDiscriminatedUnionInternals<Options>;
|
|
563
567
|
}
|
|
564
568
|
export declare const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion>;
|
|
@@ -570,34 +574,34 @@ export interface $ZodTypeDiscriminable extends ZodType {
|
|
|
570
574
|
}
|
|
571
575
|
export declare function discriminatedUnion<Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]]>(disc: string, options: Types, params?: core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
|
|
572
576
|
export declare function discriminatedUnion<Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]]>(options: Types, params?: core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
|
|
573
|
-
export interface ZodIntersection<A extends
|
|
577
|
+
export interface ZodIntersection<A extends core.$ZodType = core.$ZodType, B extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
574
578
|
_zod: core.$ZodIntersectionInternals<A, B>;
|
|
575
579
|
}
|
|
576
580
|
export declare const ZodIntersection: core.$constructor<ZodIntersection>;
|
|
577
|
-
export declare function intersection<T extends
|
|
578
|
-
export interface ZodTuple<T extends util.TupleItems = util.TupleItems, Rest extends
|
|
581
|
+
export declare function intersection<T extends core.$ZodType, U extends core.$ZodType>(left: T, right: U, params?: core.$ZodIntersectionParams): ZodIntersection<T, U>;
|
|
582
|
+
export interface ZodTuple<T extends util.TupleItems = util.TupleItems, Rest extends core.$ZodType | null = core.$ZodType | null> extends ZodType {
|
|
579
583
|
_zod: core.$ZodTupleInternals<T, Rest>;
|
|
580
584
|
rest<Rest extends core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
|
|
581
585
|
}
|
|
582
586
|
export declare const ZodTuple: core.$constructor<ZodTuple>;
|
|
583
|
-
export declare function tuple<T extends readonly [
|
|
584
|
-
export declare function tuple<T extends readonly [
|
|
587
|
+
export declare function tuple<T extends readonly [core.$ZodType, ...core.$ZodType[]]>(items: T, params?: core.$ZodTupleParams): ZodTuple<T, null>;
|
|
588
|
+
export declare function tuple<T extends readonly [core.$ZodType, ...core.$ZodType[]], Rest extends core.$ZodType>(items: T, rest: Rest, params?: core.$ZodTupleParams): ZodTuple<T, Rest>;
|
|
585
589
|
export declare function tuple(items: [], params?: core.$ZodTupleParams): ZodTuple<[], null>;
|
|
586
|
-
export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends
|
|
590
|
+
export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
587
591
|
_zod: core.$ZodRecordInternals<Key, Value>;
|
|
588
592
|
keyType: Key;
|
|
589
593
|
valueType: Value;
|
|
590
594
|
}
|
|
591
595
|
export declare const ZodRecord: core.$constructor<ZodRecord>;
|
|
592
|
-
export declare function record<Key extends core.$ZodRecordKey, Value extends
|
|
593
|
-
export interface ZodMap<Key extends
|
|
596
|
+
export declare function record<Key extends core.$ZodRecordKey, Value extends core.$ZodType>(keyType: Key, valueType: Value, params?: core.$ZodRecordParams): ZodRecord<Key, Value>;
|
|
597
|
+
export interface ZodMap<Key extends core.$ZodType = core.$ZodType, Value extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
594
598
|
_zod: core.$ZodMapInternals<Key, Value>;
|
|
595
599
|
keyType: Key;
|
|
596
600
|
valueType: Value;
|
|
597
601
|
}
|
|
598
602
|
export declare const ZodMap: core.$constructor<ZodMap>;
|
|
599
|
-
export declare function map<Key extends
|
|
600
|
-
export interface ZodSet<T extends
|
|
603
|
+
export declare function map<Key extends core.$ZodType, Value extends core.$ZodType>(keyType: Key, valueType: Value, params?: core.$ZodMapParams): ZodMap<Key, Value>;
|
|
604
|
+
export interface ZodSet<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
601
605
|
_zod: core.$ZodSetInternals<T>;
|
|
602
606
|
min(minSize: number, params?: core.$ZodCheckMinSizeParams): this;
|
|
603
607
|
/** */
|
|
@@ -606,7 +610,7 @@ export interface ZodSet<T extends SomeType = SomeType> extends ZodType {
|
|
|
606
610
|
size(size: number, params?: core.$ZodCheckSizeEqualsParams): this;
|
|
607
611
|
}
|
|
608
612
|
export declare const ZodSet: core.$constructor<ZodSet>;
|
|
609
|
-
export declare function set<Value extends
|
|
613
|
+
export declare function set<Value extends core.$ZodType>(valueType: Value, params?: core.$ZodSetParams): ZodSet<Value>;
|
|
610
614
|
export interface ZodEnum<T extends util.EnumLike = util.EnumLike> extends ZodType {
|
|
611
615
|
_zod: core.$ZodEnumInternals<T>;
|
|
612
616
|
enum: T;
|
|
@@ -615,8 +619,8 @@ export interface ZodEnum<T extends util.EnumLike = util.EnumLike> extends ZodTyp
|
|
|
615
619
|
exclude<const U extends readonly (keyof T)[]>(values: U, params?: core.$ZodEnumParams): ZodEnum<util.Flatten<Omit<T, U[number]>>>;
|
|
616
620
|
}
|
|
617
621
|
export declare const ZodEnum: core.$constructor<ZodEnum>;
|
|
618
|
-
declare function _enum<const T extends string[]>(values: T, params?: core.$ZodEnumParams): ZodEnum<util.ToEnum<T[number]>>;
|
|
619
|
-
declare function _enum<T extends util.EnumLike>(entries: T, params?: core.$ZodEnumParams): ZodEnum<T>;
|
|
622
|
+
declare function _enum<const T extends readonly string[]>(values: T, params?: core.$ZodEnumParams): ZodEnum<util.ToEnum<T[number]>>;
|
|
623
|
+
declare function _enum<const T extends util.EnumLike>(entries: T, params?: core.$ZodEnumParams): ZodEnum<T>;
|
|
620
624
|
export { _enum as enum };
|
|
621
625
|
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
|
622
626
|
*
|
|
@@ -646,82 +650,82 @@ export interface ZodTransform<O = unknown, I = unknown> extends ZodType {
|
|
|
646
650
|
}
|
|
647
651
|
export declare const ZodTransform: core.$constructor<ZodTransform>;
|
|
648
652
|
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O, params?: core.$ZodTransformParams): ZodTransform<Awaited<O>, I>;
|
|
649
|
-
export interface ZodOptional<T extends
|
|
653
|
+
export interface ZodOptional<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
650
654
|
_zod: core.$ZodOptionalInternals<T>;
|
|
651
655
|
unwrap(): T;
|
|
652
656
|
}
|
|
653
657
|
export declare const ZodOptional: core.$constructor<ZodOptional>;
|
|
654
|
-
export declare function optional<T extends
|
|
655
|
-
export interface ZodNullable<T extends
|
|
658
|
+
export declare function optional<T extends core.$ZodType>(innerType: T, params?: core.$ZodOptionalParams): ZodOptional<T>;
|
|
659
|
+
export interface ZodNullable<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
656
660
|
_zod: core.$ZodNullableInternals<T>;
|
|
657
661
|
unwrap(): T;
|
|
658
662
|
}
|
|
659
663
|
export declare const ZodNullable: core.$constructor<ZodNullable>;
|
|
660
|
-
export declare function nullable<T extends
|
|
661
|
-
export declare function nullish<T extends
|
|
662
|
-
export interface ZodDefault<T extends
|
|
664
|
+
export declare function nullable<T extends core.$ZodType>(innerType: T, params?: core.$ZodNullableParams): ZodNullable<T>;
|
|
665
|
+
export declare function nullish<T extends core.$ZodType>(innerType: T): ZodOptional<ZodNullable<T>>;
|
|
666
|
+
export interface ZodDefault<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
663
667
|
_zod: core.$ZodDefaultInternals<T>;
|
|
664
668
|
unwrap(): T;
|
|
665
669
|
/** @deprecated Use `.unwrap()` instead. */
|
|
666
670
|
removeDefault(): T;
|
|
667
671
|
}
|
|
668
672
|
export declare const ZodDefault: core.$constructor<ZodDefault>;
|
|
669
|
-
export declare function _default<T extends
|
|
670
|
-
export interface ZodNonOptional<T extends
|
|
673
|
+
export declare function _default<T extends core.$ZodType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>), params?: core.$ZodDefaultParams): ZodDefault<T>;
|
|
674
|
+
export interface ZodNonOptional<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
671
675
|
_zod: core.$ZodNonOptionalInternals<T>;
|
|
672
676
|
unwrap(): T;
|
|
673
677
|
}
|
|
674
678
|
export declare const ZodNonOptional: core.$constructor<ZodNonOptional>;
|
|
675
|
-
export declare function nonoptional<T extends
|
|
676
|
-
export interface ZodSuccess<T extends
|
|
679
|
+
export declare function nonoptional<T extends core.$ZodType>(innerType: T, params?: core.$ZodNonOptionalParams): ZodNonOptional<T>;
|
|
680
|
+
export interface ZodSuccess<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
677
681
|
_zod: core.$ZodSuccessInternals<T>;
|
|
678
682
|
unwrap(): T;
|
|
679
683
|
}
|
|
680
684
|
export declare const ZodSuccess: core.$constructor<ZodSuccess>;
|
|
681
|
-
export declare function success<T extends
|
|
682
|
-
export interface ZodCatch<T extends
|
|
685
|
+
export declare function success<T extends core.$ZodType>(innerType: T, params?: core.$ZodSuccessParams): ZodSuccess<T>;
|
|
686
|
+
export interface ZodCatch<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
683
687
|
_zod: core.$ZodCatchInternals<T>;
|
|
684
688
|
unwrap(): T;
|
|
685
689
|
/** @deprecated Use `.unwrap()` instead. */
|
|
686
690
|
removeCatch(): T;
|
|
687
691
|
}
|
|
688
692
|
export declare const ZodCatch: core.$constructor<ZodCatch>;
|
|
689
|
-
declare function _catch<T extends
|
|
693
|
+
declare function _catch<T extends core.$ZodType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>), params?: core.$ZodCatchParams): ZodCatch<T>;
|
|
690
694
|
export { _catch as catch };
|
|
691
695
|
export interface ZodNaN extends ZodType {
|
|
692
696
|
_zod: core.$ZodNaNInternals;
|
|
693
697
|
}
|
|
694
698
|
export declare const ZodNaN: core.$constructor<ZodNaN>;
|
|
695
699
|
export declare function nan(params?: string | core.$ZodNaNParams): ZodNaN;
|
|
696
|
-
export interface ZodPipe<A extends
|
|
700
|
+
export interface ZodPipe<A extends core.$ZodType = core.$ZodType, B extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
697
701
|
_zod: core.$ZodPipeInternals<A, B>;
|
|
698
702
|
in: A;
|
|
699
703
|
out: B;
|
|
700
704
|
}
|
|
701
705
|
export declare const ZodPipe: core.$constructor<ZodPipe>;
|
|
702
706
|
export declare function pipe<const A extends core.$ZodType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>, params?: core.$ZodPipeParams): ZodPipe<A, B>;
|
|
703
|
-
export interface ZodReadonly<T extends
|
|
707
|
+
export interface ZodReadonly<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
704
708
|
_zod: core.$ZodReadonlyInternals<T>;
|
|
705
709
|
}
|
|
706
710
|
export declare const ZodReadonly: core.$constructor<ZodReadonly>;
|
|
707
|
-
export declare function readonly<T extends
|
|
711
|
+
export declare function readonly<T extends core.$ZodType>(innerType: T, params?: core.$ZodReadonlyParams): ZodReadonly<T>;
|
|
708
712
|
export interface ZodTemplateLiteral<Template extends string = string> extends ZodType {
|
|
709
713
|
_zod: core.$ZodTemplateLiteralInternals<Template>;
|
|
710
714
|
}
|
|
711
715
|
export declare const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral>;
|
|
712
716
|
export declare function templateLiteral<const Parts extends core.$TemplateLiteralPart[]>(parts: Parts, params?: core.$ZodTemplateLiteralParams): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
|
|
713
|
-
export interface ZodLazy<T extends
|
|
717
|
+
export interface ZodLazy<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
714
718
|
_zod: core.$ZodLazyInternals<T>;
|
|
715
719
|
unwrap(): T;
|
|
716
720
|
}
|
|
717
721
|
export declare const ZodLazy: core.$constructor<ZodLazy>;
|
|
718
|
-
export declare function lazy<T extends
|
|
719
|
-
export interface ZodPromise<T extends
|
|
722
|
+
export declare function lazy<T extends core.$ZodType>(getter: () => T): ZodLazy<T>;
|
|
723
|
+
export interface ZodPromise<T extends core.$ZodType = core.$ZodType> extends ZodType {
|
|
720
724
|
_zod: core.$ZodPromiseInternals<T>;
|
|
721
725
|
unwrap(): T;
|
|
722
726
|
}
|
|
723
727
|
export declare const ZodPromise: core.$constructor<ZodPromise>;
|
|
724
|
-
export declare function promise<T extends
|
|
728
|
+
export declare function promise<T extends core.$ZodType>(innerType: T, params?: core.$ZodPromiseParams): ZodPromise<T>;
|
|
725
729
|
export interface ZodCustom<O = unknown, I = unknown> extends ZodType {
|
|
726
730
|
_zod: core.$ZodCustomInternals<O, I>;
|
|
727
731
|
}
|