@carlsebastian/jsu 1.1.0 → 1.2.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 (61) hide show
  1. package/global.js +1 -1
  2. package/package.json +10 -2
  3. package/src/types/arithmetic/arithmetic.d.ts +240 -0
  4. package/src/types/custom/custom.d.ts +6 -1
  5. package/src/types/custom/error/builder/error.builder.d.ts +2 -2
  6. package/src/types/custom/error/constructor/error.base.d.ts +3 -1
  7. package/src/types/custom/error/constructor/error.custom.d.ts +11 -9
  8. package/src/types/custom/error/constructor/error.meta.d.ts +9 -9
  9. package/src/types/custom/error/error.d.ts +18 -1
  10. package/src/types/custom/utils/custom.utils.d.ts +84 -1
  11. package/src/types/custom/utils/generator/generator.d.ts +5 -5
  12. package/src/types/dom/attr/attr.class.d.ts +1 -1
  13. package/src/types/dom/attr/attr.id.d.ts +1 -1
  14. package/src/types/dom/attr/attr.style.d.ts +3 -1
  15. package/src/types/dom/dom.d.ts +115 -1
  16. package/src/types/dom/element/create/element.create.d.ts +3 -1
  17. package/src/types/{api → dom/element}/element.d.ts +14 -14
  18. package/src/types/dom/element/getElementBy/dom.getElementBy.d.ts +3 -1
  19. package/src/types/dom/element/tag-verifier/verifier.d.ts +3 -1
  20. package/src/types/global.d.ts +20 -8
  21. package/src/types/guards/format/guards.format.d.ts +155 -0
  22. package/src/types/guards/guards.d.ts +6 -1
  23. package/src/types/guards/type/guards.type.d.ts +120 -0
  24. package/src/types/primitives/obj/obj.accessor.d.ts +219 -3
  25. package/src/types/primitives/obj/obj.iterator.d.ts +60 -3
  26. package/src/types/primitives/primitives.d.ts +7 -1
  27. package/src/types/primitives/str/str.d.ts +1 -1
  28. package/src/types/storage/local/storage.local.d.ts +8 -8
  29. package/src/types/storage/session/storage.session.d.ts +8 -8
  30. package/src/types/storage/storage.d.ts +22 -1
  31. package/src/types/variables.d.ts +27 -0
  32. package/src/utils/arithmetic/arithmetic.js +20 -0
  33. package/src/utils/{Arithmetic → arithmetic}/operations/operation.divide.js +17 -18
  34. package/src/utils/{Arithmetic → arithmetic}/operations/operation.multiply.js +15 -19
  35. package/src/utils/{Arithmetic → arithmetic}/operations/operation.subtract.js +6 -18
  36. package/src/utils/{Arithmetic → arithmetic}/operations/operation.sum.js +6 -17
  37. package/src/utils/custom/custom.js +3 -3
  38. package/src/utils/custom/error/error.js +3 -3
  39. package/src/utils/custom/utils/custom.utils.js +66 -2
  40. package/src/utils/custom/utils/generator/generator.js +2 -2
  41. package/src/utils/dom/attr/attr.class.js +2 -2
  42. package/src/utils/dom/attr/attr.id.js +2 -2
  43. package/src/utils/dom/attr/attr.style.js +2 -2
  44. package/src/utils/dom/dom.js +3 -3
  45. package/src/utils/dom/element/create/element.create.js +2 -2
  46. package/src/utils/dom/element/getElementBy/dom.getElementBy.js +2 -2
  47. package/src/utils/dom/element/query/dom.query.js +2 -2
  48. package/src/utils/dom/element/tag-verifier/verifier.js +2 -2
  49. package/src/utils/dom/lifecycle/mount.js +2 -2
  50. package/src/utils/dom/lifecycle/unmount.js +1 -6
  51. package/src/utils/guards/{formats/formats.js → format/guards.format.js} +1 -52
  52. package/src/utils/guards/guards.js +3 -3
  53. package/src/utils/guards/{data-types/data-types.js → type/guards.type.js} +0 -14
  54. package/src/utils/primitives/obj/obj.accessor.js +6 -6
  55. package/src/utils/primitives/obj/obj.iterator.js +58 -81
  56. package/src/utils/primitives/primitives.js +5 -5
  57. package/src/utils/storage/storage.js +2 -2
  58. package/src/types/api/api.d.ts +0 -165
  59. package/src/types/guards/data-types/data-types.d.ts +0 -5
  60. package/src/types/guards/formats/formats.d.ts +0 -5
  61. package/src/utils/Arithmetic/arithmetic.js +0 -0
