@rspack/core 1.4.0-beta.1 → 1.4.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Module.d.ts +0 -1
- package/dist/builtin-loader/swc/pluginImport.d.ts +4 -26
- package/dist/builtin-loader/swc/types.d.ts +147 -2009
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +2 -1
- package/dist/config/normalization.d.ts +2 -1
- package/dist/config/types.d.ts +14 -3
- package/dist/config/utils.d.ts +3 -17
- package/dist/config/zod.d.ts +682 -4538
- package/dist/exports.d.ts +2 -1
- package/dist/index.js +3707 -1144
- package/dist/util/validate.d.ts +1 -1
- package/package.json +4 -4
- package/compiled/enhanced-resolve/CachedInputFileSystem.d.ts +0 -0
- package/compiled/enhanced-resolve/CachedInputFileSystem.js +0 -664
- package/compiled/enhanced-resolve/index.d.ts +0 -1124
- package/compiled/enhanced-resolve/license +0 -20
- package/compiled/enhanced-resolve/package.json +0 -1
- package/compiled/zod/dist/types/index.d.ts +0 -3
- package/compiled/zod/dist/types/v3/ZodError.d.ts +0 -164
- package/compiled/zod/dist/types/v3/benchmarks/datetime.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/discriminatedUnion.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/index.d.ts +0 -1
- package/compiled/zod/dist/types/v3/benchmarks/ipv4.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/object.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/primitives.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/realworld.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/string.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/union.d.ts +0 -5
- package/compiled/zod/dist/types/v3/errors.d.ts +0 -5
- package/compiled/zod/dist/types/v3/external.d.ts +0 -6
- package/compiled/zod/dist/types/v3/helpers/enumUtil.d.ts +0 -8
- package/compiled/zod/dist/types/v3/helpers/errorUtil.d.ts +0 -9
- package/compiled/zod/dist/types/v3/helpers/parseUtil.d.ts +0 -78
- package/compiled/zod/dist/types/v3/helpers/partialUtil.d.ts +0 -8
- package/compiled/zod/dist/types/v3/helpers/typeAliases.d.ts +0 -2
- package/compiled/zod/dist/types/v3/helpers/util.d.ts +0 -85
- package/compiled/zod/dist/types/v3/index.d.ts +0 -4
- package/compiled/zod/dist/types/v3/locales/en.d.ts +0 -3
- package/compiled/zod/dist/types/v3/standard-schema.d.ts +0 -102
- package/compiled/zod/dist/types/v3/tests/Mocker.d.ts +0 -17
- package/compiled/zod/dist/types/v3/types.d.ts +0 -1031
- package/compiled/zod/dist/types/v4/classic/checks.d.ts +0 -1
- package/compiled/zod/dist/types/v4/classic/coerce.d.ts +0 -17
- package/compiled/zod/dist/types/v4/classic/compat.d.ts +0 -48
- package/compiled/zod/dist/types/v4/classic/errors.d.ts +0 -30
- package/compiled/zod/dist/types/v4/classic/external.d.ts +0 -13
- package/compiled/zod/dist/types/v4/classic/index.d.ts +0 -4
- package/compiled/zod/dist/types/v4/classic/iso.d.ts +0 -22
- package/compiled/zod/dist/types/v4/classic/parse.d.ts +0 -23
- package/compiled/zod/dist/types/v4/classic/schemas.d.ts +0 -624
- package/compiled/zod/dist/types/v4/core/api.d.ts +0 -274
- package/compiled/zod/dist/types/v4/core/checks.d.ts +0 -277
- package/compiled/zod/dist/types/v4/core/config.d.ts +0 -9
- package/compiled/zod/dist/types/v4/core/core.d.ts +0 -47
- package/compiled/zod/dist/types/v4/core/doc.d.ts +0 -14
- package/compiled/zod/dist/types/v4/core/errors.d.ts +0 -204
- package/compiled/zod/dist/types/v4/core/function.d.ts +0 -52
- package/compiled/zod/dist/types/v4/core/index.d.ts +0 -15
- package/compiled/zod/dist/types/v4/core/json-schema.d.ts +0 -100
- package/compiled/zod/dist/types/v4/core/parse.d.ts +0 -25
- package/compiled/zod/dist/types/v4/core/regexes.d.ts +0 -62
- package/compiled/zod/dist/types/v4/core/registries.d.ts +0 -39
- package/compiled/zod/dist/types/v4/core/schemas.d.ts +0 -1005
- package/compiled/zod/dist/types/v4/core/standard-schema.d.ts +0 -55
- package/compiled/zod/dist/types/v4/core/to-json-schema.d.ts +0 -84
- package/compiled/zod/dist/types/v4/core/util.d.ts +0 -182
- package/compiled/zod/dist/types/v4/core/versions.d.ts +0 -5
- package/compiled/zod/dist/types/v4/core/zsf.d.ts +0 -91
- package/compiled/zod/dist/types/v4/index.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/ar.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/az.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/be.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ca.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/cs.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/de.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/en.d.ts +0 -5
- package/compiled/zod/dist/types/v4/locales/es.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/fa.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/fi.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/fr-CA.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/fr.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/he.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/hu.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/id.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/index.d.ts +0 -38
- package/compiled/zod/dist/types/v4/locales/it.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ja.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/kh.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ko.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/mk.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ms.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/nl.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/no.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ota.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/pl.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ps.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/pt.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ru.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/sl.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/sv.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ta.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/th.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/tr.d.ts +0 -5
- package/compiled/zod/dist/types/v4/locales/ua.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ur.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/vi.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/zh-CN.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/zh-TW.d.ts +0 -4
- package/compiled/zod/dist/types/v4/mini/checks.d.ts +0 -1
- package/compiled/zod/dist/types/v4/mini/coerce.d.ts +0 -7
- package/compiled/zod/dist/types/v4/mini/external.d.ts +0 -11
- package/compiled/zod/dist/types/v4/mini/index.d.ts +0 -3
- package/compiled/zod/dist/types/v4/mini/iso.d.ts +0 -22
- package/compiled/zod/dist/types/v4/mini/parse.d.ts +0 -1
- package/compiled/zod/dist/types/v4/mini/schemas.d.ts +0 -350
- package/compiled/zod/index.js +0 -4513
- package/compiled/zod/license +0 -21
- package/compiled/zod/package.json +0 -1
- package/compiled/zod/v3/index.d.ts +0 -3
- package/compiled/zod/v4/core/index.d.ts +0 -1
- package/compiled/zod/v4/index.d.ts +0 -3
- package/compiled/zod/v4/locales/en.d.ts +0 -2
- package/compiled/zod/v4/locales/index.d.ts +0 -1
- package/compiled/zod/v4-mini/index.d.ts +0 -1
@@ -1,624 +0,0 @@
|
|
1
|
-
import * as core from "zod/v4/core";
|
2
|
-
import { util } from "zod/v4/core";
|
3
|
-
import * as parse from "./parse.js";
|
4
|
-
export interface RefinementCtx<T = unknown> extends core.ParsePayload<T> {
|
5
|
-
addIssue(arg: string | core.$ZodRawIssue | Partial<core.$ZodIssueCustom>): void;
|
6
|
-
}
|
7
|
-
export interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
|
8
|
-
def: Internals["def"];
|
9
|
-
type: Internals["def"]["type"];
|
10
|
-
/** @deprecated Use `.def` instead. */
|
11
|
-
_def: Internals["def"];
|
12
|
-
/** @deprecated Use `z.output<typeof schema>` instead. */
|
13
|
-
_output: Internals["output"];
|
14
|
-
/** @deprecated Use `z.input<typeof schema>` instead. */
|
15
|
-
_input: Internals["input"];
|
16
|
-
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
|
17
|
-
clone(def?: Internals["def"], params?: {
|
18
|
-
parent: boolean;
|
19
|
-
}): this;
|
20
|
-
register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$replace<R["_meta"], this>?] : [core.$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
|
21
|
-
brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T>;
|
22
|
-
parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
|
23
|
-
safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): parse.ZodSafeParseResult<core.output<this>>;
|
24
|
-
parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
|
25
|
-
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.output<this>>>;
|
26
|
-
spa: (data: unknown, params?: core.ParseContext<core.$ZodIssue>) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
|
27
|
-
refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
|
28
|
-
/** @deprecated Use `.check()` instead. */
|
29
|
-
superRefine(refinement: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => void | Promise<void>): this;
|
30
|
-
overwrite(fn: (x: core.output<this>) => core.output<this>): this;
|
31
|
-
optional(): ZodOptional<this>;
|
32
|
-
nonoptional(params?: string | core.$ZodNonOptionalParams): ZodNonOptional<this>;
|
33
|
-
nullable(): ZodNullable<this>;
|
34
|
-
nullish(): ZodOptional<ZodNullable<this>>;
|
35
|
-
default(def: core.output<this>): ZodDefault<this>;
|
36
|
-
default(def: () => util.NoUndefined<core.output<this>>): ZodDefault<this>;
|
37
|
-
prefault(def: () => core.input<this>): ZodPrefault<this>;
|
38
|
-
prefault(def: core.input<this>): ZodPrefault<this>;
|
39
|
-
array(): ZodArray<this>;
|
40
|
-
or<T extends core.SomeType>(option: T): ZodUnion<[this, T]>;
|
41
|
-
and<T extends core.SomeType>(incoming: T): ZodIntersection<this, T>;
|
42
|
-
transform<NewOut>(transform: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
|
43
|
-
catch(def: core.output<this>): ZodCatch<this>;
|
44
|
-
catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
|
45
|
-
pipe<T extends core.$ZodType<any, core.output<this>>>(target: T | core.$ZodType<any, core.output<this>>): ZodPipe<this, T>;
|
46
|
-
readonly(): ZodReadonly<this>;
|
47
|
-
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
|
48
|
-
describe(description: string): this;
|
49
|
-
description?: string;
|
50
|
-
/** Returns the metadata associated with this instance in `z.globalRegistry` */
|
51
|
-
meta(): core.$replace<core.GlobalMeta, this> | undefined;
|
52
|
-
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
|
53
|
-
meta(data: core.$replace<core.GlobalMeta, this>): this;
|
54
|
-
/** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
|
55
|
-
*
|
56
|
-
* ```ts
|
57
|
-
* const schema = z.string().optional();
|
58
|
-
* const isOptional = schema.safeParse(undefined).success; // true
|
59
|
-
* ```
|
60
|
-
*/
|
61
|
-
isOptional(): boolean;
|
62
|
-
/**
|
63
|
-
* @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
|
64
|
-
*
|
65
|
-
* ```ts
|
66
|
-
* const schema = z.string().nullable();
|
67
|
-
* const isNullable = schema.safeParse(null).success; // true
|
68
|
-
* ```
|
69
|
-
*/
|
70
|
-
isNullable(): boolean;
|
71
|
-
}
|
72
|
-
export interface _ZodType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodType<any, any, Internals> {
|
73
|
-
}
|
74
|
-
export declare const ZodType: core.$constructor<ZodType>;
|
75
|
-
export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>> extends _ZodType<T> {
|
76
|
-
format: string | null;
|
77
|
-
minLength: number | null;
|
78
|
-
maxLength: number | null;
|
79
|
-
regex(regex: RegExp, params?: string | core.$ZodCheckRegexParams): this;
|
80
|
-
includes(value: string, params?: core.$ZodCheckIncludesParams): this;
|
81
|
-
startsWith(value: string, params?: string | core.$ZodCheckStartsWithParams): this;
|
82
|
-
endsWith(value: string, params?: string | core.$ZodCheckEndsWithParams): this;
|
83
|
-
min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
|
84
|
-
max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
|
85
|
-
length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
|
86
|
-
nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
|
87
|
-
lowercase(params?: string | core.$ZodCheckLowerCaseParams): this;
|
88
|
-
uppercase(params?: string | core.$ZodCheckUpperCaseParams): this;
|
89
|
-
trim(): this;
|
90
|
-
normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
|
91
|
-
toLowerCase(): this;
|
92
|
-
toUpperCase(): this;
|
93
|
-
}
|
94
|
-
/** @internal */
|
95
|
-
export declare const _ZodString: core.$constructor<_ZodString>;
|
96
|
-
export interface ZodString extends _ZodString<core.$ZodStringInternals<string>> {
|
97
|
-
/** @deprecated Use `z.email()` instead. */
|
98
|
-
email(params?: string | core.$ZodCheckEmailParams): this;
|
99
|
-
/** @deprecated Use `z.url()` instead. */
|
100
|
-
url(params?: string | core.$ZodCheckURLParams): this;
|
101
|
-
/** @deprecated Use `z.jwt()` instead. */
|
102
|
-
jwt(params?: string | core.$ZodCheckJWTParams): this;
|
103
|
-
/** @deprecated Use `z.emoji()` instead. */
|
104
|
-
emoji(params?: string | core.$ZodCheckEmojiParams): this;
|
105
|
-
/** @deprecated Use `z.guid()` instead. */
|
106
|
-
guid(params?: string | core.$ZodCheckGUIDParams): this;
|
107
|
-
/** @deprecated Use `z.uuid()` instead. */
|
108
|
-
uuid(params?: string | core.$ZodCheckUUIDParams): this;
|
109
|
-
/** @deprecated Use `z.uuid()` instead. */
|
110
|
-
uuidv4(params?: string | core.$ZodCheckUUIDParams): this;
|
111
|
-
/** @deprecated Use `z.uuid()` instead. */
|
112
|
-
uuidv6(params?: string | core.$ZodCheckUUIDParams): this;
|
113
|
-
/** @deprecated Use `z.uuid()` instead. */
|
114
|
-
uuidv7(params?: string | core.$ZodCheckUUIDParams): this;
|
115
|
-
/** @deprecated Use `z.nanoid()` instead. */
|
116
|
-
nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
|
117
|
-
/** @deprecated Use `z.guid()` instead. */
|
118
|
-
guid(params?: string | core.$ZodCheckGUIDParams): this;
|
119
|
-
/** @deprecated Use `z.cuid()` instead. */
|
120
|
-
cuid(params?: string | core.$ZodCheckCUIDParams): this;
|
121
|
-
/** @deprecated Use `z.cuid2()` instead. */
|
122
|
-
cuid2(params?: string | core.$ZodCheckCUID2Params): this;
|
123
|
-
/** @deprecated Use `z.ulid()` instead. */
|
124
|
-
ulid(params?: string | core.$ZodCheckULIDParams): this;
|
125
|
-
/** @deprecated Use `z.base64()` instead. */
|
126
|
-
base64(params?: string | core.$ZodCheckBase64Params): this;
|
127
|
-
/** @deprecated Use `z.base64url()` instead. */
|
128
|
-
base64url(params?: string | core.$ZodCheckBase64URLParams): this;
|
129
|
-
/** @deprecated Use `z.xid()` instead. */
|
130
|
-
xid(params?: string | core.$ZodCheckXIDParams): this;
|
131
|
-
/** @deprecated Use `z.ksuid()` instead. */
|
132
|
-
ksuid(params?: string | core.$ZodCheckKSUIDParams): this;
|
133
|
-
/** @deprecated Use `z.ipv4()` instead. */
|
134
|
-
ipv4(params?: string | core.$ZodCheckIPv4Params): this;
|
135
|
-
/** @deprecated Use `z.ipv6()` instead. */
|
136
|
-
ipv6(params?: string | core.$ZodCheckIPv6Params): this;
|
137
|
-
/** @deprecated Use `z.cidrv4()` instead. */
|
138
|
-
cidrv4(params?: string | core.$ZodCheckCIDRv4Params): this;
|
139
|
-
/** @deprecated Use `z.cidrv6()` instead. */
|
140
|
-
cidrv6(params?: string | core.$ZodCheckCIDRv6Params): this;
|
141
|
-
/** @deprecated Use `z.e164()` instead. */
|
142
|
-
e164(params?: string | core.$ZodCheckE164Params): this;
|
143
|
-
/** @deprecated Use `z.iso.datetime()` instead. */
|
144
|
-
datetime(params?: string | core.$ZodCheckISODateTimeParams): this;
|
145
|
-
/** @deprecated Use `z.iso.date()` instead. */
|
146
|
-
date(params?: string | core.$ZodCheckISODateParams): this;
|
147
|
-
/** @deprecated Use `z.iso.time()` instead. */
|
148
|
-
time(params?: string | core.$ZodCheckISOTimeParams): this;
|
149
|
-
/** @deprecated Use `z.iso.duration()` instead. */
|
150
|
-
duration(params?: string | core.$ZodCheckISODurationParams): this;
|
151
|
-
}
|
152
|
-
export declare const ZodString: core.$constructor<ZodString>;
|
153
|
-
export declare function string(params?: string | core.$ZodStringParams): ZodString;
|
154
|
-
export interface ZodStringFormat<Format extends core.$ZodStringFormats = core.$ZodStringFormats> extends _ZodString<core.$ZodStringFormatInternals<Format>> {
|
155
|
-
}
|
156
|
-
export declare const ZodStringFormat: core.$constructor<ZodStringFormat>;
|
157
|
-
export interface ZodEmail extends ZodStringFormat<"email"> {
|
158
|
-
_zod: core.$ZodEmailInternals;
|
159
|
-
}
|
160
|
-
export declare const ZodEmail: core.$constructor<ZodEmail>;
|
161
|
-
export declare function email(params?: string | core.$ZodEmailParams): ZodEmail;
|
162
|
-
export interface ZodGUID extends ZodStringFormat<"guid"> {
|
163
|
-
_zod: core.$ZodGUIDInternals;
|
164
|
-
}
|
165
|
-
export declare const ZodGUID: core.$constructor<ZodGUID>;
|
166
|
-
export declare function guid(params?: string | core.$ZodGUIDParams): ZodGUID;
|
167
|
-
export interface ZodUUID extends ZodStringFormat<"uuid"> {
|
168
|
-
_zod: core.$ZodUUIDInternals;
|
169
|
-
}
|
170
|
-
export declare const ZodUUID: core.$constructor<ZodUUID>;
|
171
|
-
export declare function uuid(params?: string | core.$ZodUUIDParams): ZodUUID;
|
172
|
-
export declare function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodUUID;
|
173
|
-
export declare function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodUUID;
|
174
|
-
export declare function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodUUID;
|
175
|
-
export interface ZodURL extends ZodStringFormat<"url"> {
|
176
|
-
_zod: core.$ZodURLInternals;
|
177
|
-
}
|
178
|
-
export declare const ZodURL: core.$constructor<ZodURL>;
|
179
|
-
export declare function url(params?: string | core.$ZodURLParams): ZodURL;
|
180
|
-
export interface ZodEmoji extends ZodStringFormat<"emoji"> {
|
181
|
-
_zod: core.$ZodEmojiInternals;
|
182
|
-
}
|
183
|
-
export declare const ZodEmoji: core.$constructor<ZodEmoji>;
|
184
|
-
export declare function emoji(params?: string | core.$ZodEmojiParams): ZodEmoji;
|
185
|
-
export interface ZodNanoID extends ZodStringFormat<"nanoid"> {
|
186
|
-
_zod: core.$ZodNanoIDInternals;
|
187
|
-
}
|
188
|
-
export declare const ZodNanoID: core.$constructor<ZodNanoID>;
|
189
|
-
export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodNanoID;
|
190
|
-
export interface ZodCUID extends ZodStringFormat<"cuid"> {
|
191
|
-
_zod: core.$ZodCUIDInternals;
|
192
|
-
}
|
193
|
-
export declare const ZodCUID: core.$constructor<ZodCUID>;
|
194
|
-
export declare function cuid(params?: string | core.$ZodCUIDParams): ZodCUID;
|
195
|
-
export interface ZodCUID2 extends ZodStringFormat<"cuid2"> {
|
196
|
-
_zod: core.$ZodCUID2Internals;
|
197
|
-
}
|
198
|
-
export declare const ZodCUID2: core.$constructor<ZodCUID2>;
|
199
|
-
export declare function cuid2(params?: string | core.$ZodCUID2Params): ZodCUID2;
|
200
|
-
export interface ZodULID extends ZodStringFormat<"ulid"> {
|
201
|
-
_zod: core.$ZodULIDInternals;
|
202
|
-
}
|
203
|
-
export declare const ZodULID: core.$constructor<ZodULID>;
|
204
|
-
export declare function ulid(params?: string | core.$ZodULIDParams): ZodULID;
|
205
|
-
export interface ZodXID extends ZodStringFormat<"xid"> {
|
206
|
-
_zod: core.$ZodXIDInternals;
|
207
|
-
}
|
208
|
-
export declare const ZodXID: core.$constructor<ZodXID>;
|
209
|
-
export declare function xid(params?: string | core.$ZodXIDParams): ZodXID;
|
210
|
-
export interface ZodKSUID extends ZodStringFormat<"ksuid"> {
|
211
|
-
_zod: core.$ZodKSUIDInternals;
|
212
|
-
}
|
213
|
-
export declare const ZodKSUID: core.$constructor<ZodKSUID>;
|
214
|
-
export declare function ksuid(params?: string | core.$ZodKSUIDParams): ZodKSUID;
|
215
|
-
export interface ZodIPv4 extends ZodStringFormat<"ipv4"> {
|
216
|
-
_zod: core.$ZodIPv4Internals;
|
217
|
-
}
|
218
|
-
export declare const ZodIPv4: core.$constructor<ZodIPv4>;
|
219
|
-
export declare function ipv4(params?: string | core.$ZodIPv4Params): ZodIPv4;
|
220
|
-
export interface ZodIPv6 extends ZodStringFormat<"ipv6"> {
|
221
|
-
_zod: core.$ZodIPv6Internals;
|
222
|
-
}
|
223
|
-
export declare const ZodIPv6: core.$constructor<ZodIPv6>;
|
224
|
-
export declare function ipv6(params?: string | core.$ZodIPv6Params): ZodIPv6;
|
225
|
-
export interface ZodCIDRv4 extends ZodStringFormat<"cidrv4"> {
|
226
|
-
_zod: core.$ZodCIDRv4Internals;
|
227
|
-
}
|
228
|
-
export declare const ZodCIDRv4: core.$constructor<ZodCIDRv4>;
|
229
|
-
export declare function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodCIDRv4;
|
230
|
-
export interface ZodCIDRv6 extends ZodStringFormat<"cidrv6"> {
|
231
|
-
_zod: core.$ZodCIDRv6Internals;
|
232
|
-
}
|
233
|
-
export declare const ZodCIDRv6: core.$constructor<ZodCIDRv6>;
|
234
|
-
export declare function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodCIDRv6;
|
235
|
-
export interface ZodBase64 extends ZodStringFormat<"base64"> {
|
236
|
-
_zod: core.$ZodBase64Internals;
|
237
|
-
}
|
238
|
-
export declare const ZodBase64: core.$constructor<ZodBase64>;
|
239
|
-
export declare function base64(params?: string | core.$ZodBase64Params): ZodBase64;
|
240
|
-
export interface ZodBase64URL extends ZodStringFormat<"base64url"> {
|
241
|
-
_zod: core.$ZodBase64URLInternals;
|
242
|
-
}
|
243
|
-
export declare const ZodBase64URL: core.$constructor<ZodBase64URL>;
|
244
|
-
export declare function base64url(params?: string | core.$ZodBase64URLParams): ZodBase64URL;
|
245
|
-
export interface ZodE164 extends ZodStringFormat<"e164"> {
|
246
|
-
_zod: core.$ZodE164Internals;
|
247
|
-
}
|
248
|
-
export declare const ZodE164: core.$constructor<ZodE164>;
|
249
|
-
export declare function e164(params?: string | core.$ZodE164Params): ZodE164;
|
250
|
-
export interface ZodJWT extends ZodStringFormat<"jwt"> {
|
251
|
-
_zod: core.$ZodJWTInternals;
|
252
|
-
}
|
253
|
-
export declare const ZodJWT: core.$constructor<ZodJWT>;
|
254
|
-
export declare function jwt(params?: string | core.$ZodJWTParams): ZodJWT;
|
255
|
-
export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals> extends _ZodType<Internals> {
|
256
|
-
gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
257
|
-
/** Identical to .min() */
|
258
|
-
gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
259
|
-
min(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
260
|
-
lt(value: number, params?: string | core.$ZodCheckLessThanParams): this;
|
261
|
-
/** Identical to .max() */
|
262
|
-
lte(value: number, params?: string | core.$ZodCheckLessThanParams): this;
|
263
|
-
max(value: number, params?: string | core.$ZodCheckLessThanParams): this;
|
264
|
-
/** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
|
265
|
-
int(params?: string | core.$ZodCheckNumberFormatParams): this;
|
266
|
-
/** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
|
267
|
-
safe(params?: string | core.$ZodCheckNumberFormatParams): this;
|
268
|
-
positive(params?: string | core.$ZodCheckGreaterThanParams): this;
|
269
|
-
nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
|
270
|
-
negative(params?: string | core.$ZodCheckLessThanParams): this;
|
271
|
-
nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
|
272
|
-
multipleOf(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
|
273
|
-
/** @deprecated Use `.multipleOf()` instead. */
|
274
|
-
step(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
|
275
|
-
/** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
|
276
|
-
finite(params?: unknown): this;
|
277
|
-
minValue: number | null;
|
278
|
-
maxValue: number | null;
|
279
|
-
/** @deprecated Check the `format` property instead. */
|
280
|
-
isInt: boolean;
|
281
|
-
/** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
|
282
|
-
isFinite: boolean;
|
283
|
-
format: string | null;
|
284
|
-
}
|
285
|
-
export interface ZodNumber extends _ZodNumber<core.$ZodNumberInternals<number>> {
|
286
|
-
}
|
287
|
-
export declare const ZodNumber: core.$constructor<ZodNumber>;
|
288
|
-
export declare function number(params?: string | core.$ZodNumberParams): ZodNumber;
|
289
|
-
export interface ZodNumberFormat extends ZodNumber {
|
290
|
-
_zod: core.$ZodNumberFormatInternals;
|
291
|
-
}
|
292
|
-
export declare const ZodNumberFormat: core.$constructor<ZodNumberFormat>;
|
293
|
-
export interface ZodInt extends ZodNumberFormat {
|
294
|
-
}
|
295
|
-
export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt;
|
296
|
-
export interface ZodFloat32 extends ZodNumberFormat {
|
297
|
-
}
|
298
|
-
export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32;
|
299
|
-
export interface ZodFloat64 extends ZodNumberFormat {
|
300
|
-
}
|
301
|
-
export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64;
|
302
|
-
export interface ZodInt32 extends ZodNumberFormat {
|
303
|
-
}
|
304
|
-
export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32;
|
305
|
-
export interface ZodUInt32 extends ZodNumberFormat {
|
306
|
-
}
|
307
|
-
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32;
|
308
|
-
export interface _ZodBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals> extends _ZodType<T> {
|
309
|
-
}
|
310
|
-
export interface ZodBoolean extends _ZodBoolean<core.$ZodBooleanInternals<boolean>> {
|
311
|
-
}
|
312
|
-
export declare const ZodBoolean: core.$constructor<ZodBoolean>;
|
313
|
-
export declare function boolean(params?: string | core.$ZodBooleanParams): ZodBoolean;
|
314
|
-
export interface _ZodBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInternals> extends _ZodType<T> {
|
315
|
-
gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
|
316
|
-
/** Alias of `.gte()` */
|
317
|
-
min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
|
318
|
-
gt(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
|
319
|
-
/** Alias of `.lte()` */
|
320
|
-
lte(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
|
321
|
-
max(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
|
322
|
-
lt(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
|
323
|
-
positive(params?: string | core.$ZodCheckGreaterThanParams): this;
|
324
|
-
negative(params?: string | core.$ZodCheckLessThanParams): this;
|
325
|
-
nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
|
326
|
-
nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
|
327
|
-
multipleOf(value: bigint, params?: string | core.$ZodCheckMultipleOfParams): this;
|
328
|
-
minValue: bigint | null;
|
329
|
-
maxValue: bigint | null;
|
330
|
-
format: string | null;
|
331
|
-
}
|
332
|
-
export interface ZodBigInt extends _ZodBigInt<core.$ZodBigIntInternals<bigint>> {
|
333
|
-
}
|
334
|
-
export declare const ZodBigInt: core.$constructor<ZodBigInt>;
|
335
|
-
export declare function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt;
|
336
|
-
export interface ZodBigIntFormat extends ZodBigInt {
|
337
|
-
_zod: core.$ZodBigIntFormatInternals;
|
338
|
-
}
|
339
|
-
export declare const ZodBigIntFormat: core.$constructor<ZodBigIntFormat>;
|
340
|
-
export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat;
|
341
|
-
export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat;
|
342
|
-
export interface ZodSymbol extends _ZodType<core.$ZodSymbolInternals> {
|
343
|
-
}
|
344
|
-
export declare const ZodSymbol: core.$constructor<ZodSymbol>;
|
345
|
-
export declare function symbol(params?: string | core.$ZodSymbolParams): ZodSymbol;
|
346
|
-
export interface ZodUndefined extends _ZodType<core.$ZodUndefinedInternals> {
|
347
|
-
}
|
348
|
-
export declare const ZodUndefined: core.$constructor<ZodUndefined>;
|
349
|
-
declare function _undefined(params?: string | core.$ZodUndefinedParams): ZodUndefined;
|
350
|
-
export { _undefined as undefined };
|
351
|
-
export interface ZodNull extends _ZodType<core.$ZodNullInternals> {
|
352
|
-
}
|
353
|
-
export declare const ZodNull: core.$constructor<ZodNull>;
|
354
|
-
declare function _null(params?: string | core.$ZodNullParams): ZodNull;
|
355
|
-
export { _null as null };
|
356
|
-
export interface ZodAny extends _ZodType<core.$ZodAnyInternals> {
|
357
|
-
}
|
358
|
-
export declare const ZodAny: core.$constructor<ZodAny>;
|
359
|
-
export declare function any(): ZodAny;
|
360
|
-
export interface ZodUnknown extends _ZodType<core.$ZodUnknownInternals> {
|
361
|
-
}
|
362
|
-
export declare const ZodUnknown: core.$constructor<ZodUnknown>;
|
363
|
-
export declare function unknown(): ZodUnknown;
|
364
|
-
export interface ZodNever extends _ZodType<core.$ZodNeverInternals> {
|
365
|
-
}
|
366
|
-
export declare const ZodNever: core.$constructor<ZodNever>;
|
367
|
-
export declare function never(params?: string | core.$ZodNeverParams): ZodNever;
|
368
|
-
export interface ZodVoid extends _ZodType<core.$ZodVoidInternals> {
|
369
|
-
}
|
370
|
-
export declare const ZodVoid: core.$constructor<ZodVoid>;
|
371
|
-
declare function _void(params?: string | core.$ZodVoidParams): ZodVoid;
|
372
|
-
export { _void as void };
|
373
|
-
export interface _ZodDate<T extends core.$ZodDateInternals = core.$ZodDateInternals> extends _ZodType<T> {
|
374
|
-
min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
|
375
|
-
max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
|
376
|
-
/** @deprecated Not recommended. */
|
377
|
-
minDate: Date | null;
|
378
|
-
/** @deprecated Not recommended. */
|
379
|
-
maxDate: Date | null;
|
380
|
-
}
|
381
|
-
export interface ZodDate extends _ZodDate<core.$ZodDateInternals<Date>> {
|
382
|
-
}
|
383
|
-
export declare const ZodDate: core.$constructor<ZodDate>;
|
384
|
-
export declare function date(params?: string | core.$ZodDateParams): ZodDate;
|
385
|
-
export interface ZodArray<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodArrayInternals<T>>, core.$ZodArray<T> {
|
386
|
-
element: T;
|
387
|
-
min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
|
388
|
-
nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
|
389
|
-
max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
|
390
|
-
length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
|
391
|
-
unwrap(): T;
|
392
|
-
}
|
393
|
-
export declare const ZodArray: core.$constructor<ZodArray>;
|
394
|
-
export declare function array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodArray<T>;
|
395
|
-
export declare function keyof<T extends ZodObject>(schema: T): ZodLiteral<keyof T["_zod"]["output"]>;
|
396
|
-
export interface ZodObject<
|
397
|
-
/** @ts-ignore Cast variance */
|
398
|
-
out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.$ZodObjectConfig = core.$ZodObjectConfig> extends _ZodType<core.$ZodObjectInternals<Shape, Config>>, core.$ZodObject<Shape, Config> {
|
399
|
-
shape: Shape;
|
400
|
-
keyof(): ZodEnum<util.ToEnum<keyof Shape & string>>;
|
401
|
-
/** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
|
402
|
-
catchall<T extends core.SomeType>(schema: T): ZodObject<Shape, core.$catchall<T>>;
|
403
|
-
/** @deprecated Use `z.looseObject()` or `.loose()` instead. */
|
404
|
-
passthrough(): ZodObject<Shape, core.$loose>;
|
405
|
-
/** Consider `z.looseObject(A.shape)` instead */
|
406
|
-
loose(): ZodObject<Shape, core.$loose>;
|
407
|
-
/** Consider `z.strictObject(A.shape)` instead */
|
408
|
-
strict(): ZodObject<Shape, core.$strict>;
|
409
|
-
/** This is the default behavior. This method call is likely unnecessary. */
|
410
|
-
strip(): ZodObject<Shape, core.$strict>;
|
411
|
-
extend<U extends core.$ZodLooseShape & Partial<Record<keyof Shape, core.SomeType>>>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
|
412
|
-
/**
|
413
|
-
* @deprecated Use spread syntax and the `.shape` property to combine two object schemas:
|
414
|
-
*
|
415
|
-
* ```ts
|
416
|
-
* const A = z.object({ a: z.string() });
|
417
|
-
* const B = z.object({ b: z.number() });
|
418
|
-
*
|
419
|
-
* const C = z.object({
|
420
|
-
* ...A.shape,
|
421
|
-
* ...B.shape
|
422
|
-
* });
|
423
|
-
* ```
|
424
|
-
*/
|
425
|
-
merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
|
426
|
-
pick<M extends util.Exactly<util.Mask<keyof Shape>, M>>(mask: M): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
427
|
-
omit<M extends util.Exactly<util.Mask<keyof Shape>, M>>(mask: M): ZodObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
428
|
-
partial(): ZodObject<{
|
429
|
-
[k in keyof Shape]: ZodOptional<Shape[k]>;
|
430
|
-
}, Config>;
|
431
|
-
partial<M extends util.Exactly<util.Mask<keyof Shape>, M>>(mask: M): ZodObject<{
|
432
|
-
[k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k];
|
433
|
-
}, Config>;
|
434
|
-
required(): ZodObject<{
|
435
|
-
[k in keyof Shape]: ZodNonOptional<Shape[k]>;
|
436
|
-
}, Config>;
|
437
|
-
required<M extends util.Exactly<util.Mask<keyof Shape>, M>>(mask: M): ZodObject<{
|
438
|
-
[k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
|
439
|
-
}, Config>;
|
440
|
-
}
|
441
|
-
export declare const ZodObject: core.$constructor<ZodObject>;
|
442
|
-
export declare function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(shape?: T, params?: string | core.$ZodObjectParams): ZodObject<util.Writeable<T>, core.$strip>;
|
443
|
-
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<T, core.$strict>;
|
444
|
-
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<T, core.$loose>;
|
445
|
-
export interface ZodUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[]> extends _ZodType<core.$ZodUnionInternals<T>>, core.$ZodUnion<T> {
|
446
|
-
options: T;
|
447
|
-
}
|
448
|
-
export declare const ZodUnion: core.$constructor<ZodUnion>;
|
449
|
-
export declare function union<const T extends readonly core.SomeType[]>(options: T, params?: string | core.$ZodUnionParams): ZodUnion<T>;
|
450
|
-
export interface ZodDiscriminatedUnion<Options extends readonly core.SomeType[] = readonly core.$ZodType[]> extends ZodUnion<Options>, core.$ZodDiscriminatedUnion<Options> {
|
451
|
-
_zod: core.$ZodDiscriminatedUnionInternals<Options>;
|
452
|
-
}
|
453
|
-
export declare const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion>;
|
454
|
-
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]]>(discriminator: string, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
|
455
|
-
export interface ZodIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodIntersectionInternals<A, B>>, core.$ZodIntersection<A, B> {
|
456
|
-
}
|
457
|
-
export declare const ZodIntersection: core.$constructor<ZodIntersection>;
|
458
|
-
export declare function intersection<T extends core.SomeType, U extends core.SomeType>(left: T, right: U): ZodIntersection<T, U>;
|
459
|
-
export interface ZodTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends core.SomeType | null = core.$ZodType | null> extends _ZodType<core.$ZodTupleInternals<T, Rest>>, core.$ZodTuple<T, Rest> {
|
460
|
-
rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
|
461
|
-
}
|
462
|
-
export declare const ZodTuple: core.$constructor<ZodTuple>;
|
463
|
-
export declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodTuple<T, null>;
|
464
|
-
export declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], Rest extends core.SomeType>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): ZodTuple<T, Rest>;
|
465
|
-
export declare function tuple(items: [], params?: string | core.$ZodTupleParams): ZodTuple<[], null>;
|
466
|
-
export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodRecordInternals<Key, Value>>, core.$ZodRecord<Key, Value> {
|
467
|
-
keyType: Key;
|
468
|
-
valueType: Value;
|
469
|
-
}
|
470
|
-
export declare const ZodRecord: core.$constructor<ZodRecord>;
|
471
|
-
export declare function record<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodRecord<Key, Value>;
|
472
|
-
export declare function partialRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodRecord<ZodUnion<[Key, ZodNever]>, Value>;
|
473
|
-
export interface ZodMap<Key extends core.SomeType = core.$ZodType, Value extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodMapInternals<Key, Value>>, core.$ZodMap<Key, Value> {
|
474
|
-
keyType: Key;
|
475
|
-
valueType: Value;
|
476
|
-
}
|
477
|
-
export declare const ZodMap: core.$constructor<ZodMap>;
|
478
|
-
export declare function map<Key extends core.SomeType, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams): ZodMap<Key, Value>;
|
479
|
-
export interface ZodSet<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodSetInternals<T>>, core.$ZodSet<T> {
|
480
|
-
min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
|
481
|
-
/** */
|
482
|
-
nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
|
483
|
-
max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
|
484
|
-
size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
|
485
|
-
}
|
486
|
-
export declare const ZodSet: core.$constructor<ZodSet>;
|
487
|
-
export declare function set<Value extends core.SomeType>(valueType: Value, params?: string | core.$ZodSetParams): ZodSet<Value>;
|
488
|
-
export interface ZodEnum<
|
489
|
-
/** @ts-ignore Cast variance */
|
490
|
-
out T extends util.EnumLike = util.EnumLike> extends _ZodType<core.$ZodEnumInternals<T>>, core.$ZodEnum<T> {
|
491
|
-
enum: T;
|
492
|
-
options: Array<T[keyof T]>;
|
493
|
-
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): ZodEnum<util.Flatten<Pick<T, U[number]>>>;
|
494
|
-
exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): ZodEnum<util.Flatten<Omit<T, U[number]>>>;
|
495
|
-
}
|
496
|
-
export declare const ZodEnum: core.$constructor<ZodEnum>;
|
497
|
-
declare function _enum<const T extends readonly string[]>(values: T, params?: string | core.$ZodEnumParams): ZodEnum<util.ToEnum<T[number]>>;
|
498
|
-
declare function _enum<const T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
|
499
|
-
export { _enum as enum };
|
500
|
-
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
501
|
-
*
|
502
|
-
* ```ts
|
503
|
-
* enum Colors { red, green, blue }
|
504
|
-
* z.enum(Colors);
|
505
|
-
* ```
|
506
|
-
*/
|
507
|
-
export declare function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
|
508
|
-
export interface ZodLiteral<T extends util.Primitive = util.Primitive> extends _ZodType<core.$ZodLiteralInternals<T>>, core.$ZodLiteral<T> {
|
509
|
-
values: Set<T>;
|
510
|
-
/** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
|
511
|
-
value: T;
|
512
|
-
}
|
513
|
-
export declare const ZodLiteral: core.$constructor<ZodLiteral>;
|
514
|
-
export declare function literal<const T extends ReadonlyArray<util.Literal>>(value: T, params?: string | core.$ZodLiteralParams): ZodLiteral<T[number]>;
|
515
|
-
export declare function literal<const T extends util.Literal>(value: T, params?: string | core.$ZodLiteralParams): ZodLiteral<T>;
|
516
|
-
export interface ZodFile extends _ZodType<core.$ZodFileInternals>, core.$ZodFile {
|
517
|
-
min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
|
518
|
-
max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
|
519
|
-
mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
|
520
|
-
}
|
521
|
-
export declare const ZodFile: core.$constructor<ZodFile>;
|
522
|
-
export declare function file(params?: string | core.$ZodFileParams): ZodFile;
|
523
|
-
export interface ZodTransform<O = unknown, I = unknown> extends _ZodType<core.$ZodTransformInternals<O, I>>, core.$ZodTransform<O, I> {
|
524
|
-
}
|
525
|
-
export declare const ZodTransform: core.$constructor<ZodTransform>;
|
526
|
-
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodTransform<Awaited<O>, I>;
|
527
|
-
export interface ZodOptional<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodOptionalInternals<T>>, core.$ZodOptional<T> {
|
528
|
-
unwrap(): T;
|
529
|
-
}
|
530
|
-
export declare const ZodOptional: core.$constructor<ZodOptional>;
|
531
|
-
export declare function optional<T extends core.SomeType>(innerType: T): ZodOptional<T>;
|
532
|
-
export interface ZodNullable<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodNullableInternals<T>>, core.$ZodNullable<T> {
|
533
|
-
unwrap(): T;
|
534
|
-
}
|
535
|
-
export declare const ZodNullable: core.$constructor<ZodNullable>;
|
536
|
-
export declare function nullable<T extends core.SomeType>(innerType: T): ZodNullable<T>;
|
537
|
-
export declare function nullish<T extends core.SomeType>(innerType: T): ZodOptional<ZodNullable<T>>;
|
538
|
-
export interface ZodDefault<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodDefaultInternals<T>>, core.$ZodDefault<T> {
|
539
|
-
unwrap(): T;
|
540
|
-
/** @deprecated Use `.unwrap()` instead. */
|
541
|
-
removeDefault(): T;
|
542
|
-
}
|
543
|
-
export declare const ZodDefault: core.$constructor<ZodDefault>;
|
544
|
-
export declare function _default<T extends core.SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): ZodDefault<T>;
|
545
|
-
export interface ZodPrefault<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPrefaultInternals<T>>, core.$ZodPrefault<T> {
|
546
|
-
unwrap(): T;
|
547
|
-
}
|
548
|
-
export declare const ZodPrefault: core.$constructor<ZodPrefault>;
|
549
|
-
export declare function prefault<T extends core.SomeType>(innerType: T, defaultValue: core.input<T> | (() => core.input<T>)): ZodPrefault<T>;
|
550
|
-
export interface ZodNonOptional<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodNonOptionalInternals<T>>, core.$ZodNonOptional<T> {
|
551
|
-
unwrap(): T;
|
552
|
-
}
|
553
|
-
export declare const ZodNonOptional: core.$constructor<ZodNonOptional>;
|
554
|
-
export declare function nonoptional<T extends core.SomeType>(innerType: T, params?: string | core.$ZodNonOptionalParams): ZodNonOptional<T>;
|
555
|
-
export interface ZodSuccess<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodSuccessInternals<T>>, core.$ZodSuccess<T> {
|
556
|
-
unwrap(): T;
|
557
|
-
}
|
558
|
-
export declare const ZodSuccess: core.$constructor<ZodSuccess>;
|
559
|
-
export declare function success<T extends core.SomeType>(innerType: T): ZodSuccess<T>;
|
560
|
-
export interface ZodCatch<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodCatchInternals<T>>, core.$ZodCatch<T> {
|
561
|
-
unwrap(): T;
|
562
|
-
/** @deprecated Use `.unwrap()` instead. */
|
563
|
-
removeCatch(): T;
|
564
|
-
}
|
565
|
-
export declare const ZodCatch: core.$constructor<ZodCatch>;
|
566
|
-
declare function _catch<T extends core.SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)): ZodCatch<T>;
|
567
|
-
export { _catch as catch };
|
568
|
-
export interface ZodNaN extends _ZodType<core.$ZodNaNInternals>, core.$ZodNaN {
|
569
|
-
}
|
570
|
-
export declare const ZodNaN: core.$constructor<ZodNaN>;
|
571
|
-
export declare function nan(params?: string | core.$ZodNaNParams): ZodNaN;
|
572
|
-
export interface ZodPipe<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPipeInternals<A, B>>, core.$ZodPipe<A, B> {
|
573
|
-
in: A;
|
574
|
-
out: B;
|
575
|
-
}
|
576
|
-
export declare const ZodPipe: core.$constructor<ZodPipe>;
|
577
|
-
export declare function pipe<const A extends core.SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodPipe<A, B>;
|
578
|
-
export interface ZodReadonly<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodReadonlyInternals<T>>, core.$ZodReadonly<T> {
|
579
|
-
}
|
580
|
-
export declare const ZodReadonly: core.$constructor<ZodReadonly>;
|
581
|
-
export declare function readonly<T extends core.SomeType>(innerType: T): ZodReadonly<T>;
|
582
|
-
export interface ZodTemplateLiteral<Template extends string = string> extends _ZodType<core.$ZodTemplateLiteralInternals<Template>>, core.$ZodTemplateLiteral<Template> {
|
583
|
-
}
|
584
|
-
export declare const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral>;
|
585
|
-
export declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
|
586
|
-
export interface ZodLazy<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodLazyInternals<T>>, core.$ZodLazy<T> {
|
587
|
-
unwrap(): T;
|
588
|
-
}
|
589
|
-
export declare const ZodLazy: core.$constructor<ZodLazy>;
|
590
|
-
export declare function lazy<T extends core.SomeType>(getter: () => T): ZodLazy<T>;
|
591
|
-
export interface ZodPromise<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPromiseInternals<T>>, core.$ZodPromise<T> {
|
592
|
-
unwrap(): T;
|
593
|
-
}
|
594
|
-
export declare const ZodPromise: core.$constructor<ZodPromise>;
|
595
|
-
export declare function promise<T extends core.SomeType>(innerType: T): ZodPromise<T>;
|
596
|
-
export interface ZodCustom<O = unknown, I = unknown> extends _ZodType<core.$ZodCustomInternals<O, I>>, core.$ZodCustom<O, I> {
|
597
|
-
}
|
598
|
-
export declare const ZodCustom: core.$constructor<ZodCustom>;
|
599
|
-
export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
|
600
|
-
export declare function custom<O>(fn?: (data: unknown) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodCustom<O, O>;
|
601
|
-
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
|
602
|
-
export declare function superRefine<T>(fn: (arg: T, payload: RefinementCtx<T>) => void | Promise<void>, params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
|
603
|
-
type ZodInstanceOfParams = core.Params<ZodCustom, core.$ZodIssueCustom, "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path">;
|
604
|
-
declare function _instanceof<T extends typeof util.Class>(cls: T, params?: ZodInstanceOfParams): ZodCustom<InstanceType<T>, InstanceType<T>>;
|
605
|
-
export { _instanceof as instanceof };
|
606
|
-
export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodPipe<ZodPipe<ZodString, ZodTransform<boolean, string>>, ZodBoolean>;
|
607
|
-
type _ZodJSONSchema = ZodUnion<[
|
608
|
-
ZodString,
|
609
|
-
ZodNumber,
|
610
|
-
ZodBoolean,
|
611
|
-
ZodNull,
|
612
|
-
ZodArray<ZodJSONSchema>,
|
613
|
-
ZodRecord<ZodString, ZodJSONSchema>
|
614
|
-
]>;
|
615
|
-
type _ZodJSONSchemaInternals = _ZodJSONSchema["_zod"];
|
616
|
-
export interface ZodJSONSchemaInternals extends _ZodJSONSchemaInternals {
|
617
|
-
output: util.JSONType;
|
618
|
-
input: util.JSONType;
|
619
|
-
}
|
620
|
-
export interface ZodJSONSchema extends _ZodJSONSchema {
|
621
|
-
_zod: ZodJSONSchemaInternals;
|
622
|
-
}
|
623
|
-
export declare function json(params?: string | core.$ZodCustomParams): ZodJSONSchema;
|
624
|
-
export declare function preprocess<A, U extends core.SomeType, B = unknown>(fn: (arg: B, ctx: RefinementCtx) => A, schema: U): ZodPipe<ZodTransform<A, B>, U>;
|