@design-edito/tools 0.1.14 → 0.1.15

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,7 @@
1
- import {
2
- Random
3
- } from "../../chunks/chunk-WLL3FNVL.js";
4
1
  import {
5
2
  generateNiceColor,
6
3
  niceColors
7
4
  } from "../../chunks/chunk-EDVNAV3G.js";
8
- import {
9
- register
10
- } from "../../chunks/chunk-LBOQFB4H.js";
11
- import {
12
- Crossenv
13
- } from "../../chunks/chunk-GJOU3UAL.js";
14
- import "../../chunks/chunk-4CMAH7Q4.js";
15
- import "../../chunks/chunk-HEXR23CH.js";
16
- import "../../chunks/chunk-HDPSQ7WY.js";
17
5
  import {
18
6
  Bem
19
7
  } from "../../chunks/chunk-KIONYWA7.js";
@@ -21,6 +9,18 @@ import {
21
9
  classNameRegex,
22
10
  isValidClassName
23
11
  } from "../../chunks/chunk-W5A2TON3.js";
12
+ import {
13
+ Random
14
+ } from "../../chunks/chunk-WLL3FNVL.js";
15
+ import {
16
+ register
17
+ } from "../../chunks/chunk-6Z7QI756.js";
18
+ import "../../chunks/chunk-4CMAH7Q4.js";
19
+ import "../../chunks/chunk-HEXR23CH.js";
20
+ import "../../chunks/chunk-HDPSQ7WY.js";
21
+ import {
22
+ Crossenv
23
+ } from "../../chunks/chunk-GJOU3UAL.js";
24
24
  import "../../chunks/chunk-QXAJXTXV.js";
25
25
  import "../../chunks/chunk-HC6ZOHCS.js";
26
26
 
@@ -4,24 +4,39 @@ export declare namespace Register {
4
4
  message: string;
5
5
  detailsMaker: (...params: any[]) => any;
6
6
  };
