@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.
Files changed (125) hide show
  1. package/README.md +1 -1
  2. package/dist/Module.d.ts +0 -1
  3. package/dist/builtin-loader/swc/pluginImport.d.ts +4 -26
  4. package/dist/builtin-loader/swc/types.d.ts +147 -2009
  5. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +2 -1
  6. package/dist/config/normalization.d.ts +2 -1
  7. package/dist/config/types.d.ts +14 -3
  8. package/dist/config/utils.d.ts +3 -17
  9. package/dist/config/zod.d.ts +682 -4538
  10. package/dist/exports.d.ts +2 -1
  11. package/dist/index.js +3707 -1144
  12. package/dist/util/validate.d.ts +1 -1
  13. package/package.json +4 -4
  14. package/compiled/enhanced-resolve/CachedInputFileSystem.d.ts +0 -0
  15. package/compiled/enhanced-resolve/CachedInputFileSystem.js +0 -664
  16. package/compiled/enhanced-resolve/index.d.ts +0 -1124
  17. package/compiled/enhanced-resolve/license +0 -20
  18. package/compiled/enhanced-resolve/package.json +0 -1
  19. package/compiled/zod/dist/types/index.d.ts +0 -3
  20. package/compiled/zod/dist/types/v3/ZodError.d.ts +0 -164
  21. package/compiled/zod/dist/types/v3/benchmarks/datetime.d.ts +0 -5
  22. package/compiled/zod/dist/types/v3/benchmarks/discriminatedUnion.d.ts +0 -5
  23. package/compiled/zod/dist/types/v3/benchmarks/index.d.ts +0 -1
  24. package/compiled/zod/dist/types/v3/benchmarks/ipv4.d.ts +0 -5
  25. package/compiled/zod/dist/types/v3/benchmarks/object.d.ts +0 -5
  26. package/compiled/zod/dist/types/v3/benchmarks/primitives.d.ts +0 -5
  27. package/compiled/zod/dist/types/v3/benchmarks/realworld.d.ts +0 -5
  28. package/compiled/zod/dist/types/v3/benchmarks/string.d.ts +0 -5
  29. package/compiled/zod/dist/types/v3/benchmarks/union.d.ts +0 -5
  30. package/compiled/zod/dist/types/v3/errors.d.ts +0 -5
  31. package/compiled/zod/dist/types/v3/external.d.ts +0 -6
  32. package/compiled/zod/dist/types/v3/helpers/enumUtil.d.ts +0 -8
  33. package/compiled/zod/dist/types/v3/helpers/errorUtil.d.ts +0 -9
  34. package/compiled/zod/dist/types/v3/helpers/parseUtil.d.ts +0 -78
  35. package/compiled/zod/dist/types/v3/helpers/partialUtil.d.ts +0 -8
  36. package/compiled/zod/dist/types/v3/helpers/typeAliases.d.ts +0 -2
  37. package/compiled/zod/dist/types/v3/helpers/util.d.ts +0 -85
  38. package/compiled/zod/dist/types/v3/index.d.ts +0 -4
  39. package/compiled/zod/dist/types/v3/locales/en.d.ts +0 -3
  40. package/compiled/zod/dist/types/v3/standard-schema.d.ts +0 -102
  41. package/compiled/zod/dist/types/v3/tests/Mocker.d.ts +0 -17
  42. package/compiled/zod/dist/types/v3/types.d.ts +0 -1031
  43. package/compiled/zod/dist/types/v4/classic/checks.d.ts +0 -1
  44. package/compiled/zod/dist/types/v4/classic/coerce.d.ts +0 -17
  45. package/compiled/zod/dist/types/v4/classic/compat.d.ts +0 -48
  46. package/compiled/zod/dist/types/v4/classic/errors.d.ts +0 -30
  47. package/compiled/zod/dist/types/v4/classic/external.d.ts +0 -13
  48. package/compiled/zod/dist/types/v4/classic/index.d.ts +0 -4
  49. package/compiled/zod/dist/types/v4/classic/iso.d.ts +0 -22
  50. package/compiled/zod/dist/types/v4/classic/parse.d.ts +0 -23
  51. package/compiled/zod/dist/types/v4/classic/schemas.d.ts +0 -624
  52. package/compiled/zod/dist/types/v4/core/api.d.ts +0 -274
  53. package/compiled/zod/dist/types/v4/core/checks.d.ts +0 -277
  54. package/compiled/zod/dist/types/v4/core/config.d.ts +0 -9
  55. package/compiled/zod/dist/types/v4/core/core.d.ts +0 -47
  56. package/compiled/zod/dist/types/v4/core/doc.d.ts +0 -14
  57. package/compiled/zod/dist/types/v4/core/errors.d.ts +0 -204
  58. package/compiled/zod/dist/types/v4/core/function.d.ts +0 -52
  59. package/compiled/zod/dist/types/v4/core/index.d.ts +0 -15
  60. package/compiled/zod/dist/types/v4/core/json-schema.d.ts +0 -100
  61. package/compiled/zod/dist/types/v4/core/parse.d.ts +0 -25
  62. package/compiled/zod/dist/types/v4/core/regexes.d.ts +0 -62
  63. package/compiled/zod/dist/types/v4/core/registries.d.ts +0 -39
  64. package/compiled/zod/dist/types/v4/core/schemas.d.ts +0 -1005
  65. package/compiled/zod/dist/types/v4/core/standard-schema.d.ts +0 -55
  66. package/compiled/zod/dist/types/v4/core/to-json-schema.d.ts +0 -84
  67. package/compiled/zod/dist/types/v4/core/util.d.ts +0 -182
  68. package/compiled/zod/dist/types/v4/core/versions.d.ts +0 -5
  69. package/compiled/zod/dist/types/v4/core/zsf.d.ts +0 -91
  70. package/compiled/zod/dist/types/v4/index.d.ts +0 -3
  71. package/compiled/zod/dist/types/v4/locales/ar.d.ts +0 -4
  72. package/compiled/zod/dist/types/v4/locales/az.d.ts +0 -4
  73. package/compiled/zod/dist/types/v4/locales/be.d.ts +0 -4
  74. package/compiled/zod/dist/types/v4/locales/ca.d.ts +0 -4
  75. package/compiled/zod/dist/types/v4/locales/cs.d.ts +0 -4
  76. package/compiled/zod/dist/types/v4/locales/de.d.ts +0 -4
  77. package/compiled/zod/dist/types/v4/locales/en.d.ts +0 -5
  78. package/compiled/zod/dist/types/v4/locales/es.d.ts +0 -4
  79. package/compiled/zod/dist/types/v4/locales/fa.d.ts +0 -4
  80. package/compiled/zod/dist/types/v4/locales/fi.d.ts +0 -4
  81. package/compiled/zod/dist/types/v4/locales/fr-CA.d.ts +0 -4
  82. package/compiled/zod/dist/types/v4/locales/fr.d.ts +0 -4
  83. package/compiled/zod/dist/types/v4/locales/he.d.ts +0 -4
  84. package/compiled/zod/dist/types/v4/locales/hu.d.ts +0 -4
  85. package/compiled/zod/dist/types/v4/locales/id.d.ts +0 -4
  86. package/compiled/zod/dist/types/v4/locales/index.d.ts +0 -38
  87. package/compiled/zod/dist/types/v4/locales/it.d.ts +0 -4
  88. package/compiled/zod/dist/types/v4/locales/ja.d.ts +0 -4
  89. package/compiled/zod/dist/types/v4/locales/kh.d.ts +0 -4
  90. package/compiled/zod/dist/types/v4/locales/ko.d.ts +0 -4
  91. package/compiled/zod/dist/types/v4/locales/mk.d.ts +0 -4
  92. package/compiled/zod/dist/types/v4/locales/ms.d.ts +0 -4
  93. package/compiled/zod/dist/types/v4/locales/nl.d.ts +0 -4
  94. package/compiled/zod/dist/types/v4/locales/no.d.ts +0 -4
  95. package/compiled/zod/dist/types/v4/locales/ota.d.ts +0 -4
  96. package/compiled/zod/dist/types/v4/locales/pl.d.ts +0 -4
  97. package/compiled/zod/dist/types/v4/locales/ps.d.ts +0 -4
  98. package/compiled/zod/dist/types/v4/locales/pt.d.ts +0 -4
  99. package/compiled/zod/dist/types/v4/locales/ru.d.ts +0 -4
  100. package/compiled/zod/dist/types/v4/locales/sl.d.ts +0 -4
  101. package/compiled/zod/dist/types/v4/locales/sv.d.ts +0 -4
  102. package/compiled/zod/dist/types/v4/locales/ta.d.ts +0 -4
  103. package/compiled/zod/dist/types/v4/locales/th.d.ts +0 -4
  104. package/compiled/zod/dist/types/v4/locales/tr.d.ts +0 -5
  105. package/compiled/zod/dist/types/v4/locales/ua.d.ts +0 -4
  106. package/compiled/zod/dist/types/v4/locales/ur.d.ts +0 -4
  107. package/compiled/zod/dist/types/v4/locales/vi.d.ts +0 -4
  108. package/compiled/zod/dist/types/v4/locales/zh-CN.d.ts +0 -4
  109. package/compiled/zod/dist/types/v4/locales/zh-TW.d.ts +0 -4
  110. package/compiled/zod/dist/types/v4/mini/checks.d.ts +0 -1
  111. package/compiled/zod/dist/types/v4/mini/coerce.d.ts +0 -7
  112. package/compiled/zod/dist/types/v4/mini/external.d.ts +0 -11
  113. package/compiled/zod/dist/types/v4/mini/index.d.ts +0 -3
  114. package/compiled/zod/dist/types/v4/mini/iso.d.ts +0 -22
  115. package/compiled/zod/dist/types/v4/mini/parse.d.ts +0 -1
  116. package/compiled/zod/dist/types/v4/mini/schemas.d.ts +0 -350
  117. package/compiled/zod/index.js +0 -4513
  118. package/compiled/zod/license +0 -21
  119. package/compiled/zod/package.json +0 -1
  120. package/compiled/zod/v3/index.d.ts +0 -3
  121. package/compiled/zod/v4/core/index.d.ts +0 -1
  122. package/compiled/zod/v4/index.d.ts +0 -3
  123. package/compiled/zod/v4/locales/en.d.ts +0 -2
  124. package/compiled/zod/v4/locales/index.d.ts +0 -1
  125. package/compiled/zod/v4-mini/index.d.ts +0 -1
