@rspack/core 1.3.13 → 1.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/zod/dist/types/v3/types.d.ts +2 -2
- package/compiled/zod/dist/types/v4/classic/coerce.d.ts +5 -5
- package/compiled/zod/dist/types/v4/classic/external.d.ts +6 -1
- package/compiled/zod/dist/types/v4/classic/schemas.d.ts +88 -130
- package/compiled/zod/dist/types/v4/core/api.d.ts +2 -2
- package/compiled/zod/dist/types/v4/core/core.d.ts +11 -7
- package/compiled/zod/dist/types/v4/core/errors.d.ts +0 -1
- package/compiled/zod/dist/types/v4/core/function.d.ts +16 -11
- package/compiled/zod/dist/types/v4/core/regexes.d.ts +0 -1
- package/compiled/zod/dist/types/v4/core/registries.d.ts +6 -1
- package/compiled/zod/dist/types/v4/core/schemas.d.ts +144 -116
- package/compiled/zod/dist/types/v4/core/util.d.ts +5 -9
- package/compiled/zod/dist/types/v4/locales/ar.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/az.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/be.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/ca.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/cs.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/de.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/en.d.ts +0 -2
- package/compiled/zod/dist/types/v4/locales/es.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/fa.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/fi.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/{frCA.d.ts → fr-CA.d.ts} +0 -3
- package/compiled/zod/dist/types/v4/locales/fr.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/he.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/hu.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/id.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/index.d.ts +5 -2
- package/compiled/zod/dist/types/v4/locales/it.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/ja.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/{zh-tw.d.ts → kh.d.ts} +0 -3
- package/compiled/zod/dist/types/v4/locales/ko.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/mk.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/ms.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/nl.d.ts +4 -0
- package/compiled/zod/dist/types/v4/locales/no.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/ota.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/pl.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/pt.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/ru.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/sl.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/sv.d.ts +4 -0
- package/compiled/zod/dist/types/v4/locales/ta.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/th.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/tr.d.ts +0 -2
- package/compiled/zod/dist/types/v4/locales/ua.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/ur.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/vi.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/zh-CN.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/zh-TW.d.ts +4 -0
- package/compiled/zod/dist/types/v4/mini/external.d.ts +5 -1
- package/compiled/zod/dist/types/v4/mini/schemas.d.ts +39 -48
- package/compiled/zod/index.js +41 -63
- package/compiled/zod/package.json +1 -1
- package/compiled/zod/v3/index.d.ts +3 -1
- package/compiled/zod/v4/core/index.d.ts +1 -1
- package/compiled/zod/v4/index.d.ts +3 -1
- package/compiled/zod/v4/locales/index.d.ts +1 -1
- package/compiled/zod/v4-mini/index.d.ts +1 -1
- package/dist/ErrorHelpers.d.ts +0 -15
- package/dist/Module.d.ts +5 -1
- package/dist/ModuleTypeConstants.d.ts +0 -85
- package/dist/RspackError.d.ts +0 -3
- package/dist/builtin-loader/lightningcss/index.d.ts +23 -1
- package/dist/builtin-loader/swc/types.d.ts +289 -2426
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RstestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +1 -2
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/config/zod.d.ts +370 -370
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/index.js +51 -27
- package/dist/lib/AbstractMethodError.d.ts +0 -1
- package/dist/lib/CacheFacade.d.ts +0 -28
- package/dist/loader-runner/index.d.ts +1 -0
- package/dist/stats/statsFactoryUtils.d.ts +0 -4
- package/dist/util/cleverMerge.d.ts +0 -30
- package/dist/util/comparators.d.ts +0 -4
- package/dist/util/hash/wasm-hash.d.ts +0 -1
- package/dist/util/identifier.d.ts +0 -12
- package/dist/util/index.d.ts +1 -7
- package/dist/util/memoize.d.ts +0 -1
- package/dist/worker.js +5 -7
- package/package.json +4 -4
- package/dist/util/hash/BatchedHash.d.ts +0 -25
@@ -760,7 +760,7 @@ export type typecast<A, T> = A extends T ? A : never;
|
|
760
760
|
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
|
761
761
|
declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
|
762
762
|
export declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>, T[number]> {
|
763
|
-
|
763
|
+
_cache: Set<T[number]> | undefined;
|
764
764
|
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
765
765
|
get options(): T;
|
766
766
|
get enum(): Values<T>;
|
@@ -779,7 +779,7 @@ export type EnumLike = {
|
|
779
779
|
[nu: number]: string;
|
780
780
|
};
|
781
781
|
export declare class ZodNativeEnum<T extends EnumLike> extends ZodType<T[keyof T], ZodNativeEnumDef<T>, T[keyof T]> {
|
782
|
-
|
782
|
+
_cache: Set<T[keyof T]> | undefined;
|
783
783
|
_parse(input: ParseInput): ParseReturnType<T[keyof T]>;
|
784
784
|
get enum(): T;
|
785
785
|
static create: <Elements extends EnumLike>(values: Elements, params?: RawCreateParams) => ZodNativeEnum<Elements>;
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import * as core from "zod/v4/core";
|
2
2
|
import * as schemas from "./schemas.js";
|
3
|
-
export interface ZodCoercedString<T = unknown> extends schemas._ZodString<T
|
3
|
+
export interface ZodCoercedString<T = unknown> extends schemas._ZodString<core.$ZodStringInternals<T>> {
|
4
4
|
}
|
5
5
|
export declare function string<T = unknown>(params?: string | core.$ZodStringParams): ZodCoercedString<T>;
|
6
|
-
export interface ZodCoercedNumber<T = unknown> extends schemas._ZodNumber<T
|
6
|
+
export interface ZodCoercedNumber<T = unknown> extends schemas._ZodNumber<core.$ZodNumberInternals<T>> {
|
7
7
|
}
|
8
8
|
export declare function number<T = unknown>(params?: string | core.$ZodNumberParams): ZodCoercedNumber<T>;
|
9
|
-
export interface ZodCoercedBoolean<T = unknown> extends schemas._ZodBoolean<T
|
9
|
+
export interface ZodCoercedBoolean<T = unknown> extends schemas._ZodBoolean<core.$ZodBooleanInternals<T>> {
|
10
10
|
}
|
11
11
|
export declare function boolean<T = unknown>(params?: string | core.$ZodBooleanParams): ZodCoercedBoolean<T>;
|
12
|
-
export interface ZodCoercedBigInt<T = unknown> extends schemas._ZodBigInt<T
|
12
|
+
export interface ZodCoercedBigInt<T = unknown> extends schemas._ZodBigInt<core.$ZodBigIntInternals<T>> {
|
13
13
|
}
|
14
14
|
export declare function bigint<T = unknown>(params?: string | core.$ZodBigIntParams): ZodCoercedBigInt<T>;
|
15
|
-
export interface ZodCoercedDate<T = unknown> extends schemas._ZodDate<T
|
15
|
+
export interface ZodCoercedDate<T = unknown> extends schemas._ZodDate<core.$ZodDateInternals<T>> {
|
16
16
|
}
|
17
17
|
export declare function date<T = unknown>(params?: string | core.$ZodDateParams): ZodCoercedDate<T>;
|
@@ -5,4 +5,9 @@ export * from "./errors.js";
|
|
5
5
|
export * from "./parse.js";
|
6
6
|
export * from "./compat.js";
|
7
7
|
export type { infer, output, input } from "zod/v4/core";
|
8
|
-
export { globalRegistry, type GlobalMeta, registry, config, function, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema,
|
8
|
+
export { globalRegistry, type GlobalMeta, registry, config, function, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, toJSONSchema, } from "zod/v4/core";
|
9
|
+
export * as locales from "../locales/index.js";
|
10
|
+
export { ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration } from "./iso.js";
|
11
|
+
export * as iso from "./iso.js";
|
12
|
+
export type { ZodCoercedString, ZodCoercedNumber, ZodCoercedBigInt, ZodCoercedBoolean, ZodCoercedDate, } from "./coerce.js";
|
13
|
+
export * as coerce from "./coerce.js";
|
@@ -1,19 +1,20 @@
|
|
1
1
|
import * as core from "zod/v4/core";
|
2
2
|
import { util } from "zod/v4/core";
|
3
3
|
import * as parse from "./parse.js";
|
4
|
-
export * as iso from "./iso.js";
|
5
|
-
export * as coerce from "./coerce.js";
|
6
4
|
export interface RefinementCtx<T = unknown> extends core.ParsePayload<T> {
|
7
5
|
addIssue(arg: string | core.$ZodRawIssue | Partial<core.$ZodIssueCustom>): void;
|
8
6
|
}
|
9
|
-
export interface ZodType<out Output = unknown, out Input = unknown> extends core.$ZodType<Output, Input> {
|
10
|
-
def:
|
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"];
|
11
10
|
/** @deprecated Use `.def` instead. */
|
12
|
-
_def:
|
13
|
-
|
14
|
-
|
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"];
|
15
16
|
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
|
16
|
-
clone(def?:
|
17
|
+
clone(def?: Internals["def"], params?: {
|
17
18
|
parent: boolean;
|
18
19
|
}): this;
|
19
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;
|
@@ -25,7 +26,7 @@ export interface ZodType<out Output = unknown, out Input = unknown> extends core
|
|
25
26
|
spa: (data: unknown, params?: core.ParseContext<core.$ZodIssue>) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
|
26
27
|
refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
|
27
28
|
/** @deprecated Use `.check()` instead. */
|
28
|
-
superRefine(refinement: (arg: core.output<this>, ctx: RefinementCtx<this
|
29
|
+
superRefine(refinement: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => void | Promise<void>): this;
|
29
30
|
overwrite(fn: (x: core.output<this>) => core.output<this>): this;
|
30
31
|
optional(): ZodOptional<this>;
|
31
32
|
nonoptional(params?: string | core.$ZodNonOptionalParams): ZodNonOptional<this>;
|
@@ -36,12 +37,12 @@ export interface ZodType<out Output = unknown, out Input = unknown> extends core
|
|
36
37
|
prefault(def: () => core.input<this>): ZodPrefault<this>;
|
37
38
|
prefault(def: core.input<this>): ZodPrefault<this>;
|
38
39
|
array(): ZodArray<this>;
|
39
|
-
or<T extends core
|
40
|
-
and<T extends core
|
40
|
+
or<T extends core.SomeType>(option: T): ZodUnion<[this, T]>;
|
41
|
+
and<T extends core.SomeType>(incoming: T): ZodIntersection<this, T>;
|
41
42
|
transform<NewOut>(transform: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
|
42
43
|
catch(def: core.output<this>): ZodCatch<this>;
|
43
44
|
catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
|
44
|
-
pipe<T extends core.$ZodType<any, this
|
45
|
+
pipe<T extends core.$ZodType<any, core.output<this>>>(target: T | core.$ZodType<any, core.output<this>>): ZodPipe<this, T>;
|
45
46
|
readonly(): ZodReadonly<this>;
|
46
47
|
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
|
47
48
|
describe(description: string): this;
|
@@ -68,9 +69,10 @@ export interface ZodType<out Output = unknown, out Input = unknown> extends core
|
|
68
69
|
*/
|
69
70
|
isNullable(): boolean;
|
70
71
|
}
|
72
|
+
export interface _ZodType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodType<any, any, Internals> {
|
73
|
+
}
|
71
74
|
export declare const ZodType: core.$constructor<ZodType>;
|
72
|
-
export interface _ZodString<
|
73
|
-
_zod: core.$ZodStringInternals<Input>;
|
75
|
+
export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>> extends _ZodType<T> {
|
74
76
|
format: string | null;
|
75
77
|
minLength: number | null;
|
76
78
|
maxLength: number | null;
|
@@ -91,7 +93,7 @@ export interface _ZodString<Input = unknown> extends ZodType {
|
|
91
93
|
}
|
92
94
|
/** @internal */
|
93
95
|
export declare const _ZodString: core.$constructor<_ZodString>;
|
94
|
-
export interface ZodString extends _ZodString<string
|
96
|
+
export interface ZodString extends _ZodString<core.$ZodStringInternals<string>> {
|
95
97
|
/** @deprecated Use `z.email()` instead. */
|
96
98
|
email(params?: string | core.$ZodCheckEmailParams): this;
|
97
99
|
/** @deprecated Use `z.url()` instead. */
|
@@ -149,8 +151,7 @@ export interface ZodString extends _ZodString<string> {
|
|
149
151
|
}
|
150
152
|
export declare const ZodString: core.$constructor<ZodString>;
|
151
153
|
export declare function string(params?: string | core.$ZodStringParams): ZodString;
|
152
|
-
export interface ZodStringFormat<Format extends core.$ZodStringFormats = core.$ZodStringFormats> extends _ZodString {
|
153
|
-
_zod: core.$ZodStringFormatInternals<Format>;
|
154
|
+
export interface ZodStringFormat<Format extends core.$ZodStringFormats = core.$ZodStringFormats> extends _ZodString<core.$ZodStringFormatInternals<Format>> {
|
154
155
|
}
|
155
156
|
export declare const ZodStringFormat: core.$constructor<ZodStringFormat>;
|
156
157
|
export interface ZodEmail extends ZodStringFormat<"email"> {
|
@@ -251,8 +252,7 @@ export interface ZodJWT extends ZodStringFormat<"jwt"> {
|
|
251
252
|
}
|
252
253
|
export declare const ZodJWT: core.$constructor<ZodJWT>;
|
253
254
|
export declare function jwt(params?: string | core.$ZodJWTParams): ZodJWT;
|
254
|
-
export interface _ZodNumber<
|
255
|
-
_zod: core.$ZodNumberInternals<Input>;
|
255
|
+
export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals> extends _ZodType<Internals> {
|
256
256
|
gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
257
257
|
/** Identical to .min() */
|
258
258
|
gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
@@ -282,7 +282,7 @@ export interface _ZodNumber<Input = unknown> extends ZodType {
|
|
282
282
|
isFinite: boolean;
|
283
283
|
format: string | null;
|
284
284
|
}
|
285
|
-
export interface ZodNumber extends _ZodNumber<number
|
285
|
+
export interface ZodNumber extends _ZodNumber<core.$ZodNumberInternals<number>> {
|
286
286
|
}
|
287
287
|
export declare const ZodNumber: core.$constructor<ZodNumber>;
|
288
288
|
export declare function number(params?: string | core.$ZodNumberParams): ZodNumber;
|
@@ -305,15 +305,13 @@ export declare function int32(params?: string | core.$ZodCheckNumberFormatParams
|
|
305
305
|
export interface ZodUInt32 extends ZodNumberFormat {
|
306
306
|
}
|
307
307
|
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32;
|
308
|
-
export interface _ZodBoolean<T =
|
309
|
-
_zod: core.$ZodBooleanInternals<T>;
|
308
|
+
export interface _ZodBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals> extends _ZodType<T> {
|
310
309
|
}
|
311
|
-
export interface ZodBoolean extends _ZodBoolean<boolean
|
310
|
+
export interface ZodBoolean extends _ZodBoolean<core.$ZodBooleanInternals<boolean>> {
|
312
311
|
}
|
313
312
|
export declare const ZodBoolean: core.$constructor<ZodBoolean>;
|
314
313
|
export declare function boolean(params?: string | core.$ZodBooleanParams): ZodBoolean;
|
315
|
-
export interface _ZodBigInt<T =
|
316
|
-
_zod: core.$ZodBigIntInternals<T>;
|
314
|
+
export interface _ZodBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInternals> extends _ZodType<T> {
|
317
315
|
gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
|
318
316
|
/** Alias of `.gte()` */
|
319
317
|
min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
|
@@ -331,7 +329,7 @@ export interface _ZodBigInt<T = unknown> extends ZodType {
|
|
331
329
|
maxValue: bigint | null;
|
332
330
|
format: string | null;
|
333
331
|
}
|
334
|
-
export interface ZodBigInt extends _ZodBigInt<bigint
|
332
|
+
export interface ZodBigInt extends _ZodBigInt<core.$ZodBigIntInternals<bigint>> {
|
335
333
|
}
|
336
334
|
export declare const ZodBigInt: core.$constructor<ZodBigInt>;
|
337
335
|
export declare function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt;
|
@@ -341,46 +339,38 @@ export interface ZodBigIntFormat extends ZodBigInt {
|
|
341
339
|
export declare const ZodBigIntFormat: core.$constructor<ZodBigIntFormat>;
|
342
340
|
export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat;
|
343
341
|
export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat;
|
344
|
-
export interface ZodSymbol extends
|
345
|
-
_zod: core.$ZodSymbolInternals;
|
342
|
+
export interface ZodSymbol extends _ZodType<core.$ZodSymbolInternals> {
|
346
343
|
}
|
347
344
|
export declare const ZodSymbol: core.$constructor<ZodSymbol>;
|
348
345
|
export declare function symbol(params?: string | core.$ZodSymbolParams): ZodSymbol;
|
349
|
-
export interface ZodUndefined extends
|
350
|
-
_zod: core.$ZodUndefinedInternals;
|
346
|
+
export interface ZodUndefined extends _ZodType<core.$ZodUndefinedInternals> {
|
351
347
|
}
|
352
348
|
export declare const ZodUndefined: core.$constructor<ZodUndefined>;
|
353
349
|
declare function _undefined(params?: string | core.$ZodUndefinedParams): ZodUndefined;
|
354
350
|
export { _undefined as undefined };
|
355
|
-
export interface ZodNull extends
|
356
|
-
_zod: core.$ZodNullInternals;
|
351
|
+
export interface ZodNull extends _ZodType<core.$ZodNullInternals> {
|
357
352
|
}
|
358
353
|
export declare const ZodNull: core.$constructor<ZodNull>;
|
359
354
|
declare function _null(params?: string | core.$ZodNullParams): ZodNull;
|
360
355
|
export { _null as null };
|
361
|
-
export interface ZodAny extends
|
362
|
-
_zod: core.$ZodAnyInternals;
|
356
|
+
export interface ZodAny extends _ZodType<core.$ZodAnyInternals> {
|
363
357
|
}
|
364
358
|
export declare const ZodAny: core.$constructor<ZodAny>;
|
365
359
|
export declare function any(): ZodAny;
|
366
|
-
export interface ZodUnknown extends
|
367
|
-
_zod: core.$ZodUnknownInternals;
|
360
|
+
export interface ZodUnknown extends _ZodType<core.$ZodUnknownInternals> {
|
368
361
|
}
|
369
362
|
export declare const ZodUnknown: core.$constructor<ZodUnknown>;
|
370
363
|
export declare function unknown(): ZodUnknown;
|
371
|
-
export interface ZodNever extends
|
372
|
-
_zod: core.$ZodNeverInternals;
|
364
|
+
export interface ZodNever extends _ZodType<core.$ZodNeverInternals> {
|
373
365
|
}
|
374
366
|
export declare const ZodNever: core.$constructor<ZodNever>;
|
375
367
|
export declare function never(params?: string | core.$ZodNeverParams): ZodNever;
|
376
|
-
export interface ZodVoid extends
|
377
|
-
_zod: core.$ZodVoidInternals;
|
368
|
+
export interface ZodVoid extends _ZodType<core.$ZodVoidInternals> {
|
378
369
|
}
|
379
370
|
export declare const ZodVoid: core.$constructor<ZodVoid>;
|
380
371
|
declare function _void(params?: string | core.$ZodVoidParams): ZodVoid;
|
381
372
|
export { _void as void };
|
382
|
-
export interface _ZodDate<T =
|
383
|
-
_zod: core.$ZodDateInternals<T>;
|
373
|
+
export interface _ZodDate<T extends core.$ZodDateInternals = core.$ZodDateInternals> extends _ZodType<T> {
|
384
374
|
min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
|
385
375
|
max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
|
386
376
|
/** @deprecated Not recommended. */
|
@@ -388,12 +378,11 @@ export interface _ZodDate<T = unknown> extends ZodType {
|
|
388
378
|
/** @deprecated Not recommended. */
|
389
379
|
maxDate: Date | null;
|
390
380
|
}
|
391
|
-
export interface ZodDate extends _ZodDate<Date
|
381
|
+
export interface ZodDate extends _ZodDate<core.$ZodDateInternals<Date>> {
|
392
382
|
}
|
393
383
|
export declare const ZodDate: core.$constructor<ZodDate>;
|
394
384
|
export declare function date(params?: string | core.$ZodDateParams): ZodDate;
|
395
|
-
export interface ZodArray<T extends core
|
396
|
-
_zod: core.$ZodArrayInternals<T>;
|
385
|
+
export interface ZodArray<T extends core.SomeType = core.$ZodType> extends ZodType<any, any, core.$ZodArrayInternals<T>>, core.$ZodArray<T> {
|
397
386
|
element: T;
|
398
387
|
min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
|
399
388
|
nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
|
@@ -402,16 +391,15 @@ export interface ZodArray<T extends core.$ZodType = core.$ZodType> extends ZodTy
|
|
402
391
|
unwrap(): T;
|
403
392
|
}
|
404
393
|
export declare const ZodArray: core.$constructor<ZodArray>;
|
405
|
-
export declare function array<T extends core
|
394
|
+
export declare function array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodArray<T>;
|
406
395
|
export declare function keyof<T extends ZodObject>(schema: T): ZodLiteral<keyof T["_zod"]["output"]>;
|
407
396
|
export interface ZodObject<
|
408
397
|
/** @ts-ignore Cast variance */
|
409
|
-
out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.$ZodObjectConfig = core.$ZodObjectConfig> extends
|
410
|
-
_zod: core.$ZodObjectInternals<Shape, Config>;
|
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> {
|
411
399
|
shape: Shape;
|
412
400
|
keyof(): ZodEnum<util.ToEnum<keyof Shape & string>>;
|
413
401
|
/** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
|
414
|
-
catchall<T extends core
|
402
|
+
catchall<T extends core.SomeType>(schema: T): ZodObject<Shape, core.$catchall<T>>;
|
415
403
|
/** @deprecated Use `z.looseObject()` or `.loose()` instead. */
|
416
404
|
passthrough(): ZodObject<Shape, core.$loose>;
|
417
405
|
/** Consider `z.looseObject(A.shape)` instead */
|
@@ -420,7 +408,7 @@ out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.
|
|
420
408
|
strict(): ZodObject<Shape, core.$strict>;
|
421
409
|
/** This is the default behavior. This method call is likely unnecessary. */
|
422
410
|
strip(): ZodObject<Shape, core.$strict>;
|
423
|
-
extend<U extends core.$ZodLooseShape & Partial<Record<keyof Shape, core
|
411
|
+
extend<U extends core.$ZodLooseShape & Partial<Record<keyof Shape, core.SomeType>>>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
|
424
412
|
/**
|
425
413
|
* @deprecated Use spread syntax and the `.shape` property to combine two object schemas:
|
426
414
|
*
|
@@ -451,56 +439,44 @@ out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.
|
|
451
439
|
}, Config>;
|
452
440
|
}
|
453
441
|
export declare const ZodObject: core.$constructor<ZodObject>;
|
454
|
-
export declare function object<T extends core.$ZodLooseShape = Partial<Record<never, core
|
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>;
|
455
443
|
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<T, core.$strict>;
|
456
444
|
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<T, core.$loose>;
|
457
|
-
export interface ZodUnion<T extends readonly core
|
458
|
-
_zod: core.$ZodUnionInternals<T>;
|
445
|
+
export interface ZodUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[]> extends _ZodType<core.$ZodUnionInternals<T>>, core.$ZodUnion<T> {
|
459
446
|
options: T;
|
460
447
|
}
|
461
448
|
export declare const ZodUnion: core.$constructor<ZodUnion>;
|
462
|
-
export declare function union<const T extends readonly core
|
463
|
-
export interface ZodDiscriminatedUnion<Options extends readonly core
|
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> {
|
464
451
|
_zod: core.$ZodDiscriminatedUnionInternals<Options>;
|
465
452
|
}
|
466
453
|
export declare const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion>;
|
467
|
-
export
|
468
|
-
|
469
|
-
}
|
470
|
-
export interface $ZodTypeDiscriminable extends ZodType {
|
471
|
-
_zod: $ZodTypeDiscriminableInternals;
|
472
|
-
}
|
473
|
-
export declare function discriminatedUnion<Types extends readonly [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]]>(discriminator: string, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
|
474
|
-
export interface ZodIntersection<A extends core.$ZodType = core.$ZodType, B extends core.$ZodType = core.$ZodType> extends ZodType {
|
475
|
-
_zod: core.$ZodIntersectionInternals<A, B>;
|
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> {
|
476
456
|
}
|
477
457
|
export declare const ZodIntersection: core.$constructor<ZodIntersection>;
|
478
|
-
export declare function intersection<T extends core
|
479
|
-
export interface ZodTuple<T extends util.TupleItems =
|
480
|
-
|
481
|
-
rest<Rest extends core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
|
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>;
|
482
461
|
}
|
483
462
|
export declare const ZodTuple: core.$constructor<ZodTuple>;
|
484
|
-
export declare function tuple<T extends readonly [core
|
485
|
-
export declare function tuple<T extends readonly [core
|
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>;
|
486
465
|
export declare function tuple(items: [], params?: string | core.$ZodTupleParams): ZodTuple<[], null>;
|
487
|
-
export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends core
|
488
|
-
_zod: core.$ZodRecordInternals<Key, Value>;
|
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> {
|
489
467
|
keyType: Key;
|
490
468
|
valueType: Value;
|
491
469
|
}
|
492
470
|
export declare const ZodRecord: core.$constructor<ZodRecord>;
|
493
|
-
export declare function record<Key extends core.$ZodRecordKey, Value extends core
|
494
|
-
export declare function partialRecord<Key extends core.$ZodRecordKey, Value extends core
|
495
|
-
export interface ZodMap<Key extends core
|
496
|
-
_zod: core.$ZodMapInternals<Key, Value>;
|
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> {
|
497
474
|
keyType: Key;
|
498
475
|
valueType: Value;
|
499
476
|
}
|
500
477
|
export declare const ZodMap: core.$constructor<ZodMap>;
|
501
|
-
export declare function map<Key extends core
|
502
|
-
export interface ZodSet<T extends core
|
503
|
-
_zod: core.$ZodSetInternals<T>;
|
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<any, any, core.$ZodSetInternals<T>>, core.$ZodSet<T> {
|
504
480
|
min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
|
505
481
|
/** */
|
506
482
|
nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
|
@@ -508,9 +484,8 @@ export interface ZodSet<T extends core.$ZodType = core.$ZodType> extends ZodType
|
|
508
484
|
size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
|
509
485
|
}
|
510
486
|
export declare const ZodSet: core.$constructor<ZodSet>;
|
511
|
-
export declare function set<Value extends core
|
512
|
-
export interface ZodEnum<T extends util.EnumLike = util.EnumLike> extends
|
513
|
-
_zod: core.$ZodEnumInternals<T>;
|
487
|
+
export declare function set<Value extends core.SomeType>(valueType: Value, params?: string | core.$ZodSetParams): ZodSet<Value>;
|
488
|
+
export interface ZodEnum<out T extends util.EnumLike = util.EnumLike> extends _ZodType<core.$ZodEnumInternals<T>>, core.$ZodEnum<T> {
|
514
489
|
enum: T;
|
515
490
|
options: Array<T[keyof T]>;
|
516
491
|
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): ZodEnum<util.Flatten<Pick<T, U[number]>>>;
|
@@ -528,8 +503,7 @@ export { _enum as enum };
|
|
528
503
|
* ```
|
529
504
|
*/
|
530
505
|
export declare function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
|
531
|
-
export interface ZodLiteral<T extends util.Primitive = util.Primitive> extends
|
532
|
-
_zod: core.$ZodLiteralInternals<T>;
|
506
|
+
export interface ZodLiteral<T extends util.Primitive = util.Primitive> extends _ZodType<core.$ZodLiteralInternals<T>>, core.$ZodLiteral<T> {
|
533
507
|
values: Set<T>;
|
534
508
|
/** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
|
535
509
|
value: T;
|
@@ -537,103 +511,87 @@ export interface ZodLiteral<T extends util.Primitive = util.Primitive> extends Z
|
|
537
511
|
export declare const ZodLiteral: core.$constructor<ZodLiteral>;
|
538
512
|
export declare function literal<const T extends Array<util.Literal>>(value: T, params?: string | core.$ZodLiteralParams): ZodLiteral<T[number]>;
|
539
513
|
export declare function literal<const T extends util.Literal>(value: T, params?: string | core.$ZodLiteralParams): ZodLiteral<T>;
|
540
|
-
export interface ZodFile extends
|
541
|
-
_zod: core.$ZodFileInternals;
|
514
|
+
export interface ZodFile extends _ZodType<core.$ZodFileInternals>, core.$ZodFile {
|
542
515
|
min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
|
543
516
|
max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
|
544
|
-
mime(types: Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
|
517
|
+
mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
|
545
518
|
}
|
546
519
|
export declare const ZodFile: core.$constructor<ZodFile>;
|
547
520
|
export declare function file(params?: string | core.$ZodFileParams): ZodFile;
|
548
|
-
export interface ZodTransform<O = unknown, I = unknown> extends
|
549
|
-
_zod: core.$ZodTransformInternals<O, I>;
|
521
|
+
export interface ZodTransform<O = unknown, I = unknown> extends _ZodType<core.$ZodTransformInternals<O, I>>, core.$ZodTransform<O, I> {
|
550
522
|
}
|
551
523
|
export declare const ZodTransform: core.$constructor<ZodTransform>;
|
552
524
|
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodTransform<Awaited<O>, I>;
|
553
|
-
export interface ZodOptional<T extends core
|
554
|
-
_zod: core.$ZodOptionalInternals<T>;
|
525
|
+
export interface ZodOptional<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodOptionalInternals<T>>, core.$ZodOptional<T> {
|
555
526
|
unwrap(): T;
|
556
527
|
}
|
557
528
|
export declare const ZodOptional: core.$constructor<ZodOptional>;
|
558
|
-
export declare function optional<T extends core
|
559
|
-
export interface ZodNullable<T extends core
|
560
|
-
_zod: core.$ZodNullableInternals<T>;
|
529
|
+
export declare function optional<T extends core.SomeType>(innerType: T): ZodOptional<T>;
|
530
|
+
export interface ZodNullable<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodNullableInternals<T>>, core.$ZodNullable<T> {
|
561
531
|
unwrap(): T;
|
562
532
|
}
|
563
533
|
export declare const ZodNullable: core.$constructor<ZodNullable>;
|
564
|
-
export declare function nullable<T extends core
|
565
|
-
export declare function nullish<T extends core
|
566
|
-
export interface ZodDefault<T extends core
|
567
|
-
_zod: core.$ZodDefaultInternals<T>;
|
534
|
+
export declare function nullable<T extends core.SomeType>(innerType: T): ZodNullable<T>;
|
535
|
+
export declare function nullish<T extends core.SomeType>(innerType: T): ZodOptional<ZodNullable<T>>;
|
536
|
+
export interface ZodDefault<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodDefaultInternals<T>>, core.$ZodDefault<T> {
|
568
537
|
unwrap(): T;
|
569
538
|
/** @deprecated Use `.unwrap()` instead. */
|
570
539
|
removeDefault(): T;
|
571
540
|
}
|
572
541
|
export declare const ZodDefault: core.$constructor<ZodDefault>;
|
573
|
-
export declare function _default<T extends core
|
574
|
-
export interface ZodPrefault<T extends core
|
575
|
-
_zod: core.$ZodPrefaultInternals<T>;
|
542
|
+
export declare function _default<T extends core.SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): ZodDefault<T>;
|
543
|
+
export interface ZodPrefault<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPrefaultInternals<T>>, core.$ZodPrefault<T> {
|
576
544
|
unwrap(): T;
|
577
545
|
}
|
578
546
|
export declare const ZodPrefault: core.$constructor<ZodPrefault>;
|
579
|
-
export declare function prefault<T extends core
|
580
|
-
export interface ZodNonOptional<T extends core
|
581
|
-
_zod: core.$ZodNonOptionalInternals<T>;
|
547
|
+
export declare function prefault<T extends core.SomeType>(innerType: T, defaultValue: core.input<T> | (() => core.input<T>)): ZodPrefault<T>;
|
548
|
+
export interface ZodNonOptional<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodNonOptionalInternals<T>>, core.$ZodNonOptional<T> {
|
582
549
|
unwrap(): T;
|
583
550
|
}
|
584
551
|
export declare const ZodNonOptional: core.$constructor<ZodNonOptional>;
|
585
|
-
export declare function nonoptional<T extends core
|
586
|
-
export interface ZodSuccess<T extends core
|
587
|
-
_zod: core.$ZodSuccessInternals<T>;
|
552
|
+
export declare function nonoptional<T extends core.SomeType>(innerType: T, params?: string | core.$ZodNonOptionalParams): ZodNonOptional<T>;
|
553
|
+
export interface ZodSuccess<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodSuccessInternals<T>>, core.$ZodSuccess<T> {
|
588
554
|
unwrap(): T;
|
589
555
|
}
|
590
556
|
export declare const ZodSuccess: core.$constructor<ZodSuccess>;
|
591
|
-
export declare function success<T extends core
|
592
|
-
export interface ZodCatch<T extends core
|
593
|
-
_zod: core.$ZodCatchInternals<T>;
|
557
|
+
export declare function success<T extends core.SomeType>(innerType: T): ZodSuccess<T>;
|
558
|
+
export interface ZodCatch<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodCatchInternals<T>>, core.$ZodCatch<T> {
|
594
559
|
unwrap(): T;
|
595
560
|
/** @deprecated Use `.unwrap()` instead. */
|
596
561
|
removeCatch(): T;
|
597
562
|
}
|
598
563
|
export declare const ZodCatch: core.$constructor<ZodCatch>;
|
599
|
-
declare function _catch<T extends core
|
564
|
+
declare function _catch<T extends core.SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)): ZodCatch<T>;
|
600
565
|
export { _catch as catch };
|
601
|
-
export interface ZodNaN extends
|
602
|
-
_zod: core.$ZodNaNInternals;
|
566
|
+
export interface ZodNaN extends _ZodType<core.$ZodNaNInternals>, core.$ZodNaN {
|
603
567
|
}
|
604
568
|
export declare const ZodNaN: core.$constructor<ZodNaN>;
|
605
569
|
export declare function nan(params?: string | core.$ZodNaNParams): ZodNaN;
|
606
|
-
export interface ZodPipe<A extends core
|
607
|
-
_zod: core.$ZodPipeInternals<A, B>;
|
570
|
+
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> {
|
608
571
|
in: A;
|
609
572
|
out: B;
|
610
573
|
}
|
611
574
|
export declare const ZodPipe: core.$constructor<ZodPipe>;
|
612
|
-
export declare function pipe<const A extends core
|
613
|
-
export interface ZodReadonly<T extends core
|
614
|
-
_zod: core.$ZodReadonlyInternals<T>;
|
575
|
+
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>;
|
576
|
+
export interface ZodReadonly<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodReadonlyInternals<T>>, core.$ZodReadonly<T> {
|
615
577
|
}
|
616
578
|
export declare const ZodReadonly: core.$constructor<ZodReadonly>;
|
617
|
-
export declare function readonly<T extends core
|
618
|
-
export interface ZodTemplateLiteral<Template extends string = string> extends
|
619
|
-
_zod: core.$ZodTemplateLiteralInternals<Template>;
|
579
|
+
export declare function readonly<T extends core.SomeType>(innerType: T): ZodReadonly<T>;
|
580
|
+
export interface ZodTemplateLiteral<Template extends string = string> extends _ZodType<core.$ZodTemplateLiteralInternals<Template>>, core.$ZodTemplateLiteral<Template> {
|
620
581
|
}
|
621
582
|
export declare const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral>;
|
622
583
|
export declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
|
623
|
-
export interface ZodLazy<T extends core
|
624
|
-
_zod: core.$ZodLazyInternals<T>;
|
584
|
+
export interface ZodLazy<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodLazyInternals<T>>, core.$ZodLazy<T> {
|
625
585
|
unwrap(): T;
|
626
586
|
}
|
627
587
|
export declare const ZodLazy: core.$constructor<ZodLazy>;
|
628
|
-
export declare function lazy<T extends core
|
629
|
-
export interface ZodPromise<T extends core
|
630
|
-
_zod: core.$ZodPromiseInternals<T>;
|
588
|
+
export declare function lazy<T extends core.SomeType>(getter: () => T): ZodLazy<T>;
|
589
|
+
export interface ZodPromise<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPromiseInternals<T>>, core.$ZodPromise<T> {
|
631
590
|
unwrap(): T;
|
632
591
|
}
|
633
592
|
export declare const ZodPromise: core.$constructor<ZodPromise>;
|
634
|
-
export declare function promise<T extends core
|
635
|
-
export interface ZodCustom<O = unknown, I = unknown> extends
|
636
|
-
_zod: core.$ZodCustomInternals<O, I>;
|
593
|
+
export declare function promise<T extends core.SomeType>(innerType: T): ZodPromise<T>;
|
594
|
+
export interface ZodCustom<O = unknown, I = unknown> extends _ZodType<core.$ZodCustomInternals<O, I>>, core.$ZodCustom<O, I> {
|
637
595
|
}
|
638
596
|
export declare const ZodCustom: core.$constructor<ZodCustom>;
|
639
597
|
export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
|
@@ -658,4 +616,4 @@ export type ZodJSONSchema = ZodUnion<[
|
|
658
616
|
};
|
659
617
|
};
|
660
618
|
export declare function json(params?: string | core.$ZodCustomParams): ZodJSONSchema;
|
661
|
-
export declare function preprocess<A, U extends core
|
619
|
+
export declare function preprocess<A, U extends core.SomeType>(fn: (arg: unknown, ctx: RefinementCtx) => A, schema: U): ZodPipe<ZodTransform<A, unknown>, U>;
|
@@ -195,7 +195,7 @@ export type $ZodObjectParams = TypeParams<schemas.$ZodObject, "shape" | "catchal
|
|
195
195
|
export type $ZodUnionParams = TypeParams<schemas.$ZodUnion, "options">;
|
196
196
|
export declare function _union<const T extends readonly schemas.$ZodObject[]>(Class: util.SchemaClass<schemas.$ZodUnion>, options: T, params?: string | $ZodUnionParams): schemas.$ZodUnion<T>;
|
197
197
|
export interface $ZodTypeDiscriminableInternals extends schemas.$ZodTypeInternals {
|
198
|
-
|
198
|
+
propValues: util.PropValues;
|
199
199
|
}
|
200
200
|
export interface $ZodTypeDiscriminable extends schemas.$ZodType {
|
201
201
|
_zod: $ZodTypeDiscriminableInternals;
|
@@ -255,7 +255,7 @@ export type $ZodPromiseParams = TypeParams<schemas.$ZodPromise, "innerType">;
|
|
255
255
|
export declare function _promise<T extends schemas.$ZodObject>(Class: util.SchemaClass<schemas.$ZodPromise>, innerType: T): schemas.$ZodPromise<T>;
|
256
256
|
export type $ZodCustomParams = CheckTypeParams<schemas.$ZodCustom, "fn">;
|
257
257
|
export declare function _custom<O = unknown, I = O>(Class: util.SchemaClass<schemas.$ZodCustom>, fn: (data: O) => unknown, _params: string | $ZodCustomParams | undefined): schemas.$ZodCustom<O, I>;
|
258
|
-
export declare function _refine<
|
258
|
+
export declare function _refine<O = unknown, I = O>(Class: util.SchemaClass<schemas.$ZodCustom>, fn: (data: O) => unknown, _params: string | $ZodCustomParams | undefined): schemas.$ZodCustom<O, I>;
|
259
259
|
export interface $ZodStringBoolParams extends TypeParams {
|
260
260
|
truthy?: string[];
|
261
261
|
falsy?: string[];
|
@@ -20,16 +20,20 @@ export type $brand<T extends string | number | symbol = string | number | symbol
|
|
20
20
|
[k in T]: true;
|
21
21
|
};
|
22
22
|
};
|
23
|
-
export type $ZodBranded<T extends schemas
|
23
|
+
export type $ZodBranded<T extends schemas._$ZodType, Brand extends string | number | symbol> = T & Record<"_zod", Record<"output", output<T> & $brand<Brand>>>;
|
24
24
|
export declare class $ZodAsyncError extends Error {
|
25
25
|
constructor();
|
26
26
|
}
|
27
|
-
export type input<T
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
export type input<T> = T extends {
|
28
|
+
_zod: {
|
29
|
+
input: any;
|
30
|
+
};
|
31
|
+
} ? Required<T["_zod"]>["input"] : unknown;
|
32
|
+
export type output<T> = T extends {
|
33
|
+
_zod: {
|
34
|
+
output: any;
|
35
|
+
};
|
36
|
+
} ? Required<T["_zod"]>["output"] : unknown;
|
33
37
|
export type { output as infer };
|
34
38
|
export interface $ZodConfig {
|
35
39
|
/** Custom error map. Overrides `config().localeError`. */
|
@@ -132,7 +132,6 @@ type _FlattenedError<T, U = string> = {
|
|
132
132
|
[P in keyof T]?: U[];
|
133
133
|
};
|
134
134
|
};
|
135
|
-
/** @deprecated Use `z.treeifyError()` instead. */
|
136
135
|
export declare function flattenError<T>(error: $ZodError<T>): _FlattenedError<T>;
|
137
136
|
export declare function flattenError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): _FlattenedError<T, U>;
|
138
137
|
type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? {
|