7
+ type RegisterKeys<Source extends {
8
+ [k: string]: RegisterEntry;
9
+ }> = keyof Source;
10
+ type Message<Source extends {
11
+ [k: string]: RegisterEntry;
12
+ }, Code extends RegisterKeys<Source>> = Source[Code]['message'];
13
+ type DetailsMaker<Source extends {
14
+ [k: string]: RegisterEntry;
15
+ }, Code extends RegisterKeys<Source>> = Source[Code]['detailsMaker'];
16
+ type DetailsMakerParams<Source extends {
17
+ [k: string]: RegisterEntry;
18
+ }, Code extends RegisterKeys<Source>> = Parameters<DetailsMaker<Source, Code>>;
19
+ type Details<Source extends {
20
+ [k: string]: RegisterEntry;
21
+ }, Code extends RegisterKeys<Source>> = ReturnType<DetailsMaker<Source, Code>>;
7
22
  function from<Source extends {
8
23
  [k: string]: RegisterEntry;
9
24
  }>(source: Source): {
10
- getMessage: <Code extends keyof Source>(code: Code) => Source[Code]["message"];
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"]>) => {
25
+ getMessage: <Code extends RegisterKeys<Source>>(code: Code) => Message<Source, Code>;
26
+ getDetailsMaker: <Code extends RegisterKeys<Source>>(code: Code) => DetailsMaker<Source, Code>;
27
+ getDetails: <Code extends RegisterKeys<Source>>(code: Code, ...params: DetailsMakerParams<Source, Code>) => Details<Source, Code>;
28
+ getError: <Code extends RegisterKeys<Source>>(code: Code, ...params: DetailsMakerParams<Source, Code>) => {
14
29
  code: Code;
15
- details: ReturnType<Source[Code]["detailsMaker"]>;
30
+ details: ReturnType<DetailsMaker<Source, Code>>;
16
31
  name: string;
17
32
  message: string;
18
33
  stack?: string;
19
34
  };
20
- getFailureOutcome: <Code extends keyof Source>(code: Code, ...params: Parameters<Source[Code]["detailsMaker"]>) => Outcome.Failure<Code, Source[Code]["message"], ReturnType<Source[Code]["detailsMaker"]>>;
35
+ getFailureOutcome: <Code extends RegisterKeys<Source>>(code: Code, ...params: DetailsMakerParams<Source, Code>) => Outcome.Failure<Code, Message<Source, Code>, Details<Source, Code>>;
21
36
  CustomError: {
22
- new <Code extends keyof Source>(code: Code, ...params: Parameters<Source[Code]["detailsMaker"]>): {
37
+ new <Code extends RegisterKeys<Source>>(code: Code, ...params: DetailsMakerParams<Source, Code>): {
23
38
  code: Code;
24
- details: ReturnType<Source[Code]["detailsMaker"]>;
39
+ details: Details<Source, Code>;
25
40
  name: string;
26
41
  message: string;
27
42
  stack?: string;
@@ -1,29 +1,29 @@
1
1
  import {
2
- selectorToElement
3
- } from "../../chunks/chunk-TSMHOSST.js";
4
- import {
5
- stringToNodes
6
- } from "../../chunks/chunk-YJOEYNCI.js";
2
+ getNodeAncestors
3
+ } from "../../chunks/chunk-SQZGZ3VT.js";
7
4
  import {
8
5
  insertNode
9
6
  } from "../../chunks/chunk-XA4HVHJ4.js";
10
7
  import {
11
- Sanitize
12
- } from "../../chunks/chunk-O2VE3J4K.js";
13
- import {
14
- getNodeAncestors
15
- } from "../../chunks/chunk-SQZGZ3VT.js";
8
+ getPositionInsideParent
9
+ } from "../../chunks/chunk-VTPRO4NJ.js";
16
10
  import {
17
11
  Placeholders
18
12
  } from "../../chunks/chunk-VYW4IADX.js";
19
13
  import {
20
- getPositionInsideParent
21
- } from "../../chunks/chunk-VTPRO4NJ.js";
22
- import "../../chunks/chunk-LBOQFB4H.js";
23
- import "../../chunks/chunk-GJOU3UAL.js";
14
+ selectorToElement
15
+ } from "../../chunks/chunk-65DWG6N7.js";
16
+ import {
17
+ stringToNodes
18
+ } from "../../chunks/chunk-5HYQHLDT.js";
19
+ import {
20
+ Sanitize
21
+ } from "../../chunks/chunk-WAWK26LM.js";
22
+ import "../../chunks/chunk-6Z7QI756.js";
24
23
  import "../../chunks/chunk-4CMAH7Q4.js";
25
24
  import "../../chunks/chunk-HEXR23CH.js";
26
25
  import "../../chunks/chunk-HDPSQ7WY.js";
26
+ import "../../chunks/chunk-GJOU3UAL.js";
27
27
 
28
28
  // src/agnostic/html/index.ts
29
29
  var Html;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  Sanitize
3
- } from "../../../chunks/chunk-O2VE3J4K.js";
4
- import "../../../chunks/chunk-LBOQFB4H.js";
5
- import "../../../chunks/chunk-GJOU3UAL.js";
3
+ } from "../../../chunks/chunk-WAWK26LM.js";
4
+ import "../../../chunks/chunk-6Z7QI756.js";
6
5
  import "../../../chunks/chunk-4CMAH7Q4.js";
7
6
  import "../../../chunks/chunk-HEXR23CH.js";
8
7
  import "../../../chunks/chunk-HDPSQ7WY.js";
8
+ import "../../../chunks/chunk-GJOU3UAL.js";
9
9
  export {
10
10
  Sanitize
11
11
  };
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  selectorToElement
3
- } from "../../../chunks/chunk-TSMHOSST.js";
4
- import "../../../chunks/chunk-LBOQFB4H.js";
5
- import "../../../chunks/chunk-GJOU3UAL.js";
3
+ } from "../../../chunks/chunk-65DWG6N7.js";
4
+ import "../../../chunks/chunk-6Z7QI756.js";
6
5
  import "../../../chunks/chunk-4CMAH7Q4.js";
7
6
  import "../../../chunks/chunk-HEXR23CH.js";
8
7
  import "../../../chunks/chunk-HDPSQ7WY.js";
8
+ import "../../../chunks/chunk-GJOU3UAL.js";
9
9
  export {
10
10
  selectorToElement
11
11
  };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  stringToNodes