package/global.js CHANGED
@@ -1,3 +1,4 @@
1
+ import "./src/utils/arithmetic/arithmetic.js";
1
2
  import "./src/utils/custom/custom.js";
2
3
  import "./src/utils/custom/error/error.js";
3
4
  import "./src/utils/dom/dom.js";
@@ -5,4 +6,3 @@ import "./src/utils/guards/guards.js";
5
6
  import "./src/utils/primitives/primitives.js";
6
7
  import "./src/utils/storage/storage.js";
7
8
  import "./src/utils/variables.js";
8
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carlsebastian/jsu",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "A ready-to-use JavaScripts custom utilities such as types validations, formats validations, formatter, and many more!",
5
5
  "main": "./global.js",
6
6
  "types": "./src/types/global.d.ts",
@@ -13,6 +13,10 @@
13
13
  "require": "./global.js",
14
14
  "types": "./src/types/global.d.ts"
15
15
  },
16
+ "./arithmetics": {
17
+ "require": "./src/utils/arithmetic/arithmetic.js",
18
+ "types": "./src/types/arithmetic/arithmetic.d.ts"
19
+ },
16
20
  "./custom": {
17
21
  "require": "./src/utils/custom/custom.js",
18
22
  "types": "./src/types/custom/custom.d.ts"
@@ -49,7 +53,11 @@
49
53
  "url": "https://github.com/Sebastian-Carl/JSU/issues"
50
54
  },
51
55
  "homepage": "https://github.com/Sebastian-Carl/JSU#readme",
52
- "keywords": [],
56
+ "keywords": [
57
+ "utils",
58
+ "js-utils",
59
+ "jsu"
60
+ ],
53
61
  "author": "",
54
62
  "license": "ISC"
55
63
  }
