@design-edito/tools 0.1.13 → 0.1.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.
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  Random
3
3
  } from "../../chunks/chunk-WLL3FNVL.js";
4
+ import {
5
+ generateNiceColor,
6
+ niceColors
7
+ } from "../../chunks/chunk-EDVNAV3G.js";
4
8
  import {
5
9
  register
6
- } from "../../chunks/chunk-DRXZ4YUW.js";
10
+ } from "../../chunks/chunk-LBOQFB4H.js";
7
11
  import {
8
12
  Crossenv
9
13
  } from "../../chunks/chunk-GJOU3UAL.js";
10
14
  import "../../chunks/chunk-4CMAH7Q4.js";
11
15
  import "../../chunks/chunk-HEXR23CH.js";
12
16
  import "../../chunks/chunk-HDPSQ7WY.js";
13
- import {
14
- generateNiceColor,
15
- niceColors
16
- } from "../../chunks/chunk-EDVNAV3G.js";
17
17
  import {
18
18
  Bem
19
19
  } from "../../chunks/chunk-KIONYWA7.js";
@@ -1,27 +1,27 @@
1
- import { Outcome } from "~/agnostic/misc/outcome";
1
+ import { Outcome } from '~/agnostic/misc/outcome';
2
2
  export declare namespace Register {
3
3
  type RegisterEntry = {
4
4
  message: string;
5
- detailsMaker?: (...params: any[]) => any;
5
+ detailsMaker: (...params: any[]) => any;
6
6
  };
7
7
  function from<Source extends {
8
8
  [k: string]: RegisterEntry;
9
9
  }>(source: Source): {
10
10
  getMessage: <Code extends keyof Source>(code: Code) => Source[Code]["message"];
11
- getDetailsMaker: <Code extends keyof Source>(code: Code) => Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined;
12
- getDetails: <Code extends keyof Source>(code: Code, ...params: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
13
- getError: <Code extends keyof Source>(code: Code, ...params: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => {
11
+ getDetailsMaker: <Code extends keyof Source>(code: Code) => Source[Code]["detailsMaker"];
12
+ getDetails: <Code extends keyof Source>(code: Code, ...params: Parameters<Source[Code]["detailsMaker"]>) => ReturnType<Source[Code]["detailsMaker"]>;
13
+ getError: <Code extends keyof Source>(code: Code, ...params: Parameters<Source[Code]["detailsMaker"]>) => {
14
14
  code: Code;
15
- details: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
15
+ details: ReturnType<Source[Code]["detailsMaker"]>;
16
16
  name: string;
17
17
  message: string;
18
18
  stack?: string;
19
19
  };
20
- getFailureOutcome: <Code extends keyof Source>(code: Code, ...params: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => Outcome.Failure<Code, Source[Code]["message"], (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never>;
20
+ getFailureOutcome: <Code extends keyof Source>(code: Code, ...params: Parameters<Source[Code]["detailsMaker"]>) => Outcome.Failure<Code, Source[Code]["message"], ReturnType<Source[Code]["detailsMaker"]>>;
21
21
  CustomError: {
22
- new <Code extends keyof Source>(code: Code, ...params: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []): {
22
+ new <Code extends keyof Source>(code: Code, ...params: Parameters<Source[Code]["detailsMaker"]>): {
23
23
  code: Code;
24
- details: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
24
+ details: ReturnType<Source[Code]["detailsMaker"]>;
25
25
  name: string;
26
26
  message: string;
27
27
  stack?: string;
@@ -1,25 +1,25 @@
1
- import {
2
- insertNode
3
- } from "../../chunks/chunk-XA4HVHJ4.js";
4
- import {
5
- Placeholders
6
- } from "../../chunks/chunk-VYW4IADX.js";
7
1
  import {
8
2
  selectorToElement
9
- } from "../../chunks/chunk-R6W6KA2P.js";
3
+ } from "../../chunks/chunk-TSMHOSST.js";
10
4
  import {
11
5
  stringToNodes
12
- } from "../../chunks/chunk-NGL6BHCM.js";
6
+ } from "../../chunks/chunk-YJOEYNCI.js";
7
+ import {
8
+ insertNode
9
+ } from "../../chunks/chunk-XA4HVHJ4.js";
10
+ import {
11
+ Sanitize
12
+ } from "../../chunks/chunk-O2VE3J4K.js";
13
13
  import {
14
14
  getNodeAncestors
15
15
  } from "../../chunks/chunk-SQZGZ3VT.js";
16
+ import {
17
+ Placeholders
18
+ } from "../../chunks/chunk-VYW4IADX.js";
16
19
  import {
17
20
  getPositionInsideParent
18
21
  } from "../../chunks/chunk-VTPRO4NJ.js";
19
- import {
20
- Sanitize
21
- } from "../../chunks/chunk-4S4UJG5A.js";
22
- import "../../chunks/chunk-DRXZ4YUW.js";
22
+ import "../../chunks/chunk-LBOQFB4H.js";
23
23
  import "../../chunks/chunk-GJOU3UAL.js";
24
24
  import "../../chunks/chunk-4CMAH7Q4.js";
25
25
  import "../../chunks/chunk-HEXR23CH.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Sanitize
3
- } from "../../../chunks/chunk-4S4UJG5A.js";
4
- import "../../../chunks/chunk-DRXZ4YUW.js";
3
+ } from "../../../chunks/chunk-O2VE3J4K.js";
4
+ import "../../../chunks/chunk-LBOQFB4H.js";
5
5
  import "../../../chunks/chunk-GJOU3UAL.js";
6
6
  import "../../../chunks/chunk-4CMAH7Q4.js";
7
7
  import "../../../chunks/chunk-HEXR23CH.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  selectorToElement
3
- } from "../../../chunks/chunk-R6W6KA2P.js";
4
- import "../../../chunks/chunk-DRXZ4YUW.js";
3
+ } from "../../../chunks/chunk-TSMHOSST.js";
4
+ import "../../../chunks/chunk-LBOQFB4H.js";
5
5
  import "../../../chunks/chunk-GJOU3UAL.js";
6
6
  import "../../../chunks/chunk-4CMAH7Q4.js";
7
7
  import "../../../chunks/chunk-HEXR23CH.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  stringToNodes
3
- } from "../../../chunks/chunk-NGL6BHCM.js";
4
- import "../../../chunks/chunk-4S4UJG5A.js";
5
- import "../../../chunks/chunk-DRXZ4YUW.js";
3
+ } from "../../../chunks/chunk-YJOEYNCI.js";
4
+ import "../../../chunks/chunk-O2VE3J4K.js";
5
+ import "../../../chunks/chunk-LBOQFB4H.js";
6
6
  import "../../../chunks/chunk-GJOU3UAL.js";
7
7
  import "../../../chunks/chunk-4CMAH7Q4.js";
8
8
  import "../../../chunks/chunk-HEXR23CH.js";
@@ -1,12 +1,12 @@
1
- import {
2
- getCurrentDownlink
3
- } from "../../chunks/chunk-7AWTHZLY.js";
4
1
  import {
5
2
  Logs
6
3
  } from "../../chunks/chunk-HEJV6JIO.js";
7
4
  import {
8
5
  Assert
9
6
  } from "../../chunks/chunk-W7YBGJ4H.js";
7
+ import {
8
+ getCurrentDownlink
9
+ } from "../../chunks/chunk-7AWTHZLY.js";
10
10
  import {
11
11
  Cast
12
12
  } from "../../chunks/chunk-4QQBKBYH.js";
@@ -1,19 +1,19 @@
1
- import {
2
- interpolate
3
- } from "../../chunks/chunk-EW46EXFB.js";
4
- import {
5
- createScale,
6
- getHarmonic
7
- } from "../../chunks/chunk-UYTXXUU7.js";
8
1
  import {
9
2
  absoluteModulo
10
3
  } from "../../chunks/chunk-DNIOWD7K.js";
11
4
  import {
12
5
  clamp
13
6
  } from "../../chunks/chunk-OSAXBA7G.js";
7
+ import {
8
+ createScale,
9
+ getHarmonic
10
+ } from "../../chunks/chunk-UYTXXUU7.js";
14
11
  import {
15
12
  round
16
13
  } from "../../chunks/chunk-32IRF4OP.js";
14
+ import {
15
+ interpolate
16
+ } from "../../chunks/chunk-EW46EXFB.js";
17
17
 
18
18
  // src/agnostic/numbers/index.ts
19
19
  var Numbers;
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  flattenGetters
3
3
  } from "../../chunks/chunk-PO3V3I57.js";
4
+ import {
5
+ isRecord
6
+ } from "../../chunks/chunk-YDIBNEGA.js";
4
7
  import {
5
8
  isNonNullObject,
6
9
  isObject
@@ -8,9 +11,6 @@ import {
8
11
  import {
9
12
  Validation
10
13
  } from "../../chunks/chunk-FPEW3A27.js";
11
- import {
12
- isRecord
13
- } from "../../chunks/chunk-YDIBNEGA.js";
14
14
  import {
15
15
  Enums
16
16
  } from "../../chunks/chunk-WOAYU6LB.js";
@@ -1,10 +1,10 @@
1
+ import {
2
+ memoize
3
+ } from "../../chunks/chunk-JWBDZPQG.js";
1
4
  import {
2
5
  debounce,
3
6
  throttle
4
7
  } from "../../chunks/chunk-VZDUZTW6.js";
5
- import {
6
- memoize
7
- } from "../../chunks/chunk-JWBDZPQG.js";
8
8
 
9
9
  // src/agnostic/optim/index.ts
10
10
  var Optim;
@@ -8,7 +8,8 @@ import {
8
8
  // src/shared/errors/index.ts
9
9
  var register = Errors.Register.from({
10
10
  ["no-window-document-on-runtime" /* NO_DOCUMENT */]: {
11
- message: `Runtime '${Crossenv.detectRuntime()}' does not provide a Document object, cannot complete.`
11
+ message: `Runtime '${Crossenv.detectRuntime()}' does not provide a Document object, cannot complete.`,
12
+ detailsMaker: () => void 0
12
13
  },
13
14
  ["no-window-document-on-runtime-please-provide" /* NO_DOCUMENT_PLEASE_PROVIDE */]: {
14
15
  message: `Please provide a Document object since none are found on runtime '${Crossenv.detectRuntime()}'`,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  register
3
- } from "./chunk-DRXZ4YUW.js";
3
+ } from "./chunk-LBOQFB4H.js";
4
4
  import {
5
5
  Crossenv
6
6
  } from "./chunk-GJOU3UAL.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  register
3
- } from "./chunk-DRXZ4YUW.js";
3
+ } from "./chunk-LBOQFB4H.js";
4
4
  import {
5
5
  Crossenv
6
6
  } from "./chunk-GJOU3UAL.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Sanitize
3
- } from "./chunk-4S4UJG5A.js";
3
+ } from "./chunk-O2VE3J4K.js";
4
4
  import {
5
5
  register
6
- } from "./chunk-DRXZ4YUW.js";
6
+ } from "./chunk-LBOQFB4H.js";
7
7
  import {
8
8
  Crossenv
9
9
  } from "./chunk-GJOU3UAL.js";