@@ -1,20 +0,0 @@
1
- Copyright JS Foundation and other contributors
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- 'Software'), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1 +0,0 @@
1
- {"name":"enhanced-resolve","author":"Tobias Koppers @sokra","version":"5.18.1","license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -1,3 +0,0 @@
1
- import z3 from "./v3/index.js";
2
- export * from "./v3/index.js";
3
- export default z3;
@@ -1,164 +0,0 @@
1
- import type { Primitive } from "./helpers/typeAliases.js";
2
- import { util, type ZodParsedType } from "./helpers/util.js";
3
- import type { TypeOf, ZodType } from "./index.js";
4
- type allKeys<T> = T extends any ? keyof T : never;
5
- export type inferFlattenedErrors<T extends ZodType<any, any, any>, U = string> = typeToFlattenedError<TypeOf<T>, U>;
6
- export type typeToFlattenedError<T, U = string> = {
7
- formErrors: U[];
8
- fieldErrors: {
9
- [P in allKeys<T>]?: U[];
10
- };
11
- };
12
- export declare const ZodIssueCode: {
13
- invalid_type: "invalid_type";
14
- invalid_literal: "invalid_literal";
15
- custom: "custom";
16
- invalid_union: "invalid_union";
17
- invalid_union_discriminator: "invalid_union_discriminator";
18
- invalid_enum_value: "invalid_enum_value";
19
- unrecognized_keys: "unrecognized_keys";
20
- invalid_arguments: "invalid_arguments";
21
- invalid_return_type: "invalid_return_type";
22
- invalid_date: "invalid_date";
23
- invalid_string: "invalid_string";
24
- too_small: "too_small";
25
- too_big: "too_big";
26
- invalid_intersection_types: "invalid_intersection_types";
27
- not_multiple_of: "not_multiple_of";
28
- not_finite: "not_finite";
29
- };
30
- export type ZodIssueCode = keyof typeof ZodIssueCode;
31
- export type ZodIssueBase = {
32
- path: (string | number)[];
33
- message?: string | undefined;
34
- };
35
- export interface ZodInvalidTypeIssue extends ZodIssueBase {
36
- code: typeof ZodIssueCode.invalid_type;
37
- expected: ZodParsedType;
38
- received: ZodParsedType;
39
- }
40
- export interface ZodInvalidLiteralIssue extends ZodIssueBase {
41
- code: typeof ZodIssueCode.invalid_literal;
42
- expected: unknown;
43
- received: unknown;
44
- }
45
- export interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
46
- code: typeof ZodIssueCode.unrecognized_keys;
47
- keys: string[];
48
- }
49
- export interface ZodInvalidUnionIssue extends ZodIssueBase {
50
- code: typeof ZodIssueCode.invalid_union;
51
- unionErrors: ZodError[];
52
- }
53
- export interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
54
- code: typeof ZodIssueCode.invalid_union_discriminator;
55
- options: Primitive[];
56
- }
57
- export interface ZodInvalidEnumValueIssue extends ZodIssueBase {
58
- received: string | number;
59
- code: typeof ZodIssueCode.invalid_enum_value;
60
- options: (string | number)[];
61
- }
62
- export interface ZodInvalidArgumentsIssue extends ZodIssueBase {
63
- code: typeof ZodIssueCode.invalid_arguments;
64
- argumentsError: ZodError;
65
- }
66
- export interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
67
- code: typeof ZodIssueCode.invalid_return_type;
68
- returnTypeError: ZodError;
69
- }
70
- export interface ZodInvalidDateIssue extends ZodIssueBase {
71
- code: typeof ZodIssueCode.invalid_date;
72
- }
73
- export type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | {
74
- includes: string;
75
- position?: number | undefined;
76
- } | {
77
- startsWith: string;
78
- } | {
79
- endsWith: string;
80
- };
81
- export interface ZodInvalidStringIssue extends ZodIssueBase {
82
- code: typeof ZodIssueCode.invalid_string;
83
- validation: StringValidation;
84
- }
85
- export interface ZodTooSmallIssue extends ZodIssueBase {
86
- code: typeof ZodIssueCode.too_small;
87
- minimum: number | bigint;
88
- inclusive: boolean;
89
- exact?: boolean;
90
- type: "array" | "string" | "number" | "set" | "date" | "bigint";
91
- }
92
- export interface ZodTooBigIssue extends ZodIssueBase {
93
- code: typeof ZodIssueCode.too_big;
94
- maximum: number | bigint;
95
- inclusive: boolean;
96
- exact?: boolean;
97
- type: "array" | "string" | "number" | "set" | "date" | "bigint";
98
- }
99
- export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
100
- code: typeof ZodIssueCode.invalid_intersection_types;
101
- }
102
- export interface ZodNotMultipleOfIssue extends ZodIssueBase {
103
- code: typeof ZodIssueCode.not_multiple_of;
104
- multipleOf: number | bigint;
105
- }
106
- export interface ZodNotFiniteIssue extends ZodIssueBase {
107
- code: typeof ZodIssueCode.not_finite;
108
- }
109
- export interface ZodCustomIssue extends ZodIssueBase {
110
- code: typeof ZodIssueCode.custom;
111
- params?: {
112
- [k: string]: any;
113
- };
114
- }
115
- export type DenormalizedError = {
116
- [k: string]: DenormalizedError | string[];
117
- };
118
- export type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
119
- export type ZodIssue = ZodIssueOptionalMessage & {
120
- fatal?: boolean | undefined;
121
- message: string;
122
- };
123
- export declare const quotelessJson: (obj: any) => string;
124
- type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
125
- [K in keyof T]?: ZodFormattedError<T[K]>;
126
- } : T extends any[] ? {
127
- [k: number]: ZodFormattedError<T[number]>;
128
- } : T extends object ? {
129
- [K in keyof T]?: ZodFormattedError<T[K]>;
130
- } : unknown;
131
- export type ZodFormattedError<T, U = string> = {
132
- _errors: U[];
133
- } & recursiveZodFormattedError<NonNullable<T>>;
134
- export type inferFormattedError<T extends ZodType<any, any, any>, U = string> = ZodFormattedError<TypeOf<T>, U>;
135
- export declare class ZodError<T = any> extends Error {
136
- issues: ZodIssue[];
137
- get errors(): ZodIssue[];
138
- constructor(issues: ZodIssue[]);
139
- format(): ZodFormattedError<T>;
140
- format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
141
- static create: (issues: ZodIssue[]) => ZodError<any>;
142
- static assert(value: unknown): asserts value is ZodError;
143
- toString(): string;
144
- get message(): string;
145
- get isEmpty(): boolean;
146
- addIssue: (sub: ZodIssue) => void;
147
- addIssues: (subs?: ZodIssue[]) => void;
148
- flatten(): typeToFlattenedError<T>;
149
- flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
150
- get formErrors(): typeToFlattenedError<T, string>;
151
- }
152
- type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
153
- export type IssueData = stripPath<ZodIssueOptionalMessage> & {
154
- path?: (string | number)[];
155
- fatal?: boolean | undefined;
156
- };
157
- export type ErrorMapCtx = {
158
- defaultError: string;
159
- data: any;
160
- };
161
- export type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
162
- message: string;
163
- };
164
- export {};
@@ -1,5 +0,0 @@
1
- import Benchmark from "benchmark";
2
- declare const _default: {
3
- suites: Benchmark.Suite[];
4
- };
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import Benchmark from "benchmark";
2
- declare const _default: {
3
- suites: Benchmark.Suite[];
4
- };
5
- export default _default;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import Benchmark from "benchmark";
2
- declare const _default: {
3
- suites: Benchmark.Suite[];
4
- };
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import Benchmark from "benchmark";
2
- declare const _default: {
3
- suites: Benchmark.Suite[];
4
- };
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import Benchmark from "benchmark";
2
- declare const _default: {
3
- suites: Benchmark.Suite[];
4
- };
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import Benchmark from "benchmark";
2
- declare const _default: {
3
- suites: Benchmark.Suite[];
4
- };
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import Benchmark from "benchmark";
2
- declare const _default: {
3
- suites: Benchmark.Suite[];
4
- };
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import Benchmark from "benchmark";
2
- declare const _default: {
3
- suites: Benchmark.Suite[];
4
- };
5
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { ZodErrorMap } from "./ZodError.js";
2
- import defaultErrorMap from "./locales/en.js";
3
- export { defaultErrorMap };
4
- export declare function setErrorMap(map: ZodErrorMap): void;
5
- export declare function getErrorMap(): ZodErrorMap;
@@ -1,6 +0,0 @@
1
- export * from "./errors.js";
2
- export * from "./helpers/parseUtil.js";
3
- export * from "./helpers/typeAliases.js";
4
- export * from "./helpers/util.js";
5
- export * from "./types.js";
6
- export * from "./ZodError.js";
@@ -1,8 +0,0 @@
1
- export declare namespace enumUtil {
2
- type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
3
- type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
4
- type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
5
- type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
6
- export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
7
- export {};
8
- }
@@ -1,9 +0,0 @@
1
- export declare namespace errorUtil {
2
- type ErrMessage = string | {
3
- message?: string | undefined;
4
- };
5
- const errToObj: (message?: ErrMessage) => {
6
- message?: string | undefined;
7
- };
8
- const toString: (message?: ErrMessage) => string | undefined;
9
- }
@@ -1,78 +0,0 @@
1
- import type { IssueData, ZodErrorMap, ZodIssue } from "../ZodError.js";
2
- import type { ZodParsedType } from "./util.js";
3
- export declare const makeIssue: (params: {
4
- data: any;
5
- path: (string | number)[];
6
- errorMaps: ZodErrorMap[];
7
- issueData: IssueData;
8
- }) => ZodIssue;
9
- export type ParseParams = {
10
- path: (string | number)[];
11
- errorMap: ZodErrorMap;
12
- async: boolean;
13
- };
14
- export type ParsePathComponent = string | number;
15
- export type ParsePath = ParsePathComponent[];
16
- export declare const EMPTY_PATH: ParsePath;
17
- export interface ParseContext {
18
- readonly common: {
19
- readonly issues: ZodIssue[];
20
- readonly contextualErrorMap?: ZodErrorMap | undefined;
21
- readonly async: boolean;
22
- };
23
- readonly path: ParsePath;
24
- readonly schemaErrorMap?: ZodErrorMap | undefined;
25
- readonly parent: ParseContext | null;
26
- readonly data: any;
27
- readonly parsedType: ZodParsedType;
28
- }
29
- export type ParseInput = {
30
- data: any;
31
- path: (string | number)[];
32
- parent: ParseContext;
33
- };
34
- export declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void;
35
- export type ObjectPair = {
36
- key: SyncParseReturnType<any>;
37
- value: SyncParseReturnType<any>;
38
- };
39
- export declare class ParseStatus {
40
- value: "aborted" | "dirty" | "valid";
41
- dirty(): void;
42
- abort(): void;
43
- static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
44
- static mergeObjectAsync(status: ParseStatus, pairs: {
45
- key: ParseReturnType<any>;
46
- value: ParseReturnType<any>;
47
- }[]): Promise<SyncParseReturnType<any>>;
48
- static mergeObjectSync(status: ParseStatus, pairs: {
49
- key: SyncParseReturnType<any>;
50
- value: SyncParseReturnType<any>;
51
- alwaysSet?: boolean;
52
- }[]): SyncParseReturnType;
53
- }
54
- export interface ParseResult {
55
- status: "aborted" | "dirty" | "valid";
56
- data: any;
57
- }
58
- export type INVALID = {
59
- status: "aborted";
60
- };
61
- export declare const INVALID: INVALID;
62
- export type DIRTY<T> = {
63
- status: "dirty";
64
- value: T;
65
- };
66
- export declare const DIRTY: <T>(value: T) => DIRTY<T>;
67
- export type OK<T> = {
68
- status: "valid";
69
- value: T;
70
- };
71
- export declare const OK: <T>(value: T) => OK<T>;
72
- export type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
73
- export type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
74
- export type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
75
- export declare const isAborted: (x: ParseReturnType<any>) => x is INVALID;
76
- export declare const isDirty: <T>(x: ParseReturnType<T>) => x is OK<T> | DIRTY<T>;
77
- export declare const isValid: <T>(x: ParseReturnType<T>) => x is OK<T>;
78
- export declare const isAsync: <T>(x: ParseReturnType<T>) => x is AsyncParseReturnType<T>;
@@ -1,8 +0,0 @@
1
- import type { ZodArray, ZodNullable, ZodObject, ZodOptional, ZodRawShape, ZodTuple, ZodTupleItems, ZodTypeAny } from "../types.js";
2
- export declare namespace partialUtil {
3
- type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
4
- [k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
5
- }, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
6
- [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
7
- } extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
8
- }
@@ -1,2 +0,0 @@
1
- export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
2
- export type Scalars = Primitive | Primitive[];
@@ -1,85 +0,0 @@
1
- export declare namespace util {
2
- type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
3
- export type isAny<T> = 0 extends 1 & T ? true : false;
4
- export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
5
- export function assertIs<T>(_arg: T): void;
6
- export function assertNever(_x: never): never;
7
- export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
8
- export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
9
- export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
10
- export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
11
- export type InexactPartial<T> = {
12
- [k in keyof T]?: T[k] | undefined;
13
- };
14
- export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
15
- export const getValidEnumValues: (obj: any) => any[];
16
- export const objectValues: (obj: any) => any[];
17
- export const objectKeys: ObjectConstructor["keys"];
18
- export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
19
- export type identity<T> = objectUtil.identity<T>;
20
- export type flatten<T> = objectUtil.flatten<T>;
21
- export type noUndefined<T> = T extends undefined ? never : T;
22
- export const isInteger: NumberConstructor["isInteger"];
23
- export function joinValues<T extends any[]>(array: T, separator?: string): string;
24
- export const jsonStringifyReplacer: (_: string, value: any) => any;
25
- export {};
26
- }
27
- export declare namespace objectUtil {
28
- export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : {
29
- [k in Exclude<keyof U, keyof V>]: U[k];
30
- } & V;
31
- type optionalKeys<T extends object> = {
32
- [k in keyof T]: undefined extends T[k] ? k : never;
33
- }[keyof T];
34
- type requiredKeys<T extends object> = {
35
- [k in keyof T]: undefined extends T[k] ? never : k;
36
- }[keyof T];
37
- export type addQuestionMarks<T extends object, _O = any> = {
38
- [K in requiredKeys<T>]: T[K];
39
- } & {
40
- [K in optionalKeys<T>]?: T[K];
41
- } & {
42
- [k in keyof T]?: unknown;
43
- };
44
- export type identity<T> = T;
45
- export type flatten<T> = identity<{
46
- [k in keyof T]: T[k];
47
- }>;
48
- export type noNeverKeys<T> = {
49
- [k in keyof T]: [T[k]] extends [never] ? never : k;
50
- }[keyof T];
51
- export type noNever<T> = identity<{
52
- [k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
53
- }>;
54
- export const mergeShapes: <U, T>(first: U, second: T) => T & U;
55
- export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : {
56
- [K in keyof A as K extends keyof B ? never : K]: A[K];
57
- } & {
58
- [K in keyof B]: B[K];
59
- };
60
- export {};
61
- }
62
- export declare const ZodParsedType: {
63
- string: "string";
64
- nan: "nan";
65
- number: "number";
66
- integer: "integer";
67
- float: "float";
68
- boolean: "boolean";
69
- date: "date";
70
- bigint: "bigint";
71
- symbol: "symbol";
72
- function: "function";
73
- undefined: "undefined";
74
- null: "null";
75
- array: "array";
76
- object: "object";
77
- unknown: "unknown";
78
- promise: "promise";
79
- void: "void";
80
- never: "never";
81
- map: "map";
82
- set: "set";
83
- };
84
- export type ZodParsedType = keyof typeof ZodParsedType;
85
- export declare const getParsedType: (data: any) => ZodParsedType;
@@ -1,4 +0,0 @@
1
- import * as z from "./external.js";
2
- export * from "./external.js";
3
- export { z };
4
- export default z;
@@ -1,3 +0,0 @@
1
- import { type ZodErrorMap } from "../ZodError.js";
2
- declare const errorMap: ZodErrorMap;
3
- export default errorMap;
@@ -1,102 +0,0 @@
1
- /**
2
- * The Standard Schema interface.
3
- */
4
- export type StandardSchemaV1<Input = unknown, Output = Input> = {
5
- /**
6
- * The Standard Schema properties.
7
- */
8
- readonly "~standard": StandardSchemaV1.Props<Input, Output>;
9
- };
10
- export declare namespace StandardSchemaV1 {
11
- /**
12
- * The Standard Schema properties interface.
13
- */
14
- export interface Props<Input = unknown, Output = Input> {
15
- /**
16
- * The version number of the standard.
17
- */
18
- readonly version: 1;
19
- /**
20
- * The vendor name of the schema library.
21
- */
22
- readonly vendor: string;
23
- /**
24
- * Validates unknown input values.
25
- */
26
- readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
27
- /**
28
- * Inferred types associated with the schema.
29
- */
30
- readonly types?: Types<Input, Output> | undefined;
31
- }
32
- /**
33
- * The result interface of the validate function.
34
- */
35
- export type Result<Output> = SuccessResult<Output> | FailureResult;
36
- /**
37
- * The result interface if validation succeeds.
38
- */
39
- export interface SuccessResult<Output> {
40
- /**
41
- * The typed output value.
42
- */
43
- readonly value: Output;
44
- /**
45
- * The non-existent issues.
46
- */
47
- readonly issues?: undefined;
48
- }
49
- /**
50
- * The result interface if validation fails.
51
- */
52
- export interface FailureResult {
53
- /**
54
- * The issues of failed validation.
55
- */
56
- readonly issues: ReadonlyArray<Issue>;
57
- }
58
- /**
59
- * The issue interface of the failure output.
60
- */
61
- export interface Issue {
62
- /**
63
- * The error message of the issue.
64
- */
65
- readonly message: string;
66
- /**
67
- * The path of the issue, if any.
68
- */
69
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
70
- }
71
- /**
72
- * The path segment interface of the issue.
73
- */
74
- export interface PathSegment {
75
- /**
76
- * The key representing a path segment.
77
- */
78
- readonly key: PropertyKey;
79
- }
80
- /**
81
- * The Standard Schema types interface.
82
- */
83
- export interface Types<Input = unknown, Output = Input> {
84
- /**
85
- * The input type of the schema.
86
- */
87
- readonly input: Input;
88
- /**
89
- * The output type of the schema.
90
- */
91
- readonly output: Output;
92
- }
93
- /**
94
- * Infers the input type of a Standard Schema.
95
- */
96
- export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
97
- /**
98
- * Infers the output type of a Standard Schema.
99
- */
100
- export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
101
- export {};
102
- }
@@ -1,17 +0,0 @@
1
- export declare class Mocker {
2
- pick: (...args: any[]) => any;
3
- get string(): string;
4
- get number(): number;
5
- get bigint(): bigint;
6
- get boolean(): boolean;
7
- get date(): Date;
8
- get symbol(): symbol;
9
- get null(): null;
10
- get undefined(): undefined;
11
- get stringOptional(): string | undefined;
12
- get stringNullable(): string | null;
13
- get numberOptional(): number | undefined;
14
- get numberNullable(): number | null;
15
- get booleanOptional(): boolean | undefined;
16
- get booleanNullable(): boolean | null;
17
- }