Spaces:
Paused
Paused
Upload folder using huggingface_hub (part 14)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/util.cjs +137 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/util.d.cts +85 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/util.d.ts +85 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/util.js +133 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/index.cjs +33 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/index.d.cts +4 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/index.d.ts +4 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/index.js +4 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/locales/en.cjs +111 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/locales/en.d.cts +3 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/locales/en.d.ts +3 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/locales/en.js +109 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/standard-schema.cjs +2 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/standard-schema.d.cts +102 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/standard-schema.d.ts +102 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/standard-schema.js +1 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/types.cjs +0 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/types.d.cts +1031 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/types.d.ts +1031 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v3/types.js +0 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4-mini/index.cjs +17 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4-mini/index.d.cts +1 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4-mini/index.d.ts +1 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4-mini/index.js +1 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/checks.cjs +32 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/checks.d.cts +1 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/checks.d.ts +1 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/checks.js +1 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/coerce.cjs +47 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/coerce.d.ts +17 -0
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/enumUtil.d.cts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export declare namespace enumUtil {
|
| 2 |
+
type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
| 3 |
+
type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
|
| 4 |
+
type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
|
| 5 |
+
type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
|
| 6 |
+
export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
|
| 7 |
+
export {};
|
| 8 |
+
}
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/enumUtil.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export declare namespace enumUtil {
|
| 2 |
+
type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
| 3 |
+
type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
|
| 4 |
+
type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
|
| 5 |
+
type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
|
| 6 |
+
export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
|
| 7 |
+
export {};
|
| 8 |
+
}
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/enumUtil.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export {};
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/errorUtil.cjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.errorUtil = void 0;
|
| 4 |
+
var errorUtil;
|
| 5 |
+
(function (errorUtil) {
|
| 6 |
+
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
| 7 |
+
// biome-ignore lint:
|
| 8 |
+
errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
|
| 9 |
+
})(errorUtil || (exports.errorUtil = errorUtil = {}));
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/errorUtil.d.cts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export declare namespace errorUtil {
|
| 2 |
+
type ErrMessage = string | {
|
| 3 |
+
message?: string | undefined;
|
| 4 |
+
};
|
| 5 |
+
const errToObj: (message?: ErrMessage) => {
|
| 6 |
+
message?: string | undefined;
|
| 7 |
+
};
|
| 8 |
+
const toString: (message?: ErrMessage) => string | undefined;
|
| 9 |
+
}
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/errorUtil.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export declare namespace errorUtil {
|
| 2 |
+
type ErrMessage = string | {
|
| 3 |
+
message?: string | undefined;
|
| 4 |
+
};
|
| 5 |
+
const errToObj: (message?: ErrMessage) => {
|
| 6 |
+
message?: string | undefined;
|
| 7 |
+
};
|
| 8 |
+
const toString: (message?: ErrMessage) => string | undefined;
|
| 9 |
+
}
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/errorUtil.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export var errorUtil;
|
| 2 |
+
(function (errorUtil) {
|
| 3 |
+
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
| 4 |
+
// biome-ignore lint:
|
| 5 |
+
errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
|
| 6 |
+
})(errorUtil || (errorUtil = {}));
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/parseUtil.cjs
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
| 3 |
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
| 4 |
+
};
|
| 5 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 6 |
+
exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.EMPTY_PATH = exports.makeIssue = void 0;
|
| 7 |
+
exports.addIssueToContext = addIssueToContext;
|
| 8 |
+
const errors_js_1 = require("../errors.cjs");
|
| 9 |
+
const en_js_1 = __importDefault(require("../locales/en.cjs"));
|
| 10 |
+
const makeIssue = (params) => {
|
| 11 |
+
const { data, path, errorMaps, issueData } = params;
|
| 12 |
+
const fullPath = [...path, ...(issueData.path || [])];
|
| 13 |
+
const fullIssue = {
|
| 14 |
+
...issueData,
|
| 15 |
+
path: fullPath,
|
| 16 |
+
};
|
| 17 |
+
if (issueData.message !== undefined) {
|
| 18 |
+
return {
|
| 19 |
+
...issueData,
|
| 20 |
+
path: fullPath,
|
| 21 |
+
message: issueData.message,
|
| 22 |
+
};
|
| 23 |
+
}
|
| 24 |
+
let errorMessage = "";
|
| 25 |
+
const maps = errorMaps
|
| 26 |
+
.filter((m) => !!m)
|
| 27 |
+
.slice()
|
| 28 |
+
.reverse();
|
| 29 |
+
for (const map of maps) {
|
| 30 |
+
errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
|
| 31 |
+
}
|
| 32 |
+
return {
|
| 33 |
+
...issueData,
|
| 34 |
+
path: fullPath,
|
| 35 |
+
message: errorMessage,
|
| 36 |
+
};
|
| 37 |
+
};
|
| 38 |
+
exports.makeIssue = makeIssue;
|
| 39 |
+
exports.EMPTY_PATH = [];
|
| 40 |
+
function addIssueToContext(ctx, issueData) {
|
| 41 |
+
const overrideMap = (0, errors_js_1.getErrorMap)();
|
| 42 |
+
const issue = (0, exports.makeIssue)({
|
| 43 |
+
issueData: issueData,
|
| 44 |
+
data: ctx.data,
|
| 45 |
+
path: ctx.path,
|
| 46 |
+
errorMaps: [
|
| 47 |
+
ctx.common.contextualErrorMap, // contextual error map is first priority
|
| 48 |
+
ctx.schemaErrorMap, // then schema-bound map if available
|
| 49 |
+
overrideMap, // then global override map
|
| 50 |
+
overrideMap === en_js_1.default ? undefined : en_js_1.default, // then global default map
|
| 51 |
+
].filter((x) => !!x),
|
| 52 |
+
});
|
| 53 |
+
ctx.common.issues.push(issue);
|
| 54 |
+
}
|
| 55 |
+
class ParseStatus {
|
| 56 |
+
constructor() {
|
| 57 |
+
this.value = "valid";
|
| 58 |
+
}
|
| 59 |
+
dirty() {
|
| 60 |
+
if (this.value === "valid")
|
| 61 |
+
this.value = "dirty";
|
| 62 |
+
}
|
| 63 |
+
abort() {
|
| 64 |
+
if (this.value !== "aborted")
|
| 65 |
+
this.value = "aborted";
|
| 66 |
+
}
|
| 67 |
+
static mergeArray(status, results) {
|
| 68 |
+
const arrayValue = [];
|
| 69 |
+
for (const s of results) {
|
| 70 |
+
if (s.status === "aborted")
|
| 71 |
+
return exports.INVALID;
|
| 72 |
+
if (s.status === "dirty")
|
| 73 |
+
status.dirty();
|
| 74 |
+
arrayValue.push(s.value);
|
| 75 |
+
}
|
| 76 |
+
return { status: status.value, value: arrayValue };
|
| 77 |
+
}
|
| 78 |
+
static async mergeObjectAsync(status, pairs) {
|
| 79 |
+
const syncPairs = [];
|
| 80 |
+
for (const pair of pairs) {
|
| 81 |
+
const key = await pair.key;
|
| 82 |
+
const value = await pair.value;
|
| 83 |
+
syncPairs.push({
|
| 84 |
+
key,
|
| 85 |
+
value,
|
| 86 |
+
});
|
| 87 |
+
}
|
| 88 |
+
return ParseStatus.mergeObjectSync(status, syncPairs);
|
| 89 |
+
}
|
| 90 |
+
static mergeObjectSync(status, pairs) {
|
| 91 |
+
const finalObject = {};
|
| 92 |
+
for (const pair of pairs) {
|
| 93 |
+
const { key, value } = pair;
|
| 94 |
+
if (key.status === "aborted")
|
| 95 |
+
return exports.INVALID;
|
| 96 |
+
if (value.status === "aborted")
|
| 97 |
+
return exports.INVALID;
|
| 98 |
+
if (key.status === "dirty")
|
| 99 |
+
status.dirty();
|
| 100 |
+
if (value.status === "dirty")
|
| 101 |
+
status.dirty();
|
| 102 |
+
if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
|
| 103 |
+
finalObject[key.value] = value.value;
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
return { status: status.value, value: finalObject };
|
| 107 |
+
}
|
| 108 |
+
}
|
| 109 |
+
exports.ParseStatus = ParseStatus;
|
| 110 |
+
exports.INVALID = Object.freeze({
|
| 111 |
+
status: "aborted",
|
| 112 |
+
});
|
| 113 |
+
const DIRTY = (value) => ({ status: "dirty", value });
|
| 114 |
+
exports.DIRTY = DIRTY;
|
| 115 |
+
const OK = (value) => ({ status: "valid", value });
|
| 116 |
+
exports.OK = OK;
|
| 117 |
+
const isAborted = (x) => x.status === "aborted";
|
| 118 |
+
exports.isAborted = isAborted;
|
| 119 |
+
const isDirty = (x) => x.status === "dirty";
|
| 120 |
+
exports.isDirty = isDirty;
|
| 121 |
+
const isValid = (x) => x.status === "valid";
|
| 122 |
+
exports.isValid = isValid;
|
| 123 |
+
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
| 124 |
+
exports.isAsync = isAsync;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/parseUtil.d.cts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { IssueData, ZodErrorMap, ZodIssue } from "../ZodError.cjs";
|
| 2 |
+
import type { ZodParsedType } from "./util.cjs";
|
| 3 |
+
export declare const makeIssue: (params: {
|
| 4 |
+
data: any;
|
| 5 |
+
path: (string | number)[];
|
| 6 |
+
errorMaps: ZodErrorMap[];
|
| 7 |
+
issueData: IssueData;
|
| 8 |
+
}) => ZodIssue;
|
| 9 |
+
export type ParseParams = {
|
| 10 |
+
path: (string | number)[];
|
| 11 |
+
errorMap: ZodErrorMap;
|
| 12 |
+
async: boolean;
|
| 13 |
+
};
|
| 14 |
+
export type ParsePathComponent = string | number;
|
| 15 |
+
export type ParsePath = ParsePathComponent[];
|
| 16 |
+
export declare const EMPTY_PATH: ParsePath;
|
| 17 |
+
export interface ParseContext {
|
| 18 |
+
readonly common: {
|
| 19 |
+
readonly issues: ZodIssue[];
|
| 20 |
+
readonly contextualErrorMap?: ZodErrorMap | undefined;
|
| 21 |
+
readonly async: boolean;
|
| 22 |
+
};
|
| 23 |
+
readonly path: ParsePath;
|
| 24 |
+
readonly schemaErrorMap?: ZodErrorMap | undefined;
|
| 25 |
+
readonly parent: ParseContext | null;
|
| 26 |
+
readonly data: any;
|
| 27 |
+
readonly parsedType: ZodParsedType;
|
| 28 |
+
}
|
| 29 |
+
export type ParseInput = {
|
| 30 |
+
data: any;
|
| 31 |
+
path: (string | number)[];
|
| 32 |
+
parent: ParseContext;
|
| 33 |
+
};
|
| 34 |
+
export declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void;
|
| 35 |
+
export type ObjectPair = {
|
| 36 |
+
key: SyncParseReturnType<any>;
|
| 37 |
+
value: SyncParseReturnType<any>;
|
| 38 |
+
};
|
| 39 |
+
export declare class ParseStatus {
|
| 40 |
+
value: "aborted" | "dirty" | "valid";
|
| 41 |
+
dirty(): void;
|
| 42 |
+
abort(): void;
|
| 43 |
+
static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
|
| 44 |
+
static mergeObjectAsync(status: ParseStatus, pairs: {
|
| 45 |
+
key: ParseReturnType<any>;
|
| 46 |
+
value: ParseReturnType<any>;
|
| 47 |
+
}[]): Promise<SyncParseReturnType<any>>;
|
| 48 |
+
static mergeObjectSync(status: ParseStatus, pairs: {
|
| 49 |
+
key: SyncParseReturnType<any>;
|
| 50 |
+
value: SyncParseReturnType<any>;
|
| 51 |
+
alwaysSet?: boolean;
|
| 52 |
+
}[]): SyncParseReturnType;
|
| 53 |
+
}
|
| 54 |
+
export interface ParseResult {
|
| 55 |
+
status: "aborted" | "dirty" | "valid";
|
| 56 |
+
data: any;
|
| 57 |
+
}
|
| 58 |
+
export type INVALID = {
|
| 59 |
+
status: "aborted";
|
| 60 |
+
};
|
| 61 |
+
export declare const INVALID: INVALID;
|
| 62 |
+
export type DIRTY<T> = {
|
| 63 |
+
status: "dirty";
|
| 64 |
+
value: T;
|
| 65 |
+
};
|
| 66 |
+
export declare const DIRTY: <T>(value: T) => DIRTY<T>;
|
| 67 |
+
export type OK<T> = {
|
| 68 |
+
status: "valid";
|
| 69 |
+
value: T;
|
| 70 |
+
};
|
| 71 |
+
export declare const OK: <T>(value: T) => OK<T>;
|
| 72 |
+
export type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
|
| 73 |
+
export type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
|
| 74 |
+
export type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
|
| 75 |
+
export declare const isAborted: (x: ParseReturnType<any>) => x is INVALID;
|
| 76 |
+
export declare const isDirty: <T>(x: ParseReturnType<T>) => x is OK<T> | DIRTY<T>;
|
| 77 |
+
export declare const isValid: <T>(x: ParseReturnType<T>) => x is OK<T>;
|
| 78 |
+
export declare const isAsync: <T>(x: ParseReturnType<T>) => x is AsyncParseReturnType<T>;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/parseUtil.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { IssueData, ZodErrorMap, ZodIssue } from "../ZodError.js";
|
| 2 |
+
import type { ZodParsedType } from "./util.js";
|
| 3 |
+
export declare const makeIssue: (params: {
|
| 4 |
+
data: any;
|
| 5 |
+
path: (string | number)[];
|
| 6 |
+
errorMaps: ZodErrorMap[];
|
| 7 |
+
issueData: IssueData;
|
| 8 |
+
}) => ZodIssue;
|
| 9 |
+
export type ParseParams = {
|
| 10 |
+
path: (string | number)[];
|
| 11 |
+
errorMap: ZodErrorMap;
|
| 12 |
+
async: boolean;
|
| 13 |
+
};
|
| 14 |
+
export type ParsePathComponent = string | number;
|
| 15 |
+
export type ParsePath = ParsePathComponent[];
|
| 16 |
+
export declare const EMPTY_PATH: ParsePath;
|
| 17 |
+
export interface ParseContext {
|
| 18 |
+
readonly common: {
|
| 19 |
+
readonly issues: ZodIssue[];
|
| 20 |
+
readonly contextualErrorMap?: ZodErrorMap | undefined;
|
| 21 |
+
readonly async: boolean;
|
| 22 |
+
};
|
| 23 |
+
readonly path: ParsePath;
|
| 24 |
+
readonly schemaErrorMap?: ZodErrorMap | undefined;
|
| 25 |
+
readonly parent: ParseContext | null;
|
| 26 |
+
readonly data: any;
|
| 27 |
+
readonly parsedType: ZodParsedType;
|
| 28 |
+
}
|
| 29 |
+
export type ParseInput = {
|
| 30 |
+
data: any;
|
| 31 |
+
path: (string | number)[];
|
| 32 |
+
parent: ParseContext;
|
| 33 |
+
};
|
| 34 |
+
export declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void;
|
| 35 |
+
export type ObjectPair = {
|
| 36 |
+
key: SyncParseReturnType<any>;
|
| 37 |
+
value: SyncParseReturnType<any>;
|
| 38 |
+
};
|
| 39 |
+
export declare class ParseStatus {
|
| 40 |
+
value: "aborted" | "dirty" | "valid";
|
| 41 |
+
dirty(): void;
|
| 42 |
+
abort(): void;
|
| 43 |
+
static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
|
| 44 |
+
static mergeObjectAsync(status: ParseStatus, pairs: {
|
| 45 |
+
key: ParseReturnType<any>;
|
| 46 |
+
value: ParseReturnType<any>;
|
| 47 |
+
}[]): Promise<SyncParseReturnType<any>>;
|
| 48 |
+
static mergeObjectSync(status: ParseStatus, pairs: {
|
| 49 |
+
key: SyncParseReturnType<any>;
|
| 50 |
+
value: SyncParseReturnType<any>;
|
| 51 |
+
alwaysSet?: boolean;
|
| 52 |
+
}[]): SyncParseReturnType;
|
| 53 |
+
}
|
| 54 |
+
export interface ParseResult {
|
| 55 |
+
status: "aborted" | "dirty" | "valid";
|
| 56 |
+
data: any;
|
| 57 |
+
}
|
| 58 |
+
export type INVALID = {
|
| 59 |
+
status: "aborted";
|
| 60 |
+
};
|
| 61 |
+
export declare const INVALID: INVALID;
|
| 62 |
+
export type DIRTY<T> = {
|
| 63 |
+
status: "dirty";
|
| 64 |
+
value: T;
|
| 65 |
+
};
|
| 66 |
+
export declare const DIRTY: <T>(value: T) => DIRTY<T>;
|
| 67 |
+
export type OK<T> = {
|
| 68 |
+
status: "valid";
|
| 69 |
+
value: T;
|
| 70 |
+
};
|
| 71 |
+
export declare const OK: <T>(value: T) => OK<T>;
|
| 72 |
+
export type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
|
| 73 |
+
export type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
|
| 74 |
+
export type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
|
| 75 |
+
export declare const isAborted: (x: ParseReturnType<any>) => x is INVALID;
|
| 76 |
+
export declare const isDirty: <T>(x: ParseReturnType<T>) => x is OK<T> | DIRTY<T>;
|
| 77 |
+
export declare const isValid: <T>(x: ParseReturnType<T>) => x is OK<T>;
|
| 78 |
+
export declare const isAsync: <T>(x: ParseReturnType<T>) => x is AsyncParseReturnType<T>;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/parseUtil.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { getErrorMap } from "../errors.js";
|
| 2 |
+
import defaultErrorMap from "../locales/en.js";
|
| 3 |
+
export const makeIssue = (params) => {
|
| 4 |
+
const { data, path, errorMaps, issueData } = params;
|
| 5 |
+
const fullPath = [...path, ...(issueData.path || [])];
|
| 6 |
+
const fullIssue = {
|
| 7 |
+
...issueData,
|
| 8 |
+
path: fullPath,
|
| 9 |
+
};
|
| 10 |
+
if (issueData.message !== undefined) {
|
| 11 |
+
return {
|
| 12 |
+
...issueData,
|
| 13 |
+
path: fullPath,
|
| 14 |
+
message: issueData.message,
|
| 15 |
+
};
|
| 16 |
+
}
|
| 17 |
+
let errorMessage = "";
|
| 18 |
+
const maps = errorMaps
|
| 19 |
+
.filter((m) => !!m)
|
| 20 |
+
.slice()
|
| 21 |
+
.reverse();
|
| 22 |
+
for (const map of maps) {
|
| 23 |
+
errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
|
| 24 |
+
}
|
| 25 |
+
return {
|
| 26 |
+
...issueData,
|
| 27 |
+
path: fullPath,
|
| 28 |
+
message: errorMessage,
|
| 29 |
+
};
|
| 30 |
+
};
|
| 31 |
+
export const EMPTY_PATH = [];
|
| 32 |
+
export function addIssueToContext(ctx, issueData) {
|
| 33 |
+
const overrideMap = getErrorMap();
|
| 34 |
+
const issue = makeIssue({
|
| 35 |
+
issueData: issueData,
|
| 36 |
+
data: ctx.data,
|
| 37 |
+
path: ctx.path,
|
| 38 |
+
errorMaps: [
|
| 39 |
+
ctx.common.contextualErrorMap, // contextual error map is first priority
|
| 40 |
+
ctx.schemaErrorMap, // then schema-bound map if available
|
| 41 |
+
overrideMap, // then global override map
|
| 42 |
+
overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map
|
| 43 |
+
].filter((x) => !!x),
|
| 44 |
+
});
|
| 45 |
+
ctx.common.issues.push(issue);
|
| 46 |
+
}
|
| 47 |
+
export class ParseStatus {
|
| 48 |
+
constructor() {
|
| 49 |
+
this.value = "valid";
|
| 50 |
+
}
|
| 51 |
+
dirty() {
|
| 52 |
+
if (this.value === "valid")
|
| 53 |
+
this.value = "dirty";
|
| 54 |
+
}
|
| 55 |
+
abort() {
|
| 56 |
+
if (this.value !== "aborted")
|
| 57 |
+
this.value = "aborted";
|
| 58 |
+
}
|
| 59 |
+
static mergeArray(status, results) {
|
| 60 |
+
const arrayValue = [];
|
| 61 |
+
for (const s of results) {
|
| 62 |
+
if (s.status === "aborted")
|
| 63 |
+
return INVALID;
|
| 64 |
+
if (s.status === "dirty")
|
| 65 |
+
status.dirty();
|
| 66 |
+
arrayValue.push(s.value);
|
| 67 |
+
}
|
| 68 |
+
return { status: status.value, value: arrayValue };
|
| 69 |
+
}
|
| 70 |
+
static async mergeObjectAsync(status, pairs) {
|
| 71 |
+
const syncPairs = [];
|
| 72 |
+
for (const pair of pairs) {
|
| 73 |
+
const key = await pair.key;
|
| 74 |
+
const value = await pair.value;
|
| 75 |
+
syncPairs.push({
|
| 76 |
+
key,
|
| 77 |
+
value,
|
| 78 |
+
});
|
| 79 |
+
}
|
| 80 |
+
return ParseStatus.mergeObjectSync(status, syncPairs);
|
| 81 |
+
}
|
| 82 |
+
static mergeObjectSync(status, pairs) {
|
| 83 |
+
const finalObject = {};
|
| 84 |
+
for (const pair of pairs) {
|
| 85 |
+
const { key, value } = pair;
|
| 86 |
+
if (key.status === "aborted")
|
| 87 |
+
return INVALID;
|
| 88 |
+
if (value.status === "aborted")
|
| 89 |
+
return INVALID;
|
| 90 |
+
if (key.status === "dirty")
|
| 91 |
+
status.dirty();
|
| 92 |
+
if (value.status === "dirty")
|
| 93 |
+
status.dirty();
|
| 94 |
+
if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
|
| 95 |
+
finalObject[key.value] = value.value;
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
return { status: status.value, value: finalObject };
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
export const INVALID = Object.freeze({
|
| 102 |
+
status: "aborted",
|
| 103 |
+
});
|
| 104 |
+
export const DIRTY = (value) => ({ status: "dirty", value });
|
| 105 |
+
export const OK = (value) => ({ status: "valid", value });
|
| 106 |
+
export const isAborted = (x) => x.status === "aborted";
|
| 107 |
+
export const isDirty = (x) => x.status === "dirty";
|
| 108 |
+
export const isValid = (x) => x.status === "valid";
|
| 109 |
+
export const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/partialUtil.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/partialUtil.d.cts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { ZodArray, ZodNullable, ZodObject, ZodOptional, ZodRawShape, ZodTuple, ZodTupleItems, ZodTypeAny } from "../types.cjs";
|
| 2 |
+
export declare namespace partialUtil {
|
| 3 |
+
type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
|
| 4 |
+
[k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
|
| 5 |
+
}, 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> ? {
|
| 6 |
+
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
|
| 7 |
+
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
|
| 8 |
+
}
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/partialUtil.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { ZodArray, ZodNullable, ZodObject, ZodOptional, ZodRawShape, ZodTuple, ZodTupleItems, ZodTypeAny } from "../types.js";
|
| 2 |
+
export declare namespace partialUtil {
|
| 3 |
+
type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
|
| 4 |
+
[k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
|
| 5 |
+
}, 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> ? {
|
| 6 |
+
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
|
| 7 |
+
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
|
| 8 |
+
}
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/partialUtil.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export {};
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/typeAliases.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/typeAliases.d.cts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
| 2 |
+
export type Scalars = Primitive | Primitive[];
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/typeAliases.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
| 2 |
+
export type Scalars = Primitive | Primitive[];
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/typeAliases.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export {};
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/util.cjs
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.getParsedType = exports.ZodParsedType = exports.objectUtil = exports.util = void 0;
|
| 4 |
+
var util;
|
| 5 |
+
(function (util) {
|
| 6 |
+
util.assertEqual = (_) => { };
|
| 7 |
+
function assertIs(_arg) { }
|
| 8 |
+
util.assertIs = assertIs;
|
| 9 |
+
function assertNever(_x) {
|
| 10 |
+
throw new Error();
|
| 11 |
+
}
|
| 12 |
+
util.assertNever = assertNever;
|
| 13 |
+
util.arrayToEnum = (items) => {
|
| 14 |
+
const obj = {};
|
| 15 |
+
for (const item of items) {
|
| 16 |
+
obj[item] = item;
|
| 17 |
+
}
|
| 18 |
+
return obj;
|
| 19 |
+
};
|
| 20 |
+
util.getValidEnumValues = (obj) => {
|
| 21 |
+
const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
| 22 |
+
const filtered = {};
|
| 23 |
+
for (const k of validKeys) {
|
| 24 |
+
filtered[k] = obj[k];
|
| 25 |
+
}
|
| 26 |
+
return util.objectValues(filtered);
|
| 27 |
+
};
|
| 28 |
+
util.objectValues = (obj) => {
|
| 29 |
+
return util.objectKeys(obj).map(function (e) {
|
| 30 |
+
return obj[e];
|
| 31 |
+
});
|
| 32 |
+
};
|
| 33 |
+
util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban
|
| 34 |
+
? (obj) => Object.keys(obj) // eslint-disable-line ban/ban
|
| 35 |
+
: (object) => {
|
| 36 |
+
const keys = [];
|
| 37 |
+
for (const key in object) {
|
| 38 |
+
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
| 39 |
+
keys.push(key);
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
return keys;
|
| 43 |
+
};
|
| 44 |
+
util.find = (arr, checker) => {
|
| 45 |
+
for (const item of arr) {
|
| 46 |
+
if (checker(item))
|
| 47 |
+
return item;
|
| 48 |
+
}
|
| 49 |
+
return undefined;
|
| 50 |
+
};
|
| 51 |
+
util.isInteger = typeof Number.isInteger === "function"
|
| 52 |
+
? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
|
| 53 |
+
: (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
| 54 |
+
function joinValues(array, separator = " | ") {
|
| 55 |
+
return array.map((val) => (typeof val === "string" ? `'${val}'` : val)).join(separator);
|
| 56 |
+
}
|
| 57 |
+
util.joinValues = joinValues;
|
| 58 |
+
util.jsonStringifyReplacer = (_, value) => {
|
| 59 |
+
if (typeof value === "bigint") {
|
| 60 |
+
return value.toString();
|
| 61 |
+
}
|
| 62 |
+
return value;
|
| 63 |
+
};
|
| 64 |
+
})(util || (exports.util = util = {}));
|
| 65 |
+
var objectUtil;
|
| 66 |
+
(function (objectUtil) {
|
| 67 |
+
objectUtil.mergeShapes = (first, second) => {
|
| 68 |
+
return {
|
| 69 |
+
...first,
|
| 70 |
+
...second, // second overwrites first
|
| 71 |
+
};
|
| 72 |
+
};
|
| 73 |
+
})(objectUtil || (exports.objectUtil = objectUtil = {}));
|
| 74 |
+
exports.ZodParsedType = util.arrayToEnum([
|
| 75 |
+
"string",
|
| 76 |
+
"nan",
|
| 77 |
+
"number",
|
| 78 |
+
"integer",
|
| 79 |
+
"float",
|
| 80 |
+
"boolean",
|
| 81 |
+
"date",
|
| 82 |
+
"bigint",
|
| 83 |
+
"symbol",
|
| 84 |
+
"function",
|
| 85 |
+
"undefined",
|
| 86 |
+
"null",
|
| 87 |
+
"array",
|
| 88 |
+
"object",
|
| 89 |
+
"unknown",
|
| 90 |
+
"promise",
|
| 91 |
+
"void",
|
| 92 |
+
"never",
|
| 93 |
+
"map",
|
| 94 |
+
"set",
|
| 95 |
+
]);
|
| 96 |
+
const getParsedType = (data) => {
|
| 97 |
+
const t = typeof data;
|
| 98 |
+
switch (t) {
|
| 99 |
+
case "undefined":
|
| 100 |
+
return exports.ZodParsedType.undefined;
|
| 101 |
+
case "string":
|
| 102 |
+
return exports.ZodParsedType.string;
|
| 103 |
+
case "number":
|
| 104 |
+
return Number.isNaN(data) ? exports.ZodParsedType.nan : exports.ZodParsedType.number;
|
| 105 |
+
case "boolean":
|
| 106 |
+
return exports.ZodParsedType.boolean;
|
| 107 |
+
case "function":
|
| 108 |
+
return exports.ZodParsedType.function;
|
| 109 |
+
case "bigint":
|
| 110 |
+
return exports.ZodParsedType.bigint;
|
| 111 |
+
case "symbol":
|
| 112 |
+
return exports.ZodParsedType.symbol;
|
| 113 |
+
case "object":
|
| 114 |
+
if (Array.isArray(data)) {
|
| 115 |
+
return exports.ZodParsedType.array;
|
| 116 |
+
}
|
| 117 |
+
if (data === null) {
|
| 118 |
+
return exports.ZodParsedType.null;
|
| 119 |
+
}
|
| 120 |
+
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
| 121 |
+
return exports.ZodParsedType.promise;
|
| 122 |
+
}
|
| 123 |
+
if (typeof Map !== "undefined" && data instanceof Map) {
|
| 124 |
+
return exports.ZodParsedType.map;
|
| 125 |
+
}
|
| 126 |
+
if (typeof Set !== "undefined" && data instanceof Set) {
|
| 127 |
+
return exports.ZodParsedType.set;
|
| 128 |
+
}
|
| 129 |
+
if (typeof Date !== "undefined" && data instanceof Date) {
|
| 130 |
+
return exports.ZodParsedType.date;
|
| 131 |
+
}
|
| 132 |
+
return exports.ZodParsedType.object;
|
| 133 |
+
default:
|
| 134 |
+
return exports.ZodParsedType.unknown;
|
| 135 |
+
}
|
| 136 |
+
};
|
| 137 |
+
exports.getParsedType = getParsedType;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/util.d.cts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export declare namespace util {
|
| 2 |
+
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
|
| 3 |
+
export type isAny<T> = 0 extends 1 & T ? true : false;
|
| 4 |
+
export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
|
| 5 |
+
export function assertIs<T>(_arg: T): void;
|
| 6 |
+
export function assertNever(_x: never): never;
|
| 7 |
+
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
| 8 |
+
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
|
| 9 |
+
export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
| 10 |
+
export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
|
| 11 |
+
export type InexactPartial<T> = {
|
| 12 |
+
[k in keyof T]?: T[k] | undefined;
|
| 13 |
+
};
|
| 14 |
+
export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
|
| 15 |
+
export const getValidEnumValues: (obj: any) => any[];
|
| 16 |
+
export const objectValues: (obj: any) => any[];
|
| 17 |
+
export const objectKeys: ObjectConstructor["keys"];
|
| 18 |
+
export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
|
| 19 |
+
export type identity<T> = objectUtil.identity<T>;
|
| 20 |
+
export type flatten<T> = objectUtil.flatten<T>;
|
| 21 |
+
export type noUndefined<T> = T extends undefined ? never : T;
|
| 22 |
+
export const isInteger: NumberConstructor["isInteger"];
|
| 23 |
+
export function joinValues<T extends any[]>(array: T, separator?: string): string;
|
| 24 |
+
export const jsonStringifyReplacer: (_: string, value: any) => any;
|
| 25 |
+
export {};
|
| 26 |
+
}
|
| 27 |
+
export declare namespace objectUtil {
|
| 28 |
+
export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : {
|
| 29 |
+
[k in Exclude<keyof U, keyof V>]: U[k];
|
| 30 |
+
} & V;
|
| 31 |
+
type optionalKeys<T extends object> = {
|
| 32 |
+
[k in keyof T]: undefined extends T[k] ? k : never;
|
| 33 |
+
}[keyof T];
|
| 34 |
+
type requiredKeys<T extends object> = {
|
| 35 |
+
[k in keyof T]: undefined extends T[k] ? never : k;
|
| 36 |
+
}[keyof T];
|
| 37 |
+
export type addQuestionMarks<T extends object, _O = any> = {
|
| 38 |
+
[K in requiredKeys<T>]: T[K];
|
| 39 |
+
} & {
|
| 40 |
+
[K in optionalKeys<T>]?: T[K];
|
| 41 |
+
} & {
|
| 42 |
+
[k in keyof T]?: unknown;
|
| 43 |
+
};
|
| 44 |
+
export type identity<T> = T;
|
| 45 |
+
export type flatten<T> = identity<{
|
| 46 |
+
[k in keyof T]: T[k];
|
| 47 |
+
}>;
|
| 48 |
+
export type noNeverKeys<T> = {
|
| 49 |
+
[k in keyof T]: [T[k]] extends [never] ? never : k;
|
| 50 |
+
}[keyof T];
|
| 51 |
+
export type noNever<T> = identity<{
|
| 52 |
+
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
| 53 |
+
}>;
|
| 54 |
+
export const mergeShapes: <U, T>(first: U, second: T) => T & U;
|
| 55 |
+
export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : {
|
| 56 |
+
[K in keyof A as K extends keyof B ? never : K]: A[K];
|
| 57 |
+
} & {
|
| 58 |
+
[K in keyof B]: B[K];
|
| 59 |
+
};
|
| 60 |
+
export {};
|
| 61 |
+
}
|
| 62 |
+
export declare const ZodParsedType: {
|
| 63 |
+
string: "string";
|
| 64 |
+
nan: "nan";
|
| 65 |
+
number: "number";
|
| 66 |
+
integer: "integer";
|
| 67 |
+
float: "float";
|
| 68 |
+
boolean: "boolean";
|
| 69 |
+
date: "date";
|
| 70 |
+
bigint: "bigint";
|
| 71 |
+
symbol: "symbol";
|
| 72 |
+
function: "function";
|
| 73 |
+
undefined: "undefined";
|
| 74 |
+
null: "null";
|
| 75 |
+
array: "array";
|
| 76 |
+
object: "object";
|
| 77 |
+
unknown: "unknown";
|
| 78 |
+
promise: "promise";
|
| 79 |
+
void: "void";
|
| 80 |
+
never: "never";
|
| 81 |
+
map: "map";
|
| 82 |
+
set: "set";
|
| 83 |
+
};
|
| 84 |
+
export type ZodParsedType = keyof typeof ZodParsedType;
|
| 85 |
+
export declare const getParsedType: (data: any) => ZodParsedType;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/util.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export declare namespace util {
|
| 2 |
+
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
|
| 3 |
+
export type isAny<T> = 0 extends 1 & T ? true : false;
|
| 4 |
+
export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
|
| 5 |
+
export function assertIs<T>(_arg: T): void;
|
| 6 |
+
export function assertNever(_x: never): never;
|
| 7 |
+
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
| 8 |
+
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
|
| 9 |
+
export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
| 10 |
+
export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
|
| 11 |
+
export type InexactPartial<T> = {
|
| 12 |
+
[k in keyof T]?: T[k] | undefined;
|
| 13 |
+
};
|
| 14 |
+
export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
|
| 15 |
+
export const getValidEnumValues: (obj: any) => any[];
|
| 16 |
+
export const objectValues: (obj: any) => any[];
|
| 17 |
+
export const objectKeys: ObjectConstructor["keys"];
|
| 18 |
+
export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
|
| 19 |
+
export type identity<T> = objectUtil.identity<T>;
|
| 20 |
+
export type flatten<T> = objectUtil.flatten<T>;
|
| 21 |
+
export type noUndefined<T> = T extends undefined ? never : T;
|
| 22 |
+
export const isInteger: NumberConstructor["isInteger"];
|
| 23 |
+
export function joinValues<T extends any[]>(array: T, separator?: string): string;
|
| 24 |
+
export const jsonStringifyReplacer: (_: string, value: any) => any;
|
| 25 |
+
export {};
|
| 26 |
+
}
|
| 27 |
+
export declare namespace objectUtil {
|
| 28 |
+
export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : {
|
| 29 |
+
[k in Exclude<keyof U, keyof V>]: U[k];
|
| 30 |
+
} & V;
|
| 31 |
+
type optionalKeys<T extends object> = {
|
| 32 |
+
[k in keyof T]: undefined extends T[k] ? k : never;
|
| 33 |
+
}[keyof T];
|
| 34 |
+
type requiredKeys<T extends object> = {
|
| 35 |
+
[k in keyof T]: undefined extends T[k] ? never : k;
|
| 36 |
+
}[keyof T];
|
| 37 |
+
export type addQuestionMarks<T extends object, _O = any> = {
|
| 38 |
+
[K in requiredKeys<T>]: T[K];
|
| 39 |
+
} & {
|
| 40 |
+
[K in optionalKeys<T>]?: T[K];
|
| 41 |
+
} & {
|
| 42 |
+
[k in keyof T]?: unknown;
|
| 43 |
+
};
|
| 44 |
+
export type identity<T> = T;
|
| 45 |
+
export type flatten<T> = identity<{
|
| 46 |
+
[k in keyof T]: T[k];
|
| 47 |
+
}>;
|
| 48 |
+
export type noNeverKeys<T> = {
|
| 49 |
+
[k in keyof T]: [T[k]] extends [never] ? never : k;
|
| 50 |
+
}[keyof T];
|
| 51 |
+
export type noNever<T> = identity<{
|
| 52 |
+
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
| 53 |
+
}>;
|
| 54 |
+
export const mergeShapes: <U, T>(first: U, second: T) => T & U;
|
| 55 |
+
export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : {
|
| 56 |
+
[K in keyof A as K extends keyof B ? never : K]: A[K];
|
| 57 |
+
} & {
|
| 58 |
+
[K in keyof B]: B[K];
|
| 59 |
+
};
|
| 60 |
+
export {};
|
| 61 |
+
}
|
| 62 |
+
export declare const ZodParsedType: {
|
| 63 |
+
string: "string";
|
| 64 |
+
nan: "nan";
|
| 65 |
+
number: "number";
|
| 66 |
+
integer: "integer";
|
| 67 |
+
float: "float";
|
| 68 |
+
boolean: "boolean";
|
| 69 |
+
date: "date";
|
| 70 |
+
bigint: "bigint";
|
| 71 |
+
symbol: "symbol";
|
| 72 |
+
function: "function";
|
| 73 |
+
undefined: "undefined";
|
| 74 |
+
null: "null";
|
| 75 |
+
array: "array";
|
| 76 |
+
object: "object";
|
| 77 |
+
unknown: "unknown";
|
| 78 |
+
promise: "promise";
|
| 79 |
+
void: "void";
|
| 80 |
+
never: "never";
|
| 81 |
+
map: "map";
|
| 82 |
+
set: "set";
|
| 83 |
+
};
|
| 84 |
+
export type ZodParsedType = keyof typeof ZodParsedType;
|
| 85 |
+
export declare const getParsedType: (data: any) => ZodParsedType;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/helpers/util.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export var util;
|
| 2 |
+
(function (util) {
|
| 3 |
+
util.assertEqual = (_) => { };
|
| 4 |
+
function assertIs(_arg) { }
|
| 5 |
+
util.assertIs = assertIs;
|
| 6 |
+
function assertNever(_x) {
|
| 7 |
+
throw new Error();
|
| 8 |
+
}
|
| 9 |
+
util.assertNever = assertNever;
|
| 10 |
+
util.arrayToEnum = (items) => {
|
| 11 |
+
const obj = {};
|
| 12 |
+
for (const item of items) {
|
| 13 |
+
obj[item] = item;
|
| 14 |
+
}
|
| 15 |
+
return obj;
|
| 16 |
+
};
|
| 17 |
+
util.getValidEnumValues = (obj) => {
|
| 18 |
+
const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
| 19 |
+
const filtered = {};
|
| 20 |
+
for (const k of validKeys) {
|
| 21 |
+
filtered[k] = obj[k];
|
| 22 |
+
}
|
| 23 |
+
return util.objectValues(filtered);
|
| 24 |
+
};
|
| 25 |
+
util.objectValues = (obj) => {
|
| 26 |
+
return util.objectKeys(obj).map(function (e) {
|
| 27 |
+
return obj[e];
|
| 28 |
+
});
|
| 29 |
+
};
|
| 30 |
+
util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban
|
| 31 |
+
? (obj) => Object.keys(obj) // eslint-disable-line ban/ban
|
| 32 |
+
: (object) => {
|
| 33 |
+
const keys = [];
|
| 34 |
+
for (const key in object) {
|
| 35 |
+
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
| 36 |
+
keys.push(key);
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
return keys;
|
| 40 |
+
};
|
| 41 |
+
util.find = (arr, checker) => {
|
| 42 |
+
for (const item of arr) {
|
| 43 |
+
if (checker(item))
|
| 44 |
+
return item;
|
| 45 |
+
}
|
| 46 |
+
return undefined;
|
| 47 |
+
};
|
| 48 |
+
util.isInteger = typeof Number.isInteger === "function"
|
| 49 |
+
? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
|
| 50 |
+
: (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
| 51 |
+
function joinValues(array, separator = " | ") {
|
| 52 |
+
return array.map((val) => (typeof val === "string" ? `'${val}'` : val)).join(separator);
|
| 53 |
+
}
|
| 54 |
+
util.joinValues = joinValues;
|
| 55 |
+
util.jsonStringifyReplacer = (_, value) => {
|
| 56 |
+
if (typeof value === "bigint") {
|
| 57 |
+
return value.toString();
|
| 58 |
+
}
|
| 59 |
+
return value;
|
| 60 |
+
};
|
| 61 |
+
})(util || (util = {}));
|
| 62 |
+
export var objectUtil;
|
| 63 |
+
(function (objectUtil) {
|
| 64 |
+
objectUtil.mergeShapes = (first, second) => {
|
| 65 |
+
return {
|
| 66 |
+
...first,
|
| 67 |
+
...second, // second overwrites first
|
| 68 |
+
};
|
| 69 |
+
};
|
| 70 |
+
})(objectUtil || (objectUtil = {}));
|
| 71 |
+
export const ZodParsedType = util.arrayToEnum([
|
| 72 |
+
"string",
|
| 73 |
+
"nan",
|
| 74 |
+
"number",
|
| 75 |
+
"integer",
|
| 76 |
+
"float",
|
| 77 |
+
"boolean",
|
| 78 |
+
"date",
|
| 79 |
+
"bigint",
|
| 80 |
+
"symbol",
|
| 81 |
+
"function",
|
| 82 |
+
"undefined",
|
| 83 |
+
"null",
|
| 84 |
+
"array",
|
| 85 |
+
"object",
|
| 86 |
+
"unknown",
|
| 87 |
+
"promise",
|
| 88 |
+
"void",
|
| 89 |
+
"never",
|
| 90 |
+
"map",
|
| 91 |
+
"set",
|
| 92 |
+
]);
|
| 93 |
+
export const getParsedType = (data) => {
|
| 94 |
+
const t = typeof data;
|
| 95 |
+
switch (t) {
|
| 96 |
+
case "undefined":
|
| 97 |
+
return ZodParsedType.undefined;
|
| 98 |
+
case "string":
|
| 99 |
+
return ZodParsedType.string;
|
| 100 |
+
case "number":
|
| 101 |
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
| 102 |
+
case "boolean":
|
| 103 |
+
return ZodParsedType.boolean;
|
| 104 |
+
case "function":
|
| 105 |
+
return ZodParsedType.function;
|
| 106 |
+
case "bigint":
|
| 107 |
+
return ZodParsedType.bigint;
|
| 108 |
+
case "symbol":
|
| 109 |
+
return ZodParsedType.symbol;
|
| 110 |
+
case "object":
|
| 111 |
+
if (Array.isArray(data)) {
|
| 112 |
+
return ZodParsedType.array;
|
| 113 |
+
}
|
| 114 |
+
if (data === null) {
|
| 115 |
+
return ZodParsedType.null;
|
| 116 |
+
}
|
| 117 |
+
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
| 118 |
+
return ZodParsedType.promise;
|
| 119 |
+
}
|
| 120 |
+
if (typeof Map !== "undefined" && data instanceof Map) {
|
| 121 |
+
return ZodParsedType.map;
|
| 122 |
+
}
|
| 123 |
+
if (typeof Set !== "undefined" && data instanceof Set) {
|
| 124 |
+
return ZodParsedType.set;
|
| 125 |
+
}
|
| 126 |
+
if (typeof Date !== "undefined" && data instanceof Date) {
|
| 127 |
+
return ZodParsedType.date;
|
| 128 |
+
}
|
| 129 |
+
return ZodParsedType.object;
|
| 130 |
+
default:
|
| 131 |
+
return ZodParsedType.unknown;
|
| 132 |
+
}
|
| 133 |
+
};
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/index.cjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
| 3 |
+
if (k2 === undefined) k2 = k;
|
| 4 |
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
| 5 |
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
| 6 |
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
| 7 |
+
}
|
| 8 |
+
Object.defineProperty(o, k2, desc);
|
| 9 |
+
}) : (function(o, m, k, k2) {
|
| 10 |
+
if (k2 === undefined) k2 = k;
|
| 11 |
+
o[k2] = m[k];
|
| 12 |
+
}));
|
| 13 |
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
| 14 |
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
| 15 |
+
}) : function(o, v) {
|
| 16 |
+
o["default"] = v;
|
| 17 |
+
});
|
| 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 |
+
};
|
| 25 |
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
| 26 |
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
| 27 |
+
};
|
| 28 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 29 |
+
exports.z = void 0;
|
| 30 |
+
const z = __importStar(require("./external.cjs"));
|
| 31 |
+
exports.z = z;
|
| 32 |
+
__exportStar(require("./external.cjs"), exports);
|
| 33 |
+
exports.default = z;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/index.d.cts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as z from "./external.cjs";
|
| 2 |
+
export * from "./external.cjs";
|
| 3 |
+
export { z };
|
| 4 |
+
export default z;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as z from "./external.js";
|
| 2 |
+
export * from "./external.js";
|
| 3 |
+
export { z };
|
| 4 |
+
export default z;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as z from "./external.js";
|
| 2 |
+
export * from "./external.js";
|
| 3 |
+
export { z };
|
| 4 |
+
export default z;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/locales/en.cjs
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
const ZodError_js_1 = require("../ZodError.cjs");
|
| 4 |
+
const util_js_1 = require("../helpers/util.cjs");
|
| 5 |
+
const errorMap = (issue, _ctx) => {
|
| 6 |
+
let message;
|
| 7 |
+
switch (issue.code) {
|
| 8 |
+
case ZodError_js_1.ZodIssueCode.invalid_type:
|
| 9 |
+
if (issue.received === util_js_1.ZodParsedType.undefined) {
|
| 10 |
+
message = "Required";
|
| 11 |
+
}
|
| 12 |
+
else {
|
| 13 |
+
message = `Expected ${issue.expected}, received ${issue.received}`;
|
| 14 |
+
}
|
| 15 |
+
break;
|
| 16 |
+
case ZodError_js_1.ZodIssueCode.invalid_literal:
|
| 17 |
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_js_1.util.jsonStringifyReplacer)}`;
|
| 18 |
+
break;
|
| 19 |
+
case ZodError_js_1.ZodIssueCode.unrecognized_keys:
|
| 20 |
+
message = `Unrecognized key(s) in object: ${util_js_1.util.joinValues(issue.keys, ", ")}`;
|
| 21 |
+
break;
|
| 22 |
+
case ZodError_js_1.ZodIssueCode.invalid_union:
|
| 23 |
+
message = `Invalid input`;
|
| 24 |
+
break;
|
| 25 |
+
case ZodError_js_1.ZodIssueCode.invalid_union_discriminator:
|
| 26 |
+
message = `Invalid discriminator value. Expected ${util_js_1.util.joinValues(issue.options)}`;
|
| 27 |
+
break;
|
| 28 |
+
case ZodError_js_1.ZodIssueCode.invalid_enum_value:
|
| 29 |
+
message = `Invalid enum value. Expected ${util_js_1.util.joinValues(issue.options)}, received '${issue.received}'`;
|
| 30 |
+
break;
|
| 31 |
+
case ZodError_js_1.ZodIssueCode.invalid_arguments:
|
| 32 |
+
message = `Invalid function arguments`;
|
| 33 |
+
break;
|
| 34 |
+
case ZodError_js_1.ZodIssueCode.invalid_return_type:
|
| 35 |
+
message = `Invalid function return type`;
|
| 36 |
+
break;
|
| 37 |
+
case ZodError_js_1.ZodIssueCode.invalid_date:
|
| 38 |
+
message = `Invalid date`;
|
| 39 |
+
break;
|
| 40 |
+
case ZodError_js_1.ZodIssueCode.invalid_string:
|
| 41 |
+
if (typeof issue.validation === "object") {
|
| 42 |
+
if ("includes" in issue.validation) {
|
| 43 |
+
message = `Invalid input: must include "${issue.validation.includes}"`;
|
| 44 |
+
if (typeof issue.validation.position === "number") {
|
| 45 |
+
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
else if ("startsWith" in issue.validation) {
|
| 49 |
+
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
| 50 |
+
}
|
| 51 |
+
else if ("endsWith" in issue.validation) {
|
| 52 |
+
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
| 53 |
+
}
|
| 54 |
+
else {
|
| 55 |
+
util_js_1.util.assertNever(issue.validation);
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
else if (issue.validation !== "regex") {
|
| 59 |
+
message = `Invalid ${issue.validation}`;
|
| 60 |
+
}
|
| 61 |
+
else {
|
| 62 |
+
message = "Invalid";
|
| 63 |
+
}
|
| 64 |
+
break;
|
| 65 |
+
case ZodError_js_1.ZodIssueCode.too_small:
|
| 66 |
+
if (issue.type === "array")
|
| 67 |
+
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
| 68 |
+
else if (issue.type === "string")
|
| 69 |
+
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
| 70 |
+
else if (issue.type === "number")
|
| 71 |
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
| 72 |
+
else if (issue.type === "bigint")
|
| 73 |
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
| 74 |
+
else if (issue.type === "date")
|
| 75 |
+
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
| 76 |
+
else
|
| 77 |
+
message = "Invalid input";
|
| 78 |
+
break;
|
| 79 |
+
case ZodError_js_1.ZodIssueCode.too_big:
|
| 80 |
+
if (issue.type === "array")
|
| 81 |
+
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
| 82 |
+
else if (issue.type === "string")
|
| 83 |
+
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
| 84 |
+
else if (issue.type === "number")
|
| 85 |
+
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
| 86 |
+
else if (issue.type === "bigint")
|
| 87 |
+
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
| 88 |
+
else if (issue.type === "date")
|
| 89 |
+
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
|
| 90 |
+
else
|
| 91 |
+
message = "Invalid input";
|
| 92 |
+
break;
|
| 93 |
+
case ZodError_js_1.ZodIssueCode.custom:
|
| 94 |
+
message = `Invalid input`;
|
| 95 |
+
break;
|
| 96 |
+
case ZodError_js_1.ZodIssueCode.invalid_intersection_types:
|
| 97 |
+
message = `Intersection results could not be merged`;
|
| 98 |
+
break;
|
| 99 |
+
case ZodError_js_1.ZodIssueCode.not_multiple_of:
|
| 100 |
+
message = `Number must be a multiple of ${issue.multipleOf}`;
|
| 101 |
+
break;
|
| 102 |
+
case ZodError_js_1.ZodIssueCode.not_finite:
|
| 103 |
+
message = "Number must be finite";
|
| 104 |
+
break;
|
| 105 |
+
default:
|
| 106 |
+
message = _ctx.defaultError;
|
| 107 |
+
util_js_1.util.assertNever(issue);
|
| 108 |
+
}
|
| 109 |
+
return { message };
|
| 110 |
+
};
|
| 111 |
+
exports.default = errorMap;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/locales/en.d.cts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type ZodErrorMap } from "../ZodError.cjs";
|
| 2 |
+
declare const errorMap: ZodErrorMap;
|
| 3 |
+
export default errorMap;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/locales/en.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type ZodErrorMap } from "../ZodError.js";
|
| 2 |
+
declare const errorMap: ZodErrorMap;
|
| 3 |
+
export default errorMap;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/locales/en.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ZodIssueCode } from "../ZodError.js";
|
| 2 |
+
import { util, ZodParsedType } from "../helpers/util.js";
|
| 3 |
+
const errorMap = (issue, _ctx) => {
|
| 4 |
+
let message;
|
| 5 |
+
switch (issue.code) {
|
| 6 |
+
case ZodIssueCode.invalid_type:
|
| 7 |
+
if (issue.received === ZodParsedType.undefined) {
|
| 8 |
+
message = "Required";
|
| 9 |
+
}
|
| 10 |
+
else {
|
| 11 |
+
message = `Expected ${issue.expected}, received ${issue.received}`;
|
| 12 |
+
}
|
| 13 |
+
break;
|
| 14 |
+
case ZodIssueCode.invalid_literal:
|
| 15 |
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
|
| 16 |
+
break;
|
| 17 |
+
case ZodIssueCode.unrecognized_keys:
|
| 18 |
+
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
|
| 19 |
+
break;
|
| 20 |
+
case ZodIssueCode.invalid_union:
|
| 21 |
+
message = `Invalid input`;
|
| 22 |
+
break;
|
| 23 |
+
case ZodIssueCode.invalid_union_discriminator:
|
| 24 |
+
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
|
| 25 |
+
break;
|
| 26 |
+
case ZodIssueCode.invalid_enum_value:
|
| 27 |
+
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
|
| 28 |
+
break;
|
| 29 |
+
case ZodIssueCode.invalid_arguments:
|
| 30 |
+
message = `Invalid function arguments`;
|
| 31 |
+
break;
|
| 32 |
+
case ZodIssueCode.invalid_return_type:
|
| 33 |
+
message = `Invalid function return type`;
|
| 34 |
+
break;
|
| 35 |
+
case ZodIssueCode.invalid_date:
|
| 36 |
+
message = `Invalid date`;
|
| 37 |
+
break;
|
| 38 |
+
case ZodIssueCode.invalid_string:
|
| 39 |
+
if (typeof issue.validation === "object") {
|
| 40 |
+
if ("includes" in issue.validation) {
|
| 41 |
+
message = `Invalid input: must include "${issue.validation.includes}"`;
|
| 42 |
+
if (typeof issue.validation.position === "number") {
|
| 43 |
+
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
else if ("startsWith" in issue.validation) {
|
| 47 |
+
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
| 48 |
+
}
|
| 49 |
+
else if ("endsWith" in issue.validation) {
|
| 50 |
+
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
| 51 |
+
}
|
| 52 |
+
else {
|
| 53 |
+
util.assertNever(issue.validation);
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
else if (issue.validation !== "regex") {
|
| 57 |
+
message = `Invalid ${issue.validation}`;
|
| 58 |
+
}
|
| 59 |
+
else {
|
| 60 |
+
message = "Invalid";
|
| 61 |
+
}
|
| 62 |
+
break;
|
| 63 |
+
case ZodIssueCode.too_small:
|
| 64 |
+
if (issue.type === "array")
|
| 65 |
+
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
| 66 |
+
else if (issue.type === "string")
|
| 67 |
+
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
| 68 |
+
else if (issue.type === "number")
|
| 69 |
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
| 70 |
+
else if (issue.type === "bigint")
|
| 71 |
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
| 72 |
+
else if (issue.type === "date")
|
| 73 |
+
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
| 74 |
+
else
|
| 75 |
+
message = "Invalid input";
|
| 76 |
+
break;
|
| 77 |
+
case ZodIssueCode.too_big:
|
| 78 |
+
if (issue.type === "array")
|
| 79 |
+
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
| 80 |
+
else if (issue.type === "string")
|
| 81 |
+
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
| 82 |
+
else if (issue.type === "number")
|
| 83 |
+
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
| 84 |
+
else if (issue.type === "bigint")
|
| 85 |
+
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
| 86 |
+
else if (issue.type === "date")
|
| 87 |
+
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
|
| 88 |
+
else
|
| 89 |
+
message = "Invalid input";
|
| 90 |
+
break;
|
| 91 |
+
case ZodIssueCode.custom:
|
| 92 |
+
message = `Invalid input`;
|
| 93 |
+
break;
|
| 94 |
+
case ZodIssueCode.invalid_intersection_types:
|
| 95 |
+
message = `Intersection results could not be merged`;
|
| 96 |
+
break;
|
| 97 |
+
case ZodIssueCode.not_multiple_of:
|
| 98 |
+
message = `Number must be a multiple of ${issue.multipleOf}`;
|
| 99 |
+
break;
|
| 100 |
+
case ZodIssueCode.not_finite:
|
| 101 |
+
message = "Number must be finite";
|
| 102 |
+
break;
|
| 103 |
+
default:
|
| 104 |
+
message = _ctx.defaultError;
|
| 105 |
+
util.assertNever(issue);
|
| 106 |
+
}
|
| 107 |
+
return { message };
|
| 108 |
+
};
|
| 109 |
+
export default errorMap;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/standard-schema.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/standard-schema.d.cts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* The Standard Schema interface.
|
| 3 |
+
*/
|
| 4 |
+
export type StandardSchemaV1<Input = unknown, Output = Input> = {
|
| 5 |
+
/**
|
| 6 |
+
* The Standard Schema properties.
|
| 7 |
+
*/
|
| 8 |
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
| 9 |
+
};
|
| 10 |
+
export declare namespace StandardSchemaV1 {
|
| 11 |
+
/**
|
| 12 |
+
* The Standard Schema properties interface.
|
| 13 |
+
*/
|
| 14 |
+
export interface Props<Input = unknown, Output = Input> {
|
| 15 |
+
/**
|
| 16 |
+
* The version number of the standard.
|
| 17 |
+
*/
|
| 18 |
+
readonly version: 1;
|
| 19 |
+
/**
|
| 20 |
+
* The vendor name of the schema library.
|
| 21 |
+
*/
|
| 22 |
+
readonly vendor: string;
|
| 23 |
+
/**
|
| 24 |
+
* Validates unknown input values.
|
| 25 |
+
*/
|
| 26 |
+
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
| 27 |
+
/**
|
| 28 |
+
* Inferred types associated with the schema.
|
| 29 |
+
*/
|
| 30 |
+
readonly types?: Types<Input, Output> | undefined;
|
| 31 |
+
}
|
| 32 |
+
/**
|
| 33 |
+
* The result interface of the validate function.
|
| 34 |
+
*/
|
| 35 |
+
export type Result<Output> = SuccessResult<Output> | FailureResult;
|
| 36 |
+
/**
|
| 37 |
+
* The result interface if validation succeeds.
|
| 38 |
+
*/
|
| 39 |
+
export interface SuccessResult<Output> {
|
| 40 |
+
/**
|
| 41 |
+
* The typed output value.
|
| 42 |
+
*/
|
| 43 |
+
readonly value: Output;
|
| 44 |
+
/**
|
| 45 |
+
* The non-existent issues.
|
| 46 |
+
*/
|
| 47 |
+
readonly issues?: undefined;
|
| 48 |
+
}
|
| 49 |
+
/**
|
| 50 |
+
* The result interface if validation fails.
|
| 51 |
+
*/
|
| 52 |
+
export interface FailureResult {
|
| 53 |
+
/**
|
| 54 |
+
* The issues of failed validation.
|
| 55 |
+
*/
|
| 56 |
+
readonly issues: ReadonlyArray<Issue>;
|
| 57 |
+
}
|
| 58 |
+
/**
|
| 59 |
+
* The issue interface of the failure output.
|
| 60 |
+
*/
|
| 61 |
+
export interface Issue {
|
| 62 |
+
/**
|
| 63 |
+
* The error message of the issue.
|
| 64 |
+
*/
|
| 65 |
+
readonly message: string;
|
| 66 |
+
/**
|
| 67 |
+
* The path of the issue, if any.
|
| 68 |
+
*/
|
| 69 |
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
| 70 |
+
}
|
| 71 |
+
/**
|
| 72 |
+
* The path segment interface of the issue.
|
| 73 |
+
*/
|
| 74 |
+
export interface PathSegment {
|
| 75 |
+
/**
|
| 76 |
+
* The key representing a path segment.
|
| 77 |
+
*/
|
| 78 |
+
readonly key: PropertyKey;
|
| 79 |
+
}
|
| 80 |
+
/**
|
| 81 |
+
* The Standard Schema types interface.
|
| 82 |
+
*/
|
| 83 |
+
export interface Types<Input = unknown, Output = Input> {
|
| 84 |
+
/**
|
| 85 |
+
* The input type of the schema.
|
| 86 |
+
*/
|
| 87 |
+
readonly input: Input;
|
| 88 |
+
/**
|
| 89 |
+
* The output type of the schema.
|
| 90 |
+
*/
|
| 91 |
+
readonly output: Output;
|
| 92 |
+
}
|
| 93 |
+
/**
|
| 94 |
+
* Infers the input type of a Standard Schema.
|
| 95 |
+
*/
|
| 96 |
+
export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
| 97 |
+
/**
|
| 98 |
+
* Infers the output type of a Standard Schema.
|
| 99 |
+
*/
|
| 100 |
+
export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
| 101 |
+
export {};
|
| 102 |
+
}
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/standard-schema.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* The Standard Schema interface.
|
| 3 |
+
*/
|
| 4 |
+
export type StandardSchemaV1<Input = unknown, Output = Input> = {
|
| 5 |
+
/**
|
| 6 |
+
* The Standard Schema properties.
|
| 7 |
+
*/
|
| 8 |
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
| 9 |
+
};
|
| 10 |
+
export declare namespace StandardSchemaV1 {
|
| 11 |
+
/**
|
| 12 |
+
* The Standard Schema properties interface.
|
| 13 |
+
*/
|
| 14 |
+
export interface Props<Input = unknown, Output = Input> {
|
| 15 |
+
/**
|
| 16 |
+
* The version number of the standard.
|
| 17 |
+
*/
|
| 18 |
+
readonly version: 1;
|
| 19 |
+
/**
|
| 20 |
+
* The vendor name of the schema library.
|
| 21 |
+
*/
|
| 22 |
+
readonly vendor: string;
|
| 23 |
+
/**
|
| 24 |
+
* Validates unknown input values.
|
| 25 |
+
*/
|
| 26 |
+
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
| 27 |
+
/**
|
| 28 |
+
* Inferred types associated with the schema.
|
| 29 |
+
*/
|
| 30 |
+
readonly types?: Types<Input, Output> | undefined;
|
| 31 |
+
}
|
| 32 |
+
/**
|
| 33 |
+
* The result interface of the validate function.
|
| 34 |
+
*/
|
| 35 |
+
export type Result<Output> = SuccessResult<Output> | FailureResult;
|
| 36 |
+
/**
|
| 37 |
+
* The result interface if validation succeeds.
|
| 38 |
+
*/
|
| 39 |
+
export interface SuccessResult<Output> {
|
| 40 |
+
/**
|
| 41 |
+
* The typed output value.
|
| 42 |
+
*/
|
| 43 |
+
readonly value: Output;
|
| 44 |
+
/**
|
| 45 |
+
* The non-existent issues.
|
| 46 |
+
*/
|
| 47 |
+
readonly issues?: undefined;
|
| 48 |
+
}
|
| 49 |
+
/**
|
| 50 |
+
* The result interface if validation fails.
|
| 51 |
+
*/
|
| 52 |
+
export interface FailureResult {
|
| 53 |
+
/**
|
| 54 |
+
* The issues of failed validation.
|
| 55 |
+
*/
|
| 56 |
+
readonly issues: ReadonlyArray<Issue>;
|
| 57 |
+
}
|
| 58 |
+
/**
|
| 59 |
+
* The issue interface of the failure output.
|
| 60 |
+
*/
|
| 61 |
+
export interface Issue {
|
| 62 |
+
/**
|
| 63 |
+
* The error message of the issue.
|
| 64 |
+
*/
|
| 65 |
+
readonly message: string;
|
| 66 |
+
/**
|
| 67 |
+
* The path of the issue, if any.
|
| 68 |
+
*/
|
| 69 |
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
| 70 |
+
}
|
| 71 |
+
/**
|
| 72 |
+
* The path segment interface of the issue.
|
| 73 |
+
*/
|
| 74 |
+
export interface PathSegment {
|
| 75 |
+
/**
|
| 76 |
+
* The key representing a path segment.
|
| 77 |
+
*/
|
| 78 |
+
readonly key: PropertyKey;
|
| 79 |
+
}
|
| 80 |
+
/**
|
| 81 |
+
* The Standard Schema types interface.
|
| 82 |
+
*/
|
| 83 |
+
export interface Types<Input = unknown, Output = Input> {
|
| 84 |
+
/**
|
| 85 |
+
* The input type of the schema.
|
| 86 |
+
*/
|
| 87 |
+
readonly input: Input;
|
| 88 |
+
/**
|
| 89 |
+
* The output type of the schema.
|
| 90 |
+
*/
|
| 91 |
+
readonly output: Output;
|
| 92 |
+
}
|
| 93 |
+
/**
|
| 94 |
+
* Infers the input type of a Standard Schema.
|
| 95 |
+
*/
|
| 96 |
+
export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
| 97 |
+
/**
|
| 98 |
+
* Infers the output type of a Standard Schema.
|
| 99 |
+
*/
|
| 100 |
+
export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
| 101 |
+
export {};
|
| 102 |
+
}
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/standard-schema.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export {};
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/types.cjs
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/types.d.cts
ADDED
|
@@ -0,0 +1,1031 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type IssueData, type StringValidation, type ZodCustomIssue, ZodError, type ZodErrorMap } from "./ZodError.cjs";
|
| 2 |
+
import type { enumUtil } from "./helpers/enumUtil.cjs";
|
| 3 |
+
import { errorUtil } from "./helpers/errorUtil.cjs";
|
| 4 |
+
import { type AsyncParseReturnType, INVALID, type ParseContext, type ParseInput, type ParseParams, type ParseReturnType, ParseStatus, type SyncParseReturnType } from "./helpers/parseUtil.cjs";
|
| 5 |
+
import type { partialUtil } from "./helpers/partialUtil.cjs";
|
| 6 |
+
import type { Primitive } from "./helpers/typeAliases.cjs";
|
| 7 |
+
import { util, type objectUtil } from "./helpers/util.cjs";
|
| 8 |
+
import type { StandardSchemaV1 } from "./standard-schema.cjs";
|
| 9 |
+
export interface RefinementCtx {
|
| 10 |
+
addIssue: (arg: IssueData) => void;
|
| 11 |
+
path: (string | number)[];
|
| 12 |
+
}
|
| 13 |
+
export type ZodRawShape = {
|
| 14 |
+
[k: string]: ZodTypeAny;
|
| 15 |
+
};
|
| 16 |
+
export type ZodTypeAny = ZodType<any, any, any>;
|
| 17 |
+
export type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
|
| 18 |
+
export type input<T extends ZodType<any, any, any>> = T["_input"];
|
| 19 |
+
export type output<T extends ZodType<any, any, any>> = T["_output"];
|
| 20 |
+
export type { TypeOf as infer };
|
| 21 |
+
export type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
|
| 22 |
+
export interface ZodTypeDef {
|
| 23 |
+
errorMap?: ZodErrorMap | undefined;
|
| 24 |
+
description?: string | undefined;
|
| 25 |
+
}
|
| 26 |
+
export type RawCreateParams = {
|
| 27 |
+
errorMap?: ZodErrorMap | undefined;
|
| 28 |
+
invalid_type_error?: string | undefined;
|
| 29 |
+
required_error?: string | undefined;
|
| 30 |
+
message?: string | undefined;
|
| 31 |
+
description?: string | undefined;
|
| 32 |
+
} | undefined;
|
| 33 |
+
export type ProcessedCreateParams = {
|
| 34 |
+
errorMap?: ZodErrorMap | undefined;
|
| 35 |
+
description?: string | undefined;
|
| 36 |
+
};
|
| 37 |
+
export type SafeParseSuccess<Output> = {
|
| 38 |
+
success: true;
|
| 39 |
+
data: Output;
|
| 40 |
+
error?: never;
|
| 41 |
+
};
|
| 42 |
+
export type SafeParseError<Input> = {
|
| 43 |
+
success: false;
|
| 44 |
+
error: ZodError<Input>;
|
| 45 |
+
data?: never;
|
| 46 |
+
};
|
| 47 |
+
export type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
|
| 48 |
+
export declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
|
| 49 |
+
readonly _type: Output;
|
| 50 |
+
readonly _output: Output;
|
| 51 |
+
readonly _input: Input;
|
| 52 |
+
readonly _def: Def;
|
| 53 |
+
get description(): string | undefined;
|
| 54 |
+
"~standard": StandardSchemaV1.Props<Input, Output>;
|
| 55 |
+
abstract _parse(input: ParseInput): ParseReturnType<Output>;
|
| 56 |
+
_getType(input: ParseInput): string;
|
| 57 |
+
_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
|
| 58 |
+
_processInputParams(input: ParseInput): {
|
| 59 |
+
status: ParseStatus;
|
| 60 |
+
ctx: ParseContext;
|
| 61 |
+
};
|
| 62 |
+
_parseSync(input: ParseInput): SyncParseReturnType<Output>;
|
| 63 |
+
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
|
| 64 |
+
parse(data: unknown, params?: util.InexactPartial<ParseParams>): Output;
|
| 65 |
+
safeParse(data: unknown, params?: util.InexactPartial<ParseParams>): SafeParseReturnType<Input, Output>;
|
| 66 |
+
"~validate"(data: unknown): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>>;
|
| 67 |
+
parseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<Output>;
|
| 68 |
+
safeParseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
|
| 69 |
+
/** Alias of safeParseAsync */
|
| 70 |
+
spa: (data: unknown, params?: util.InexactPartial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
|
| 71 |
+
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
|
| 72 |
+
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
|
| 73 |
+
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
|
| 74 |
+
refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
|
| 75 |
+
_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
|
| 76 |
+
superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
|
| 77 |
+
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
|
| 78 |
+
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
|
| 79 |
+
constructor(def: Def);
|
| 80 |
+
optional(): ZodOptional<this>;
|
| 81 |
+
nullable(): ZodNullable<this>;
|
| 82 |
+
nullish(): ZodOptional<ZodNullable<this>>;
|
| 83 |
+
array(): ZodArray<this>;
|
| 84 |
+
promise(): ZodPromise<this>;
|
| 85 |
+
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
|
| 86 |
+
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
|
| 87 |
+
transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
|
| 88 |
+
default(def: util.noUndefined<Input>): ZodDefault<this>;
|
| 89 |
+
default(def: () => util.noUndefined<Input>): ZodDefault<this>;
|
| 90 |
+
brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
|
| 91 |
+
catch(def: Output): ZodCatch<this>;
|
| 92 |
+
catch(def: (ctx: {
|
| 93 |
+
error: ZodError;
|
| 94 |
+
input: Input;
|
| 95 |
+
}) => Output): ZodCatch<this>;
|
| 96 |
+
describe(description: string): this;
|
| 97 |
+
pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
|
| 98 |
+
readonly(): ZodReadonly<this>;
|
| 99 |
+
isOptional(): boolean;
|
| 100 |
+
isNullable(): boolean;
|
| 101 |
+
}
|
| 102 |
+
export type IpVersion = "v4" | "v6";
|
| 103 |
+
export type ZodStringCheck = {
|
| 104 |
+
kind: "min";
|
| 105 |
+
value: number;
|
| 106 |
+
message?: string | undefined;
|
| 107 |
+
} | {
|
| 108 |
+
kind: "max";
|
| 109 |
+
value: number;
|
| 110 |
+
message?: string | undefined;
|
| 111 |
+
} | {
|
| 112 |
+
kind: "length";
|
| 113 |
+
value: number;
|
| 114 |
+
message?: string | undefined;
|
| 115 |
+
} | {
|
| 116 |
+
kind: "email";
|
| 117 |
+
message?: string | undefined;
|
| 118 |
+
} | {
|
| 119 |
+
kind: "url";
|
| 120 |
+
message?: string | undefined;
|
| 121 |
+
} | {
|
| 122 |
+
kind: "emoji";
|
| 123 |
+
message?: string | undefined;
|
| 124 |
+
} | {
|
| 125 |
+
kind: "uuid";
|
| 126 |
+
message?: string | undefined;
|
| 127 |
+
} | {
|
| 128 |
+
kind: "nanoid";
|
| 129 |
+
message?: string | undefined;
|
| 130 |
+
} | {
|
| 131 |
+
kind: "cuid";
|
| 132 |
+
message?: string | undefined;
|
| 133 |
+
} | {
|
| 134 |
+
kind: "includes";
|
| 135 |
+
value: string;
|
| 136 |
+
position?: number | undefined;
|
| 137 |
+
message?: string | undefined;
|
| 138 |
+
} | {
|
| 139 |
+
kind: "cuid2";
|
| 140 |
+
message?: string | undefined;
|
| 141 |
+
} | {
|
| 142 |
+
kind: "ulid";
|
| 143 |
+
message?: string | undefined;
|
| 144 |
+
} | {
|
| 145 |
+
kind: "startsWith";
|
| 146 |
+
value: string;
|
| 147 |
+
message?: string | undefined;
|
| 148 |
+
} | {
|
| 149 |
+
kind: "endsWith";
|
| 150 |
+
value: string;
|
| 151 |
+
message?: string | undefined;
|
| 152 |
+
} | {
|
| 153 |
+
kind: "regex";
|
| 154 |
+
regex: RegExp;
|
| 155 |
+
message?: string | undefined;
|
| 156 |
+
} | {
|
| 157 |
+
kind: "trim";
|
| 158 |
+
message?: string | undefined;
|
| 159 |
+
} | {
|
| 160 |
+
kind: "toLowerCase";
|
| 161 |
+
message?: string | undefined;
|
| 162 |
+
} | {
|
| 163 |
+
kind: "toUpperCase";
|
| 164 |
+
message?: string | undefined;
|
| 165 |
+
} | {
|
| 166 |
+
kind: "jwt";
|
| 167 |
+
alg?: string;
|
| 168 |
+
message?: string | undefined;
|
| 169 |
+
} | {
|
| 170 |
+
kind: "datetime";
|
| 171 |
+
offset: boolean;
|
| 172 |
+
local: boolean;
|
| 173 |
+
precision: number | null;
|
| 174 |
+
message?: string | undefined;
|
| 175 |
+
} | {
|
| 176 |
+
kind: "date";
|
| 177 |
+
message?: string | undefined;
|
| 178 |
+
} | {
|
| 179 |
+
kind: "time";
|
| 180 |
+
precision: number | null;
|
| 181 |
+
message?: string | undefined;
|
| 182 |
+
} | {
|
| 183 |
+
kind: "duration";
|
| 184 |
+
message?: string | undefined;
|
| 185 |
+
} | {
|
| 186 |
+
kind: "ip";
|
| 187 |
+
version?: IpVersion | undefined;
|
| 188 |
+
message?: string | undefined;
|
| 189 |
+
} | {
|
| 190 |
+
kind: "cidr";
|
| 191 |
+
version?: IpVersion | undefined;
|
| 192 |
+
message?: string | undefined;
|
| 193 |
+
} | {
|
| 194 |
+
kind: "base64";
|
| 195 |
+
message?: string | undefined;
|
| 196 |
+
} | {
|
| 197 |
+
kind: "base64url";
|
| 198 |
+
message?: string | undefined;
|
| 199 |
+
};
|
| 200 |
+
export interface ZodStringDef extends ZodTypeDef {
|
| 201 |
+
checks: ZodStringCheck[];
|
| 202 |
+
typeName: ZodFirstPartyTypeKind.ZodString;
|
| 203 |
+
coerce: boolean;
|
| 204 |
+
}
|
| 205 |
+
export declare function datetimeRegex(args: {
|
| 206 |
+
precision?: number | null;
|
| 207 |
+
offset?: boolean;
|
| 208 |
+
local?: boolean;
|
| 209 |
+
}): RegExp;
|
| 210 |
+
export declare class ZodString extends ZodType<string, ZodStringDef, string> {
|
| 211 |
+
_parse(input: ParseInput): ParseReturnType<string>;
|
| 212 |
+
protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage): ZodEffects<this, string, string>;
|
| 213 |
+
_addCheck(check: ZodStringCheck): ZodString;
|
| 214 |
+
email(message?: errorUtil.ErrMessage): ZodString;
|
| 215 |
+
url(message?: errorUtil.ErrMessage): ZodString;
|
| 216 |
+
emoji(message?: errorUtil.ErrMessage): ZodString;
|
| 217 |
+
uuid(message?: errorUtil.ErrMessage): ZodString;
|
| 218 |
+
nanoid(message?: errorUtil.ErrMessage): ZodString;
|
| 219 |
+
cuid(message?: errorUtil.ErrMessage): ZodString;
|
| 220 |
+
cuid2(message?: errorUtil.ErrMessage): ZodString;
|
| 221 |
+
ulid(message?: errorUtil.ErrMessage): ZodString;
|
| 222 |
+
base64(message?: errorUtil.ErrMessage): ZodString;
|
| 223 |
+
base64url(message?: errorUtil.ErrMessage): ZodString;
|
| 224 |
+
jwt(options?: {
|
| 225 |
+
alg?: string;
|
| 226 |
+
message?: string | undefined;
|
| 227 |
+
}): ZodString;
|
| 228 |
+
ip(options?: string | {
|
| 229 |
+
version?: IpVersion;
|
| 230 |
+
message?: string | undefined;
|
| 231 |
+
}): ZodString;
|
| 232 |
+
cidr(options?: string | {
|
| 233 |
+
version?: IpVersion;
|
| 234 |
+
message?: string | undefined;
|
| 235 |
+
}): ZodString;
|
| 236 |
+
datetime(options?: string | {
|
| 237 |
+
message?: string | undefined;
|
| 238 |
+
precision?: number | null;
|
| 239 |
+
offset?: boolean;
|
| 240 |
+
local?: boolean;
|
| 241 |
+
}): ZodString;
|
| 242 |
+
date(message?: string): ZodString;
|
| 243 |
+
time(options?: string | {
|
| 244 |
+
message?: string | undefined;
|
| 245 |
+
precision?: number | null;
|
| 246 |
+
}): ZodString;
|
| 247 |
+
duration(message?: errorUtil.ErrMessage): ZodString;
|
| 248 |
+
regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
|
| 249 |
+
includes(value: string, options?: {
|
| 250 |
+
message?: string;
|
| 251 |
+
position?: number;
|
| 252 |
+
}): ZodString;
|
| 253 |
+
startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
| 254 |
+
endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
| 255 |
+
min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
|
| 256 |
+
max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
|
| 257 |
+
length(len: number, message?: errorUtil.ErrMessage): ZodString;
|
| 258 |
+
/**
|
| 259 |
+
* Equivalent to `.min(1)`
|
| 260 |
+
*/
|
| 261 |
+
nonempty(message?: errorUtil.ErrMessage): ZodString;
|
| 262 |
+
trim(): ZodString;
|
| 263 |
+
toLowerCase(): ZodString;
|
| 264 |
+
toUpperCase(): ZodString;
|
| 265 |
+
get isDatetime(): boolean;
|
| 266 |
+
get isDate(): boolean;
|
| 267 |
+
get isTime(): boolean;
|
| 268 |
+
get isDuration(): boolean;
|
| 269 |
+
get isEmail(): boolean;
|
| 270 |
+
get isURL(): boolean;
|
| 271 |
+
get isEmoji(): boolean;
|
| 272 |
+
get isUUID(): boolean;
|
| 273 |
+
get isNANOID(): boolean;
|
| 274 |
+
get isCUID(): boolean;
|
| 275 |
+
get isCUID2(): boolean;
|
| 276 |
+
get isULID(): boolean;
|
| 277 |
+
get isIP(): boolean;
|
| 278 |
+
get isCIDR(): boolean;
|
| 279 |
+
get isBase64(): boolean;
|
| 280 |
+
get isBase64url(): boolean;
|
| 281 |
+
get minLength(): number | null;
|
| 282 |
+
get maxLength(): number | null;
|
| 283 |
+
static create: (params?: RawCreateParams & {
|
| 284 |
+
coerce?: true;
|
| 285 |
+
}) => ZodString;
|
| 286 |
+
}
|
| 287 |
+
export type ZodNumberCheck = {
|
| 288 |
+
kind: "min";
|
| 289 |
+
value: number;
|
| 290 |
+
inclusive: boolean;
|
| 291 |
+
message?: string | undefined;
|
| 292 |
+
} | {
|
| 293 |
+
kind: "max";
|
| 294 |
+
value: number;
|
| 295 |
+
inclusive: boolean;
|
| 296 |
+
message?: string | undefined;
|
| 297 |
+
} | {
|
| 298 |
+
kind: "int";
|
| 299 |
+
message?: string | undefined;
|
| 300 |
+
} | {
|
| 301 |
+
kind: "multipleOf";
|
| 302 |
+
value: number;
|
| 303 |
+
message?: string | undefined;
|
| 304 |
+
} | {
|
| 305 |
+
kind: "finite";
|
| 306 |
+
message?: string | undefined;
|
| 307 |
+
};
|
| 308 |
+
export interface ZodNumberDef extends ZodTypeDef {
|
| 309 |
+
checks: ZodNumberCheck[];
|
| 310 |
+
typeName: ZodFirstPartyTypeKind.ZodNumber;
|
| 311 |
+
coerce: boolean;
|
| 312 |
+
}
|
| 313 |
+
export declare class ZodNumber extends ZodType<number, ZodNumberDef, number> {
|
| 314 |
+
_parse(input: ParseInput): ParseReturnType<number>;
|
| 315 |
+
static create: (params?: RawCreateParams & {
|
| 316 |
+
coerce?: boolean;
|
| 317 |
+
}) => ZodNumber;
|
| 318 |
+
gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
| 319 |
+
min: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
| 320 |
+
gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
| 321 |
+
lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
| 322 |
+
max: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
| 323 |
+
lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
| 324 |
+
protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
|
| 325 |
+
_addCheck(check: ZodNumberCheck): ZodNumber;
|
| 326 |
+
int(message?: errorUtil.ErrMessage): ZodNumber;
|
| 327 |
+
positive(message?: errorUtil.ErrMessage): ZodNumber;
|
| 328 |
+
negative(message?: errorUtil.ErrMessage): ZodNumber;
|
| 329 |
+
nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
|
| 330 |
+
nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
|
| 331 |
+
multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
| 332 |
+
step: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
| 333 |
+
finite(message?: errorUtil.ErrMessage): ZodNumber;
|
| 334 |
+
safe(message?: errorUtil.ErrMessage): ZodNumber;
|
| 335 |
+
get minValue(): number | null;
|
| 336 |
+
get maxValue(): number | null;
|
| 337 |
+
get isInt(): boolean;
|
| 338 |
+
get isFinite(): boolean;
|
| 339 |
+
}
|
| 340 |
+
export type ZodBigIntCheck = {
|
| 341 |
+
kind: "min";
|
| 342 |
+
value: bigint;
|
| 343 |
+
inclusive: boolean;
|
| 344 |
+
message?: string | undefined;
|
| 345 |
+
} | {
|
| 346 |
+
kind: "max";
|
| 347 |
+
value: bigint;
|
| 348 |
+
inclusive: boolean;
|
| 349 |
+
message?: string | undefined;
|
| 350 |
+
} | {
|
| 351 |
+
kind: "multipleOf";
|
| 352 |
+
value: bigint;
|
| 353 |
+
message?: string | undefined;
|
| 354 |
+
};
|
| 355 |
+
export interface ZodBigIntDef extends ZodTypeDef {
|
| 356 |
+
checks: ZodBigIntCheck[];
|
| 357 |
+
typeName: ZodFirstPartyTypeKind.ZodBigInt;
|
| 358 |
+
coerce: boolean;
|
| 359 |
+
}
|
| 360 |
+
export declare class ZodBigInt extends ZodType<bigint, ZodBigIntDef, bigint> {
|
| 361 |
+
_parse(input: ParseInput): ParseReturnType<bigint>;
|
| 362 |
+
_getInvalidInput(input: ParseInput): INVALID;
|
| 363 |
+
static create: (params?: RawCreateParams & {
|
| 364 |
+
coerce?: boolean;
|
| 365 |
+
}) => ZodBigInt;
|
| 366 |
+
gte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
| 367 |
+
min: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
|
| 368 |
+
gt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
| 369 |
+
lte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
| 370 |
+
max: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
|
| 371 |
+
lt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
| 372 |
+
protected setLimit(kind: "min" | "max", value: bigint, inclusive: boolean, message?: string): ZodBigInt;
|
| 373 |
+
_addCheck(check: ZodBigIntCheck): ZodBigInt;
|
| 374 |
+
positive(message?: errorUtil.ErrMessage): ZodBigInt;
|
| 375 |
+
negative(message?: errorUtil.ErrMessage): ZodBigInt;
|
| 376 |
+
nonpositive(message?: errorUtil.ErrMessage): ZodBigInt;
|
| 377 |
+
nonnegative(message?: errorUtil.ErrMessage): ZodBigInt;
|
| 378 |
+
multipleOf(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
| 379 |
+
get minValue(): bigint | null;
|
| 380 |
+
get maxValue(): bigint | null;
|
| 381 |
+
}
|
| 382 |
+
export interface ZodBooleanDef extends ZodTypeDef {
|
| 383 |
+
typeName: ZodFirstPartyTypeKind.ZodBoolean;
|
| 384 |
+
coerce: boolean;
|
| 385 |
+
}
|
| 386 |
+
export declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef, boolean> {
|
| 387 |
+
_parse(input: ParseInput): ParseReturnType<boolean>;
|
| 388 |
+
static create: (params?: RawCreateParams & {
|
| 389 |
+
coerce?: boolean;
|
| 390 |
+
}) => ZodBoolean;
|
| 391 |
+
}
|
| 392 |
+
export type ZodDateCheck = {
|
| 393 |
+
kind: "min";
|
| 394 |
+
value: number;
|
| 395 |
+
message?: string | undefined;
|
| 396 |
+
} | {
|
| 397 |
+
kind: "max";
|
| 398 |
+
value: number;
|
| 399 |
+
message?: string | undefined;
|
| 400 |
+
};
|
| 401 |
+
export interface ZodDateDef extends ZodTypeDef {
|
| 402 |
+
checks: ZodDateCheck[];
|
| 403 |
+
coerce: boolean;
|
| 404 |
+
typeName: ZodFirstPartyTypeKind.ZodDate;
|
| 405 |
+
}
|
| 406 |
+
export declare class ZodDate extends ZodType<Date, ZodDateDef, Date> {
|
| 407 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 408 |
+
_addCheck(check: ZodDateCheck): ZodDate;
|
| 409 |
+
min(minDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
| 410 |
+
max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
| 411 |
+
get minDate(): Date | null;
|
| 412 |
+
get maxDate(): Date | null;
|
| 413 |
+
static create: (params?: RawCreateParams & {
|
| 414 |
+
coerce?: boolean;
|
| 415 |
+
}) => ZodDate;
|
| 416 |
+
}
|
| 417 |
+
export interface ZodSymbolDef extends ZodTypeDef {
|
| 418 |
+
typeName: ZodFirstPartyTypeKind.ZodSymbol;
|
| 419 |
+
}
|
| 420 |
+
export declare class ZodSymbol extends ZodType<symbol, ZodSymbolDef, symbol> {
|
| 421 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 422 |
+
static create: (params?: RawCreateParams) => ZodSymbol;
|
| 423 |
+
}
|
| 424 |
+
export interface ZodUndefinedDef extends ZodTypeDef {
|
| 425 |
+
typeName: ZodFirstPartyTypeKind.ZodUndefined;
|
| 426 |
+
}
|
| 427 |
+
export declare class ZodUndefined extends ZodType<undefined, ZodUndefinedDef, undefined> {
|
| 428 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 429 |
+
params?: RawCreateParams;
|
| 430 |
+
static create: (params?: RawCreateParams) => ZodUndefined;
|
| 431 |
+
}
|
| 432 |
+
export interface ZodNullDef extends ZodTypeDef {
|
| 433 |
+
typeName: ZodFirstPartyTypeKind.ZodNull;
|
| 434 |
+
}
|
| 435 |
+
export declare class ZodNull extends ZodType<null, ZodNullDef, null> {
|
| 436 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 437 |
+
static create: (params?: RawCreateParams) => ZodNull;
|
| 438 |
+
}
|
| 439 |
+
export interface ZodAnyDef extends ZodTypeDef {
|
| 440 |
+
typeName: ZodFirstPartyTypeKind.ZodAny;
|
| 441 |
+
}
|
| 442 |
+
export declare class ZodAny extends ZodType<any, ZodAnyDef, any> {
|
| 443 |
+
_any: true;
|
| 444 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 445 |
+
static create: (params?: RawCreateParams) => ZodAny;
|
| 446 |
+
}
|
| 447 |
+
export interface ZodUnknownDef extends ZodTypeDef {
|
| 448 |
+
typeName: ZodFirstPartyTypeKind.ZodUnknown;
|
| 449 |
+
}
|
| 450 |
+
export declare class ZodUnknown extends ZodType<unknown, ZodUnknownDef, unknown> {
|
| 451 |
+
_unknown: true;
|
| 452 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 453 |
+
static create: (params?: RawCreateParams) => ZodUnknown;
|
| 454 |
+
}
|
| 455 |
+
export interface ZodNeverDef extends ZodTypeDef {
|
| 456 |
+
typeName: ZodFirstPartyTypeKind.ZodNever;
|
| 457 |
+
}
|
| 458 |
+
export declare class ZodNever extends ZodType<never, ZodNeverDef, never> {
|
| 459 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 460 |
+
static create: (params?: RawCreateParams) => ZodNever;
|
| 461 |
+
}
|
| 462 |
+
export interface ZodVoidDef extends ZodTypeDef {
|
| 463 |
+
typeName: ZodFirstPartyTypeKind.ZodVoid;
|
| 464 |
+
}
|
| 465 |
+
export declare class ZodVoid extends ZodType<void, ZodVoidDef, void> {
|
| 466 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 467 |
+
static create: (params?: RawCreateParams) => ZodVoid;
|
| 468 |
+
}
|
| 469 |
+
export interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 470 |
+
type: T;
|
| 471 |
+
typeName: ZodFirstPartyTypeKind.ZodArray;
|
| 472 |
+
exactLength: {
|
| 473 |
+
value: number;
|
| 474 |
+
message?: string | undefined;
|
| 475 |
+
} | null;
|
| 476 |
+
minLength: {
|
| 477 |
+
value: number;
|
| 478 |
+
message?: string | undefined;
|
| 479 |
+
} | null;
|
| 480 |
+
maxLength: {
|
| 481 |
+
value: number;
|
| 482 |
+
message?: string | undefined;
|
| 483 |
+
} | null;
|
| 484 |
+
}
|
| 485 |
+
export type ArrayCardinality = "many" | "atleastone";
|
| 486 |
+
export type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
|
| 487 |
+
export 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"][]> {
|
| 488 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 489 |
+
get element(): T;
|
| 490 |
+
min(minLength: number, message?: errorUtil.ErrMessage): this;
|
| 491 |
+
max(maxLength: number, message?: errorUtil.ErrMessage): this;
|
| 492 |
+
length(len: number, message?: errorUtil.ErrMessage): this;
|
| 493 |
+
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
|
| 494 |
+
static create: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
|
| 495 |
+
}
|
| 496 |
+
export type ZodNonEmptyArray<T extends ZodTypeAny> = ZodArray<T, "atleastone">;
|
| 497 |
+
export type UnknownKeysParam = "passthrough" | "strict" | "strip";
|
| 498 |
+
export interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 499 |
+
typeName: ZodFirstPartyTypeKind.ZodObject;
|
| 500 |
+
shape: () => T;
|
| 501 |
+
catchall: Catchall;
|
| 502 |
+
unknownKeys: UnknownKeys;
|
| 503 |
+
}
|
| 504 |
+
export type mergeTypes<A, B> = {
|
| 505 |
+
[k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never;
|
| 506 |
+
};
|
| 507 |
+
export type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
|
| 508 |
+
export type baseObjectOutputType<Shape extends ZodRawShape> = {
|
| 509 |
+
[k in keyof Shape]: Shape[k]["_output"];
|
| 510 |
+
};
|
| 511 |
+
export type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
|
| 512 |
+
export type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
|
| 513 |
+
[k in keyof Shape]: Shape[k]["_input"];
|
| 514 |
+
}>;
|
| 515 |
+
export type CatchallOutput<T extends ZodType> = ZodType extends T ? unknown : {
|
| 516 |
+
[k: string]: T["_output"];
|
| 517 |
+
};
|
| 518 |
+
export type CatchallInput<T extends ZodType> = ZodType extends T ? unknown : {
|
| 519 |
+
[k: string]: T["_input"];
|
| 520 |
+
};
|
| 521 |
+
export type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
|
| 522 |
+
[k: string]: unknown;
|
| 523 |
+
} : unknown;
|
| 524 |
+
export type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
|
| 525 |
+
export type SomeZodObject = ZodObject<ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
| 526 |
+
export type noUnrecognized<Obj extends object, Shape extends object> = {
|
| 527 |
+
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;
|
| 528 |
+
};
|
| 529 |
+
export 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> {
|
| 530 |
+
private _cached;
|
| 531 |
+
_getCached(): {
|
| 532 |
+
shape: T;
|
| 533 |
+
keys: string[];
|
| 534 |
+
};
|
| 535 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 536 |
+
get shape(): T;
|
| 537 |
+
strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
|
| 538 |
+
strip(): ZodObject<T, "strip", Catchall>;
|
| 539 |
+
passthrough(): ZodObject<T, "passthrough", Catchall>;
|
| 540 |
+
/**
|
| 541 |
+
* @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
|
| 542 |
+
* If you want to pass through unknown properties, use `.passthrough()` instead.
|
| 543 |
+
*/
|
| 544 |
+
nonstrict: () => ZodObject<T, "passthrough", Catchall>;
|
| 545 |
+
extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
| 546 |
+
/**
|
| 547 |
+
* @deprecated Use `.extend` instead
|
| 548 |
+
* */
|
| 549 |
+
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
| 550 |
+
/**
|
| 551 |
+
* Prior to zod@1.0.12 there was a bug in the
|
| 552 |
+
* inferred type of merged objects. Please
|
| 553 |
+
* upgrade if you are experiencing issues.
|
| 554 |
+
*/
|
| 555 |
+
merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<objectUtil.extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
|
| 556 |
+
setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
|
| 557 |
+
[k in Key]: Schema;
|
| 558 |
+
}, UnknownKeys, Catchall>;
|
| 559 |
+
catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
|
| 560 |
+
pick<Mask extends util.Exactly<{
|
| 561 |
+
[k in keyof T]?: true;
|
| 562 |
+
}, Mask>>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
|
| 563 |
+
omit<Mask extends util.Exactly<{
|
| 564 |
+
[k in keyof T]?: true;
|
| 565 |
+
}, Mask>>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
|
| 566 |
+
/**
|
| 567 |
+
* @deprecated
|
| 568 |
+
*/
|
| 569 |
+
deepPartial(): partialUtil.DeepPartial<this>;
|
| 570 |
+
partial(): ZodObject<{
|
| 571 |
+
[k in keyof T]: ZodOptional<T[k]>;
|
| 572 |
+
}, UnknownKeys, Catchall>;
|
| 573 |
+
partial<Mask extends util.Exactly<{
|
| 574 |
+
[k in keyof T]?: true;
|
| 575 |
+
}, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{
|
| 576 |
+
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
|
| 577 |
+
}>, UnknownKeys, Catchall>;
|
| 578 |
+
required(): ZodObject<{
|
| 579 |
+
[k in keyof T]: deoptional<T[k]>;
|
| 580 |
+
}, UnknownKeys, Catchall>;
|
| 581 |
+
required<Mask extends util.Exactly<{
|
| 582 |
+
[k in keyof T]?: true;
|
| 583 |
+
}, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{
|
| 584 |
+
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
| 585 |
+
}>, UnknownKeys, Catchall>;
|
| 586 |
+
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
| 587 |
+
static create: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, objectOutputType<Shape, ZodTypeAny, "strip">, objectInputType<Shape, ZodTypeAny, "strip">>;
|
| 588 |
+
static strictCreate: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strict">;
|
| 589 |
+
static lazycreate: <Shape extends ZodRawShape>(shape: () => Shape, params?: RawCreateParams) => ZodObject<Shape, "strip">;
|
| 590 |
+
}
|
| 591 |
+
export type AnyZodObject = ZodObject<any, any, any>;
|
| 592 |
+
export type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
|
| 593 |
+
export interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>> extends ZodTypeDef {
|
| 594 |
+
options: T;
|
| 595 |
+
typeName: ZodFirstPartyTypeKind.ZodUnion;
|
| 596 |
+
}
|
| 597 |
+
export declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
|
| 598 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 599 |
+
get options(): T;
|
| 600 |
+
static create: <Options extends Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
|
| 601 |
+
}
|
| 602 |
+
export type ZodDiscriminatedUnionOption<Discriminator extends string> = ZodObject<{
|
| 603 |
+
[key in Discriminator]: ZodTypeAny;
|
| 604 |
+
} & ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
| 605 |
+
export interface ZodDiscriminatedUnionDef<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> extends ZodTypeDef {
|
| 606 |
+
discriminator: Discriminator;
|
| 607 |
+
options: Options;
|
| 608 |
+
optionsMap: Map<Primitive, ZodDiscriminatedUnionOption<any>>;
|
| 609 |
+
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion;
|
| 610 |
+
}
|
| 611 |
+
export declare class ZodDiscriminatedUnion<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<Discriminator>[]> extends ZodType<output<Options[number]>, ZodDiscriminatedUnionDef<Discriminator, Options>, input<Options[number]>> {
|
| 612 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 613 |
+
get discriminator(): Discriminator;
|
| 614 |
+
get options(): Options;
|
| 615 |
+
get optionsMap(): Map<Primitive, ZodDiscriminatedUnionOption<any>>;
|
| 616 |
+
/**
|
| 617 |
+
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
| 618 |
+
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
| 619 |
+
* have a different value for each object in the union.
|
| 620 |
+
* @param discriminator the name of the discriminator property
|
| 621 |
+
* @param types an array of object schemas
|
| 622 |
+
* @param params
|
| 623 |
+
*/
|
| 624 |
+
static create<Discriminator extends string, Types extends readonly [
|
| 625 |
+
ZodDiscriminatedUnionOption<Discriminator>,
|
| 626 |
+
...ZodDiscriminatedUnionOption<Discriminator>[]
|
| 627 |
+
]>(discriminator: Discriminator, options: Types, params?: RawCreateParams): ZodDiscriminatedUnion<Discriminator, Types>;
|
| 628 |
+
}
|
| 629 |
+
export interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 630 |
+
left: T;
|
| 631 |
+
right: U;
|
| 632 |
+
typeName: ZodFirstPartyTypeKind.ZodIntersection;
|
| 633 |
+
}
|
| 634 |
+
export declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
|
| 635 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 636 |
+
static create: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
|
| 637 |
+
}
|
| 638 |
+
export type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
|
| 639 |
+
export type AssertArray<T> = T extends any[] ? T : never;
|
| 640 |
+
export type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
| 641 |
+
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_output"] : never;
|
| 642 |
+
}>;
|
| 643 |
+
export type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
|
| 644 |
+
export type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
| 645 |
+
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_input"] : never;
|
| 646 |
+
}>;
|
| 647 |
+
export type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
|
| 648 |
+
export interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
|
| 649 |
+
items: T;
|
| 650 |
+
rest: Rest;
|
| 651 |
+
typeName: ZodFirstPartyTypeKind.ZodTuple;
|
| 652 |
+
}
|
| 653 |
+
export type AnyZodTuple = ZodTuple<[ZodTypeAny, ...ZodTypeAny[]] | [], ZodTypeAny | null>;
|
| 654 |
+
export declare class ZodTuple<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
|
| 655 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 656 |
+
get items(): T;
|
| 657 |
+
rest<RestSchema extends ZodTypeAny>(rest: RestSchema): ZodTuple<T, RestSchema>;
|
| 658 |
+
static create: <Items extends [ZodTypeAny, ...ZodTypeAny[]] | []>(schemas: Items, params?: RawCreateParams) => ZodTuple<Items, null>;
|
| 659 |
+
}
|
| 660 |
+
export interface ZodRecordDef<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 661 |
+
valueType: Value;
|
| 662 |
+
keyType: Key;
|
| 663 |
+
typeName: ZodFirstPartyTypeKind.ZodRecord;
|
| 664 |
+
}
|
| 665 |
+
export type KeySchema = ZodType<string | number | symbol, any, any>;
|
| 666 |
+
export 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>>;
|
| 667 |
+
export 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"]>> {
|
| 668 |
+
get keySchema(): Key;
|
| 669 |
+
get valueSchema(): Value;
|
| 670 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 671 |
+
get element(): Value;
|
| 672 |
+
static create<Value extends ZodTypeAny>(valueType: Value, params?: RawCreateParams): ZodRecord<ZodString, Value>;
|
| 673 |
+
static create<Keys extends KeySchema, Value extends ZodTypeAny>(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord<Keys, Value>;
|
| 674 |
+
}
|
| 675 |
+
export interface ZodMapDef<Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 676 |
+
valueType: Value;
|
| 677 |
+
keyType: Key;
|
| 678 |
+
typeName: ZodFirstPartyTypeKind.ZodMap;
|
| 679 |
+
}
|
| 680 |
+
export 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"]>> {
|
| 681 |
+
get keySchema(): Key;
|
| 682 |
+
get valueSchema(): Value;
|
| 683 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 684 |
+
static create: <KeySchema extends ZodTypeAny = ZodTypeAny, ValueSchema extends ZodTypeAny = ZodTypeAny>(keyType: KeySchema, valueType: ValueSchema, params?: RawCreateParams) => ZodMap<KeySchema, ValueSchema>;
|
| 685 |
+
}
|
| 686 |
+
export interface ZodSetDef<Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 687 |
+
valueType: Value;
|
| 688 |
+
typeName: ZodFirstPartyTypeKind.ZodSet;
|
| 689 |
+
minSize: {
|
| 690 |
+
value: number;
|
| 691 |
+
message?: string | undefined;
|
| 692 |
+
} | null;
|
| 693 |
+
maxSize: {
|
| 694 |
+
value: number;
|
| 695 |
+
message?: string | undefined;
|
| 696 |
+
} | null;
|
| 697 |
+
}
|
| 698 |
+
export declare class ZodSet<Value extends ZodTypeAny = ZodTypeAny> extends ZodType<Set<Value["_output"]>, ZodSetDef<Value>, Set<Value["_input"]>> {
|
| 699 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 700 |
+
min(minSize: number, message?: errorUtil.ErrMessage): this;
|
| 701 |
+
max(maxSize: number, message?: errorUtil.ErrMessage): this;
|
| 702 |
+
size(size: number, message?: errorUtil.ErrMessage): this;
|
| 703 |
+
nonempty(message?: errorUtil.ErrMessage): ZodSet<Value>;
|
| 704 |
+
static create: <ValueSchema extends ZodTypeAny = ZodTypeAny>(valueType: ValueSchema, params?: RawCreateParams) => ZodSet<ValueSchema>;
|
| 705 |
+
}
|
| 706 |
+
export interface ZodFunctionDef<Args extends ZodTuple<any, any> = ZodTuple<any, any>, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 707 |
+
args: Args;
|
| 708 |
+
returns: Returns;
|
| 709 |
+
typeName: ZodFirstPartyTypeKind.ZodFunction;
|
| 710 |
+
}
|
| 711 |
+
export type OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_input"] extends Array<any> ? (...args: Args["_input"]) => Returns["_output"] : never;
|
| 712 |
+
export type InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_output"] extends Array<any> ? (...args: Args["_output"]) => Returns["_input"] : never;
|
| 713 |
+
export declare class ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> extends ZodType<OuterTypeOfFunction<Args, Returns>, ZodFunctionDef<Args, Returns>, InnerTypeOfFunction<Args, Returns>> {
|
| 714 |
+
_parse(input: ParseInput): ParseReturnType<any>;
|
| 715 |
+
parameters(): Args;
|
| 716 |
+
returnType(): Returns;
|
| 717 |
+
args<Items extends Parameters<(typeof ZodTuple)["create"]>[0]>(...items: Items): ZodFunction<ZodTuple<Items, ZodUnknown>, Returns>;
|
| 718 |
+
returns<NewReturnType extends ZodType<any, any, any>>(returnType: NewReturnType): ZodFunction<Args, NewReturnType>;
|
| 719 |
+
implement<F extends InnerTypeOfFunction<Args, Returns>>(func: F): ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
| 720 |
+
strictImplement(func: InnerTypeOfFunction<Args, Returns>): InnerTypeOfFunction<Args, Returns>;
|
| 721 |
+
validate: <F extends InnerTypeOfFunction<Args, Returns>>(func: F) => ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
| 722 |
+
static create(): ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>;
|
| 723 |
+
static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>>(args: T): ZodFunction<T, ZodUnknown>;
|
| 724 |
+
static create<T extends AnyZodTuple, U extends ZodTypeAny>(args: T, returns: U): ZodFunction<T, U>;
|
| 725 |
+
static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>, U extends ZodTypeAny = ZodUnknown>(args: T, returns: U, params?: RawCreateParams): ZodFunction<T, U>;
|
| 726 |
+
}
|
| 727 |
+
export interface ZodLazyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 728 |
+
getter: () => T;
|
| 729 |
+
typeName: ZodFirstPartyTypeKind.ZodLazy;
|
| 730 |
+
}
|
| 731 |
+
export declare class ZodLazy<T extends ZodTypeAny> extends ZodType<output<T>, ZodLazyDef<T>, input<T>> {
|
| 732 |
+
get schema(): T;
|
| 733 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 734 |
+
static create: <Inner extends ZodTypeAny>(getter: () => Inner, params?: RawCreateParams) => ZodLazy<Inner>;
|
| 735 |
+
}
|
| 736 |
+
export interface ZodLiteralDef<T = any> extends ZodTypeDef {
|
| 737 |
+
value: T;
|
| 738 |
+
typeName: ZodFirstPartyTypeKind.ZodLiteral;
|
| 739 |
+
}
|
| 740 |
+
export declare class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>, T> {
|
| 741 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 742 |
+
get value(): T;
|
| 743 |
+
static create: <Value extends Primitive>(value: Value, params?: RawCreateParams) => ZodLiteral<Value>;
|
| 744 |
+
}
|
| 745 |
+
export type ArrayKeys = keyof any[];
|
| 746 |
+
export type Indices<T> = Exclude<keyof T, ArrayKeys>;
|
| 747 |
+
export type EnumValues<T extends string = string> = readonly [T, ...T[]];
|
| 748 |
+
export type Values<T extends EnumValues> = {
|
| 749 |
+
[k in T[number]]: k;
|
| 750 |
+
};
|
| 751 |
+
export interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
|
| 752 |
+
values: T;
|
| 753 |
+
typeName: ZodFirstPartyTypeKind.ZodEnum;
|
| 754 |
+
}
|
| 755 |
+
export type Writeable<T> = {
|
| 756 |
+
-readonly [P in keyof T]: T[P];
|
| 757 |
+
};
|
| 758 |
+
export type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
|
| 759 |
+
export type typecast<A, T> = A extends T ? A : never;
|
| 760 |
+
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
|
| 761 |
+
declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
|
| 762 |
+
export declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>, T[number]> {
|
| 763 |
+
_cache: Set<T[number]> | undefined;
|
| 764 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 765 |
+
get options(): T;
|
| 766 |
+
get enum(): Values<T>;
|
| 767 |
+
get Values(): Values<T>;
|
| 768 |
+
get Enum(): Values<T>;
|
| 769 |
+
extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract, newDef?: RawCreateParams): ZodEnum<Writeable<ToExtract>>;
|
| 770 |
+
exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude, newDef?: RawCreateParams): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
|
| 771 |
+
static create: typeof createZodEnum;
|
| 772 |
+
}
|
| 773 |
+
export interface ZodNativeEnumDef<T extends EnumLike = EnumLike> extends ZodTypeDef {
|
| 774 |
+
values: T;
|
| 775 |
+
typeName: ZodFirstPartyTypeKind.ZodNativeEnum;
|
| 776 |
+
}
|
| 777 |
+
export type EnumLike = {
|
| 778 |
+
[k: string]: string | number;
|
| 779 |
+
[nu: number]: string;
|
| 780 |
+
};
|
| 781 |
+
export declare class ZodNativeEnum<T extends EnumLike> extends ZodType<T[keyof T], ZodNativeEnumDef<T>, T[keyof T]> {
|
| 782 |
+
_cache: Set<T[keyof T]> | undefined;
|
| 783 |
+
_parse(input: ParseInput): ParseReturnType<T[keyof T]>;
|
| 784 |
+
get enum(): T;
|
| 785 |
+
static create: <Elements extends EnumLike>(values: Elements, params?: RawCreateParams) => ZodNativeEnum<Elements>;
|
| 786 |
+
}
|
| 787 |
+
export interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 788 |
+
type: T;
|
| 789 |
+
typeName: ZodFirstPartyTypeKind.ZodPromise;
|
| 790 |
+
}
|
| 791 |
+
export declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
|
| 792 |
+
unwrap(): T;
|
| 793 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 794 |
+
static create: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
|
| 795 |
+
}
|
| 796 |
+
export type Refinement<T> = (arg: T, ctx: RefinementCtx) => any;
|
| 797 |
+
export type SuperRefinement<T> = (arg: T, ctx: RefinementCtx) => void | Promise<void>;
|
| 798 |
+
export type RefinementEffect<T> = {
|
| 799 |
+
type: "refinement";
|
| 800 |
+
refinement: (arg: T, ctx: RefinementCtx) => any;
|
| 801 |
+
};
|
| 802 |
+
export type TransformEffect<T> = {
|
| 803 |
+
type: "transform";
|
| 804 |
+
transform: (arg: T, ctx: RefinementCtx) => any;
|
| 805 |
+
};
|
| 806 |
+
export type PreprocessEffect<T> = {
|
| 807 |
+
type: "preprocess";
|
| 808 |
+
transform: (arg: T, ctx: RefinementCtx) => any;
|
| 809 |
+
};
|
| 810 |
+
export type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
|
| 811 |
+
export interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 812 |
+
schema: T;
|
| 813 |
+
typeName: ZodFirstPartyTypeKind.ZodEffects;
|
| 814 |
+
effect: Effect<any>;
|
| 815 |
+
}
|
| 816 |
+
export declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
|
| 817 |
+
innerType(): T;
|
| 818 |
+
sourceType(): T;
|
| 819 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 820 |
+
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
| 821 |
+
static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
| 822 |
+
}
|
| 823 |
+
export { ZodEffects as ZodTransformer };
|
| 824 |
+
export interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 825 |
+
innerType: T;
|
| 826 |
+
typeName: ZodFirstPartyTypeKind.ZodOptional;
|
| 827 |
+
}
|
| 828 |
+
export type ZodOptionalType<T extends ZodTypeAny> = ZodOptional<T>;
|
| 829 |
+
export declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
|
| 830 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 831 |
+
unwrap(): T;
|
| 832 |
+
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
|
| 833 |
+
}
|
| 834 |
+
export interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 835 |
+
innerType: T;
|
| 836 |
+
typeName: ZodFirstPartyTypeKind.ZodNullable;
|
| 837 |
+
}
|
| 838 |
+
export type ZodNullableType<T extends ZodTypeAny> = ZodNullable<T>;
|
| 839 |
+
export declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
|
| 840 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 841 |
+
unwrap(): T;
|
| 842 |
+
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
|
| 843 |
+
}
|
| 844 |
+
export interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 845 |
+
innerType: T;
|
| 846 |
+
defaultValue: () => util.noUndefined<T["_input"]>;
|
| 847 |
+
typeName: ZodFirstPartyTypeKind.ZodDefault;
|
| 848 |
+
}
|
| 849 |
+
export declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
|
| 850 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 851 |
+
removeDefault(): T;
|
| 852 |
+
static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
|
| 853 |
+
default: Inner["_input"] | (() => util.noUndefined<Inner["_input"]>);
|
| 854 |
+
}) => ZodDefault<Inner>;
|
| 855 |
+
}
|
| 856 |
+
export interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 857 |
+
innerType: T;
|
| 858 |
+
catchValue: (ctx: {
|
| 859 |
+
error: ZodError;
|
| 860 |
+
input: unknown;
|
| 861 |
+
}) => T["_input"];
|
| 862 |
+
typeName: ZodFirstPartyTypeKind.ZodCatch;
|
| 863 |
+
}
|
| 864 |
+
export declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
|
| 865 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 866 |
+
removeCatch(): T;
|
| 867 |
+
static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
|
| 868 |
+
catch: Inner["_output"] | (() => Inner["_output"]);
|
| 869 |
+
}) => ZodCatch<Inner>;
|
| 870 |
+
}
|
| 871 |
+
export interface ZodNaNDef extends ZodTypeDef {
|
| 872 |
+
typeName: ZodFirstPartyTypeKind.ZodNaN;
|
| 873 |
+
}
|
| 874 |
+
export declare class ZodNaN extends ZodType<number, ZodNaNDef, number> {
|
| 875 |
+
_parse(input: ParseInput): ParseReturnType<any>;
|
| 876 |
+
static create: (params?: RawCreateParams) => ZodNaN;
|
| 877 |
+
}
|
| 878 |
+
export interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
|
| 879 |
+
type: T;
|
| 880 |
+
typeName: ZodFirstPartyTypeKind.ZodBranded;
|
| 881 |
+
}
|
| 882 |
+
export declare const BRAND: unique symbol;
|
| 883 |
+
export type BRAND<T extends string | number | symbol> = {
|
| 884 |
+
[BRAND]: {
|
| 885 |
+
[k in T]: true;
|
| 886 |
+
};
|
| 887 |
+
};
|
| 888 |
+
export declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
|
| 889 |
+
_parse(input: ParseInput): ParseReturnType<any>;
|
| 890 |
+
unwrap(): T;
|
| 891 |
+
}
|
| 892 |
+
export interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
|
| 893 |
+
in: A;
|
| 894 |
+
out: B;
|
| 895 |
+
typeName: ZodFirstPartyTypeKind.ZodPipeline;
|
| 896 |
+
}
|
| 897 |
+
export declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
|
| 898 |
+
_parse(input: ParseInput): ParseReturnType<any>;
|
| 899 |
+
static create<ASchema extends ZodTypeAny, BSchema extends ZodTypeAny>(a: ASchema, b: BSchema): ZodPipeline<ASchema, BSchema>;
|
| 900 |
+
}
|
| 901 |
+
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
| 902 |
+
readonly [Symbol.toStringTag]: string;
|
| 903 |
+
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
| 904 |
+
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>;
|
| 905 |
+
export interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 906 |
+
innerType: T;
|
| 907 |
+
typeName: ZodFirstPartyTypeKind.ZodReadonly;
|
| 908 |
+
}
|
| 909 |
+
export declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, MakeReadonly<T["_input"]>> {
|
| 910 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 911 |
+
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodReadonly<Inner>;
|
| 912 |
+
unwrap(): T;
|
| 913 |
+
}
|
| 914 |
+
type CustomParams = CustomErrorParams & {
|
| 915 |
+
fatal?: boolean;
|
| 916 |
+
};
|
| 917 |
+
export declare function custom<T>(check?: (data: any) => any, _params?: string | CustomParams | ((input: any) => CustomParams),
|
| 918 |
+
/**
|
| 919 |
+
* @deprecated
|
| 920 |
+
*
|
| 921 |
+
* Pass `fatal` into the params object instead:
|
| 922 |
+
*
|
| 923 |
+
* ```ts
|
| 924 |
+
* z.string().custom((val) => val.length > 5, { fatal: false })
|
| 925 |
+
* ```
|
| 926 |
+
*
|
| 927 |
+
*/
|
| 928 |
+
fatal?: boolean): ZodType<T, ZodTypeDef, T>;
|
| 929 |
+
export { ZodType as Schema, ZodType as ZodSchema };
|
| 930 |
+
export declare const late: {
|
| 931 |
+
object: <Shape extends ZodRawShape>(shape: () => Shape, params?: RawCreateParams) => ZodObject<Shape, "strip">;
|
| 932 |
+
};
|
| 933 |
+
export declare enum ZodFirstPartyTypeKind {
|
| 934 |
+
ZodString = "ZodString",
|
| 935 |
+
ZodNumber = "ZodNumber",
|
| 936 |
+
ZodNaN = "ZodNaN",
|
| 937 |
+
ZodBigInt = "ZodBigInt",
|
| 938 |
+
ZodBoolean = "ZodBoolean",
|
| 939 |
+
ZodDate = "ZodDate",
|
| 940 |
+
ZodSymbol = "ZodSymbol",
|
| 941 |
+
ZodUndefined = "ZodUndefined",
|
| 942 |
+
ZodNull = "ZodNull",
|
| 943 |
+
ZodAny = "ZodAny",
|
| 944 |
+
ZodUnknown = "ZodUnknown",
|
| 945 |
+
ZodNever = "ZodNever",
|
| 946 |
+
ZodVoid = "ZodVoid",
|
| 947 |
+
ZodArray = "ZodArray",
|
| 948 |
+
ZodObject = "ZodObject",
|
| 949 |
+
ZodUnion = "ZodUnion",
|
| 950 |
+
ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
|
| 951 |
+
ZodIntersection = "ZodIntersection",
|
| 952 |
+
ZodTuple = "ZodTuple",
|
| 953 |
+
ZodRecord = "ZodRecord",
|
| 954 |
+
ZodMap = "ZodMap",
|
| 955 |
+
ZodSet = "ZodSet",
|
| 956 |
+
ZodFunction = "ZodFunction",
|
| 957 |
+
ZodLazy = "ZodLazy",
|
| 958 |
+
ZodLiteral = "ZodLiteral",
|
| 959 |
+
ZodEnum = "ZodEnum",
|
| 960 |
+
ZodEffects = "ZodEffects",
|
| 961 |
+
ZodNativeEnum = "ZodNativeEnum",
|
| 962 |
+
ZodOptional = "ZodOptional",
|
| 963 |
+
ZodNullable = "ZodNullable",
|
| 964 |
+
ZodDefault = "ZodDefault",
|
| 965 |
+
ZodCatch = "ZodCatch",
|
| 966 |
+
ZodPromise = "ZodPromise",
|
| 967 |
+
ZodBranded = "ZodBranded",
|
| 968 |
+
ZodPipeline = "ZodPipeline",
|
| 969 |
+
ZodReadonly = "ZodReadonly"
|
| 970 |
+
}
|
| 971 |
+
export 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;
|
| 972 |
+
declare abstract class Class {
|
| 973 |
+
constructor(..._: any[]);
|
| 974 |
+
}
|
| 975 |
+
declare const instanceOfType: <T extends typeof Class>(cls: T, params?: CustomParams) => ZodType<InstanceType<T>, ZodTypeDef, InstanceType<T>>;
|
| 976 |
+
declare const stringType: (params?: RawCreateParams & {
|
| 977 |
+
coerce?: true;
|
| 978 |
+
}) => ZodString;
|
| 979 |
+
declare const numberType: (params?: RawCreateParams & {
|
| 980 |
+
coerce?: boolean;
|
| 981 |
+
}) => ZodNumber;
|
| 982 |
+
declare const nanType: (params?: RawCreateParams) => ZodNaN;
|
| 983 |
+
declare const bigIntType: (params?: RawCreateParams & {
|
| 984 |
+
coerce?: boolean;
|
| 985 |
+
}) => ZodBigInt;
|
| 986 |
+
declare const booleanType: (params?: RawCreateParams & {
|
| 987 |
+
coerce?: boolean;
|
| 988 |
+
}) => ZodBoolean;
|
| 989 |
+
declare const dateType: (params?: RawCreateParams & {
|
| 990 |
+
coerce?: boolean;
|
| 991 |
+
}) => ZodDate;
|
| 992 |
+
declare const symbolType: (params?: RawCreateParams) => ZodSymbol;
|
| 993 |
+
declare const undefinedType: (params?: RawCreateParams) => ZodUndefined;
|
| 994 |
+
declare const nullType: (params?: RawCreateParams) => ZodNull;
|
| 995 |
+
declare const anyType: (params?: RawCreateParams) => ZodAny;
|
| 996 |
+
declare const unknownType: (params?: RawCreateParams) => ZodUnknown;
|
| 997 |
+
declare const neverType: (params?: RawCreateParams) => ZodNever;
|
| 998 |
+
declare const voidType: (params?: RawCreateParams) => ZodVoid;
|
| 999 |
+
declare const arrayType: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
|
| 1000 |
+
declare const objectType: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, objectOutputType<Shape, ZodTypeAny, "strip">, objectInputType<Shape, ZodTypeAny, "strip">>;
|
| 1001 |
+
declare const strictObjectType: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strict">;
|
| 1002 |
+
declare const unionType: <Options extends Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
|
| 1003 |
+
declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create;
|
| 1004 |
+
declare const intersectionType: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
|
| 1005 |
+
declare const tupleType: <Items extends [ZodTypeAny, ...ZodTypeAny[]] | []>(schemas: Items, params?: RawCreateParams) => ZodTuple<Items, null>;
|
| 1006 |
+
declare const recordType: typeof ZodRecord.create;
|
| 1007 |
+
declare const mapType: <KeySchema extends ZodTypeAny = ZodTypeAny, ValueSchema extends ZodTypeAny = ZodTypeAny>(keyType: KeySchema, valueType: ValueSchema, params?: RawCreateParams) => ZodMap<KeySchema, ValueSchema>;
|
| 1008 |
+
declare const setType: <ValueSchema extends ZodTypeAny = ZodTypeAny>(valueType: ValueSchema, params?: RawCreateParams) => ZodSet<ValueSchema>;
|
| 1009 |
+
declare const functionType: typeof ZodFunction.create;
|
| 1010 |
+
declare const lazyType: <Inner extends ZodTypeAny>(getter: () => Inner, params?: RawCreateParams) => ZodLazy<Inner>;
|
| 1011 |
+
declare const literalType: <Value extends Primitive>(value: Value, params?: RawCreateParams) => ZodLiteral<Value>;
|
| 1012 |
+
declare const enumType: typeof createZodEnum;
|
| 1013 |
+
declare const nativeEnumType: <Elements extends EnumLike>(values: Elements, params?: RawCreateParams) => ZodNativeEnum<Elements>;
|
| 1014 |
+
declare const promiseType: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
|
| 1015 |
+
declare const effectsType: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
| 1016 |
+
declare const optionalType: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
|
| 1017 |
+
declare const nullableType: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
|
| 1018 |
+
declare const preprocessType: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
| 1019 |
+
declare const pipelineType: typeof ZodPipeline.create;
|
| 1020 |
+
declare const ostring: () => ZodOptional<ZodString>;
|
| 1021 |
+
declare const onumber: () => ZodOptional<ZodNumber>;
|
| 1022 |
+
declare const oboolean: () => ZodOptional<ZodBoolean>;
|
| 1023 |
+
export declare const coerce: {
|
| 1024 |
+
string: (typeof ZodString)["create"];
|
| 1025 |
+
number: (typeof ZodNumber)["create"];
|
| 1026 |
+
boolean: (typeof ZodBoolean)["create"];
|
| 1027 |
+
bigint: (typeof ZodBigInt)["create"];
|
| 1028 |
+
date: (typeof ZodDate)["create"];
|
| 1029 |
+
};
|
| 1030 |
+
export { anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, };
|
| 1031 |
+
export declare const NEVER: never;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/types.d.ts
ADDED
|
@@ -0,0 +1,1031 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type IssueData, type StringValidation, type ZodCustomIssue, ZodError, type ZodErrorMap } from "./ZodError.js";
|
| 2 |
+
import type { enumUtil } from "./helpers/enumUtil.js";
|
| 3 |
+
import { errorUtil } from "./helpers/errorUtil.js";
|
| 4 |
+
import { type AsyncParseReturnType, INVALID, type ParseContext, type ParseInput, type ParseParams, type ParseReturnType, ParseStatus, type SyncParseReturnType } from "./helpers/parseUtil.js";
|
| 5 |
+
import type { partialUtil } from "./helpers/partialUtil.js";
|
| 6 |
+
import type { Primitive } from "./helpers/typeAliases.js";
|
| 7 |
+
import { util, type objectUtil } from "./helpers/util.js";
|
| 8 |
+
import type { StandardSchemaV1 } from "./standard-schema.js";
|
| 9 |
+
export interface RefinementCtx {
|
| 10 |
+
addIssue: (arg: IssueData) => void;
|
| 11 |
+
path: (string | number)[];
|
| 12 |
+
}
|
| 13 |
+
export type ZodRawShape = {
|
| 14 |
+
[k: string]: ZodTypeAny;
|
| 15 |
+
};
|
| 16 |
+
export type ZodTypeAny = ZodType<any, any, any>;
|
| 17 |
+
export type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
|
| 18 |
+
export type input<T extends ZodType<any, any, any>> = T["_input"];
|
| 19 |
+
export type output<T extends ZodType<any, any, any>> = T["_output"];
|
| 20 |
+
export type { TypeOf as infer };
|
| 21 |
+
export type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
|
| 22 |
+
export interface ZodTypeDef {
|
| 23 |
+
errorMap?: ZodErrorMap | undefined;
|
| 24 |
+
description?: string | undefined;
|
| 25 |
+
}
|
| 26 |
+
export type RawCreateParams = {
|
| 27 |
+
errorMap?: ZodErrorMap | undefined;
|
| 28 |
+
invalid_type_error?: string | undefined;
|
| 29 |
+
required_error?: string | undefined;
|
| 30 |
+
message?: string | undefined;
|
| 31 |
+
description?: string | undefined;
|
| 32 |
+
} | undefined;
|
| 33 |
+
export type ProcessedCreateParams = {
|
| 34 |
+
errorMap?: ZodErrorMap | undefined;
|
| 35 |
+
description?: string | undefined;
|
| 36 |
+
};
|
| 37 |
+
export type SafeParseSuccess<Output> = {
|
| 38 |
+
success: true;
|
| 39 |
+
data: Output;
|
| 40 |
+
error?: never;
|
| 41 |
+
};
|
| 42 |
+
export type SafeParseError<Input> = {
|
| 43 |
+
success: false;
|
| 44 |
+
error: ZodError<Input>;
|
| 45 |
+
data?: never;
|
| 46 |
+
};
|
| 47 |
+
export type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
|
| 48 |
+
export declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
|
| 49 |
+
readonly _type: Output;
|
| 50 |
+
readonly _output: Output;
|
| 51 |
+
readonly _input: Input;
|
| 52 |
+
readonly _def: Def;
|
| 53 |
+
get description(): string | undefined;
|
| 54 |
+
"~standard": StandardSchemaV1.Props<Input, Output>;
|
| 55 |
+
abstract _parse(input: ParseInput): ParseReturnType<Output>;
|
| 56 |
+
_getType(input: ParseInput): string;
|
| 57 |
+
_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
|
| 58 |
+
_processInputParams(input: ParseInput): {
|
| 59 |
+
status: ParseStatus;
|
| 60 |
+
ctx: ParseContext;
|
| 61 |
+
};
|
| 62 |
+
_parseSync(input: ParseInput): SyncParseReturnType<Output>;
|
| 63 |
+
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
|
| 64 |
+
parse(data: unknown, params?: util.InexactPartial<ParseParams>): Output;
|
| 65 |
+
safeParse(data: unknown, params?: util.InexactPartial<ParseParams>): SafeParseReturnType<Input, Output>;
|
| 66 |
+
"~validate"(data: unknown): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>>;
|
| 67 |
+
parseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<Output>;
|
| 68 |
+
safeParseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
|
| 69 |
+
/** Alias of safeParseAsync */
|
| 70 |
+
spa: (data: unknown, params?: util.InexactPartial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
|
| 71 |
+
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
|
| 72 |
+
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
|
| 73 |
+
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
|
| 74 |
+
refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
|
| 75 |
+
_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
|
| 76 |
+
superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
|
| 77 |
+
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
|
| 78 |
+
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
|
| 79 |
+
constructor(def: Def);
|
| 80 |
+
optional(): ZodOptional<this>;
|
| 81 |
+
nullable(): ZodNullable<this>;
|
| 82 |
+
nullish(): ZodOptional<ZodNullable<this>>;
|
| 83 |
+
array(): ZodArray<this>;
|
| 84 |
+
promise(): ZodPromise<this>;
|
| 85 |
+
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
|
| 86 |
+
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
|
| 87 |
+
transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
|
| 88 |
+
default(def: util.noUndefined<Input>): ZodDefault<this>;
|
| 89 |
+
default(def: () => util.noUndefined<Input>): ZodDefault<this>;
|
| 90 |
+
brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
|
| 91 |
+
catch(def: Output): ZodCatch<this>;
|
| 92 |
+
catch(def: (ctx: {
|
| 93 |
+
error: ZodError;
|
| 94 |
+
input: Input;
|
| 95 |
+
}) => Output): ZodCatch<this>;
|
| 96 |
+
describe(description: string): this;
|
| 97 |
+
pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
|
| 98 |
+
readonly(): ZodReadonly<this>;
|
| 99 |
+
isOptional(): boolean;
|
| 100 |
+
isNullable(): boolean;
|
| 101 |
+
}
|
| 102 |
+
export type IpVersion = "v4" | "v6";
|
| 103 |
+
export type ZodStringCheck = {
|
| 104 |
+
kind: "min";
|
| 105 |
+
value: number;
|
| 106 |
+
message?: string | undefined;
|
| 107 |
+
} | {
|
| 108 |
+
kind: "max";
|
| 109 |
+
value: number;
|
| 110 |
+
message?: string | undefined;
|
| 111 |
+
} | {
|
| 112 |
+
kind: "length";
|
| 113 |
+
value: number;
|
| 114 |
+
message?: string | undefined;
|
| 115 |
+
} | {
|
| 116 |
+
kind: "email";
|
| 117 |
+
message?: string | undefined;
|
| 118 |
+
} | {
|
| 119 |
+
kind: "url";
|
| 120 |
+
message?: string | undefined;
|
| 121 |
+
} | {
|
| 122 |
+
kind: "emoji";
|
| 123 |
+
message?: string | undefined;
|
| 124 |
+
} | {
|
| 125 |
+
kind: "uuid";
|
| 126 |
+
message?: string | undefined;
|
| 127 |
+
} | {
|
| 128 |
+
kind: "nanoid";
|
| 129 |
+
message?: string | undefined;
|
| 130 |
+
} | {
|
| 131 |
+
kind: "cuid";
|
| 132 |
+
message?: string | undefined;
|
| 133 |
+
} | {
|
| 134 |
+
kind: "includes";
|
| 135 |
+
value: string;
|
| 136 |
+
position?: number | undefined;
|
| 137 |
+
message?: string | undefined;
|
| 138 |
+
} | {
|
| 139 |
+
kind: "cuid2";
|
| 140 |
+
message?: string | undefined;
|
| 141 |
+
} | {
|
| 142 |
+
kind: "ulid";
|
| 143 |
+
message?: string | undefined;
|
| 144 |
+
} | {
|
| 145 |
+
kind: "startsWith";
|
| 146 |
+
value: string;
|
| 147 |
+
message?: string | undefined;
|
| 148 |
+
} | {
|
| 149 |
+
kind: "endsWith";
|
| 150 |
+
value: string;
|
| 151 |
+
message?: string | undefined;
|
| 152 |
+
} | {
|
| 153 |
+
kind: "regex";
|
| 154 |
+
regex: RegExp;
|
| 155 |
+
message?: string | undefined;
|
| 156 |
+
} | {
|
| 157 |
+
kind: "trim";
|
| 158 |
+
message?: string | undefined;
|
| 159 |
+
} | {
|
| 160 |
+
kind: "toLowerCase";
|
| 161 |
+
message?: string | undefined;
|
| 162 |
+
} | {
|
| 163 |
+
kind: "toUpperCase";
|
| 164 |
+
message?: string | undefined;
|
| 165 |
+
} | {
|
| 166 |
+
kind: "jwt";
|
| 167 |
+
alg?: string;
|
| 168 |
+
message?: string | undefined;
|
| 169 |
+
} | {
|
| 170 |
+
kind: "datetime";
|
| 171 |
+
offset: boolean;
|
| 172 |
+
local: boolean;
|
| 173 |
+
precision: number | null;
|
| 174 |
+
message?: string | undefined;
|
| 175 |
+
} | {
|
| 176 |
+
kind: "date";
|
| 177 |
+
message?: string | undefined;
|
| 178 |
+
} | {
|
| 179 |
+
kind: "time";
|
| 180 |
+
precision: number | null;
|
| 181 |
+
message?: string | undefined;
|
| 182 |
+
} | {
|
| 183 |
+
kind: "duration";
|
| 184 |
+
message?: string | undefined;
|
| 185 |
+
} | {
|
| 186 |
+
kind: "ip";
|
| 187 |
+
version?: IpVersion | undefined;
|
| 188 |
+
message?: string | undefined;
|
| 189 |
+
} | {
|
| 190 |
+
kind: "cidr";
|
| 191 |
+
version?: IpVersion | undefined;
|
| 192 |
+
message?: string | undefined;
|
| 193 |
+
} | {
|
| 194 |
+
kind: "base64";
|
| 195 |
+
message?: string | undefined;
|
| 196 |
+
} | {
|
| 197 |
+
kind: "base64url";
|
| 198 |
+
message?: string | undefined;
|
| 199 |
+
};
|
| 200 |
+
export interface ZodStringDef extends ZodTypeDef {
|
| 201 |
+
checks: ZodStringCheck[];
|
| 202 |
+
typeName: ZodFirstPartyTypeKind.ZodString;
|
| 203 |
+
coerce: boolean;
|
| 204 |
+
}
|
| 205 |
+
export declare function datetimeRegex(args: {
|
| 206 |
+
precision?: number | null;
|
| 207 |
+
offset?: boolean;
|
| 208 |
+
local?: boolean;
|
| 209 |
+
}): RegExp;
|
| 210 |
+
export declare class ZodString extends ZodType<string, ZodStringDef, string> {
|
| 211 |
+
_parse(input: ParseInput): ParseReturnType<string>;
|
| 212 |
+
protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage): ZodEffects<this, string, string>;
|
| 213 |
+
_addCheck(check: ZodStringCheck): ZodString;
|
| 214 |
+
email(message?: errorUtil.ErrMessage): ZodString;
|
| 215 |
+
url(message?: errorUtil.ErrMessage): ZodString;
|
| 216 |
+
emoji(message?: errorUtil.ErrMessage): ZodString;
|
| 217 |
+
uuid(message?: errorUtil.ErrMessage): ZodString;
|
| 218 |
+
nanoid(message?: errorUtil.ErrMessage): ZodString;
|
| 219 |
+
cuid(message?: errorUtil.ErrMessage): ZodString;
|
| 220 |
+
cuid2(message?: errorUtil.ErrMessage): ZodString;
|
| 221 |
+
ulid(message?: errorUtil.ErrMessage): ZodString;
|
| 222 |
+
base64(message?: errorUtil.ErrMessage): ZodString;
|
| 223 |
+
base64url(message?: errorUtil.ErrMessage): ZodString;
|
| 224 |
+
jwt(options?: {
|
| 225 |
+
alg?: string;
|
| 226 |
+
message?: string | undefined;
|
| 227 |
+
}): ZodString;
|
| 228 |
+
ip(options?: string | {
|
| 229 |
+
version?: IpVersion;
|
| 230 |
+
message?: string | undefined;
|
| 231 |
+
}): ZodString;
|
| 232 |
+
cidr(options?: string | {
|
| 233 |
+
version?: IpVersion;
|
| 234 |
+
message?: string | undefined;
|
| 235 |
+
}): ZodString;
|
| 236 |
+
datetime(options?: string | {
|
| 237 |
+
message?: string | undefined;
|
| 238 |
+
precision?: number | null;
|
| 239 |
+
offset?: boolean;
|
| 240 |
+
local?: boolean;
|
| 241 |
+
}): ZodString;
|
| 242 |
+
date(message?: string): ZodString;
|
| 243 |
+
time(options?: string | {
|
| 244 |
+
message?: string | undefined;
|
| 245 |
+
precision?: number | null;
|
| 246 |
+
}): ZodString;
|
| 247 |
+
duration(message?: errorUtil.ErrMessage): ZodString;
|
| 248 |
+
regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
|
| 249 |
+
includes(value: string, options?: {
|
| 250 |
+
message?: string;
|
| 251 |
+
position?: number;
|
| 252 |
+
}): ZodString;
|
| 253 |
+
startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
| 254 |
+
endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
| 255 |
+
min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
|
| 256 |
+
max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
|
| 257 |
+
length(len: number, message?: errorUtil.ErrMessage): ZodString;
|
| 258 |
+
/**
|
| 259 |
+
* Equivalent to `.min(1)`
|
| 260 |
+
*/
|
| 261 |
+
nonempty(message?: errorUtil.ErrMessage): ZodString;
|
| 262 |
+
trim(): ZodString;
|
| 263 |
+
toLowerCase(): ZodString;
|
| 264 |
+
toUpperCase(): ZodString;
|
| 265 |
+
get isDatetime(): boolean;
|
| 266 |
+
get isDate(): boolean;
|
| 267 |
+
get isTime(): boolean;
|
| 268 |
+
get isDuration(): boolean;
|
| 269 |
+
get isEmail(): boolean;
|
| 270 |
+
get isURL(): boolean;
|
| 271 |
+
get isEmoji(): boolean;
|
| 272 |
+
get isUUID(): boolean;
|
| 273 |
+
get isNANOID(): boolean;
|
| 274 |
+
get isCUID(): boolean;
|
| 275 |
+
get isCUID2(): boolean;
|
| 276 |
+
get isULID(): boolean;
|
| 277 |
+
get isIP(): boolean;
|
| 278 |
+
get isCIDR(): boolean;
|
| 279 |
+
get isBase64(): boolean;
|
| 280 |
+
get isBase64url(): boolean;
|
| 281 |
+
get minLength(): number | null;
|
| 282 |
+
get maxLength(): number | null;
|
| 283 |
+
static create: (params?: RawCreateParams & {
|
| 284 |
+
coerce?: true;
|
| 285 |
+
}) => ZodString;
|
| 286 |
+
}
|
| 287 |
+
export type ZodNumberCheck = {
|
| 288 |
+
kind: "min";
|
| 289 |
+
value: number;
|
| 290 |
+
inclusive: boolean;
|
| 291 |
+
message?: string | undefined;
|
| 292 |
+
} | {
|
| 293 |
+
kind: "max";
|
| 294 |
+
value: number;
|
| 295 |
+
inclusive: boolean;
|
| 296 |
+
message?: string | undefined;
|
| 297 |
+
} | {
|
| 298 |
+
kind: "int";
|
| 299 |
+
message?: string | undefined;
|
| 300 |
+
} | {
|
| 301 |
+
kind: "multipleOf";
|
| 302 |
+
value: number;
|
| 303 |
+
message?: string | undefined;
|
| 304 |
+
} | {
|
| 305 |
+
kind: "finite";
|
| 306 |
+
message?: string | undefined;
|
| 307 |
+
};
|
| 308 |
+
export interface ZodNumberDef extends ZodTypeDef {
|
| 309 |
+
checks: ZodNumberCheck[];
|
| 310 |
+
typeName: ZodFirstPartyTypeKind.ZodNumber;
|
| 311 |
+
coerce: boolean;
|
| 312 |
+
}
|
| 313 |
+
export declare class ZodNumber extends ZodType<number, ZodNumberDef, number> {
|
| 314 |
+
_parse(input: ParseInput): ParseReturnType<number>;
|
| 315 |
+
static create: (params?: RawCreateParams & {
|
| 316 |
+
coerce?: boolean;
|
| 317 |
+
}) => ZodNumber;
|
| 318 |
+
gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
| 319 |
+
min: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
| 320 |
+
gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
| 321 |
+
lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
| 322 |
+
max: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
| 323 |
+
lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
| 324 |
+
protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
|
| 325 |
+
_addCheck(check: ZodNumberCheck): ZodNumber;
|
| 326 |
+
int(message?: errorUtil.ErrMessage): ZodNumber;
|
| 327 |
+
positive(message?: errorUtil.ErrMessage): ZodNumber;
|
| 328 |
+
negative(message?: errorUtil.ErrMessage): ZodNumber;
|
| 329 |
+
nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
|
| 330 |
+
nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
|
| 331 |
+
multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
| 332 |
+
step: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
| 333 |
+
finite(message?: errorUtil.ErrMessage): ZodNumber;
|
| 334 |
+
safe(message?: errorUtil.ErrMessage): ZodNumber;
|
| 335 |
+
get minValue(): number | null;
|
| 336 |
+
get maxValue(): number | null;
|
| 337 |
+
get isInt(): boolean;
|
| 338 |
+
get isFinite(): boolean;
|
| 339 |
+
}
|
| 340 |
+
export type ZodBigIntCheck = {
|
| 341 |
+
kind: "min";
|
| 342 |
+
value: bigint;
|
| 343 |
+
inclusive: boolean;
|
| 344 |
+
message?: string | undefined;
|
| 345 |
+
} | {
|
| 346 |
+
kind: "max";
|
| 347 |
+
value: bigint;
|
| 348 |
+
inclusive: boolean;
|
| 349 |
+
message?: string | undefined;
|
| 350 |
+
} | {
|
| 351 |
+
kind: "multipleOf";
|
| 352 |
+
value: bigint;
|
| 353 |
+
message?: string | undefined;
|
| 354 |
+
};
|
| 355 |
+
export interface ZodBigIntDef extends ZodTypeDef {
|
| 356 |
+
checks: ZodBigIntCheck[];
|
| 357 |
+
typeName: ZodFirstPartyTypeKind.ZodBigInt;
|
| 358 |
+
coerce: boolean;
|
| 359 |
+
}
|
| 360 |
+
export declare class ZodBigInt extends ZodType<bigint, ZodBigIntDef, bigint> {
|
| 361 |
+
_parse(input: ParseInput): ParseReturnType<bigint>;
|
| 362 |
+
_getInvalidInput(input: ParseInput): INVALID;
|
| 363 |
+
static create: (params?: RawCreateParams & {
|
| 364 |
+
coerce?: boolean;
|
| 365 |
+
}) => ZodBigInt;
|
| 366 |
+
gte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
| 367 |
+
min: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
|
| 368 |
+
gt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
| 369 |
+
lte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
| 370 |
+
max: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
|
| 371 |
+
lt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
| 372 |
+
protected setLimit(kind: "min" | "max", value: bigint, inclusive: boolean, message?: string): ZodBigInt;
|
| 373 |
+
_addCheck(check: ZodBigIntCheck): ZodBigInt;
|
| 374 |
+
positive(message?: errorUtil.ErrMessage): ZodBigInt;
|
| 375 |
+
negative(message?: errorUtil.ErrMessage): ZodBigInt;
|
| 376 |
+
nonpositive(message?: errorUtil.ErrMessage): ZodBigInt;
|
| 377 |
+
nonnegative(message?: errorUtil.ErrMessage): ZodBigInt;
|
| 378 |
+
multipleOf(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
| 379 |
+
get minValue(): bigint | null;
|
| 380 |
+
get maxValue(): bigint | null;
|
| 381 |
+
}
|
| 382 |
+
export interface ZodBooleanDef extends ZodTypeDef {
|
| 383 |
+
typeName: ZodFirstPartyTypeKind.ZodBoolean;
|
| 384 |
+
coerce: boolean;
|
| 385 |
+
}
|
| 386 |
+
export declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef, boolean> {
|
| 387 |
+
_parse(input: ParseInput): ParseReturnType<boolean>;
|
| 388 |
+
static create: (params?: RawCreateParams & {
|
| 389 |
+
coerce?: boolean;
|
| 390 |
+
}) => ZodBoolean;
|
| 391 |
+
}
|
| 392 |
+
export type ZodDateCheck = {
|
| 393 |
+
kind: "min";
|
| 394 |
+
value: number;
|
| 395 |
+
message?: string | undefined;
|
| 396 |
+
} | {
|
| 397 |
+
kind: "max";
|
| 398 |
+
value: number;
|
| 399 |
+
message?: string | undefined;
|
| 400 |
+
};
|
| 401 |
+
export interface ZodDateDef extends ZodTypeDef {
|
| 402 |
+
checks: ZodDateCheck[];
|
| 403 |
+
coerce: boolean;
|
| 404 |
+
typeName: ZodFirstPartyTypeKind.ZodDate;
|
| 405 |
+
}
|
| 406 |
+
export declare class ZodDate extends ZodType<Date, ZodDateDef, Date> {
|
| 407 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 408 |
+
_addCheck(check: ZodDateCheck): ZodDate;
|
| 409 |
+
min(minDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
| 410 |
+
max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
| 411 |
+
get minDate(): Date | null;
|
| 412 |
+
get maxDate(): Date | null;
|
| 413 |
+
static create: (params?: RawCreateParams & {
|
| 414 |
+
coerce?: boolean;
|
| 415 |
+
}) => ZodDate;
|
| 416 |
+
}
|
| 417 |
+
export interface ZodSymbolDef extends ZodTypeDef {
|
| 418 |
+
typeName: ZodFirstPartyTypeKind.ZodSymbol;
|
| 419 |
+
}
|
| 420 |
+
export declare class ZodSymbol extends ZodType<symbol, ZodSymbolDef, symbol> {
|
| 421 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 422 |
+
static create: (params?: RawCreateParams) => ZodSymbol;
|
| 423 |
+
}
|
| 424 |
+
export interface ZodUndefinedDef extends ZodTypeDef {
|
| 425 |
+
typeName: ZodFirstPartyTypeKind.ZodUndefined;
|
| 426 |
+
}
|
| 427 |
+
export declare class ZodUndefined extends ZodType<undefined, ZodUndefinedDef, undefined> {
|
| 428 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 429 |
+
params?: RawCreateParams;
|
| 430 |
+
static create: (params?: RawCreateParams) => ZodUndefined;
|
| 431 |
+
}
|
| 432 |
+
export interface ZodNullDef extends ZodTypeDef {
|
| 433 |
+
typeName: ZodFirstPartyTypeKind.ZodNull;
|
| 434 |
+
}
|
| 435 |
+
export declare class ZodNull extends ZodType<null, ZodNullDef, null> {
|
| 436 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 437 |
+
static create: (params?: RawCreateParams) => ZodNull;
|
| 438 |
+
}
|
| 439 |
+
export interface ZodAnyDef extends ZodTypeDef {
|
| 440 |
+
typeName: ZodFirstPartyTypeKind.ZodAny;
|
| 441 |
+
}
|
| 442 |
+
export declare class ZodAny extends ZodType<any, ZodAnyDef, any> {
|
| 443 |
+
_any: true;
|
| 444 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 445 |
+
static create: (params?: RawCreateParams) => ZodAny;
|
| 446 |
+
}
|
| 447 |
+
export interface ZodUnknownDef extends ZodTypeDef {
|
| 448 |
+
typeName: ZodFirstPartyTypeKind.ZodUnknown;
|
| 449 |
+
}
|
| 450 |
+
export declare class ZodUnknown extends ZodType<unknown, ZodUnknownDef, unknown> {
|
| 451 |
+
_unknown: true;
|
| 452 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 453 |
+
static create: (params?: RawCreateParams) => ZodUnknown;
|
| 454 |
+
}
|
| 455 |
+
export interface ZodNeverDef extends ZodTypeDef {
|
| 456 |
+
typeName: ZodFirstPartyTypeKind.ZodNever;
|
| 457 |
+
}
|
| 458 |
+
export declare class ZodNever extends ZodType<never, ZodNeverDef, never> {
|
| 459 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 460 |
+
static create: (params?: RawCreateParams) => ZodNever;
|
| 461 |
+
}
|
| 462 |
+
export interface ZodVoidDef extends ZodTypeDef {
|
| 463 |
+
typeName: ZodFirstPartyTypeKind.ZodVoid;
|
| 464 |
+
}
|
| 465 |
+
export declare class ZodVoid extends ZodType<void, ZodVoidDef, void> {
|
| 466 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 467 |
+
static create: (params?: RawCreateParams) => ZodVoid;
|
| 468 |
+
}
|
| 469 |
+
export interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 470 |
+
type: T;
|
| 471 |
+
typeName: ZodFirstPartyTypeKind.ZodArray;
|
| 472 |
+
exactLength: {
|
| 473 |
+
value: number;
|
| 474 |
+
message?: string | undefined;
|
| 475 |
+
} | null;
|
| 476 |
+
minLength: {
|
| 477 |
+
value: number;
|
| 478 |
+
message?: string | undefined;
|
| 479 |
+
} | null;
|
| 480 |
+
maxLength: {
|
| 481 |
+
value: number;
|
| 482 |
+
message?: string | undefined;
|
| 483 |
+
} | null;
|
| 484 |
+
}
|
| 485 |
+
export type ArrayCardinality = "many" | "atleastone";
|
| 486 |
+
export type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
|
| 487 |
+
export 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"][]> {
|
| 488 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 489 |
+
get element(): T;
|
| 490 |
+
min(minLength: number, message?: errorUtil.ErrMessage): this;
|
| 491 |
+
max(maxLength: number, message?: errorUtil.ErrMessage): this;
|
| 492 |
+
length(len: number, message?: errorUtil.ErrMessage): this;
|
| 493 |
+
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
|
| 494 |
+
static create: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
|
| 495 |
+
}
|
| 496 |
+
export type ZodNonEmptyArray<T extends ZodTypeAny> = ZodArray<T, "atleastone">;
|
| 497 |
+
export type UnknownKeysParam = "passthrough" | "strict" | "strip";
|
| 498 |
+
export interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 499 |
+
typeName: ZodFirstPartyTypeKind.ZodObject;
|
| 500 |
+
shape: () => T;
|
| 501 |
+
catchall: Catchall;
|
| 502 |
+
unknownKeys: UnknownKeys;
|
| 503 |
+
}
|
| 504 |
+
export type mergeTypes<A, B> = {
|
| 505 |
+
[k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never;
|
| 506 |
+
};
|
| 507 |
+
export type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
|
| 508 |
+
export type baseObjectOutputType<Shape extends ZodRawShape> = {
|
| 509 |
+
[k in keyof Shape]: Shape[k]["_output"];
|
| 510 |
+
};
|
| 511 |
+
export type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
|
| 512 |
+
export type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
|
| 513 |
+
[k in keyof Shape]: Shape[k]["_input"];
|
| 514 |
+
}>;
|
| 515 |
+
export type CatchallOutput<T extends ZodType> = ZodType extends T ? unknown : {
|
| 516 |
+
[k: string]: T["_output"];
|
| 517 |
+
};
|
| 518 |
+
export type CatchallInput<T extends ZodType> = ZodType extends T ? unknown : {
|
| 519 |
+
[k: string]: T["_input"];
|
| 520 |
+
};
|
| 521 |
+
export type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
|
| 522 |
+
[k: string]: unknown;
|
| 523 |
+
} : unknown;
|
| 524 |
+
export type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
|
| 525 |
+
export type SomeZodObject = ZodObject<ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
| 526 |
+
export type noUnrecognized<Obj extends object, Shape extends object> = {
|
| 527 |
+
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;
|
| 528 |
+
};
|
| 529 |
+
export 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> {
|
| 530 |
+
private _cached;
|
| 531 |
+
_getCached(): {
|
| 532 |
+
shape: T;
|
| 533 |
+
keys: string[];
|
| 534 |
+
};
|
| 535 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 536 |
+
get shape(): T;
|
| 537 |
+
strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
|
| 538 |
+
strip(): ZodObject<T, "strip", Catchall>;
|
| 539 |
+
passthrough(): ZodObject<T, "passthrough", Catchall>;
|
| 540 |
+
/**
|
| 541 |
+
* @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
|
| 542 |
+
* If you want to pass through unknown properties, use `.passthrough()` instead.
|
| 543 |
+
*/
|
| 544 |
+
nonstrict: () => ZodObject<T, "passthrough", Catchall>;
|
| 545 |
+
extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
| 546 |
+
/**
|
| 547 |
+
* @deprecated Use `.extend` instead
|
| 548 |
+
* */
|
| 549 |
+
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
| 550 |
+
/**
|
| 551 |
+
* Prior to zod@1.0.12 there was a bug in the
|
| 552 |
+
* inferred type of merged objects. Please
|
| 553 |
+
* upgrade if you are experiencing issues.
|
| 554 |
+
*/
|
| 555 |
+
merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<objectUtil.extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
|
| 556 |
+
setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
|
| 557 |
+
[k in Key]: Schema;
|
| 558 |
+
}, UnknownKeys, Catchall>;
|
| 559 |
+
catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
|
| 560 |
+
pick<Mask extends util.Exactly<{
|
| 561 |
+
[k in keyof T]?: true;
|
| 562 |
+
}, Mask>>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
|
| 563 |
+
omit<Mask extends util.Exactly<{
|
| 564 |
+
[k in keyof T]?: true;
|
| 565 |
+
}, Mask>>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
|
| 566 |
+
/**
|
| 567 |
+
* @deprecated
|
| 568 |
+
*/
|
| 569 |
+
deepPartial(): partialUtil.DeepPartial<this>;
|
| 570 |
+
partial(): ZodObject<{
|
| 571 |
+
[k in keyof T]: ZodOptional<T[k]>;
|
| 572 |
+
}, UnknownKeys, Catchall>;
|
| 573 |
+
partial<Mask extends util.Exactly<{
|
| 574 |
+
[k in keyof T]?: true;
|
| 575 |
+
}, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{
|
| 576 |
+
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
|
| 577 |
+
}>, UnknownKeys, Catchall>;
|
| 578 |
+
required(): ZodObject<{
|
| 579 |
+
[k in keyof T]: deoptional<T[k]>;
|
| 580 |
+
}, UnknownKeys, Catchall>;
|
| 581 |
+
required<Mask extends util.Exactly<{
|
| 582 |
+
[k in keyof T]?: true;
|
| 583 |
+
}, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{
|
| 584 |
+
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
| 585 |
+
}>, UnknownKeys, Catchall>;
|
| 586 |
+
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
| 587 |
+
static create: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, objectOutputType<Shape, ZodTypeAny, "strip">, objectInputType<Shape, ZodTypeAny, "strip">>;
|
| 588 |
+
static strictCreate: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strict">;
|
| 589 |
+
static lazycreate: <Shape extends ZodRawShape>(shape: () => Shape, params?: RawCreateParams) => ZodObject<Shape, "strip">;
|
| 590 |
+
}
|
| 591 |
+
export type AnyZodObject = ZodObject<any, any, any>;
|
| 592 |
+
export type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
|
| 593 |
+
export interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>> extends ZodTypeDef {
|
| 594 |
+
options: T;
|
| 595 |
+
typeName: ZodFirstPartyTypeKind.ZodUnion;
|
| 596 |
+
}
|
| 597 |
+
export declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
|
| 598 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 599 |
+
get options(): T;
|
| 600 |
+
static create: <Options extends Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
|
| 601 |
+
}
|
| 602 |
+
export type ZodDiscriminatedUnionOption<Discriminator extends string> = ZodObject<{
|
| 603 |
+
[key in Discriminator]: ZodTypeAny;
|
| 604 |
+
} & ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
| 605 |
+
export interface ZodDiscriminatedUnionDef<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> extends ZodTypeDef {
|
| 606 |
+
discriminator: Discriminator;
|
| 607 |
+
options: Options;
|
| 608 |
+
optionsMap: Map<Primitive, ZodDiscriminatedUnionOption<any>>;
|
| 609 |
+
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion;
|
| 610 |
+
}
|
| 611 |
+
export declare class ZodDiscriminatedUnion<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<Discriminator>[]> extends ZodType<output<Options[number]>, ZodDiscriminatedUnionDef<Discriminator, Options>, input<Options[number]>> {
|
| 612 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 613 |
+
get discriminator(): Discriminator;
|
| 614 |
+
get options(): Options;
|
| 615 |
+
get optionsMap(): Map<Primitive, ZodDiscriminatedUnionOption<any>>;
|
| 616 |
+
/**
|
| 617 |
+
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
| 618 |
+
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
| 619 |
+
* have a different value for each object in the union.
|
| 620 |
+
* @param discriminator the name of the discriminator property
|
| 621 |
+
* @param types an array of object schemas
|
| 622 |
+
* @param params
|
| 623 |
+
*/
|
| 624 |
+
static create<Discriminator extends string, Types extends readonly [
|
| 625 |
+
ZodDiscriminatedUnionOption<Discriminator>,
|
| 626 |
+
...ZodDiscriminatedUnionOption<Discriminator>[]
|
| 627 |
+
]>(discriminator: Discriminator, options: Types, params?: RawCreateParams): ZodDiscriminatedUnion<Discriminator, Types>;
|
| 628 |
+
}
|
| 629 |
+
export interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 630 |
+
left: T;
|
| 631 |
+
right: U;
|
| 632 |
+
typeName: ZodFirstPartyTypeKind.ZodIntersection;
|
| 633 |
+
}
|
| 634 |
+
export declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
|
| 635 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 636 |
+
static create: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
|
| 637 |
+
}
|
| 638 |
+
export type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
|
| 639 |
+
export type AssertArray<T> = T extends any[] ? T : never;
|
| 640 |
+
export type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
| 641 |
+
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_output"] : never;
|
| 642 |
+
}>;
|
| 643 |
+
export type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
|
| 644 |
+
export type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
| 645 |
+
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_input"] : never;
|
| 646 |
+
}>;
|
| 647 |
+
export type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
|
| 648 |
+
export interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
|
| 649 |
+
items: T;
|
| 650 |
+
rest: Rest;
|
| 651 |
+
typeName: ZodFirstPartyTypeKind.ZodTuple;
|
| 652 |
+
}
|
| 653 |
+
export type AnyZodTuple = ZodTuple<[ZodTypeAny, ...ZodTypeAny[]] | [], ZodTypeAny | null>;
|
| 654 |
+
export declare class ZodTuple<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
|
| 655 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 656 |
+
get items(): T;
|
| 657 |
+
rest<RestSchema extends ZodTypeAny>(rest: RestSchema): ZodTuple<T, RestSchema>;
|
| 658 |
+
static create: <Items extends [ZodTypeAny, ...ZodTypeAny[]] | []>(schemas: Items, params?: RawCreateParams) => ZodTuple<Items, null>;
|
| 659 |
+
}
|
| 660 |
+
export interface ZodRecordDef<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 661 |
+
valueType: Value;
|
| 662 |
+
keyType: Key;
|
| 663 |
+
typeName: ZodFirstPartyTypeKind.ZodRecord;
|
| 664 |
+
}
|
| 665 |
+
export type KeySchema = ZodType<string | number | symbol, any, any>;
|
| 666 |
+
export 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>>;
|
| 667 |
+
export 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"]>> {
|
| 668 |
+
get keySchema(): Key;
|
| 669 |
+
get valueSchema(): Value;
|
| 670 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 671 |
+
get element(): Value;
|
| 672 |
+
static create<Value extends ZodTypeAny>(valueType: Value, params?: RawCreateParams): ZodRecord<ZodString, Value>;
|
| 673 |
+
static create<Keys extends KeySchema, Value extends ZodTypeAny>(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord<Keys, Value>;
|
| 674 |
+
}
|
| 675 |
+
export interface ZodMapDef<Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 676 |
+
valueType: Value;
|
| 677 |
+
keyType: Key;
|
| 678 |
+
typeName: ZodFirstPartyTypeKind.ZodMap;
|
| 679 |
+
}
|
| 680 |
+
export 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"]>> {
|
| 681 |
+
get keySchema(): Key;
|
| 682 |
+
get valueSchema(): Value;
|
| 683 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 684 |
+
static create: <KeySchema extends ZodTypeAny = ZodTypeAny, ValueSchema extends ZodTypeAny = ZodTypeAny>(keyType: KeySchema, valueType: ValueSchema, params?: RawCreateParams) => ZodMap<KeySchema, ValueSchema>;
|
| 685 |
+
}
|
| 686 |
+
export interface ZodSetDef<Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 687 |
+
valueType: Value;
|
| 688 |
+
typeName: ZodFirstPartyTypeKind.ZodSet;
|
| 689 |
+
minSize: {
|
| 690 |
+
value: number;
|
| 691 |
+
message?: string | undefined;
|
| 692 |
+
} | null;
|
| 693 |
+
maxSize: {
|
| 694 |
+
value: number;
|
| 695 |
+
message?: string | undefined;
|
| 696 |
+
} | null;
|
| 697 |
+
}
|
| 698 |
+
export declare class ZodSet<Value extends ZodTypeAny = ZodTypeAny> extends ZodType<Set<Value["_output"]>, ZodSetDef<Value>, Set<Value["_input"]>> {
|
| 699 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 700 |
+
min(minSize: number, message?: errorUtil.ErrMessage): this;
|
| 701 |
+
max(maxSize: number, message?: errorUtil.ErrMessage): this;
|
| 702 |
+
size(size: number, message?: errorUtil.ErrMessage): this;
|
| 703 |
+
nonempty(message?: errorUtil.ErrMessage): ZodSet<Value>;
|
| 704 |
+
static create: <ValueSchema extends ZodTypeAny = ZodTypeAny>(valueType: ValueSchema, params?: RawCreateParams) => ZodSet<ValueSchema>;
|
| 705 |
+
}
|
| 706 |
+
export interface ZodFunctionDef<Args extends ZodTuple<any, any> = ZodTuple<any, any>, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 707 |
+
args: Args;
|
| 708 |
+
returns: Returns;
|
| 709 |
+
typeName: ZodFirstPartyTypeKind.ZodFunction;
|
| 710 |
+
}
|
| 711 |
+
export type OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_input"] extends Array<any> ? (...args: Args["_input"]) => Returns["_output"] : never;
|
| 712 |
+
export type InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_output"] extends Array<any> ? (...args: Args["_output"]) => Returns["_input"] : never;
|
| 713 |
+
export declare class ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> extends ZodType<OuterTypeOfFunction<Args, Returns>, ZodFunctionDef<Args, Returns>, InnerTypeOfFunction<Args, Returns>> {
|
| 714 |
+
_parse(input: ParseInput): ParseReturnType<any>;
|
| 715 |
+
parameters(): Args;
|
| 716 |
+
returnType(): Returns;
|
| 717 |
+
args<Items extends Parameters<(typeof ZodTuple)["create"]>[0]>(...items: Items): ZodFunction<ZodTuple<Items, ZodUnknown>, Returns>;
|
| 718 |
+
returns<NewReturnType extends ZodType<any, any, any>>(returnType: NewReturnType): ZodFunction<Args, NewReturnType>;
|
| 719 |
+
implement<F extends InnerTypeOfFunction<Args, Returns>>(func: F): ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
| 720 |
+
strictImplement(func: InnerTypeOfFunction<Args, Returns>): InnerTypeOfFunction<Args, Returns>;
|
| 721 |
+
validate: <F extends InnerTypeOfFunction<Args, Returns>>(func: F) => ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
| 722 |
+
static create(): ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>;
|
| 723 |
+
static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>>(args: T): ZodFunction<T, ZodUnknown>;
|
| 724 |
+
static create<T extends AnyZodTuple, U extends ZodTypeAny>(args: T, returns: U): ZodFunction<T, U>;
|
| 725 |
+
static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>, U extends ZodTypeAny = ZodUnknown>(args: T, returns: U, params?: RawCreateParams): ZodFunction<T, U>;
|
| 726 |
+
}
|
| 727 |
+
export interface ZodLazyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 728 |
+
getter: () => T;
|
| 729 |
+
typeName: ZodFirstPartyTypeKind.ZodLazy;
|
| 730 |
+
}
|
| 731 |
+
export declare class ZodLazy<T extends ZodTypeAny> extends ZodType<output<T>, ZodLazyDef<T>, input<T>> {
|
| 732 |
+
get schema(): T;
|
| 733 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 734 |
+
static create: <Inner extends ZodTypeAny>(getter: () => Inner, params?: RawCreateParams) => ZodLazy<Inner>;
|
| 735 |
+
}
|
| 736 |
+
export interface ZodLiteralDef<T = any> extends ZodTypeDef {
|
| 737 |
+
value: T;
|
| 738 |
+
typeName: ZodFirstPartyTypeKind.ZodLiteral;
|
| 739 |
+
}
|
| 740 |
+
export declare class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>, T> {
|
| 741 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 742 |
+
get value(): T;
|
| 743 |
+
static create: <Value extends Primitive>(value: Value, params?: RawCreateParams) => ZodLiteral<Value>;
|
| 744 |
+
}
|
| 745 |
+
export type ArrayKeys = keyof any[];
|
| 746 |
+
export type Indices<T> = Exclude<keyof T, ArrayKeys>;
|
| 747 |
+
export type EnumValues<T extends string = string> = readonly [T, ...T[]];
|
| 748 |
+
export type Values<T extends EnumValues> = {
|
| 749 |
+
[k in T[number]]: k;
|
| 750 |
+
};
|
| 751 |
+
export interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
|
| 752 |
+
values: T;
|
| 753 |
+
typeName: ZodFirstPartyTypeKind.ZodEnum;
|
| 754 |
+
}
|
| 755 |
+
export type Writeable<T> = {
|
| 756 |
+
-readonly [P in keyof T]: T[P];
|
| 757 |
+
};
|
| 758 |
+
export type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
|
| 759 |
+
export type typecast<A, T> = A extends T ? A : never;
|
| 760 |
+
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
|
| 761 |
+
declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
|
| 762 |
+
export declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>, T[number]> {
|
| 763 |
+
_cache: Set<T[number]> | undefined;
|
| 764 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 765 |
+
get options(): T;
|
| 766 |
+
get enum(): Values<T>;
|
| 767 |
+
get Values(): Values<T>;
|
| 768 |
+
get Enum(): Values<T>;
|
| 769 |
+
extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract, newDef?: RawCreateParams): ZodEnum<Writeable<ToExtract>>;
|
| 770 |
+
exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude, newDef?: RawCreateParams): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
|
| 771 |
+
static create: typeof createZodEnum;
|
| 772 |
+
}
|
| 773 |
+
export interface ZodNativeEnumDef<T extends EnumLike = EnumLike> extends ZodTypeDef {
|
| 774 |
+
values: T;
|
| 775 |
+
typeName: ZodFirstPartyTypeKind.ZodNativeEnum;
|
| 776 |
+
}
|
| 777 |
+
export type EnumLike = {
|
| 778 |
+
[k: string]: string | number;
|
| 779 |
+
[nu: number]: string;
|
| 780 |
+
};
|
| 781 |
+
export declare class ZodNativeEnum<T extends EnumLike> extends ZodType<T[keyof T], ZodNativeEnumDef<T>, T[keyof T]> {
|
| 782 |
+
_cache: Set<T[keyof T]> | undefined;
|
| 783 |
+
_parse(input: ParseInput): ParseReturnType<T[keyof T]>;
|
| 784 |
+
get enum(): T;
|
| 785 |
+
static create: <Elements extends EnumLike>(values: Elements, params?: RawCreateParams) => ZodNativeEnum<Elements>;
|
| 786 |
+
}
|
| 787 |
+
export interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 788 |
+
type: T;
|
| 789 |
+
typeName: ZodFirstPartyTypeKind.ZodPromise;
|
| 790 |
+
}
|
| 791 |
+
export declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
|
| 792 |
+
unwrap(): T;
|
| 793 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 794 |
+
static create: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
|
| 795 |
+
}
|
| 796 |
+
export type Refinement<T> = (arg: T, ctx: RefinementCtx) => any;
|
| 797 |
+
export type SuperRefinement<T> = (arg: T, ctx: RefinementCtx) => void | Promise<void>;
|
| 798 |
+
export type RefinementEffect<T> = {
|
| 799 |
+
type: "refinement";
|
| 800 |
+
refinement: (arg: T, ctx: RefinementCtx) => any;
|
| 801 |
+
};
|
| 802 |
+
export type TransformEffect<T> = {
|
| 803 |
+
type: "transform";
|
| 804 |
+
transform: (arg: T, ctx: RefinementCtx) => any;
|
| 805 |
+
};
|
| 806 |
+
export type PreprocessEffect<T> = {
|
| 807 |
+
type: "preprocess";
|
| 808 |
+
transform: (arg: T, ctx: RefinementCtx) => any;
|
| 809 |
+
};
|
| 810 |
+
export type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
|
| 811 |
+
export interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 812 |
+
schema: T;
|
| 813 |
+
typeName: ZodFirstPartyTypeKind.ZodEffects;
|
| 814 |
+
effect: Effect<any>;
|
| 815 |
+
}
|
| 816 |
+
export declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
|
| 817 |
+
innerType(): T;
|
| 818 |
+
sourceType(): T;
|
| 819 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 820 |
+
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
| 821 |
+
static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
| 822 |
+
}
|
| 823 |
+
export { ZodEffects as ZodTransformer };
|
| 824 |
+
export interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 825 |
+
innerType: T;
|
| 826 |
+
typeName: ZodFirstPartyTypeKind.ZodOptional;
|
| 827 |
+
}
|
| 828 |
+
export type ZodOptionalType<T extends ZodTypeAny> = ZodOptional<T>;
|
| 829 |
+
export declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
|
| 830 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 831 |
+
unwrap(): T;
|
| 832 |
+
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
|
| 833 |
+
}
|
| 834 |
+
export interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 835 |
+
innerType: T;
|
| 836 |
+
typeName: ZodFirstPartyTypeKind.ZodNullable;
|
| 837 |
+
}
|
| 838 |
+
export type ZodNullableType<T extends ZodTypeAny> = ZodNullable<T>;
|
| 839 |
+
export declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
|
| 840 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 841 |
+
unwrap(): T;
|
| 842 |
+
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
|
| 843 |
+
}
|
| 844 |
+
export interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 845 |
+
innerType: T;
|
| 846 |
+
defaultValue: () => util.noUndefined<T["_input"]>;
|
| 847 |
+
typeName: ZodFirstPartyTypeKind.ZodDefault;
|
| 848 |
+
}
|
| 849 |
+
export declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
|
| 850 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 851 |
+
removeDefault(): T;
|
| 852 |
+
static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
|
| 853 |
+
default: Inner["_input"] | (() => util.noUndefined<Inner["_input"]>);
|
| 854 |
+
}) => ZodDefault<Inner>;
|
| 855 |
+
}
|
| 856 |
+
export interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 857 |
+
innerType: T;
|
| 858 |
+
catchValue: (ctx: {
|
| 859 |
+
error: ZodError;
|
| 860 |
+
input: unknown;
|
| 861 |
+
}) => T["_input"];
|
| 862 |
+
typeName: ZodFirstPartyTypeKind.ZodCatch;
|
| 863 |
+
}
|
| 864 |
+
export declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
|
| 865 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 866 |
+
removeCatch(): T;
|
| 867 |
+
static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
|
| 868 |
+
catch: Inner["_output"] | (() => Inner["_output"]);
|
| 869 |
+
}) => ZodCatch<Inner>;
|
| 870 |
+
}
|
| 871 |
+
export interface ZodNaNDef extends ZodTypeDef {
|
| 872 |
+
typeName: ZodFirstPartyTypeKind.ZodNaN;
|
| 873 |
+
}
|
| 874 |
+
export declare class ZodNaN extends ZodType<number, ZodNaNDef, number> {
|
| 875 |
+
_parse(input: ParseInput): ParseReturnType<any>;
|
| 876 |
+
static create: (params?: RawCreateParams) => ZodNaN;
|
| 877 |
+
}
|
| 878 |
+
export interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
|
| 879 |
+
type: T;
|
| 880 |
+
typeName: ZodFirstPartyTypeKind.ZodBranded;
|
| 881 |
+
}
|
| 882 |
+
export declare const BRAND: unique symbol;
|
| 883 |
+
export type BRAND<T extends string | number | symbol> = {
|
| 884 |
+
[BRAND]: {
|
| 885 |
+
[k in T]: true;
|
| 886 |
+
};
|
| 887 |
+
};
|
| 888 |
+
export declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
|
| 889 |
+
_parse(input: ParseInput): ParseReturnType<any>;
|
| 890 |
+
unwrap(): T;
|
| 891 |
+
}
|
| 892 |
+
export interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
|
| 893 |
+
in: A;
|
| 894 |
+
out: B;
|
| 895 |
+
typeName: ZodFirstPartyTypeKind.ZodPipeline;
|
| 896 |
+
}
|
| 897 |
+
export declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
|
| 898 |
+
_parse(input: ParseInput): ParseReturnType<any>;
|
| 899 |
+
static create<ASchema extends ZodTypeAny, BSchema extends ZodTypeAny>(a: ASchema, b: BSchema): ZodPipeline<ASchema, BSchema>;
|
| 900 |
+
}
|
| 901 |
+
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
| 902 |
+
readonly [Symbol.toStringTag]: string;
|
| 903 |
+
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
| 904 |
+
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>;
|
| 905 |
+
export interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
| 906 |
+
innerType: T;
|
| 907 |
+
typeName: ZodFirstPartyTypeKind.ZodReadonly;
|
| 908 |
+
}
|
| 909 |
+
export declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, MakeReadonly<T["_input"]>> {
|
| 910 |
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
| 911 |
+
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodReadonly<Inner>;
|
| 912 |
+
unwrap(): T;
|
| 913 |
+
}
|
| 914 |
+
type CustomParams = CustomErrorParams & {
|
| 915 |
+
fatal?: boolean;
|
| 916 |
+
};
|
| 917 |
+
export declare function custom<T>(check?: (data: any) => any, _params?: string | CustomParams | ((input: any) => CustomParams),
|
| 918 |
+
/**
|
| 919 |
+
* @deprecated
|
| 920 |
+
*
|
| 921 |
+
* Pass `fatal` into the params object instead:
|
| 922 |
+
*
|
| 923 |
+
* ```ts
|
| 924 |
+
* z.string().custom((val) => val.length > 5, { fatal: false })
|
| 925 |
+
* ```
|
| 926 |
+
*
|
| 927 |
+
*/
|
| 928 |
+
fatal?: boolean): ZodType<T, ZodTypeDef, T>;
|
| 929 |
+
export { ZodType as Schema, ZodType as ZodSchema };
|
| 930 |
+
export declare const late: {
|
| 931 |
+
object: <Shape extends ZodRawShape>(shape: () => Shape, params?: RawCreateParams) => ZodObject<Shape, "strip">;
|
| 932 |
+
};
|
| 933 |
+
export declare enum ZodFirstPartyTypeKind {
|
| 934 |
+
ZodString = "ZodString",
|
| 935 |
+
ZodNumber = "ZodNumber",
|
| 936 |
+
ZodNaN = "ZodNaN",
|
| 937 |
+
ZodBigInt = "ZodBigInt",
|
| 938 |
+
ZodBoolean = "ZodBoolean",
|
| 939 |
+
ZodDate = "ZodDate",
|
| 940 |
+
ZodSymbol = "ZodSymbol",
|
| 941 |
+
ZodUndefined = "ZodUndefined",
|
| 942 |
+
ZodNull = "ZodNull",
|
| 943 |
+
ZodAny = "ZodAny",
|
| 944 |
+
ZodUnknown = "ZodUnknown",
|
| 945 |
+
ZodNever = "ZodNever",
|
| 946 |
+
ZodVoid = "ZodVoid",
|
| 947 |
+
ZodArray = "ZodArray",
|
| 948 |
+
ZodObject = "ZodObject",
|
| 949 |
+
ZodUnion = "ZodUnion",
|
| 950 |
+
ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
|
| 951 |
+
ZodIntersection = "ZodIntersection",
|
| 952 |
+
ZodTuple = "ZodTuple",
|
| 953 |
+
ZodRecord = "ZodRecord",
|
| 954 |
+
ZodMap = "ZodMap",
|
| 955 |
+
ZodSet = "ZodSet",
|
| 956 |
+
ZodFunction = "ZodFunction",
|
| 957 |
+
ZodLazy = "ZodLazy",
|
| 958 |
+
ZodLiteral = "ZodLiteral",
|
| 959 |
+
ZodEnum = "ZodEnum",
|
| 960 |
+
ZodEffects = "ZodEffects",
|
| 961 |
+
ZodNativeEnum = "ZodNativeEnum",
|
| 962 |
+
ZodOptional = "ZodOptional",
|
| 963 |
+
ZodNullable = "ZodNullable",
|
| 964 |
+
ZodDefault = "ZodDefault",
|
| 965 |
+
ZodCatch = "ZodCatch",
|
| 966 |
+
ZodPromise = "ZodPromise",
|
| 967 |
+
ZodBranded = "ZodBranded",
|
| 968 |
+
ZodPipeline = "ZodPipeline",
|
| 969 |
+
ZodReadonly = "ZodReadonly"
|
| 970 |
+
}
|
| 971 |
+
export 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;
|
| 972 |
+
declare abstract class Class {
|
| 973 |
+
constructor(..._: any[]);
|
| 974 |
+
}
|
| 975 |
+
declare const instanceOfType: <T extends typeof Class>(cls: T, params?: CustomParams) => ZodType<InstanceType<T>, ZodTypeDef, InstanceType<T>>;
|
| 976 |
+
declare const stringType: (params?: RawCreateParams & {
|
| 977 |
+
coerce?: true;
|
| 978 |
+
}) => ZodString;
|
| 979 |
+
declare const numberType: (params?: RawCreateParams & {
|
| 980 |
+
coerce?: boolean;
|
| 981 |
+
}) => ZodNumber;
|
| 982 |
+
declare const nanType: (params?: RawCreateParams) => ZodNaN;
|
| 983 |
+
declare const bigIntType: (params?: RawCreateParams & {
|
| 984 |
+
coerce?: boolean;
|
| 985 |
+
}) => ZodBigInt;
|
| 986 |
+
declare const booleanType: (params?: RawCreateParams & {
|
| 987 |
+
coerce?: boolean;
|
| 988 |
+
}) => ZodBoolean;
|
| 989 |
+
declare const dateType: (params?: RawCreateParams & {
|
| 990 |
+
coerce?: boolean;
|
| 991 |
+
}) => ZodDate;
|
| 992 |
+
declare const symbolType: (params?: RawCreateParams) => ZodSymbol;
|
| 993 |
+
declare const undefinedType: (params?: RawCreateParams) => ZodUndefined;
|
| 994 |
+
declare const nullType: (params?: RawCreateParams) => ZodNull;
|
| 995 |
+
declare const anyType: (params?: RawCreateParams) => ZodAny;
|
| 996 |
+
declare const unknownType: (params?: RawCreateParams) => ZodUnknown;
|
| 997 |
+
declare const neverType: (params?: RawCreateParams) => ZodNever;
|
| 998 |
+
declare const voidType: (params?: RawCreateParams) => ZodVoid;
|
| 999 |
+
declare const arrayType: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
|
| 1000 |
+
declare const objectType: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, objectOutputType<Shape, ZodTypeAny, "strip">, objectInputType<Shape, ZodTypeAny, "strip">>;
|
| 1001 |
+
declare const strictObjectType: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strict">;
|
| 1002 |
+
declare const unionType: <Options extends Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
|
| 1003 |
+
declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create;
|
| 1004 |
+
declare const intersectionType: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
|
| 1005 |
+
declare const tupleType: <Items extends [ZodTypeAny, ...ZodTypeAny[]] | []>(schemas: Items, params?: RawCreateParams) => ZodTuple<Items, null>;
|
| 1006 |
+
declare const recordType: typeof ZodRecord.create;
|
| 1007 |
+
declare const mapType: <KeySchema extends ZodTypeAny = ZodTypeAny, ValueSchema extends ZodTypeAny = ZodTypeAny>(keyType: KeySchema, valueType: ValueSchema, params?: RawCreateParams) => ZodMap<KeySchema, ValueSchema>;
|
| 1008 |
+
declare const setType: <ValueSchema extends ZodTypeAny = ZodTypeAny>(valueType: ValueSchema, params?: RawCreateParams) => ZodSet<ValueSchema>;
|
| 1009 |
+
declare const functionType: typeof ZodFunction.create;
|
| 1010 |
+
declare const lazyType: <Inner extends ZodTypeAny>(getter: () => Inner, params?: RawCreateParams) => ZodLazy<Inner>;
|
| 1011 |
+
declare const literalType: <Value extends Primitive>(value: Value, params?: RawCreateParams) => ZodLiteral<Value>;
|
| 1012 |
+
declare const enumType: typeof createZodEnum;
|
| 1013 |
+
declare const nativeEnumType: <Elements extends EnumLike>(values: Elements, params?: RawCreateParams) => ZodNativeEnum<Elements>;
|
| 1014 |
+
declare const promiseType: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
|
| 1015 |
+
declare const effectsType: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
| 1016 |
+
declare const optionalType: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
|
| 1017 |
+
declare const nullableType: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
|
| 1018 |
+
declare const preprocessType: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
| 1019 |
+
declare const pipelineType: typeof ZodPipeline.create;
|
| 1020 |
+
declare const ostring: () => ZodOptional<ZodString>;
|
| 1021 |
+
declare const onumber: () => ZodOptional<ZodNumber>;
|
| 1022 |
+
declare const oboolean: () => ZodOptional<ZodBoolean>;
|
| 1023 |
+
export declare const coerce: {
|
| 1024 |
+
string: (typeof ZodString)["create"];
|
| 1025 |
+
number: (typeof ZodNumber)["create"];
|
| 1026 |
+
boolean: (typeof ZodBoolean)["create"];
|
| 1027 |
+
bigint: (typeof ZodBigInt)["create"];
|
| 1028 |
+
date: (typeof ZodDate)["create"];
|
| 1029 |
+
};
|
| 1030 |
+
export { anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, };
|
| 1031 |
+
export declare const NEVER: never;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v3/types.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4-mini/index.cjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
| 3 |
+
if (k2 === undefined) k2 = k;
|
| 4 |
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
| 5 |
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
| 6 |
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
| 7 |
+
}
|
| 8 |
+
Object.defineProperty(o, k2, desc);
|
| 9 |
+
}) : (function(o, m, k, k2) {
|
| 10 |
+
if (k2 === undefined) k2 = k;
|
| 11 |
+
o[k2] = m[k];
|
| 12 |
+
}));
|
| 13 |
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
| 14 |
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
| 15 |
+
};
|
| 16 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 17 |
+
__exportStar(require("../v4/mini/index.cjs"), exports);
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4-mini/index.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export * from "../v4/mini/index.cjs";
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4-mini/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export * from "../v4/mini/index.js";
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4-mini/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export * from "../v4/mini/index.js";
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/checks.cjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.toUpperCase = exports.toLowerCase = exports.trim = exports.normalize = exports.overwrite = exports.mime = exports.property = exports.endsWith = exports.startsWith = exports.includes = exports.uppercase = exports.lowercase = exports.regex = exports.length = exports.minLength = exports.maxLength = exports.size = exports.minSize = exports.maxSize = exports.multipleOf = exports.nonnegative = exports.nonpositive = exports.negative = exports.positive = exports.gte = exports.gt = exports.lte = exports.lt = void 0;
|
| 4 |
+
var index_js_1 = require("../core/index.cjs");
|
| 5 |
+
Object.defineProperty(exports, "lt", { enumerable: true, get: function () { return index_js_1._lt; } });
|
| 6 |
+
Object.defineProperty(exports, "lte", { enumerable: true, get: function () { return index_js_1._lte; } });
|
| 7 |
+
Object.defineProperty(exports, "gt", { enumerable: true, get: function () { return index_js_1._gt; } });
|
| 8 |
+
Object.defineProperty(exports, "gte", { enumerable: true, get: function () { return index_js_1._gte; } });
|
| 9 |
+
Object.defineProperty(exports, "positive", { enumerable: true, get: function () { return index_js_1._positive; } });
|
| 10 |
+
Object.defineProperty(exports, "negative", { enumerable: true, get: function () { return index_js_1._negative; } });
|
| 11 |
+
Object.defineProperty(exports, "nonpositive", { enumerable: true, get: function () { return index_js_1._nonpositive; } });
|
| 12 |
+
Object.defineProperty(exports, "nonnegative", { enumerable: true, get: function () { return index_js_1._nonnegative; } });
|
| 13 |
+
Object.defineProperty(exports, "multipleOf", { enumerable: true, get: function () { return index_js_1._multipleOf; } });
|
| 14 |
+
Object.defineProperty(exports, "maxSize", { enumerable: true, get: function () { return index_js_1._maxSize; } });
|
| 15 |
+
Object.defineProperty(exports, "minSize", { enumerable: true, get: function () { return index_js_1._minSize; } });
|
| 16 |
+
Object.defineProperty(exports, "size", { enumerable: true, get: function () { return index_js_1._size; } });
|
| 17 |
+
Object.defineProperty(exports, "maxLength", { enumerable: true, get: function () { return index_js_1._maxLength; } });
|
| 18 |
+
Object.defineProperty(exports, "minLength", { enumerable: true, get: function () { return index_js_1._minLength; } });
|
| 19 |
+
Object.defineProperty(exports, "length", { enumerable: true, get: function () { return index_js_1._length; } });
|
| 20 |
+
Object.defineProperty(exports, "regex", { enumerable: true, get: function () { return index_js_1._regex; } });
|
| 21 |
+
Object.defineProperty(exports, "lowercase", { enumerable: true, get: function () { return index_js_1._lowercase; } });
|
| 22 |
+
Object.defineProperty(exports, "uppercase", { enumerable: true, get: function () { return index_js_1._uppercase; } });
|
| 23 |
+
Object.defineProperty(exports, "includes", { enumerable: true, get: function () { return index_js_1._includes; } });
|
| 24 |
+
Object.defineProperty(exports, "startsWith", { enumerable: true, get: function () { return index_js_1._startsWith; } });
|
| 25 |
+
Object.defineProperty(exports, "endsWith", { enumerable: true, get: function () { return index_js_1._endsWith; } });
|
| 26 |
+
Object.defineProperty(exports, "property", { enumerable: true, get: function () { return index_js_1._property; } });
|
| 27 |
+
Object.defineProperty(exports, "mime", { enumerable: true, get: function () { return index_js_1._mime; } });
|
| 28 |
+
Object.defineProperty(exports, "overwrite", { enumerable: true, get: function () { return index_js_1._overwrite; } });
|
| 29 |
+
Object.defineProperty(exports, "normalize", { enumerable: true, get: function () { return index_js_1._normalize; } });
|
| 30 |
+
Object.defineProperty(exports, "trim", { enumerable: true, get: function () { return index_js_1._trim; } });
|
| 31 |
+
Object.defineProperty(exports, "toLowerCase", { enumerable: true, get: function () { return index_js_1._toLowerCase; } });
|
| 32 |
+
Object.defineProperty(exports, "toUpperCase", { enumerable: true, get: function () { return index_js_1._toUpperCase; } });
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/checks.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.cjs";
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/checks.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.js";
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/checks.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.js";
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/coerce.cjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
| 3 |
+
if (k2 === undefined) k2 = k;
|
| 4 |
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
| 5 |
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
| 6 |
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
| 7 |
+
}
|
| 8 |
+
Object.defineProperty(o, k2, desc);
|
| 9 |
+
}) : (function(o, m, k, k2) {
|
| 10 |
+
if (k2 === undefined) k2 = k;
|
| 11 |
+
o[k2] = m[k];
|
| 12 |
+
}));
|
| 13 |
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
| 14 |
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
| 15 |
+
}) : function(o, v) {
|
| 16 |
+
o["default"] = v;
|
| 17 |
+
});
|
| 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 |
+
};
|
| 25 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 26 |
+
exports.string = string;
|
| 27 |
+
exports.number = number;
|
| 28 |
+
exports.boolean = boolean;
|
| 29 |
+
exports.bigint = bigint;
|
| 30 |
+
exports.date = date;
|
| 31 |
+
const core = __importStar(require("../core/index.cjs"));
|
| 32 |
+
const schemas = __importStar(require("./schemas.cjs"));
|
| 33 |
+
function string(params) {
|
| 34 |
+
return core._coercedString(schemas.ZodString, params);
|
| 35 |
+
}
|
| 36 |
+
function number(params) {
|
| 37 |
+
return core._coercedNumber(schemas.ZodNumber, params);
|
| 38 |
+
}
|
| 39 |
+
function boolean(params) {
|
| 40 |
+
return core._coercedBoolean(schemas.ZodBoolean, params);
|
| 41 |
+
}
|
| 42 |
+
function bigint(params) {
|
| 43 |
+
return core._coercedBigint(schemas.ZodBigInt, params);
|
| 44 |
+
}
|
| 45 |
+
function date(params) {
|
| 46 |
+
return core._coercedDate(schemas.ZodDate, params);
|
| 47 |
+
}
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/coerce.d.cts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as core from "../core/index.cjs";
|
| 2 |
+
import * as schemas from "./schemas.cjs";
|
| 3 |
+
export interface ZodCoercedString<T = unknown> extends schemas._ZodString<core.$ZodStringInternals<T>> {
|
| 4 |
+
}
|
| 5 |
+
export declare function string<T = unknown>(params?: string | core.$ZodStringParams): ZodCoercedString<T>;
|
| 6 |
+
export interface ZodCoercedNumber<T = unknown> extends schemas._ZodNumber<core.$ZodNumberInternals<T>> {
|
| 7 |
+
}
|
| 8 |
+
export declare function number<T = unknown>(params?: string | core.$ZodNumberParams): ZodCoercedNumber<T>;
|
| 9 |
+
export interface ZodCoercedBoolean<T = unknown> extends schemas._ZodBoolean<core.$ZodBooleanInternals<T>> {
|
| 10 |
+
}
|
| 11 |
+
export declare function boolean<T = unknown>(params?: string | core.$ZodBooleanParams): ZodCoercedBoolean<T>;
|
| 12 |
+
export interface ZodCoercedBigInt<T = unknown> extends schemas._ZodBigInt<core.$ZodBigIntInternals<T>> {
|
| 13 |
+
}
|
| 14 |
+
export declare function bigint<T = unknown>(params?: string | core.$ZodBigIntParams): ZodCoercedBigInt<T>;
|
| 15 |
+
export interface ZodCoercedDate<T = unknown> extends schemas._ZodDate<core.$ZodDateInternals<T>> {
|
| 16 |
+
}
|
| 17 |
+
export declare function date<T = unknown>(params?: string | core.$ZodDateParams): ZodCoercedDate<T>;
|
node_modules/@jimp/plugin-displace/node_modules/zod/v4/classic/coerce.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as core from "../core/index.js";
|
| 2 |
+
import * as schemas from "./schemas.js";
|
| 3 |
+
export interface ZodCoercedString<T = unknown> extends schemas._ZodString<core.$ZodStringInternals<T>> {
|
| 4 |
+
}
|
| 5 |
+
export declare function string<T = unknown>(params?: string | core.$ZodStringParams): ZodCoercedString<T>;
|
| 6 |
+
export interface ZodCoercedNumber<T = unknown> extends schemas._ZodNumber<core.$ZodNumberInternals<T>> {
|
| 7 |
+
}
|
| 8 |
+
export declare function number<T = unknown>(params?: string | core.$ZodNumberParams): ZodCoercedNumber<T>;
|
| 9 |
+
export interface ZodCoercedBoolean<T = unknown> extends schemas._ZodBoolean<core.$ZodBooleanInternals<T>> {
|
| 10 |
+
}
|
| 11 |
+
export declare function boolean<T = unknown>(params?: string | core.$ZodBooleanParams): ZodCoercedBoolean<T>;
|
| 12 |
+
export interface ZodCoercedBigInt<T = unknown> extends schemas._ZodBigInt<core.$ZodBigIntInternals<T>> {
|
| 13 |
+
}
|
| 14 |
+
export declare function bigint<T = unknown>(params?: string | core.$ZodBigIntParams): ZodCoercedBigInt<T>;
|
| 15 |
+
export interface ZodCoercedDate<T = unknown> extends schemas._ZodDate<core.$ZodDateInternals<T>> {
|
| 16 |
+
}
|
| 17 |
+
export declare function date<T = unknown>(params?: string | core.$ZodDateParams): ZodCoercedDate<T>;
|