@ray-js/robot-data-stream 0.0.14 → 0.0.15-beta.1

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 (156) hide show
  1. package/lib/mqtt/createCommonOptions.d.ts +4 -2
  2. package/lib/mqtt/createCommonOptions.js +10 -5
  3. package/lib/mqtt/hooks/useStructuredMessage.d.ts +14 -0
  4. package/lib/mqtt/hooks/useStructuredMessage.js +131 -0
  5. package/lib/mqtt/mqttProvider.d.ts +19 -1
  6. package/lib/mqtt/mqttProvider.js +69 -8
  7. package/lib/mqtt/promise.d.ts +57 -4
  8. package/lib/mqtt/promise.js +115 -36
  9. package/lib/mqtt/type/fun.d.ts +49 -0
  10. package/lib/mqtt/type/fun.js +145 -0
  11. package/lib/mqtt/type/index.d.ts +0 -7
  12. package/lib/mqtt/type/index.js +0 -1
  13. package/lib/mqtt/type/protocols/base.d.ts +5 -0
  14. package/lib/mqtt/type/protocols/base.js +32 -0
  15. package/lib/mqtt/type/protocols/carpetCleanProtocol.d.ts +8 -0
  16. package/lib/mqtt/type/protocols/carpetCleanProtocol.js +16 -0
  17. package/lib/mqtt/type/protocols/carpetProtocol.d.ts +41 -0
  18. package/lib/mqtt/type/protocols/carpetProtocol.js +202 -0
  19. package/lib/mqtt/type/protocols/devInfoProtocol.d.ts +5 -0
  20. package/lib/mqtt/type/protocols/devInfoProtocol.js +12 -0
  21. package/lib/mqtt/type/protocols/deviceModelProtocol.d.ts +8 -0
  22. package/lib/mqtt/type/protocols/deviceModelProtocol.js +34 -0
  23. package/lib/mqtt/type/protocols/furnitureModelProtocol.d.ts +10 -0
  24. package/lib/mqtt/type/protocols/furnitureModelProtocol.js +35 -0
  25. package/lib/mqtt/type/protocols/historyMapProtocol.d.ts +17 -0
  26. package/lib/mqtt/type/protocols/historyMapProtocol.js +37 -0
  27. package/lib/mqtt/type/protocols/index.d.ts +20 -0
  28. package/lib/mqtt/type/protocols/index.js +20 -0
  29. package/lib/mqtt/type/protocols/partDivisionProtocol.d.ts +8 -0
  30. package/lib/mqtt/type/protocols/partDivisionProtocol.js +12 -0
  31. package/lib/mqtt/type/protocols/partMergeProtocol.d.ts +7 -0
  32. package/lib/mqtt/type/protocols/partMergeProtocol.js +12 -0
  33. package/lib/mqtt/type/protocols/passwordProtocol.d.ts +11 -0
  34. package/lib/mqtt/type/protocols/passwordProtocol.js +25 -0
  35. package/lib/mqtt/type/protocols/quietHoursProtocol.d.ts +8 -0
  36. package/lib/mqtt/type/protocols/quietHoursProtocol.js +35 -0
  37. package/lib/mqtt/type/protocols/resetMapProtocol.d.ts +4 -0
  38. package/lib/mqtt/type/protocols/resetMapProtocol.js +1 -0
  39. package/lib/mqtt/type/protocols/roomPropertyProtocol.d.ts +14 -0
  40. package/lib/mqtt/type/protocols/roomPropertyProtocol.js +113 -0
  41. package/lib/mqtt/type/protocols/scheduleProtocol.d.ts +18 -0
  42. package/lib/mqtt/type/protocols/scheduleProtocol.js +100 -0
  43. package/lib/mqtt/type/protocols/selectRoomCleanProtocol.d.ts +8 -0
  44. package/lib/mqtt/type/protocols/selectRoomCleanProtocol.js +40 -0
  45. package/lib/mqtt/type/protocols/spotCleanProtocol.d.ts +9 -0
  46. package/lib/mqtt/type/protocols/spotCleanProtocol.js +72 -0
  47. package/lib/mqtt/type/protocols/virtualAreaProtocol.d.ts +8 -0
  48. package/lib/mqtt/type/protocols/virtualAreaProtocol.js +36 -0
  49. package/lib/mqtt/type/protocols/virtualWallProtocol.d.ts +8 -0
  50. package/lib/mqtt/type/protocols/virtualWallProtocol.js +25 -0
  51. package/lib/mqtt/type/protocols/voiceProtocol.d.ts +8 -0
  52. package/lib/mqtt/type/protocols/voiceProtocol.js +23 -0
  53. package/lib/mqtt/type/protocols/wifiMapProtocol.d.ts +8 -0
  54. package/lib/mqtt/type/protocols/wifiMapProtocol.js +14 -0
  55. package/lib/mqtt/type/protocols/zoneCleanProtocol.d.ts +8 -0
  56. package/lib/mqtt/type/protocols/zoneCleanProtocol.js +49 -0
  57. package/lib/mqtt/useCarpet.d.ts +7 -67
  58. package/lib/mqtt/useCarpet.js +101 -181
  59. package/lib/mqtt/useCarpetClean.d.ts +2 -11
  60. package/lib/mqtt/useCarpetClean.js +24 -51
  61. package/lib/mqtt/useDevInfo.d.ts +8 -6
  62. package/lib/mqtt/useDevInfo.js +44 -36
  63. package/lib/mqtt/useDeviceModel.d.ts +6 -19
  64. package/lib/mqtt/useDeviceModel.js +29 -42
  65. package/lib/mqtt/useFurnitureModel.d.ts +6 -18
  66. package/lib/mqtt/useFurnitureModel.js +29 -43
  67. package/lib/mqtt/useHistoryMap.d.ts +2 -18
  68. package/lib/mqtt/useHistoryMap.js +102 -119
  69. package/lib/mqtt/usePartDivision.d.ts +2 -9
  70. package/lib/mqtt/usePartDivision.js +48 -57
  71. package/lib/mqtt/usePartMerge.d.ts +2 -8
  72. package/lib/mqtt/usePartMerge.js +34 -49
  73. package/lib/mqtt/usePassword.d.ts +6 -13
  74. package/lib/mqtt/usePassword.js +84 -74
  75. package/lib/mqtt/useQuiteHours.d.ts +4 -37
  76. package/lib/mqtt/useQuiteHours.js +66 -100
  77. package/lib/mqtt/useResetMap.d.ts +2 -8
  78. package/lib/mqtt/useResetMap.js +27 -34
  79. package/lib/mqtt/useRoomProperty.d.ts +8 -9
  80. package/lib/mqtt/useRoomProperty.js +67 -65
  81. package/lib/mqtt/useSchedule.d.ts +3 -23
  82. package/lib/mqtt/useSchedule.js +72 -101
  83. package/lib/mqtt/useSelectRoomClean.d.ts +3 -24
  84. package/lib/mqtt/useSelectRoomClean.js +107 -133
  85. package/lib/mqtt/useSpotClean.d.ts +5 -15
  86. package/lib/mqtt/useSpotClean.js +68 -121
  87. package/lib/mqtt/useVirtualArea.d.ts +6 -17
  88. package/lib/mqtt/useVirtualArea.js +109 -119
  89. package/lib/mqtt/useVirtualWall.d.ts +2 -18
  90. package/lib/mqtt/useVirtualWall.js +69 -90
  91. package/lib/mqtt/useVoice.d.ts +2 -16
  92. package/lib/mqtt/useVoice.js +48 -68
  93. package/lib/mqtt/useWifiMap.d.ts +6 -5
  94. package/lib/mqtt/useWifiMap.js +43 -42
  95. package/lib/mqtt/useZoneClean.d.ts +2 -21
  96. package/lib/mqtt/useZoneClean.js +125 -137
  97. package/lib/myLib/zod/mini/index.d.cts +1 -0
  98. package/lib/myLib/zod/mini/index.d.ts +1 -0
  99. package/lib/myLib/zod/mini/index.js +1 -0
  100. package/lib/myLib/zod/mini/package.json +6 -0
  101. package/lib/myLib/zod/src/mini/index.d.ts +1 -0
  102. package/lib/myLib/zod/src/mini/index.js +1 -0
  103. package/lib/myLib/zod/src/v4/core/api.d.ts +306 -0
  104. package/lib/myLib/zod/src/v4/core/api.js +1256 -0
  105. package/lib/myLib/zod/src/v4/core/checks.d.ts +278 -0
  106. package/lib/myLib/zod/src/v4/core/checks.js +816 -0
  107. package/lib/myLib/zod/src/v4/core/config.d.ts +9 -0
  108. package/lib/myLib/zod/src/v4/core/config.js +5 -0
  109. package/lib/myLib/zod/src/v4/core/core.d.ts +70 -0
  110. package/lib/myLib/zod/src/v4/core/core.js +95 -0
  111. package/lib/myLib/zod/src/v4/core/doc.d.ts +14 -0
  112. package/lib/myLib/zod/src/v4/core/doc.js +42 -0
  113. package/lib/myLib/zod/src/v4/core/errors.d.ts +220 -0
  114. package/lib/myLib/zod/src/v4/core/errors.js +232 -0
  115. package/lib/myLib/zod/src/v4/core/index.d.ts +15 -0
  116. package/lib/myLib/zod/src/v4/core/index.js +15 -0
  117. package/lib/myLib/zod/src/v4/core/json-schema-generator.d.ts +65 -0
  118. package/lib/myLib/zod/src/v4/core/json-schema-generator.js +120 -0
  119. package/lib/myLib/zod/src/v4/core/json-schema-processors.d.ts +49 -0
  120. package/lib/myLib/zod/src/v4/core/json-schema-processors.js +593 -0
  121. package/lib/myLib/zod/src/v4/core/json-schema.d.ts +88 -0
  122. package/lib/myLib/zod/src/v4/core/json-schema.js +1 -0
  123. package/lib/myLib/zod/src/v4/core/parse.d.ts +49 -0
  124. package/lib/myLib/zod/src/v4/core/parse.js +147 -0
  125. package/lib/myLib/zod/src/v4/core/regexes.d.ts +78 -0
  126. package/lib/myLib/zod/src/v4/core/regexes.js +146 -0
  127. package/lib/myLib/zod/src/v4/core/registries.d.ts +35 -0
  128. package/lib/myLib/zod/src/v4/core/registries.js +51 -0
  129. package/lib/myLib/zod/src/v4/core/schemas.d.ts +1136 -0
  130. package/lib/myLib/zod/src/v4/core/schemas.js +2745 -0
  131. package/lib/myLib/zod/src/v4/core/standard-schema.d.ts +126 -0
  132. package/lib/myLib/zod/src/v4/core/standard-schema.js +1 -0
  133. package/lib/myLib/zod/src/v4/core/to-json-schema.d.ts +114 -0
  134. package/lib/myLib/zod/src/v4/core/to-json-schema.js +488 -0
  135. package/lib/myLib/zod/src/v4/core/util.d.ts +199 -0
  136. package/lib/myLib/zod/src/v4/core/util.js +656 -0
  137. package/lib/myLib/zod/src/v4/core/versions.d.ts +5 -0
  138. package/lib/myLib/zod/src/v4/core/versions.js +5 -0
  139. package/lib/myLib/zod/src/v4/core/zsf.d.ts +91 -0
  140. package/lib/myLib/zod/src/v4/core/zsf.js +1 -0
  141. package/lib/myLib/zod/src/v4/mini/checks.d.ts +1 -0
  142. package/lib/myLib/zod/src/v4/mini/checks.js +1 -0
  143. package/lib/myLib/zod/src/v4/mini/coerce.d.ts +7 -0
  144. package/lib/myLib/zod/src/v4/mini/coerce.js +27 -0
  145. package/lib/myLib/zod/src/v4/mini/external.d.ts +11 -0
  146. package/lib/myLib/zod/src/v4/mini/external.js +16 -0
  147. package/lib/myLib/zod/src/v4/mini/index.d.ts +3 -0
  148. package/lib/myLib/zod/src/v4/mini/index.js +3 -0
  149. package/lib/myLib/zod/src/v4/mini/iso.d.ts +22 -0
  150. package/lib/myLib/zod/src/v4/mini/iso.js +46 -0
  151. package/lib/myLib/zod/src/v4/mini/parse.d.ts +1 -0
  152. package/lib/myLib/zod/src/v4/mini/parse.js +1 -0
  153. package/lib/myLib/zod/src/v4/mini/schemas.js +1244 -0
  154. package/lib/utils/index.d.ts +1 -0
  155. package/lib/utils/index.js +2 -1
  156. package/package.json +5 -3