@@ -1,9 +1,9 @@
1
- import {
2
- readWrite
3
- } from "../../chunks/chunk-7DBNMU6N.js";
4
1
  import {
5
2
  isInDirectory
6
3
  } from "../../chunks/chunk-NRITRUZW.js";
4
+ import {
5
+ readWrite
6
+ } from "../../chunks/chunk-7DBNMU6N.js";
7
7
  import {
8
8
  Subpaths
9
9
  } from "../../chunks/chunk-HGCG2J77.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design-edito/tools",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "",
5
5
  "author": "Maxime Fabas",
6
6
  "license": "ISC",
@@ -6,6 +6,7 @@ export declare const register: {
6
6
  getMessage: <Code extends Codes>(code: Code) => {
7
7
  "no-window-document-on-runtime": {
8
8
  message: string;
9
+ detailsMaker: () => undefined;
9
10
  };
10
11
  "no-window-document-on-runtime-please-provide": {
11
12
  message: string;
@@ -15,169 +16,107 @@ export declare const register: {
15
16
  getDetailsMaker: <Code extends Codes>(code: Code) => {
16
17
  "no-window-document-on-runtime": {
17
18
  message: string;
19
+ detailsMaker: () => undefined;
18
20
  };
19
21
  "no-window-document-on-runtime-please-provide": {
20
22
  message: string;
21
23
  detailsMaker: (tips?: string) => string | undefined;
22
24
  };
23
- }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
25
+ }[Code]["detailsMaker"];
26
+ getDetails: <Code extends Codes>(code: Code, ...params: Parameters<{
24
27
  "no-window-document-on-runtime": {
25
28
  message: string;
29
+ detailsMaker: () => undefined;
26
30
  };
27
31
  "no-window-document-on-runtime-please-provide": {
28
32
  message: string;
29
33
  detailsMaker: (tips?: string) => string | undefined;
30
34
  };
31
- }[Code]["detailsMaker"] : undefined;
32
- getDetails: <Code extends Codes>(code: Code, ...params: ({
35
+ }[Code]["detailsMaker"]>) => ReturnType<{
33
36
  "no-window-document-on-runtime": {
34
37
  message: string;
38
+ detailsMaker: () => undefined;
35
39
  };
36
40
  "no-window-document-on-runtime-please-provide": {
37
41
  message: string;
38
42
  detailsMaker: (tips?: string) => string | undefined;
39
43
  };
40
- }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
44
+ }[Code]["detailsMaker"]>;
45
+ getError: <Code extends Codes>(code: Code, ...params: Parameters<{
41
46
  "no-window-document-on-runtime": {
42
47
  message: string;
48
+ detailsMaker: () => undefined;
43
49
  };
44
50
  "no-window-document-on-runtime-please-provide": {
45
51
  message: string;
46
52
  detailsMaker: (tips?: string) => string | undefined;
47
53
  };
48
- }[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => ({
49
- "no-window-document-on-runtime": {
50
- message: string;
51
- };
52
- "no-window-document-on-runtime-please-provide": {
53
- message: string;
54
- detailsMaker: (tips?: string) => string | undefined;
55
- };
56
- }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
57
- "no-window-document-on-runtime": {
58
- message: string;
59
- };
60
- "no-window-document-on-runtime-please-provide": {
61
- message: string;
62
- detailsMaker: (tips?: string) => string | undefined;
63
- };
64
- }[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
65
- getError: <Code extends Codes>(code: Code, ...params: ({
66
- "no-window-document-on-runtime": {
67
- message: string;
68
- };
69
- "no-window-document-on-runtime-please-provide": {
70
- message: string;
71
- detailsMaker: (tips?: string) => string | undefined;
72
- };
73
- }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
74
- "no-window-document-on-runtime": {
75
- message: string;
76
- };
77
- "no-window-document-on-runtime-please-provide": {
78
- message: string;
79
- detailsMaker: (tips?: string) => string | undefined;
80
- };
81
- }[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => {
54
+ }[Code]["detailsMaker"]>) => {
82
55
  code: Code;
83
- details: ({
56
+ details: ReturnType<{
84
57
  "no-window-document-on-runtime": {
85
58
  message: string;
59
+ detailsMaker: () => undefined;
86
60
  };
87
61
  "no-window-document-on-runtime-please-provide": {
88
62
  message: string;
89
63
  detailsMaker: (tips?: string) => string | undefined;
90
64
  };
91
- }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
92
- "no-window-document-on-runtime": {
93
- message: string;
94
- };
95
- "no-window-document-on-runtime-please-provide": {
96
- message: string;
97
- detailsMaker: (tips?: string) => string | undefined;
98
- };
99
- }[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
65
+ }[Code]["detailsMaker"]>;
100
66
  name: string;
101
67
  message: string;
102
68
  stack?: string;
103
69
  };
104
- getFailureOutcome: <Code extends Codes>(code: Code, ...params: ({
105
- "no-window-document-on-runtime": {
106
- message: string;
107
- };
108
- "no-window-document-on-runtime-please-provide": {
109
- message: string;
110
- detailsMaker: (tips?: string) => string | undefined;
111
- };
112
- }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
70
+ getFailureOutcome: <Code extends Codes>(code: Code, ...params: Parameters<{
113
71
  "no-window-document-on-runtime": {
114
72
  message: string;
73
+ detailsMaker: () => undefined;
115
74
  };
116
75
  "no-window-document-on-runtime-please-provide": {
117
76
  message: string;
118
77
  detailsMaker: (tips?: string) => string | undefined;
119
78
  };
120
- }[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => import("../../agnostic/misc/outcome").Outcome.Failure<Code, {
79
+ }[Code]["detailsMaker"]>) => import("../../agnostic/misc/outcome").Outcome.Failure<Code, {
121
80
  "no-window-document-on-runtime": {
122
81
  message: string;
82
+ detailsMaker: () => undefined;
123
83
  };
124
84
  "no-window-document-on-runtime-please-provide": {
125
85
  message: string;
126
86
  detailsMaker: (tips?: string) => string | undefined;
127
87
  };
128
- }[Code]["message"], ({
88
+ }[Code]["message"], ReturnType<{
129
89
  "no-window-document-on-runtime": {
130
90
  message: string;
91
+ detailsMaker: () => undefined;
131
92
  };
132
93
  "no-window-document-on-runtime-please-provide": {
133
94
  message: string;
134
95
  detailsMaker: (tips?: string) => string | undefined;
135
96
  };
136
- }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
137
- "no-window-document-on-runtime": {
138
- message: string;
139
- };
140
- "no-window-document-on-runtime-please-provide": {
141
- message: string;
142
- detailsMaker: (tips?: string) => string | undefined;
143
- };
144
- }[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never>;
97
+ }[Code]["detailsMaker"]>>;
145
98
  CustomError: {
146
- new <Code extends Codes>(code: Code, ...params: ({
147
- "no-window-document-on-runtime": {
148
- message: string;
149
- };
150
- "no-window-document-on-runtime-please-provide": {
151
- message: string;
152
- detailsMaker: (tips?: string) => string | undefined;
153
- };
154
- }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
99
+ new <Code extends Codes>(code: Code, ...params: Parameters<{
155
100
  "no-window-document-on-runtime": {
156
101
  message: string;
102
+ detailsMaker: () => undefined;
157
103
  };
158
104
  "no-window-document-on-runtime-please-provide": {
159
105
  message: string;
160
106
  detailsMaker: (tips?: string) => string | undefined;
161
107
  };
162
- }[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []): {
108
+ }[Code]["detailsMaker"]>): {
163
109
  code: Code;
164
- details: ({
165
- "no-window-document-on-runtime": {
166
- message: string;
167
- };
168
- "no-window-document-on-runtime-please-provide": {
169
- message: string;
170
- detailsMaker: (tips?: string) => string | undefined;
171
- };
172
- }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
110
+ details: ReturnType<{
173
111
  "no-window-document-on-runtime": {
174
112
  message: string;
113
+ detailsMaker: () => undefined;
175
114
  };
176
115
  "no-window-document-on-runtime-please-provide": {
177
116
  message: string;
178
117
  detailsMaker: (tips?: string) => string | undefined;
179
118
  };
180
- }[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
119
+ }[Code]["detailsMaker"]>;
181
120
  name: string;
182
121
  message: string;
183
122
  stack?: string;
@@ -189,6 +128,7 @@ export declare const register: {
189
128
  source: {
190
129
  "no-window-document-on-runtime": {
191
130
  message: string;
131
+ detailsMaker: () => undefined;
192
132
  };
193
133
  "no-window-document-on-runtime-please-provide": {
194
134
  message: string;