3
- } from "../../../chunks/chunk-YJOEYNCI.js";
4
- import "../../../chunks/chunk-O2VE3J4K.js";
5
- import "../../../chunks/chunk-LBOQFB4H.js";
6
- import "../../../chunks/chunk-GJOU3UAL.js";
3
+ } from "../../../chunks/chunk-5HYQHLDT.js";
4
+ import "../../../chunks/chunk-WAWK26LM.js";
5
+ import "../../../chunks/chunk-6Z7QI756.js";
7
6
  import "../../../chunks/chunk-4CMAH7Q4.js";
8
7
  import "../../../chunks/chunk-HEXR23CH.js";
9
8
  import "../../../chunks/chunk-HDPSQ7WY.js";
9
+ import "../../../chunks/chunk-GJOU3UAL.js";
10
10
  export {
11
11
  stringToNodes
12
12
  };
@@ -1,24 +1,24 @@
1
1
  import {
2
- Logs
3
- } from "../../chunks/chunk-HEJV6JIO.js";
2
+ getCurrentDownlink
3
+ } from "../../chunks/chunk-7AWTHZLY.js";
4
4
  import {
5
5
  Assert
6
6
  } from "../../chunks/chunk-W7YBGJ4H.js";
7
- import {
8
- getCurrentDownlink
9
- } from "../../chunks/chunk-7AWTHZLY.js";
10
7
  import {
11
8
  Cast
12
9
  } from "../../chunks/chunk-4QQBKBYH.js";
13
10
  import {
14
- isConstructorFunction
15
- } from "../../chunks/chunk-RCO57B6F.js";
11
+ Logs
12
+ } from "../../chunks/chunk-HEJV6JIO.js";
16
13
  import {
17
14
  Random
18
15
  } from "../../chunks/chunk-WLL3FNVL.js";
19
16
  import {
20
17
  Crossenv
21
18
  } from "../../chunks/chunk-GJOU3UAL.js";
19
+ import {
20
+ isConstructorFunction
21
+ } from "../../chunks/chunk-RCO57B6F.js";
22
22
  import "../../chunks/chunk-QXAJXTXV.js";
23
23
  import {
24
24
  isNotNullish,
@@ -1,9 +1,9 @@
1
- import {
2
- absoluteModulo
3
- } from "../../chunks/chunk-DNIOWD7K.js";
4
1
  import {
5
2
  clamp
6
3
  } from "../../chunks/chunk-OSAXBA7G.js";
4
+ import {
5
+ interpolate
6
+ } from "../../chunks/chunk-EW46EXFB.js";
7
7
  import {
8
8
  createScale,
9
9
  getHarmonic
@@ -12,8 +12,8 @@ import {
12
12
  round
13
13
  } from "../../chunks/chunk-32IRF4OP.js";
14
14
  import {
15
- interpolate
16
- } from "../../chunks/chunk-EW46EXFB.js";
15
+ absoluteModulo
16
+ } from "../../chunks/chunk-DNIOWD7K.js";
17
17
 
18
18
  // src/agnostic/numbers/index.ts
19
19
  var Numbers;
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  flattenGetters
3
3
  } from "../../chunks/chunk-PO3V3I57.js";
4
- import {
5
- isRecord
6
- } from "../../chunks/chunk-YDIBNEGA.js";
7
4
  import {
8
5
  isNonNullObject,
9
6
  isObject
10
7
  } from "../../chunks/chunk-HQLRJ7XW.js";
8
+ import {
9
+ isRecord
10
+ } from "../../chunks/chunk-YDIBNEGA.js";
11
11
  import {
12
12
  Validation
13
13
  } from "../../chunks/chunk-FPEW3A27.js";
@@ -1,10 +1,10 @@
1
- import {
2
- memoize
3
- } from "../../chunks/chunk-JWBDZPQG.js";
4
1
  import {
5
2
  debounce,
6
3
  throttle
7
4
  } 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;
@@ -7,14 +7,14 @@ import {
7
7
  matchesSome
8
8
  } from "../../chunks/chunk-LQFKUNVQ.js";
9
9
  import {
10
- replaceAll
11
- } from "../../chunks/chunk-MF56TTC5.js";
10
+ toAlphanum
11
+ } from "../../chunks/chunk-COVPTTAD.js";
12
12
  import {
13
13
  normalizeIndent
14
14
  } from "../../chunks/chunk-JQXNEJAP.js";