@@ -0,0 +1,9 @@
1
+ import type * as errors from "./errors.js";
2
+ export interface $ZodConfig {
3
+ /** Custom error map. Overrides `config().localeError`. */
4
+ customError?: errors.$ZodErrorMap | undefined;
5
+ /** Localized error map. Lowest priority. */
6
+ localeError?: errors.$ZodErrorMap | undefined;
7
+ }
8
+ export declare const globalConfig: $ZodConfig;
9
+ export declare function config(config?: Partial<$ZodConfig>): $ZodConfig;
@@ -0,0 +1,5 @@
1
+ export const globalConfig = {};
2
+ export function config(config) {
3
+ if (config) Object.assign(globalConfig, config);
4
+ return globalConfig;
5
+ }
@@ -0,0 +1,70 @@
1
+ import type * as errors from "./errors.js";
2
+ import type * as schemas from "./schemas.js";
3
+ import type { Class } from "./util.js";
4
+ type ZodTrait = {
5
+ _zod: {
6
+ def: any;
7
+ [k: string]: any;
8
+ };
9
+ };
10
+ export interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
11
+ new (def: D): T;
12
+ init(inst: T, def: D): asserts inst is T;
13
+ }
14
+ /** A special constant with type `never` */
15
+ export declare const NEVER: never;
16
+ export declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void, params?: {
17
+ Parent?: typeof Class;
18
+ }): $constructor<T, D>;
19
+ export declare const $brand: unique symbol;
20
+ export type $brand<T extends string | number | symbol = string | number | symbol> = {
21
+ [$brand]: {
22
+ [k in T]: true;
23
+ };
24
+ };
25
+ export type $ZodBranded<T extends schemas.SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
26
+ _zod: {
27
+ input: input<T> & $brand<Brand>;
28
+ output: output<T> & $brand<Brand>;
29
+ };
30
+ } : Dir extends "in" ? {
31
+ _zod: {
32
+ input: input<T> & $brand<Brand>;
33
+ };
34
+ } : {
35
+ _zod: {
36
+ output: output<T> & $brand<Brand>;
37
+ };
38
+ });
39
+ export type $ZodNarrow<T extends schemas.SomeType, Out> = T & {
40
+ _zod: {
41
+ output: Out;
42
+ };
43
+ };
44
+ export declare class $ZodAsyncError extends Error {
45
+ constructor();
46
+ }
47
+ export declare class $ZodEncodeError extends Error {
48
+ constructor(name: string);
49
+ }
50
+ export type input<T> = T extends {
51
+ _zod: {
52
+ input: any;
53
+ };
54
+ } ? T["_zod"]["input"] : unknown;
55
+ export type output<T> = T extends {
56
+ _zod: {
57
+ output: any;
58
+ };
59
+ } ? T["_zod"]["output"] : unknown;
60
+ export type { output as infer };
61
+ export interface $ZodConfig {
62
+ /** Custom error map. Overrides `config().localeError`. */
63
+ customError?: errors.$ZodErrorMap | undefined;
64
+ /** Localized error map. Lowest priority. */
65
+ localeError?: errors.$ZodErrorMap | undefined;
66
+ /** Disable JIT schema compilation. Useful in environments that disallow `eval`. */
67
+ jitless?: boolean | undefined;
68
+ }
69
+ export declare const globalConfig: $ZodConfig;
70
+ export declare function config(newConfig?: Partial<$ZodConfig>): $ZodConfig;
@@ -0,0 +1,95 @@
1
+ ////////////////////////////// CONSTRUCTORS ///////////////////////////////////////
2
+
3
+ /** A special constant with type `never` */
4
+ export const NEVER = Object.freeze({
5
+ status: "aborted"
6
+ });
7
+ export /*@__NO_SIDE_EFFECTS__*/function $constructor(name, initializer, params) {
8
+ var _params$Parent;
9
+ function init(inst, def) {
10
+ if (!inst._zod) {
11
+ Object.defineProperty(inst, "_zod", {
12
+ value: {
13
+ def,
14
+ constr: _,
15
+ traits: new Set()
16
+ },
17
+ enumerable: false
18
+ });
19
+ }
20
+ if (inst._zod.traits.has(name)) {
21
+ return;
22
+ }
23
+ inst._zod.traits.add(name);
24
+ initializer(inst, def);
25
+
26
+ // support prototype modifications
27
+ const proto = _.prototype;
28
+ const keys = Object.keys(proto);
29
+ for (let i = 0; i < keys.length; i++) {
30
+ const k = keys[i];
31
+ if (!(k in inst)) {
32
+ inst[k] = proto[k].bind(inst);
33
+ }
34
+ }
35
+ }
36
+
37
+ // doesn't work if Parent has a constructor with arguments
38
+ const Parent = (_params$Parent = params === null || params === void 0 ? void 0 : params.Parent) !== null && _params$Parent !== void 0 ? _params$Parent : Object;
39
+ class Definition extends Parent {}
40
+ Object.defineProperty(Definition, "name", {
41
+ value: name
42
+ });
43
+ function _(def) {
44
+ const inst = params !== null && params !== void 0 && params.Parent ? new Definition() : this;
45
+ init(inst, def);
46
+ inst._zod.deferred ??= [];
47
+ for (const fn of inst._zod.deferred) {
48
+ fn();
49
+ }
50
+ return inst;
51
+ }
52
+ Object.defineProperty(_, "init", {
53
+ value: init
54
+ });
55
+ Object.defineProperty(_, Symbol.hasInstance, {
56
+ value: inst => {
57
+ var _inst$_zod;
58
+ if (params !== null && params !== void 0 && params.Parent && inst instanceof params.Parent) return true;
59
+ return inst === null || inst === void 0 || (_inst$_zod = inst._zod) === null || _inst$_zod === void 0 || (_inst$_zod = _inst$_zod.traits) === null || _inst$_zod === void 0 ? void 0 : _inst$_zod.has(name);
60
+ }
61
+ });
62
+ Object.defineProperty(_, "name", {
63
+ value: name
64
+ });
65
+ return _;
66
+ }
67
+
68
+ ////////////////////////////// UTILITIES ///////////////////////////////////////
69
+ export const $brand = Symbol("zod_brand");
70
+ export class $ZodAsyncError extends Error {
71
+ constructor() {
72
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
73
+ }
74
+ }
75
+ export class $ZodEncodeError extends Error {
76
+ constructor(name) {
77
+ super(`Encountered unidirectional transform during encode: ${name}`);
78
+ this.name = "ZodEncodeError";
79
+ }
80
+ }
81
+
82
+ //////////////////////////// TYPE HELPERS ///////////////////////////////////
83
+
84
+ // export type input<T extends schemas.$ZodType> = T["_zod"]["input"];
85
+ // export type output<T extends schemas.$ZodType> = T["_zod"]["output"];
86
+ // export type input<T extends schemas.$ZodType> = T["_zod"]["input"];
87
+ // export type output<T extends schemas.$ZodType> = T["_zod"]["output"];
88
+
89
+ ////////////////////////////// CONFIG ///////////////////////////////////////
90
+
91
+ export const globalConfig = {};
92
+ export function config(newConfig) {
93
+ if (newConfig) Object.assign(globalConfig, newConfig);
94
+ return globalConfig;
95
+ }
@@ -0,0 +1,14 @@
1
+ type ModeWriter = (doc: Doc, modes: {
2
+ execution: "sync" | "async";
3
+ }) => void;
4
+ export declare class Doc {
5
+ args: string[];
6
+ content: string[];
7
+ indent: number;
8
+ constructor(args?: string[]);
9
+ indented(fn: (doc: Doc) => void): void;
10
+ write(fn: ModeWriter): void;
11
+ write(line: string): void;
12
+ compile(): any;
13
+ }
14
+ export {};
@@ -0,0 +1,42 @@
1
+ import "core-js/modules/esnext.iterator.constructor.js";
2
+ import "core-js/modules/esnext.iterator.filter.js";
3
+ import "core-js/modules/esnext.iterator.map.js";
4
+ export class Doc {
5
+ content = [];
6
+ indent = 0;
7
+ constructor() {
8
+ let args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9
+ if (this) this.args = args;
10
+ }
11
+ indented(fn) {
12
+ this.indent += 1;
13
+ fn(this);
14
+ this.indent -= 1;
15
+ }
16
+ write(arg) {
17
+ if (typeof arg === "function") {
18
+ arg(this, {
19
+ execution: "sync"
20
+ });
21
+ arg(this, {
22
+ execution: "async"
23
+ });
24
+ return;
25
+ }
26
+ const lines = arg.split("\n").filter(x => x);
27
+ const minIndent = Math.min(...lines.map(x => x.length - x.trimStart().length));
28
+ const dedented = lines.map(x => x.slice(minIndent)).map(x => " ".repeat(this.indent * 2) + x);
29
+ for (const line of dedented) {
30
+ this.content.push(line);
31
+ }
32
+ }
33
+ compile() {
34
+ var _this$content;
35
+ const F = Function;
36
+ const args = this === null || this === void 0 ? void 0 : this.args;
37
+ const content = (_this$content = this === null || this === void 0 ? void 0 : this.content) !== null && _this$content !== void 0 ? _this$content : [``];
38
+ const lines = [...content.map(x => ` ${x}`)];
39
+ // console.log(lines.join("\n"));
40
+ return new F(...args, lines.join("\n"));
41
+ }
42
+ }
@@ -0,0 +1,220 @@
1
+ import type { $ZodCheck, $ZodStringFormats } from "./checks.js";
2
+ import { $constructor } from "./core.js";
3
+ import type { $ZodType } from "./schemas.js";
4
+ import type { StandardSchemaV1 } from "./standard-schema.js";
5
+ import * as util from "./util.js";
6
+ export interface $ZodIssueBase {
7
+ readonly code?: string;
8
+ readonly input?: unknown;
9
+ readonly path: PropertyKey[];
10
+ readonly message: string;
11
+ }
12
+ export type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {});
13
+ export interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
14
+ readonly code: "invalid_type";
15
+ readonly expected: $ZodInvalidTypeExpected;
16
+ readonly input?: Input;
17
+ }
18
+ export interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
19
+ readonly code: "too_big";
20
+ readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
21
+ readonly maximum: number | bigint;
22
+ readonly inclusive?: boolean;
23
+ readonly exact?: boolean;
24
+ readonly input?: Input;
25
+ }
26
+ export interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
27
+ readonly code: "too_small";
28
+ readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
29
+ readonly minimum: number | bigint;
30
+ /** True if the allowable range includes the minimum */
31
+ readonly inclusive?: boolean;
32
+ /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
33
+ readonly exact?: boolean;
34
+ readonly input?: Input;
35
+ }
36
+ export interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
37
+ readonly code: "invalid_format";
38
+ readonly format: $ZodStringFormats | (string & {});
39
+ readonly pattern?: string;
40
+ readonly input?: string;
41
+ }
42
+ export interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
43
+ readonly code: "not_multiple_of";
44
+ readonly divisor: number;
45
+ readonly input?: Input;
46
+ }
47
+ export interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
48
+ readonly code: "unrecognized_keys";
49
+ readonly keys: string[];
50
+ readonly input?: Record<string, unknown>;
51
+ }
52
+ interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
53
+ readonly code: "invalid_union";
54
+ readonly errors: $ZodIssue[][];
55
+ readonly input?: unknown;
56
+ readonly discriminator?: string | undefined;
57
+ readonly inclusive?: true;
58
+ }
59
+ interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
60
+ readonly code: "invalid_union";
61
+ readonly errors: [];
62
+ readonly input?: unknown;
63
+ readonly discriminator?: string | undefined;
64
+ readonly inclusive: false;
65
+ }
66
+ export type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
67
+ export interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
68
+ readonly code: "invalid_key";
69
+ readonly origin: "map" | "record";
70
+ readonly issues: $ZodIssue[];
71
+ readonly input?: Input;
72
+ }
73
+ export interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
74
+ readonly code: "invalid_element";
75
+ readonly origin: "map" | "set";
76
+ readonly key: unknown;
77
+ readonly issues: $ZodIssue[];
78
+ readonly input?: Input;
79
+ }
80
+ export interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
81
+ readonly code: "invalid_value";
82
+ readonly values: util.Primitive[];
83
+ readonly input?: Input;
84
+ }
85
+ export interface $ZodIssueCustom extends $ZodIssueBase {
86
+ readonly code: "custom";
87
+ readonly params?: Record<string, any> | undefined;
88
+ readonly input?: unknown;
89
+ }
90
+ export interface $ZodIssueStringCommonFormats extends $ZodIssueInvalidStringFormat {
91
+ format: Exclude<$ZodStringFormats, "regex" | "jwt" | "starts_with" | "ends_with" | "includes">;
92
+ }
93
+ export interface $ZodIssueStringInvalidRegex extends $ZodIssueInvalidStringFormat {
94
+ format: "regex";
95
+ pattern: string;
96
+ }
97
+ export interface $ZodIssueStringInvalidJWT extends $ZodIssueInvalidStringFormat {
98
+ format: "jwt";
99
+ algorithm?: string;
100
+ }
101
+ export interface $ZodIssueStringStartsWith extends $ZodIssueInvalidStringFormat {
102
+ format: "starts_with";
103
+ prefix: string;
104
+ }
105
+ export interface $ZodIssueStringEndsWith extends $ZodIssueInvalidStringFormat {
106
+ format: "ends_with";
107
+ suffix: string;
108
+ }
109
+ export interface $ZodIssueStringIncludes extends $ZodIssueInvalidStringFormat {
110
+ format: "includes";
111
+ includes: string;
112
+ }
113
+ export type $ZodStringFormatIssues = $ZodIssueStringCommonFormats | $ZodIssueStringInvalidRegex | $ZodIssueStringInvalidJWT | $ZodIssueStringStartsWith | $ZodIssueStringEndsWith | $ZodIssueStringIncludes;
114
+ export type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
115
+ export type $ZodIssueCode = $ZodIssue["code"];
116
+ export type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
117
+ type RawIssue<T extends $ZodIssueBase> = T extends any ? util.Flatten<util.MakePartial<T, "message" | "path"> & {
118
+ /** The input data */
119
+ readonly input: unknown;
120
+ /** The schema or check that originated this issue. */
121
+ readonly inst?: $ZodType | $ZodCheck;
122
+ /** If `true`, Zod will continue executing checks/refinements after this issue. */
123
+ readonly continue?: boolean | undefined;
124
+ } & Record<string, unknown>> : never;
125
+ export type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
126
+ export interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
127
+ (issue: $ZodRawIssue<T>): {
128
+ message: string;
129
+ } | string | undefined | null;
130
+ }
131
+ export interface $ZodError<T = unknown> extends Error {
132
+ type: T;
133
+ issues: $ZodIssue[];
134
+ _zod: {
135
+ output: T;
136
+ def: $ZodIssue[];
137
+ };
138
+ stack?: string;
139
+ name: string;
140
+ }
141
+ export declare const $ZodError: $constructor<$ZodError>;
142
+ interface $ZodRealError<T = any> extends $ZodError<T> {
143
+ }
144
+ export declare const $ZodRealError: $constructor<$ZodRealError>;
145
+ export type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
146
+ type _FlattenedError<T, U = string> = {
147
+ formErrors: U[];
148
+ fieldErrors: {
149
+ [P in keyof T]?: U[];
150
+ };
151
+ };
152
+ export declare function flattenError<T>(error: $ZodError<T>): _FlattenedError<T>;
153
+ export declare function flattenError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): _FlattenedError<T, U>;
154
+ type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? {
155
+ [K in keyof T]?: $ZodFormattedError<T[K], U>;
156
+ } : T extends any[] ? {
157
+ [k: number]: $ZodFormattedError<T[number], U>;
158
+ } : T extends object ? util.Flatten<{
159
+ [K in keyof T]?: $ZodFormattedError<T[K], U>;
160
+ }> : any;
161
+ export type $ZodFormattedError<T, U = string> = {
162
+ _errors: U[];
163
+ } & util.Flatten<_ZodFormattedError<T, U>>;
164
+ export declare function formatError<T>(error: $ZodError<T>): $ZodFormattedError<T>;
165
+ export declare function formatError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
166
+ export type $ZodErrorTree<T, U = string> = T extends util.Primitive ? {
167
+ errors: U[];
168
+ } : T extends [any, ...any[]] ? {
169
+ errors: U[];
170
+ items?: {
171
+ [K in keyof T]?: $ZodErrorTree<T[K], U>;
172
+ };
173
+ } : T extends any[] ? {
174
+ errors: U[];
175
+ items?: Array<$ZodErrorTree<T[number], U>>;
176
+ } : T extends object ? {
177
+ errors: U[];
178
+ properties?: {
179
+ [K in keyof T]?: $ZodErrorTree<T[K], U>;
180
+ };
181
+ } : {
182
+ errors: U[];
183
+ };
184
+ export declare function treeifyError<T>(error: $ZodError<T>): $ZodErrorTree<T>;
185
+ export declare function treeifyError<T, U>(error: $ZodError<T>, mapper?: (issue: $ZodIssue) => U): $ZodErrorTree<T, U>;
186
+ /** Format a ZodError as a human-readable string in the following form.
187
+ *
188
+ * From
189
+ *
190
+ * ```ts
191
+ * ZodError {
192
+ * issues: [
193
+ * {
194
+ * expected: 'string',
195
+ * code: 'invalid_type',
196
+ * path: [ 'username' ],
197
+ * message: 'Invalid input: expected string'
198
+ * },
199
+ * {
200
+ * expected: 'number',
201
+ * code: 'invalid_type',
202
+ * path: [ 'favoriteNumbers', 1 ],
203
+ * message: 'Invalid input: expected number'
204
+ * }
205
+ * ];
206
+ * }
207
+ * ```
208
+ *
209
+ * to
210
+ *
211
+ * ```
212
+ * username
213
+ * ✖ Expected number, received string at "username
214
+ * favoriteNumbers[0]
215
+ * ✖ Invalid input: expected number
216
+ * ```
217
+ */
218
+ export declare function toDotPath(_path: readonly (string | number | symbol | StandardSchemaV1.PathSegment)[]): string;
219
+ export declare function prettifyError(error: StandardSchemaV1.FailureResult): string;
220
+ export {};