@@ -0,0 +1,240 @@
1
+ export interface ArithmeticAPI {
2
+ /**
3
+ * Accumulates the total divided value of the given collection of numerical values.
4
+ *
5
+ * ***Note***:
6
+ * - Using a zero (`0`) to divide other given numerical values would always resulted to `NaN`.
7
+ *
8
+ * @param nums - The collection of numerical values to divide.
9
+ * @returns The total accumulated result of this operation.
10
+ */
11
+ Divide(...nums: number[]): number;
12
+
13
+ /**
14
+ * Accumulates the total divided value of the first, second, third, fourth, and fifth numerical values.
15
+ *
16
+ * ***Note***:
17
+ * - Using a zero (`0`) to divide other given numerical values would always resulted to `NaN`.
18
+ *
19
+ * @param num1 - The first or primary base numerical value of this operation.
20
+ * @param num2 - The second numerical value to divide with primary value.
21
+ * @param num3 - The third numerical value to divide with the given first 2 numerical values.
22
+ * @param num4 - The fourth numerical value to divide with the given first 3 numerical values.
23
+ * @param num5 - The fifth numerical value to divide with the other given 4 numerical values.
24
+ * @returns The total accumulated result of this operation.
25
+ */
26
+ Divide(num1: number, num2: number, num3: number, num4: number, num5: number): number;
27
+
28
+ /**
29
+ * Accumulates the total divided value of the first, second, third, and fourth numerical values.
30
+ *
31
+ * ***Note***:
32
+ * - Using a zero (`0`) to divide other given numerical values would always resulted to `NaN`.
33
+ *
34
+ * @param num1 - The first or primary base numerical value of this operation.
35
+ * @param num2 - The second numerical value to divide with primary value.
36
+ * @param num3 - The third numerical value to divide with the given first 2 numerical values.
37
+ * @param num4 - The fourth numerical value to divide with the given first 3 numerical values.
38
+ * @returns The total accumulated result of this operation.
39
+ */
40
+ Divide(num1: number, num2: number, num3: number, num4: number): number;
41
+
42
+ /**
43
+ * Accumulates the total divided value of the first, second, and third numerical values.
44
+ *
45
+ * ***Note***:
46
+ * - Using a zero (`0`) to divide other given numerical values would always resulted to `NaN`.
47
+ *
48
+ * @param num1 - The first or primary base numerical value of this operation.
49
+ * @param num2 - The second numerical value to divide with primary value.
50
+ * @param num3 - The third numerical value to divide with the given first 2 numerical values.
51
+ * @returns The total accumulated result of this operation.
52
+ */
53
+ Divide(num1: number, num2: number, num3: number): number;
54
+
55
+ /**
56
+ * Accumulates the total divided value of the first and second numerical values.
57
+ *
58
+ * ***Note***:
59
+ * - Using a zero (`0`) to divide other given numerical values would always resulted to `NaN`.
60
+ *
61
+ * @param num1 - The first or primary base numerical value of this operation.
62
+ * @param num2 - The second numerical value to divide with primary value.
63
+ * @returns The total accumulated result of this operation.
64
+ */
65
+ Divide(num1: number, num2: number): number;
66
+
67
+ /**
68
+ * Accumulates the total multiplied value of the given collection of numerical values.
69
+ *
70
+ * ***Note***:
71
+ * - Using a zero (`0`) to multiply other given numerical values would always resulted to (`0`).
72
+ *
73
+ * @param nums - The collection of numerical values to multiply.
74
+ * @returns The total accumulated result of this operation.
75
+ */
76
+ Multiply(...nums: number[]): number;
77
+
78
+ /**
79
+ * Accumulates the total multiplied value of the first, second, third, fourth, and fifth numerical values.
80
+ *
81
+ * ***Note***:
82
+ * - Using a zero (`0`) to multiply other given numerical values would always resulted to (`0`).
83
+ *
84
+ * @param num1 - The first or primary base numerical value of this operation.
85
+ * @param num2 - The second numerical value to multiply with primary value.
86
+ * @param num3 - The third numerical value to multiply with the given first 2 numerical values.
87
+ * @param num4 - The fourth numerical value to multiply with the given first 3 numerical values.
88
+ * @param num5 - The fifth numerical value to multiply with the other given 4 numerical values.
89
+ * @returns The total accumulated result of this operation.
90
+ */
91
+ Multiply(num1: number, num2: number, num3: number, num4: number, num5: number): number;
92
+
93
+ /**
94
+ * Accumulates the total multiplied value of the first, second, third, and fourth numerical values.
95
+ *
96
+ * ***Note***:
97
+ * - Using a zero (`0`) to multiply other given numerical values would always resulted to (`0`).
98
+ *
99
+ * @param num1 - The first or primary base numerical value of this operation.
100
+ * @param num2 - The second numerical value to multiply with primary value.
101
+ * @param num3 - The third numerical value to multiply with the given first 2 numerical values.
102
+ * @param num4 - The fourth numerical value to multiply with the given first 3 numerical values.
103
+ * @returns The total accumulated result of this operation.
104
+ */
105
+ Multiply(num1: number, num2: number, num3: number, num4: number): number;
106
+
107
+ /**
108
+ * Accumulates the total multiplied value of the first, second, and third numerical values.
109
+ *
110
+ * ***Note***:
111
+ * - Using a zero (`0`) to multiply other given numerical values would always resulted to (`0`).
112
+ *
113
+ * @param num1 - The first or primary base numerical value of this operation.
114
+ * @param num2 - The second numerical value to multiply with primary value.
115
+ * @param num3 - The third numerical value to multiply with the given first 2 numerical values.
116
+ * @returns The total accumulated result of this operation.
117
+ */
118
+ Multiply(num1: number, num2: number, num3: number): number;
119
+
120
+ /**
121
+ * Accumulates the total multiplied value of the first and second numerical values.
122
+ *
123
+ * ***Note***:
124
+ * - Using a zero (`0`) to multiply other given numerical values would always resulted to (`0`).
125
+ *
126
+ * @param num1 - The first or primary base numerical value of this operation.
127
+ * @param num2 - The second numerical value to multiply with primary value.
128
+ * @returns The total accumulated result of this operation.
129
+ */
130
+ Multiply(num1: number, num2: number): number;
131
+
132
+ /**
133
+ * Accumulates the total subtracted value of the given collection of numerical values.
134
+ *
135
+ * @param nums - The collection of numerical values to subtract.
136
+ * @returns The total accumulated result of this operation.
137
+ */
138
+ Subtract(...nums: number[]): number;
139
+
140
+ /**
141
+ * Accumulates the total subtracted value of the first, second, third, fourth, and fifth numerical values.
142
+ *
143
+ * @param num1 - The first or primary base numerical value of this operation.
144
+ * @param num2 - The second numerical value to subtract with primary value.
145
+ * @param num3 - The third numerical value to subtract with the given first 2 numerical values.
146
+ * @param num4 - The fourth numerical value to subtract with the given first 3 numerical values.
147
+ * @param num5 - The fifth numerical value to subtract with the other given 4 numerical values.
148
+ * @returns The total accumulated result of this operation.
149
+ */
150
+ Subtract(num1: number, num2: number, num3: number, num4: number, num5: number): number;
151
+
152
+ /**
153
+ * Accumulates the total subtracted value of the first, second, third, and fourth numerical values.
154
+ *
155
+ * @param num1 - The first or primary base numerical value of this operation.
156
+ * @param num2 - The second numerical value to subtract with primary value.
157
+ * @param num3 - The third numerical value to subtract with the given first 2 numerical values.
158
+ * @param num4 - The fourth numerical value to subtract with the given first 3 numerical values.
159
+ * @returns The total accumulated result of this operation.
160
+ */
161
+ Subtract(num1: number, num2: number, num3: number, num4: number): number;
162
+
163
+ /**
164
+ * Accumulates the total subtracted value of the first, second, and third numerical values.
165
+ *
166
+ * @param num1 - The first or primary base numerical value of this operation.
167
+ * @param num2 - The second numerical value to subtract with primary value.
168
+ * @param num3 - The third numerical value to subtract with the given first 2 numerical values.
169
+ * @returns The total accumulated result of this operation.
170
+ */
171
+ Subtract(num1: number, num2: number, num3: number): number;
172
+
173
+ /**
174
+ * Accumulates the total subtracted value of the first and second numerical values.
175
+ *
176
+ * @param num1 - The first or primary base numerical value of this operation.
177
+ * @param num2 - The second numerical value to subtract with primary value.
178
+ * @returns The total accumulated result of this operation.
179
+ */
180
+ Subtract(num1: number, num2: number): number;
181
+
182
+ /**
183
+ * Accumulates the total summed value of the given collection of numerical values.
184
+ *
185
+ * @param nums - The collection of numerical values to sum.
186
+ * @returns The total accumulated result of this operation.
187
+ */
188
+ Sum(...nums: number[]): number;
189
+
190
+ /**
191
+ * Accumulates the total summed value of the first, second, third, fourth, and fifth numerical values.
192
+ *
193
+ * @param num1 - The first or primary base numerical value of this operation.
194
+ * @param num2 - The second numerical value to sum with primary value.
195
+ * @param num3 - The third numerical value to sum with the given first 2 numerical values.
196
+ * @param num4 - The fourth numerical value to sum with the given first 3 numerical values.
197
+ * @param num5 - The fifth numerical value to sum with the other given 4 numerical values.
198
+ * @returns The total accumulated result of this operation.
199
+ */
200
+ Sum(num1: number, num2: number, num3: number, num4: number, num5: number): number;
201
+
202
+ /**
203
+ * Accumulates the total summed value of the first, second, third, and fourth numerical values.
204
+ *
205
+ * @param num1 - The first or primary base numerical value of this operation.
206
+ * @param num2 - The second numerical value to sum with primary value.
207
+ * @param num3 - The third numerical value to sum with the given first 2 numerical values.
208
+ * @param num4 - The fourth numerical value to sum with the given first 3 numerical values.
209
+ * @returns The total accumulated result of this operation.
210
+ */
211
+ Sum(num1: number, num2: number, num3: number, num4: number): number;
212
+
213
+ /**
214
+ * Accumulates the total summed value of the first, second, and third numerical values.
215
+ *
216
+ * @param num1 - The first or primary base numerical value of this operation.
217
+ * @param num2 - The second numerical value to sum with primary value.
218
+ * @param num3 - The third numerical value to sum with the given first 2 numerical values.
219
+ * @returns The total accumulated result of this operation.
220
+ */
221
+ Sum(num1: number, num2: number, num3: number): number;
222
+
223
+ /**
224
+ * Accumulates the total summed value of the first and second numerical values.
225
+ *
226
+ * @param num1 - The first or primary base numerical value of this operation.
227
+ * @param num2 - The second numerical value to sum with primary value.
228
+ * @returns The total accumulated result of this operation.
229
+ */
230
+ Sum(num1: number, num2: number): number;
231
+ }
232
+
233
+ declare global {
234
+ /**
235
+ * A collection of basic math operation.
236
+ */
237
+ var Arithmetic: ArithmeticAPI;
238
+ }
239
+
240
+ export { }
@@ -1,8 +1,13 @@
1
+ import { CustomUtilitiesAPI } from "./utils/custom.utils.js"
2
+ import { GeneratorAPI } from "./utils/generator/generator.js"
3
+
4
+ export type CustomAPI = CustomUtilitiesAPI & GeneratorAPI;
5
+
1
6
  declare global {
2
7
  /**
3
8
  * A collection of customized utilities (`ad-hoc`)
4
9
  */
5
- readonly var Custom: CustomAPI
10
+ var Custom: CustomAPI;
6
11
  }