15
15
  import {
16
- toAlphanum
17
- } from "../../chunks/chunk-COVPTTAD.js";
16
+ replaceAll
17
+ } from "../../chunks/chunk-MF56TTC5.js";
18
18
 
19
19
  // src/agnostic/strings/index.ts
20
20
  var Strings;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Sanitize
3
- } from "./chunk-O2VE3J4K.js";
3
+ } from "./chunk-WAWK26LM.js";
4
4
  import {
5
5
  register
6
- } from "./chunk-LBOQFB4H.js";
6
+ } from "./chunk-6Z7QI756.js";
7
7
  import {
8
8
  Crossenv
9
9
  } from "./chunk-GJOU3UAL.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  register
3
- } from "./chunk-LBOQFB4H.js";
3
+ } from "./chunk-6Z7QI756.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-LBOQFB4H.js";
3
+ } from "./chunk-6Z7QI756.js";
4
4
  import {
5
5
  Crossenv
6
6
  } from "./chunk-GJOU3UAL.js";
@@ -1,12 +1,12 @@
1
+ import {
2
+ Subpaths
3
+ } from "../../chunks/chunk-HGCG2J77.js";
1
4
  import {
2
5
  isInDirectory
3
6
  } from "../../chunks/chunk-NRITRUZW.js";
4
7
  import {
5
8
  readWrite
6
9
  } from "../../chunks/chunk-7DBNMU6N.js";
7
- import {
8
- Subpaths
9
- } from "../../chunks/chunk-HGCG2J77.js";
10
10
  import "../../chunks/chunk-LQFKUNVQ.js";
11
11
 
12
12
  // src/node/files/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design-edito/tools",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "",
5
5
  "author": "Maxime Fabas",
6
6
  "license": "ISC",
@@ -1,9 +1,10 @@
1
+ import { Errors } from '~/agnostic/errors';
1
2
  export declare enum Codes {
2
3
  NO_DOCUMENT = "no-window-document-on-runtime",
3
4
  NO_DOCUMENT_PLEASE_PROVIDE = "no-window-document-on-runtime-please-provide"
4
5
  }
