@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,55 +0,0 @@
1
- /** The Standard Schema interface. */
2
- export interface StandardSchemaV1<Input = unknown, Output = Input> {
3
- /** The Standard Schema properties. */
4
- readonly "~standard": StandardSchemaV1.Props<Input, Output>;
5
- }
6
- export declare namespace StandardSchemaV1 {
7
- /** The Standard Schema properties interface. */
8
- interface Props<Input = unknown, Output = Input> {
9
- /** The version number of the standard. */
10
- readonly version: 1;
11
- /** The vendor name of the schema library. */
12
- readonly vendor: string;
13
- /** Validates unknown input values. */
14
- readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
15
- /** Inferred types associated with the schema. */
16
- readonly types?: Types<Input, Output> | undefined;
17
- }
18
- /** The result interface of the validate function. */
19
- type Result<Output> = SuccessResult<Output> | FailureResult;
20
- /** The result interface if validation succeeds. */
21
- interface SuccessResult<Output> {
22
- /** The typed output value. */
23
- readonly value: Output;
24
- /** The non-existent issues. */
25
- readonly issues?: undefined;
26
- }
27
- /** The result interface if validation fails. */
28
- interface FailureResult {
29
- /** The issues of failed validation. */
30
- readonly issues: ReadonlyArray<Issue>;
31
- }
32
- /** The issue interface of the failure output. */
33
- interface Issue {
34
- /** The error message of the issue. */
35
- readonly message: string;
36
- /** The path of the issue, if any. */
37
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
38
- }
39
- /** The path segment interface of the issue. */
40
- interface PathSegment {
41
- /** The key representing a path segment. */
42
- readonly key: PropertyKey;
43
- }
44
- /** The Standard Schema types interface. */
45
- interface Types<Input = unknown, Output = Input> {
46
- /** The input type of the schema. */
47
- readonly input: Input;
48
- /** The output type of the schema. */
49
- readonly output: Output;
50
- }
51
- /** Infers the input type of a Standard Schema. */
52
- type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
53
- /** Infers the output type of a Standard Schema. */
54
- type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
55
- }
@@ -1,84 +0,0 @@
1
- import type * as JSONSchema from "./json-schema.js";
2
- import { $ZodRegistry } from "./registries.js";
3
- import type * as schemas from "./schemas.js";
4
- interface JSONSchemaGeneratorParams {
5
- /** A registry used to look up metadata for each schema. Any schema with an `id` property will be extracted as a $def.
6
- * @default globalRegistry */
7
- metadata?: $ZodRegistry<Record<string, any>>;
8
- /** The JSON Schema version to target.
9
- * - `"draft-2020-12"` — Default. JSON Schema Draft 2020-12
10
- * - `"draft-7"` — JSON Schema Draft 7 */
11
- target?: "draft-7" | "draft-2020-12";
12
- /** How to handle unrepresentable types.
13
- * - `"throw"` — Default. Unrepresentable types throw an error
14
- * - `"any"` — Unrepresentable types become `{}` */
15
- unrepresentable?: "throw" | "any";
16
- /** Arbitrary custom logic that can be used to modify the generated JSON Schema. */
17
- override?: (ctx: {
18
- zodSchema: schemas.$ZodTypes;
19
- jsonSchema: JSONSchema.BaseSchema;
20
- }) => void;
21
- /** Whether to extract the `"input"` or `"output"` type. Relevant to transforms, Error converting schema to JSONz, defaults, coerced primitives, etc.
22
- * - `"output" — Default. Convert the output schema.
23
- * - `"input"` — Convert the input schema. */
24
- io?: "input" | "output";
25
- }
26
- interface ProcessParams {
27
- schemaPath: schemas.$ZodType[];
28
- path: (string | number)[];
29
- }
30
- interface EmitParams {
31
- /** How to handle cycles.
32
- * - `"ref"` — Default. Cycles will be broken using $defs
33
- * - `"throw"` — Cycles will throw an error if encountered */
34
- cycles?: "ref" | "throw";
35
- reused?: "ref" | "inline";
36
- external?: {
37
- /** */
38
- registry: $ZodRegistry<{
39
- id?: string | undefined;
40
- }>;
41
- uri: (id: string) => string;
42
- defs: Record<string, JSONSchema.BaseSchema>;
43
- } | undefined;
44
- }
45
- interface Seen {
46
- /** JSON Schema result for this Zod schema */
47
- schema: JSONSchema.BaseSchema;
48
- /** A cached version of the schema that doesn't get overwritten during ref resolution */
49
- def?: JSONSchema.BaseSchema;
50
- defId?: string | undefined;
51
- /** Number of times this schema was encountered during traversal */
52
- count: number;
53
- /** Cycle path */
54
- cycle?: (string | number)[] | undefined;
55
- isParent?: boolean | undefined;
56
- ref?: schemas.$ZodType | undefined | null;
57
- }
58
- export declare class JSONSchemaGenerator {
59
- metadataRegistry: $ZodRegistry<Record<string, any>>;
60
- target: "draft-7" | "draft-2020-12";
61
- unrepresentable: "throw" | "any";
62
- override: (ctx: {
63
- zodSchema: schemas.$ZodTypes;
64
- jsonSchema: JSONSchema.BaseSchema;
65
- }) => void;
66
- io: "input" | "output";
67
- counter: number;
68
- seen: Map<schemas.$ZodType, Seen>;
69
- constructor(params?: JSONSchemaGeneratorParams);
70
- process(schema: schemas.$ZodType, _params?: ProcessParams): JSONSchema.BaseSchema;
71
- emit(schema: schemas.$ZodType, _params?: EmitParams): JSONSchema.BaseSchema;
72
- }
73
- interface ToJSONSchemaParams extends Omit<JSONSchemaGeneratorParams & EmitParams, "external"> {
74
- }
75
- interface RegistryToJSONSchemaParams extends Omit<JSONSchemaGeneratorParams & EmitParams, "external"> {
76
- uri?: (id: string) => string;
77
- }
78
- export declare function toJSONSchema(schema: schemas.$ZodType, _params?: ToJSONSchemaParams): JSONSchema.BaseSchema;
79
- export declare function toJSONSchema(registry: $ZodRegistry<{
80
- id?: string | undefined;
81
- }>, _params?: RegistryToJSONSchemaParams): {
82
- schemas: Record<string, JSONSchema.BaseSchema>;
83
- };
84
- export {};
@@ -1,182 +0,0 @@
1
- import type * as checks from "./checks.js";
2
- import type { $ZodConfig } from "./core.js";
3
- import type * as errors from "./errors.js";
4
- import type * as schemas from "./schemas.js";
5
- export type JSONType = string | number | boolean | null | JSONType[] | {
6
- [key: string]: JSONType;
7
- };
8
- export type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
9
- export type IPVersion = "v4" | "v6";
10
- export type MimeTypes = "application/json" | "application/xml" | "application/x-www-form-urlencoded" | "application/javascript" | "application/pdf" | "application/zip" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/octet-stream" | "application/graphql" | "text/html" | "text/plain" | "text/css" | "text/javascript" | "text/csv" | "image/png" | "image/jpeg" | "image/gif" | "image/svg+xml" | "image/webp" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf" | "multipart/form-data" | (string & {});
11
- export type ParsedTypes = "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "file" | "date" | "array" | "map" | "set" | "nan" | "null" | "promise";
12
- export type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
13
- export type AssertNotEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? false : true;
14
- export type AssertExtends<T, U> = T extends U ? T : never;
15
- export type IsAny<T> = 0 extends 1 & T ? true : false;
16
- export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
17
- export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
18
- export type MakePartial<T, K extends keyof T> = Omit<T, K> & InexactPartial<Pick<T, K>>;
19
- export type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
20
- export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
21
- export type NoUndefined<T> = T extends undefined ? never : T;
22
- export type Whatever = {} | undefined | null;
23
- export type LoosePartial<T extends object> = InexactPartial<T> & {
24
- [k: string]: unknown;
25
- };
26
- export type Mask<Keys extends PropertyKey> = {
27
- [K in Keys]?: true;
28
- };
29
- export type Writeable<T> = {
30
- -readonly [P in keyof T]: T[P];
31
- } & {};
32
- export type InexactPartial<T> = {
33
- [P in keyof T]?: T[P] | undefined;
34
- };
35
- export type EmptyObject = Record<string, never>;
36
- export type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
37
- readonly [Symbol.toStringTag]: string;
38
- } | Date | Error | Generator | Promise<unknown> | RegExp;
39
- export type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
40
- export type SomeObject = Record<PropertyKey, any>;
41
- export type Identity<T> = T;
42
- export type Flatten<T> = Identity<{
43
- [k in keyof T]: T[k];
44
- }>;
45
- export type Mapped<T> = {
46
- [k in keyof T]: T[k];
47
- };
48
- export type Prettify<T> = {
49
- [K in keyof T]: T[K];
50
- } & {};
51
- export type NoNeverKeys<T> = {
52
- [k in keyof T]: [T[k]] extends [never] ? never : k;
53
- }[keyof T];
54
- export type NoNever<T> = Identity<{
55
- [k in NoNeverKeys<T>]: k extends keyof T ? T[k] : never;
56
- }>;
57
- export type Extend<A extends SomeObject, B extends SomeObject> = Flatten<keyof A & keyof B extends never ? A & B : {
58
- [K in keyof A as K extends keyof B ? never : K]: A[K];
59
- } & {
60
- [K in keyof B]: B[K];
61
- }>;
62
- export type TupleItems = ReadonlyArray<schemas.SomeType>;
63
- export type AnyFunc = (...args: any[]) => any;
64
- export type IsProp<T, K extends keyof T> = T[K] extends AnyFunc ? never : K;
65
- export type MaybeAsync<T> = T | Promise<T>;
66
- export type KeyOf<T> = keyof OmitIndexSignature<T>;
67
- export type OmitIndexSignature<T> = {
68
- [K in keyof T as string extends K ? never : K extends string ? K : never]: T[K];
69
- };
70
- export type ExtractIndexSignature<T> = {
71
- [K in keyof T as string extends K ? K : K extends string ? never : K]: T[K];
72
- };
73
- export type Keys<T extends object> = keyof OmitIndexSignature<T>;
74
- export type SchemaClass<T extends schemas.SomeType> = {
75
- new (def: T["_zod"]["def"]): T;
76
- };
77
- export type EnumValue = string | number;
78
- export type EnumLike = Readonly<Record<string, EnumValue>>;
79
- export type ToEnum<T extends EnumValue> = Flatten<{
80
- [k in T]: k;
81
- }>;
82
- export type KeysEnum<T extends object> = ToEnum<Exclude<keyof T, symbol>>;
83
- export type KeysArray<T extends object> = Flatten<(keyof T & string)[]>;
84
- export type Literal = string | number | bigint | boolean | null | undefined;
85
- export type LiteralArray = Array<Literal>;
86
- export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
87
- export type PrimitiveArray = Array<Primitive>;
88
- export type HasSize = {
89
- size: number;
90
- };
91
- export type HasLength = {
92
- length: number;
93
- };
94
- export type Numeric = number | bigint | Date;
95
- export type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError<T>;
96
- export type SafeParseSuccess<T> = {
97
- success: true;
98
- data: T;
99
- error?: never;
100
- };
101
- export type SafeParseError<T> = {
102
- success: false;
103
- data?: never;
104
- error: errors.$ZodError<T>;
105
- };
106
- export type PropValues = Record<string, Set<Primitive>>;
107
- export type PrimitiveSet = Set<Primitive>;
108
- export declare function assertEqual<A, B>(val: AssertEqual<A, B>): AssertEqual<A, B>;
109
- export declare function assertNotEqual<A, B>(val: AssertNotEqual<A, B>): AssertNotEqual<A, B>;
110
- export declare function assertIs<T>(_arg: T): void;
111
- export declare function assertNever(_x: never): never;
112
- export declare function assert<T>(_: any): asserts _ is T;
113
- export declare function getEnumValues(entries: EnumLike): EnumValue[];
114
- export declare function joinValues<T extends Primitive[]>(array: T, separator?: string): string;
115
- export declare function jsonStringifyReplacer(_: string, value: any): any;
116
- export declare function cached<T>(getter: () => T): {
117
- value: T;
118
- };
119
- export declare function nullish(input: any): boolean;
120
- export declare function cleanRegex(source: string): string;
121
- export declare function floatSafeRemainder(val: number, step: number): number;
122
- export declare function defineLazy<T, K extends keyof T>(object: T, key: K, getter: () => T[K]): void;
123
- export declare function assignProp<T extends object, K extends PropertyKey>(target: T, prop: K, value: K extends keyof T ? T[K] : any): void;
124
- export declare function getElementAtPath(obj: any, path: (string | number)[] | null | undefined): any;
125
- export declare function promiseAllObject<T extends object>(promisesObj: T): Promise<{
126
- [k in keyof T]: Awaited<T[k]>;
127
- }>;
128
- export declare function randomString(length?: number): string;
129
- export declare function esc(str: string): string;
130
- export declare function isObject(data: any): data is Record<PropertyKey, unknown>;
131
- export declare const allowsEval: {
132
- value: boolean;
133
- };
134
- export declare function isPlainObject(o: any): o is Record<PropertyKey, unknown>;
135
- export declare function numKeys(data: any): number;
136
- export declare const getParsedType: (data: any) => ParsedTypes;
137
- export declare const propertyKeyTypes: Set<string>;
138
- export declare const primitiveTypes: Set<string>;
139
- export declare function escapeRegex(str: string): string;
140
- export declare function clone<T extends schemas.$ZodType>(inst: T, def?: T["_zod"]["def"], params?: {
141
- parent: boolean;
142
- }): T;
143
- export type EmptyToNever<T> = keyof T extends never ? never : T;
144
- export type Normalize<T> = T extends undefined ? never : T extends Record<any, any> ? Flatten<{
145
- [k in keyof Omit<T, "error" | "message">]: T[k];
146
- } & ("error" extends keyof T ? {
147
- error?: Exclude<T["error"], string>;
148
- } : unknown)> : never;
149
- export declare function normalizeParams<T>(_params: T): Normalize<T>;
150
- export declare function createTransparentProxy<T extends object>(getter: () => T): T;
151
- export declare function stringifyPrimitive(value: any): string;
152
- export declare function optionalKeys(shape: schemas.$ZodShape): string[];
153
- export type CleanKey<T extends PropertyKey> = T extends `?${infer K}` ? K : T extends `${infer K}?` ? K : T;
154
- export type ToCleanMap<T extends schemas.$ZodLooseShape> = {
155
- [k in keyof T]: k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k;
156
- };
157
- export type FromCleanMap<T extends schemas.$ZodLooseShape> = {
158
- [k in keyof T as k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k]: k;
159
- };
160
- export declare const NUMBER_FORMAT_RANGES: Record<checks.$ZodNumberFormats, [number, number]>;
161
- export declare const BIGINT_FORMAT_RANGES: Record<checks.$ZodBigIntFormats, [bigint, bigint]>;
162
- export declare function pick(schema: schemas.$ZodObject, mask: Record<string, unknown>): any;
163
- export declare function omit(schema: schemas.$ZodObject, mask: object): any;
164
- export declare function extend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any;
165
- export declare function merge(a: schemas.$ZodObject, b: schemas.$ZodObject): any;
166
- export declare function partial(Class: SchemaClass<schemas.$ZodOptional> | null, schema: schemas.$ZodObject, mask: object | undefined): any;
167
- export declare function required(Class: SchemaClass<schemas.$ZodNonOptional>, schema: schemas.$ZodObject, mask: object | undefined): any;
168
- export type Constructor<T, Def extends any[] = any[]> = new (...args: Def) => T;
169
- export declare function aborted(x: schemas.ParsePayload, startIndex?: number): boolean;
170
- export declare function prefixIssues(path: PropertyKey, issues: errors.$ZodRawIssue[]): errors.$ZodRawIssue[];
171
- export declare function unwrapMessage(message: string | {
172
- message: string;
173
- } | undefined | null): string | undefined;
174
- export declare function finalizeIssue(iss: errors.$ZodRawIssue, ctx: schemas.ParseContextInternal | undefined, config: $ZodConfig): errors.$ZodIssue;
175
- export declare function getSizableOrigin(input: any): "set" | "map" | "file" | "unknown";
176
- export declare function getLengthableOrigin(input: any): "array" | "string" | "unknown";
177
- export declare function issue(_iss: string, input: any, inst: any): errors.$ZodRawIssue;
178
- export declare function issue(_iss: errors.$ZodRawIssue): errors.$ZodRawIssue;
179
- export declare function cleanEnum(obj: Record<string, EnumValue>): EnumValue[];
180
- export declare abstract class Class {
181
- constructor(..._args: any[]);
182
- }
@@ -1,5 +0,0 @@
1
- export declare const version: {
2
- readonly major: 4;
3
- readonly minor: 0;
4
- readonly patch: number;
5
- };
@@ -1,91 +0,0 @@
1
- export interface $ZSF {
2
- $zsf: {
3
- version: number;
4
- };
5
- type: string;
6
- default: unknown;
7
- fallback: unknown;
8
- }
9
- export interface $ZSFString extends $ZSF {
10
- type: "string";
11
- min_length?: number;
12
- max_length?: number;
13
- pattern?: string;
14
- }
15
- export type NumberTypes = "float32" | "int32" | "uint32" | "float64" | "int64" | "uint64" | "bigint" | "bigdecimal";
16
- export interface $ZSFNumber extends $ZSF {
17
- type: "number";
18
- format?: NumberTypes;
19
- minimum?: number;
20
- maximum?: number;
21
- multiple_of?: number;
22
- }
23
- export interface $ZSFBoolean extends $ZSF {
24
- type: "boolean";
25
- }
26
- export interface $ZSFNull extends $ZSF {
27
- type: "null";
28
- }
29
- export interface $ZSFUndefined extends $ZSF {
30
- type: "undefined";
31
- }
32
- export interface $ZSFOptional<T extends $ZSF = $ZSF> extends $ZSF {
33
- type: "optional";
34
- inner: T;
35
- }
36
- export interface $ZSFNever extends $ZSF {
37
- type: "never";
38
- }
39
- export interface $ZSFAny extends $ZSF {
40
- type: "any";
41
- }
42
- /** Supports */
43
- export interface $ZSFEnum<Elements extends {
44
- [k: string]: $ZSFLiteral;
45
- } = {
46
- [k: string]: $ZSFLiteral;
47
- }> extends $ZSF {
48
- type: "enum";
49
- elements: Elements;
50
- }
51
- export interface $ZSFArray<PrefixItems extends $ZSF[] = $ZSF[], Items extends $ZSF = $ZSF> extends $ZSF {
52
- type: "array";
53
- prefixItems: PrefixItems;
54
- items: Items;
55
- }
56
- type $ZSFObjectProperties = Array<{
57
- key: string;
58
- value: $ZSF;
59
- format?: "literal" | "pattern";
60
- ordering?: number;
61
- }>;
62
- export interface $ZSFObject<Properties extends $ZSFObjectProperties = $ZSFObjectProperties> extends $ZSF {
63
- type: "object";
64
- properties: Properties;
65
- }
66
- /** Supports arbitrary literal values */
67
- export interface $ZSFLiteral<T extends $ZSF = $ZSF> extends $ZSF {
68
- type: "literal";
69
- schema: T;
70
- value: unknown;
71
- }
72
- export interface $ZSFUnion<Elements extends $ZSF[] = $ZSF[]> extends $ZSF {
73
- type: "union";
74
- elements: Elements;
75
- }
76
- export interface $ZSFIntersection extends $ZSF {
77
- type: "intersection";
78
- elements: $ZSF[];
79
- }
80
- export interface $ZSFMap<K extends $ZSF = $ZSF, V extends $ZSF = $ZSF> extends $ZSF {
81
- type: "map";
82
- keys: K;
83
- values: V;
84
- }
85
- export interface $ZSFConditional<If extends $ZSF, Then extends $ZSF, Else extends $ZSF> extends $ZSF {
86
- type: "conditional";
87
- if: If;
88
- then: Then;
89
- else: Else;
90
- }
91
- export {};
@@ -1,3 +0,0 @@
1
- import z4 from "./classic/index.js";
2
- export * from "./classic/index.js";
3
- export default z4;
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,5 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export declare const parsedType: (data: any) => string;
3
- export default function (): {
4
- localeError: errors.$ZodErrorMap;
5
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,38 +0,0 @@
1
- export { default as ar } from "./ar.js";
2
- export { default as az } from "./az.js";
3
- export { default as be } from "./be.js";
4
- export { default as ca } from "./ca.js";
5
- export { default as cs } from "./cs.js";
6
- export { default as de } from "./de.js";
7
- export { default as en } from "./en.js";
8
- export { default as es } from "./es.js";
9
- export { default as fa } from "./fa.js";
10
- export { default as fi } from "./fi.js";
11
- export { default as fr } from "./fr.js";
12
- export { default as frCA } from "./fr-CA.js";
13
- export { default as he } from "./he.js";
14
- export { default as hu } from "./hu.js";
15
- export { default as id } from "./id.js";
16
- export { default as it } from "./it.js";
17
- export { default as ja } from "./ja.js";
18
- export { default as kh } from "./kh.js";
19
- export { default as ko } from "./ko.js";
20
- export { default as mk } from "./mk.js";
21
- export { default as ms } from "./ms.js";
22
- export { default as nl } from "./nl.js";
23
- export { default as no } from "./no.js";
24
- export { default as ota } from "./ota.js";
25
- export { default as ps } from "./ps.js";
26
- export { default as pl } from "./pl.js";
27
- export { default as pt } from "./pt.js";
28
- export { default as ru } from "./ru.js";
29
- export { default as sl } from "./sl.js";
30
- export { default as sv } from "./sv.js";
31
- export { default as ta } from "./ta.js";
32
- export { default as th } from "./th.js";
33
- export { default as tr } from "./tr.js";
34
- export { default as ua } from "./ua.js";
35
- export { default as ur } from "./ur.js";
36
- export { default as vi } from "./vi.js";
37
- export { default as zhCN } from "./zh-CN.js";
38
- export { default as zhTW } from "./zh-TW.js";
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };
@@ -1,4 +0,0 @@
1
- import type * as errors from "../core/errors.js";
2
- export default function (): {
3
- localeError: errors.$ZodErrorMap;
4
- };