7
12
 
8
13
  export { }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A collection of customized error emitter contents for `ErrorConstructorAPI`.
3
3
  */
4
- type ErrorRaiseAPI = {
4
+ export type ErrorRaiseAPI = {
5
5
  /**
6
6
  * Builds and emit the contents of `ArgumentError`.
7
7
  *
@@ -10,7 +10,7 @@ type ErrorRaiseAPI = {
10
10
  * @param received_arg - The received argument data.
11
11
  * @param expected_args - The expected argument(s) of emitter to receive.
12
12
  */
13
- _ArgumentError(emitter_id: string, argument_id?: string, received_arg?: string, ...expected_args?: string[]): never;
13
+ _ArgumentError(emitter_id: string, argument_id?: string, received_arg?: string, ...expected_args: string[]): never;
14
14
 
15
15
  /**
16
16
  * Builds and emit the contents of `IndexOutOfBoundsError`.
@@ -1,4 +1,6 @@
1
+ import { BaseMeta } from "./error.meta.js";
2
+
1
3
  /**
2
4
  * A central class constructor for making customized or enhanced error.
3
5
  */
4
- class CustomError<Meta extends BaseMeta = BaseMeta> extends Error {}
6
+ export class CustomError<Meta extends BaseMeta = BaseMeta> extends Error {}
@@ -1,50 +1,52 @@
1
- type ErrorConstructorAPI = {
1
+ import { ArgumentErrorMeta, IndexOutOfBoundsErrorMeta, InvalidPropertyErrorMeta, MissingParameterErrorMeta, MissingPropertyErrorMeta, NoSuchElementTagErrorMeta, NotSupportedErrorMeta, UnknownPropertyErrorMeta } from "./error.meta.js";
2
+
3
+ export type ErrorConstructorAPI = {
2
4
  /**
3
5
  * A customized and enhanced `TypeError`.
4
6
  */
5
7
  ArgumentError: {
6
- new (meta: ArgumentErrorMeta): ArgumentErrorMeta;
8
+ new(meta: ArgumentErrorMeta): ArgumentErrorMeta;
7
9
  };
8
10
  /**
9
11
  * A customized and enhanced `RangeError`.
10
12
  */
11
13
  IndexOutOfBoundsError: {
12
- new (meta: IndexOutOfBoundsErrorMeta): IndexOutOfBoundsErrorMeta;
14
+ new(meta: IndexOutOfBoundsErrorMeta): IndexOutOfBoundsErrorMeta;
13
15
  };
14
16
  /**
15
17
  * A customized error for invalid properties.
16
18
  */
17
19
  InvalidPropertyError: {
18
- new (meta: InvalidPropertyErrorMeta): InvalidPropertyErrorMeta;
20
+ new(meta: InvalidPropertyErrorMeta): InvalidPropertyErrorMeta;
19
21
  };
20
22
  /**
21
23
  * A customized error for missing parameter value.
22
24
  */
23
25
  MissingParameterError: {
24
- new (meta: MissingParameterErrorMeta): MissingParameterErrorMeta;
26
+ new(meta: MissingParameterErrorMeta): MissingParameterErrorMeta;
25
27
  };
26
28
  /**
27
29
  * A customized error for missing property.
28
30
  */
29
31
  MissingPropertyError: {
30
- new (meta: MissingPropertyError): MissingPropertyError;
32
+ new(meta: MissingPropertyErrorMeta): MissingPropertyErrorMeta;
31
33
  };
32
34
  /**
33
35
  * A customized error for unqualified element's tag.
34
36
  */
35
37
  NoSuchElementTagError: {
36
- new (meta: NoSuchElementTagErrorMeta): NoSuchElementTagErrorMeta;
38
+ new(meta: NoSuchElementTagErrorMeta): NoSuchElementTagErrorMeta;
37
39
  };
38
40
  /**
39
41
  * A customized error for not supported objects, etc.
40
42
  */
41
43
  NotSupportedError: {
42
- new (meta: NotSupportedErrorMeta): NotSupportedErrorMeta;
44
+ new(meta: NotSupportedErrorMeta): NotSupportedErrorMeta;
43
45
  };
44
46
  /**
45
47
  * A customized error for unknown property.
46
48
  */
47
49
  UnknownPropertyError: {
48
- new (meta: UnknownPropertyErrorMeta): UnknownPropertyErrorMeta;
50
+ new(meta: UnknownPropertyErrorMeta): UnknownPropertyErrorMeta;
49
51
  };
50
52
  }
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * Default meta data of custom error constructors.
3
3
  */
4
- type BaseMeta<OtherArguments extends {} = {}> = {
4
+ export type BaseMeta<OtherArguments extends {} = {}> = {
5
5
  Message: string;
6
6
  Context?: { Message?: string; Emitter: string };
7
7
  Args?: { Id: string } & OtherArguments;
8
8
  Guide?: string;
9
9
  }
10
10
 
11
- type ArgumentErrorMeta = BaseMeta<{ ReceivedArgument: string, ExpectedArguments: string[] }>;
12
- type IndexOutOfBoundsErrorMeta = BaseMeta<{ Index: number, MaxBound: number }>;
13
- type InvalidPropertyErrorMeta = BaseMeta<{ PropertyId: string }>;
14
- type MissingParameterErrorMeta = BaseMeta<{ Value: string }>;
15
- type MissingPropertyErrorMeta = BaseMeta<{ PropertyId: string }>;
16
- type NoSuchElementTagErrorMeta = BaseMeta<{ Tag: string, TagOf: "HTMLElement" | "MathMLElement" | "SVGElement" }>;
17
- type NotSupportedErrorMeta = BaseMeta;
18
- type UnknownPropertyErrorMeta = BaseMeta<{ PropertyId: string }>;
11
+ export type ArgumentErrorMeta = BaseMeta<{ ReceivedArgument: string, ExpectedArguments: string[] }>;
12
+ export type IndexOutOfBoundsErrorMeta = BaseMeta<{ Index: number, MaxBound: number }>;
13
+ export type InvalidPropertyErrorMeta = BaseMeta<{ PropertyId: string }>;
14
+ export type MissingParameterErrorMeta = BaseMeta<{ Value: string }>;
15
+ export type MissingPropertyErrorMeta = BaseMeta<{ PropertyId: string }>;
16
+ export type NoSuchElementTagErrorMeta = BaseMeta<{ Tag: string, TagOf: "HTMLElement" | "MathMLElement" | "SVGElement" }>;
17
+ export type NotSupportedErrorMeta = BaseMeta;
18
+ export type UnknownPropertyErrorMeta = BaseMeta<{ PropertyId: string }>;
@@ -1,5 +1,22 @@
1
+ import { ErrorRaiseAPI } from "./builder/error.builder.js";
2
+ import { ErrorConstructorAPI } from "./constructor/error.custom.js";
3
+
4
+ export interface ErrorAPI {
5
+ /**
6
+ * A collection of customized error constructors.
7
+ */
8
+ readonly Constructors: ErrorConstructorAPI,
9
+ /**
10
+ * A collection of pre-defined customized error constructors builder.
11
+ */
12
+ readonly Raise: ErrorRaiseAPI
13
+ }
14
+
1
15
  declare global {
2
- readonly var ERROR: ErrorAPI;
16
+ /**
17
+ * A collection of customized error constructors.
18
+ */
19
+ var ERROR: ErrorAPI;
3
20
  }
4
21
 
5
22
  export { }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A collection of customized utilities (`ad-hoc`).
3
3
  */
4
- type CustomUtilitiesAPI = {
4
+ export type CustomUtilitiesAPI = {
5
5
  /**
6
6
  * Clamps the current numeric value into its `minimum` and/or `maximum` numeric value.
7
7
  *
@@ -27,6 +27,31 @@ type CustomUtilitiesAPI = {
27
27
  */
28
28
  ConstructorOrTypeOf(arg: any): string | undefined;
29
29
 
30
+ /**
31
+ * Defines the given key-pair data to the target object.
32
+ *
33
+ * ***Options***:
34
+ * - `def` - Allows the defined key-pair data to be **writable**, **configurable**, and **enumerable**. (Default)
35
+ * - `hard` - Prevents the defined key-pair data to be **writable**, **configurable**, and **enumerable**.
36
+ * - `med` - Prevents the defined key-pair data to be **writable** and **configurable** but, can be **enumerable**.
37
+ * - `soft` - Prevents the defined key-pair data to be **writable** but, can be **configurable** and **enumerable**.
38
+ *
39
+ * @param obj - The target object to define the key-pair data at.
40
+ * @param key - The key of key-pair data.
41
+ * @param data - The data of key-pair data.
42
+ * @param opt - A options of what would be the state configuration of the defined key-pair data.
43
+ */
44
+ DefineProperty<K, D>(obj: { [prop: string]: any }, key: K, data: D, opt?: 'def' | 'hard' | 'med' | 'soft'): { [prop: string]: any } & { [prop in K extends string ? K : string]: D; };
45
+
46
+ /**
47
+ * Defines the given key-pair data to the `globalThis` or `window` API.
48
+ *
49
+ * @param key - The key of key-pair data.
50
+ * @param data - The data of key-pair data.
51
+ * @param opt - A options of what would be the state configuration of the defined key-pair data.
52
+ */
53
+ Global(key: string, data: any, opt?: 'def' | 'hard' | 'med' | 'soft'): void;
54
+
30
55
  /**
31
56
  * Retrieves the `name` property of the specified object.
32
57
  *
@@ -39,4 +64,62 @@ type CustomUtilitiesAPI = {
39
64
  * @returns The `name` property value of the object.
40
65
  */
41
66
  NameOf(obj: {}): string;
67
+
68
+ /**
69
+ * Validates and normalize the given numerical value to valid numerical value.
70
+ *
71
+ * @param num1 - The numerical value to normalize.
72
+ * @returns The normalized numerical value.
73
+ */
74
+ NormalizeNumbers(num1: number): number;
75
+
76
+ /**
77
+ * Validates and normalize the given collection of numerical values to a valid numerical values.
78
+ *
79
+ * @param num1 - The first numerical value to normalize.
80
+ * @param num2 - The second numerical value to normalize.
81
+ * @returns The normalized collection of numerical values.
82
+ */
83
+ NormalizeNumbers(num1: number, num2: number): number[];
84
+
85
+ /**
86
+ * Validates and normalize the given collection of numerical values to a valid numerical values.
87
+ *
88
+ * @param num1 - The first numerical value to normalize.
89
+ * @param num2 - The second numerical value to normalize.
90
+ * @param num3 - The third numerical value to normalize.
91
+ * @returns The normalized collection of numerical values.
92
+ */
93
+ NormalizeNumbers(num1: number, num2: number, num3: number): number[];
94
+
95
+ /**
96
+ * Validates and normalize the given collection of numerical values to a valid numerical values.
97
+ *
98
+ * @param num1 - The first numerical value to normalize.
99
+ * @param num2 - The second numerical value to normalize.
100
+ * @param num3 - The third numerical value to normalize.
101
+ * @param num4 - The fourth numerical value to normalize.
102
+ * @returns The normalized collection of numerical values.
103
+ */
104
+ NormalizeNumbers(num1: number, num2: number, num3: number, num4: number): number[];
105
+
106
+ /**
107
+ * Validates and normalize the given collection of numerical values to a valid numerical values.
108
+ *
109
+ * @param num1 - The first numerical value to normalize.
110
+ * @param num2 - The second numerical value to normalize.
111
+ * @param num3 - The third numerical value to normalize.
112
+ * @param num4 - The fourth numerical value to normalize.
113
+ * @param num5 - The fifth numerical value to normalize.
114
+ * @returns The normalized collection of numerical values.
115
+ */
116
+ NormalizeNumbers(num1: number, num2: number, num3: number, num4: number, num5: number): number[];
117
+
118
+ /**
119
+ * Validates and normalize the given collection of numerical values to a valid numerical values.
120
+ *
121
+ * @param nums - The collection of numerical values to normalize.
122
+ * @returns The normalized collection of numerical values.
123
+ */
124
+ NormalizeNumbers(...nums: number[]): number[];
42
125
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Configuration for generator's contents.
3
3
  */
4
- interface GeneratorAPIConfig {
4
+ export interface GeneratorAPIConfig {
5
5
  /**
6
6
  * A configuration state for including or excluding numerical values at generator's content.
7
7
  */
@@ -35,7 +35,7 @@ interface GeneratorAPIConfig {
35
35
  /**
36
36
  * A collection of randomized content generators.
37
37
  */
38
- class GeneratorAPI {
38
+ export class GeneratorAPI {
39
39
  /**
40
40
  * The `size` or `length` of contents of generators to generate.
41
41
  */
@@ -78,15 +78,15 @@ class GeneratorAPI {
78
78
  * @param min - The minimum or lowest integer value it can generate. (Default: 0)
79
79
  * @param max - The maximum or highest integer value it can generate. (Default: 1)
80
80
  */
81
- readonly RandomInteger(min?: number, max?: number): number;
81
+ RandomInteger(min?: number, max?: number): number;
82
82
 
83
83
  /**
84
84
  * Generates a set of randomized characters in lowercase and/or uppercase.
85
85
  */
86
- readonly RandomCharacters(): string;
86
+ RandomCharacters(): string;
87
87
 
88
88
  /**
89
89
  * Generates a new set of randomized tokens that can be used for ids, session id, etc.
90
90
  */
91
- readonly NewToken(): string;
91
+ NewToken(): string;
92
92
  }
@@ -1,4 +1,4 @@
1
- interface DOMClassOfAPI {
1
+ export interface DOMClassOfAPI {
2
2
  /**
3
3
  * Search the given `class` token at the element's `DOMTokenList`.
4
4
  *
@@ -1,4 +1,4 @@
1
- interface DOMIdOfAPI {
1
+ export interface DOMIdOfAPI {
2
2
  /**
3
3
  * The current unique `id` value of the element.
4
4
  *
@@ -1,4 +1,6 @@
1
- interface DOMStyleOfAPI {
1
+ import { CSSDeclaration } from "../element/element.js";
2
+
3
+ export interface DOMStyleOfAPI {
2
4
  /**
3
5
  * Set the given `CSSStyle` object properties from the element.
4
6
  *