5
6
  export declare const register: {
6
- getMessage: <Code extends Codes>(code: Code) => {
7
+ getMessage: <Code extends Codes>(code: Code) => Errors.Register.Message<{
7
8
  "no-window-document-on-runtime": {
8
9
  message: string;
9
10
  detailsMaker: () => undefined;
@@ -12,8 +13,8 @@ export declare const register: {
12
13
  message: string;
13
14
  detailsMaker: (tips?: string) => string | undefined;
14
15
  };
15
- }[Code]["message"];
16
- getDetailsMaker: <Code extends Codes>(code: Code) => {
16
+ }, Code>;
17
+ getDetailsMaker: <Code extends Codes>(code: Code) => Errors.Register.DetailsMaker<{
17
18
  "no-window-document-on-runtime": {
18
19
  message: string;
19
20
  detailsMaker: () => undefined;
@@ -22,8 +23,8 @@ export declare const register: {
22
23
  message: string;
23
24
  detailsMaker: (tips?: string) => string | undefined;
24
25
  };
25
- }[Code]["detailsMaker"];
26
- getDetails: <Code extends Codes>(code: Code, ...params: Parameters<{
26
+ }, Code>;
27
+ getDetails: <Code extends Codes>(code: Code, ...params: Parameters<Errors.Register.DetailsMaker<{
27
28
  "no-window-document-on-runtime": {
28
29
  message: string;
29
30
  detailsMaker: () => undefined;
@@ -32,7 +33,7 @@ export declare const register: {
32
33
  message: string;
33
34
  detailsMaker: (tips?: string) => string | undefined;
34
35
  };
35
- }[Code]["detailsMaker"]>) => ReturnType<{
36
+ }, Code>>) => ReturnType<Errors.Register.DetailsMaker<{
36
37
  "no-window-document-on-runtime": {
37
38
  message: string;
38
39
  detailsMaker: () => undefined;
@@ -41,8 +42,8 @@ export declare const register: {
41
42
  message: string;
42
43
  detailsMaker: (tips?: string) => string | undefined;
43
44
  };
44
- }[Code]["detailsMaker"]>;
45
- getError: <Code extends Codes>(code: Code, ...params: Parameters<{
45
+ }, Code>>;
46
+ getError: <Code extends Codes>(code: Code, ...params: Parameters<Errors.Register.DetailsMaker<{
46
47
  "no-window-document-on-runtime": {
47
48
  message: string;
48
49
  detailsMaker: () => undefined;
@@ -51,9 +52,9 @@ export declare const register: {
51
52
  message: string;
52
53
  detailsMaker: (tips?: string) => string | undefined;
53
54
  };
54
- }[Code]["detailsMaker"]>) => {
55
+ }, Code>>) => {
55
56
  code: Code;
56
- details: ReturnType<{
57
+ details: ReturnType<Errors.Register.DetailsMaker<{
57
58
  "no-window-document-on-runtime": {
58
59
  message: string;
59
60
  detailsMaker: () => undefined;
@@ -62,12 +63,12 @@ export declare const register: {
62
63
  message: string;
63
64
  detailsMaker: (tips?: string) => string | undefined;
64
65
  };
65
- }[Code]["detailsMaker"]>;
66
+ }, Code>>;
66
67
  name: string;
67
68
  message: string;
68
69
  stack?: string;
69
70
  };
70
- getFailureOutcome: <Code extends Codes>(code: Code, ...params: Parameters<{
71
+ getFailureOutcome: <Code extends Codes>(code: Code, ...params: Parameters<Errors.Register.DetailsMaker<{
71
72
  "no-window-document-on-runtime": {
72
73
  message: string;
73
74
  detailsMaker: () => undefined;
@@ -76,7 +77,7 @@ export declare const register: {
76
77
  message: string;
77
78
  detailsMaker: (tips?: string) => string | undefined;
78
79
  };
79
- }[Code]["detailsMaker"]>) => import("../../agnostic/misc/outcome").Outcome.Failure<Code, {
80
+ }, Code>>) => import("../../agnostic/misc/outcome").Outcome.Failure<Code, Errors.Register.Message<{
80
81
  "no-window-document-on-runtime": {
81
82
  message: string;
82
83
  detailsMaker: () => undefined;
@@ -85,7 +86,7 @@ export declare const register: {
85
86
  message: string;
86
87
  detailsMaker: (tips?: string) => string | undefined;
87
88
  };
88
- }[Code]["message"], ReturnType<{
89
+ }, Code>, ReturnType<Errors.Register.DetailsMaker<{
89
90
  "no-window-document-on-runtime": {
90
91
  message: string;
91
92
  detailsMaker: () => undefined;
@@ -94,9 +95,9 @@ export declare const register: {
94
95
  message: string;
95
96
  detailsMaker: (tips?: string) => string | undefined;
96
97
  };
97
- }[Code]["detailsMaker"]>>;
98
+ }, Code>>>;
98
99
  CustomError: {
99
- new <Code extends Codes>(code: Code, ...params: Parameters<{
100
+ new <Code extends Codes>(code: Code, ...params: Parameters<Errors.Register.DetailsMaker<{
100
101
  "no-window-document-on-runtime": {
101
102
  message: string;
102
103
  detailsMaker: () => undefined;
@@ -105,9 +106,9 @@ export declare const register: {
105
106
  message: string;
106
107
  detailsMaker: (tips?: string) => string | undefined;
107
108
  };
108
- }[Code]["detailsMaker"]>): {
109
+ }, Code>>): {
109
110
  code: Code;
110
- details: ReturnType<{
111
+ details: ReturnType<Errors.Register.DetailsMaker<{
111
112
  "no-window-document-on-runtime": {
112
113
  message: string;
113
114
  detailsMaker: () => undefined;
@@ -116,7 +117,7 @@ export declare const register: {
116
117
  message: string;
117
118
  detailsMaker: (tips?: string) => string | undefined;
118
119
  };
119
- }[Code]["detailsMaker"]>;
120
+ }, Code>>;
120
121
  name: string;
121
122
  message: string;
122
123
  stack?: string;
@@ -1,9 +1,9 @@
1
- import {
2
- Crossenv
3
- } from "./chunk-GJOU3UAL.js";
4
1
  import {
5
2
  Errors
6
3
  } from "./chunk-4CMAH7Q4.js";
4
+ import {
5
+ Crossenv
6
+ } from "./chunk-GJOU3UAL.js";
7
7
 
8
8
  // src/shared/errors/index.ts
9
9
  var register = Errors.Register.from({