@carlsebastian/jsu 1.1.1 → 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.
- package/package.json +1 -1
- package/src/types/arithmetic/arithmetic.d.ts +52 -93
- package/src/types/custom/custom.d.ts +6 -1
- package/src/types/custom/error/builder/error.builder.d.ts +2 -2
- package/src/types/custom/error/constructor/error.base.d.ts +3 -1
- package/src/types/custom/error/constructor/error.custom.d.ts +11 -9
- package/src/types/custom/error/constructor/error.meta.d.ts +9 -9
- package/src/types/custom/error/error.d.ts +18 -1
- package/src/types/custom/utils/custom.utils.d.ts +2 -2
- package/src/types/custom/utils/generator/generator.d.ts +5 -5
- package/src/types/dom/attr/attr.class.d.ts +1 -1
- package/src/types/dom/attr/attr.id.d.ts +1 -1
- package/src/types/dom/attr/attr.style.d.ts +3 -1
- package/src/types/dom/dom.d.ts +115 -1
- package/src/types/dom/element/create/element.create.d.ts +3 -1
- package/src/types/{api → dom/element}/element.d.ts +14 -14
- package/src/types/dom/element/getElementBy/dom.getElementBy.d.ts +3 -1
- package/src/types/dom/element/tag-verifier/verifier.d.ts +3 -1
- package/src/types/global.d.ts +19 -9
- package/src/types/guards/format/guards.format.d.ts +155 -0
- package/src/types/guards/guards.d.ts +6 -1
- package/src/types/guards/type/guards.type.d.ts +120 -0
- package/src/types/primitives/obj/obj.accessor.d.ts +219 -3
- package/src/types/primitives/obj/obj.iterator.d.ts +60 -3
- package/src/types/primitives/primitives.d.ts +7 -1
- package/src/types/primitives/str/str.d.ts +1 -1
- package/src/types/storage/local/storage.local.d.ts +8 -8
- package/src/types/storage/session/storage.session.d.ts +8 -8
- package/src/types/storage/storage.d.ts +22 -1
- package/src/types/variables.d.ts +27 -0
- package/src/utils/arithmetic/arithmetic.js +3 -3
- package/src/utils/arithmetic/operations/operation.divide.js +1 -1
- package/src/utils/arithmetic/operations/operation.multiply.js +1 -1
- package/src/utils/arithmetic/operations/operation.subtract.js +1 -1
- package/src/utils/arithmetic/operations/operation.sum.js +1 -1
- package/src/utils/custom/custom.js +3 -3
- package/src/utils/custom/error/error.js +3 -3
- package/src/utils/custom/utils/custom.utils.js +2 -2
- package/src/utils/custom/utils/generator/generator.js +2 -2
- package/src/utils/dom/attr/attr.class.js +2 -2
- package/src/utils/dom/attr/attr.id.js +2 -2
- package/src/utils/dom/attr/attr.style.js +2 -2
- package/src/utils/dom/dom.js +3 -3
- package/src/utils/dom/element/create/element.create.js +2 -2
- package/src/utils/dom/element/getElementBy/dom.getElementBy.js +2 -2
- package/src/utils/dom/element/query/dom.query.js +2 -2
- package/src/utils/dom/element/tag-verifier/verifier.js +2 -2
- package/src/utils/dom/lifecycle/mount.js +2 -2
- package/src/utils/dom/lifecycle/unmount.js +1 -6
- package/src/utils/guards/{formats/formats.js → format/guards.format.js} +1 -52
- package/src/utils/guards/guards.js +3 -3
- package/src/utils/guards/{data-types/data-types.js → type/guards.type.js} +0 -14
- package/src/utils/primitives/obj/obj.accessor.js +6 -6
- package/src/utils/primitives/obj/obj.iterator.js +58 -81
- package/src/utils/primitives/primitives.js +5 -5
- package/src/utils/storage/storage.js +2 -2
- package/src/types/api/api.d.ts +0 -165
- package/src/types/guards/data-types/data-types.d.ts +0 -5
- package/src/types/guards/formats/formats.d.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carlsebastian/jsu",
|
|
3
|
-
"version": "1.
|
|
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",
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
interface ArithmeticAPI {
|
|
1
|
+
export interface ArithmeticAPI {
|
|
2
2
|
/**
|
|
3
|
-
* Accumulates the total divided value of the
|
|
3
|
+
* Accumulates the total divided value of the given collection of numerical values.
|
|
4
4
|
*
|
|
5
5
|
* ***Note***:
|
|
6
6
|
* - Using a zero (`0`) to divide other given numerical values would always resulted to `NaN`.
|
|
7
7
|
*
|
|
8
|
-
* @param
|
|
9
|
-
* @param num2 - The second numerical value to divide with primary value.
|
|
8
|
+
* @param nums - The collection of numerical values to divide.
|
|
10
9
|
* @returns The total accumulated result of this operation.
|
|
11
10
|
*/
|
|
12
|
-
Divide(
|
|
11
|
+
Divide(...nums: number[]): number;
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
|
-
* Accumulates the total divided value of the first, second, and
|
|
14
|
+
* Accumulates the total divided value of the first, second, third, fourth, and fifth numerical values.
|
|
16
15
|
*
|
|
17
16
|
* ***Note***:
|
|
18
17
|
* - Using a zero (`0`) to divide other given numerical values would always resulted to `NaN`.
|
|
@@ -20,9 +19,11 @@ interface ArithmeticAPI {
|
|
|
20
19
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
21
20
|
* @param num2 - The second numerical value to divide with primary value.
|
|
22
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.
|
|
23
24
|
* @returns The total accumulated result of this operation.
|
|
24
25
|
*/
|
|
25
|
-
Divide(num1: number, num2: number, num3: number): number;
|
|
26
|
+
Divide(num1: number, num2: number, num3: number, num4: number, num5: number): number;
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Accumulates the total divided value of the first, second, third, and fourth numerical values.
|
|
@@ -39,7 +40,7 @@ interface ArithmeticAPI {
|
|
|
39
40
|
Divide(num1: number, num2: number, num3: number, num4: number): number;
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
|
-
* Accumulates the total divided value of the first, second,
|
|
43
|
+
* Accumulates the total divided value of the first, second, and third numerical values.
|
|
43
44
|
*
|
|
44
45
|
* ***Note***:
|
|
45
46
|
* - Using a zero (`0`) to divide other given numerical values would always resulted to `NaN`.
|
|
@@ -47,51 +48,35 @@ interface ArithmeticAPI {
|
|
|
47
48
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
48
49
|
* @param num2 - The second numerical value to divide with primary value.
|
|
49
50
|
* @param num3 - The third numerical value to divide with the given first 2 numerical values.
|
|
50
|
-
* @param num4 - The fourth numerical value to divide with the given first 3 numerical values.
|
|
51
51
|
* @returns The total accumulated result of this operation.
|
|
52
52
|
*/
|
|
53
|
-
Divide(num1: number, num2: number, num3: number
|
|
53
|
+
Divide(num1: number, num2: number, num3: number): number;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* Accumulates the total divided value of the first
|
|
56
|
+
* Accumulates the total divided value of the first and second numerical values.
|
|
57
57
|
*
|
|
58
58
|
* ***Note***:
|
|
59
59
|
* - Using a zero (`0`) to divide other given numerical values would always resulted to `NaN`.
|
|
60
60
|
*
|
|
61
61
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
62
62
|
* @param num2 - The second numerical value to divide with primary value.
|
|
63
|
-
* @param num3 - The third numerical value to divide with the given first 2 numerical values.
|
|
64
|
-
* @param num4 - The fourth numerical value to divide with the given first 3 numerical values.
|
|
65
|
-
* @param num5 - The fifth numerical value to divide with the other given 4 numerical values.
|
|
66
63
|
* @returns The total accumulated result of this operation.
|
|
67
64
|
*/
|
|
68
|
-
Divide(num1: number, num2: number
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Accumulates the total divided value of the given collection of numerical values.
|
|
72
|
-
*
|
|
73
|
-
* ***Note***:
|
|
74
|
-
* - Using a zero (`0`) to divide other given numerical values would always resulted to `NaN`.
|
|
75
|
-
*
|
|
76
|
-
* @param nums - The collection of numerical values to divide.
|
|
77
|
-
* @returns The total accumulated result of this operation.
|
|
78
|
-
*/
|
|
79
|
-
Divide(...nums: number[]): number;
|
|
65
|
+
Divide(num1: number, num2: number): number;
|
|
80
66
|
|
|
81
67
|
/**
|
|
82
|
-
* Accumulates the total multiplied value of the
|
|
68
|
+
* Accumulates the total multiplied value of the given collection of numerical values.
|
|
83
69
|
*
|
|
84
70
|
* ***Note***:
|
|
85
71
|
* - Using a zero (`0`) to multiply other given numerical values would always resulted to (`0`).
|
|
86
72
|
*
|
|
87
|
-
* @param
|
|
88
|
-
* @param num2 - The second numerical value to multiply with primary value.
|
|
73
|
+
* @param nums - The collection of numerical values to multiply.
|
|
89
74
|
* @returns The total accumulated result of this operation.
|
|
90
75
|
*/
|
|
91
|
-
Multiply(
|
|
76
|
+
Multiply(...nums: number[]): number;
|
|
92
77
|
|
|
93
78
|
/**
|
|
94
|
-
* Accumulates the total multiplied value of the first, second, and
|
|
79
|
+
* Accumulates the total multiplied value of the first, second, third, fourth, and fifth numerical values.
|
|
95
80
|
*
|
|
96
81
|
* ***Note***:
|
|
97
82
|
* - Using a zero (`0`) to multiply other given numerical values would always resulted to (`0`).
|
|
@@ -99,9 +84,11 @@ interface ArithmeticAPI {
|
|
|
99
84
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
100
85
|
* @param num2 - The second numerical value to multiply with primary value.
|
|
101
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.
|
|
102
89
|
* @returns The total accumulated result of this operation.
|
|
103
90
|
*/
|
|
104
|
-
Multiply(num1: number, num2: number, num3: number): number;
|
|
91
|
+
Multiply(num1: number, num2: number, num3: number, num4: number, num5: number): number;
|
|
105
92
|
|
|
106
93
|
/**
|
|
107
94
|
* Accumulates the total multiplied value of the first, second, third, and fourth numerical values.
|
|
@@ -118,7 +105,7 @@ interface ArithmeticAPI {
|
|
|
118
105
|
Multiply(num1: number, num2: number, num3: number, num4: number): number;
|
|
119
106
|
|
|
120
107
|
/**
|
|
121
|
-
* Accumulates the total multiplied value of the first, second,
|
|
108
|
+
* Accumulates the total multiplied value of the first, second, and third numerical values.
|
|
122
109
|
*
|
|
123
110
|
* ***Note***:
|
|
124
111
|
* - Using a zero (`0`) to multiply other given numerical values would always resulted to (`0`).
|
|
@@ -126,55 +113,41 @@ interface ArithmeticAPI {
|
|
|
126
113
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
127
114
|
* @param num2 - The second numerical value to multiply with primary value.
|
|
128
115
|
* @param num3 - The third numerical value to multiply with the given first 2 numerical values.
|
|
129
|
-
* @param num4 - The fourth numerical value to multiply with the given first 3 numerical values.
|
|
130
116
|
* @returns The total accumulated result of this operation.
|
|
131
|
-
|
|
132
|
-
Multiply(num1: number, num2: number, num3: number
|
|
117
|
+
*/
|
|
118
|
+
Multiply(num1: number, num2: number, num3: number): number;
|
|
133
119
|
|
|
134
120
|
/**
|
|
135
|
-
* Accumulates the total multiplied value of the first
|
|
121
|
+
* Accumulates the total multiplied value of the first and second numerical values.
|
|
136
122
|
*
|
|
137
123
|
* ***Note***:
|
|
138
124
|
* - Using a zero (`0`) to multiply other given numerical values would always resulted to (`0`).
|
|
139
125
|
*
|
|
140
126
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
141
127
|
* @param num2 - The second numerical value to multiply with primary value.
|
|
142
|
-
* @param num3 - The third numerical value to multiply with the given first 2 numerical values.
|
|
143
|
-
* @param num4 - The fourth numerical value to multiply with the given first 3 numerical values.
|
|
144
|
-
* @param num5 - The fifth numerical value to multiply with the other given 4 numerical values.
|
|
145
|
-
* @returns The total accumulated result of this operation.
|
|
146
|
-
*/
|
|
147
|
-
Multiply(num1: number, num2: number, num3: number, num4: number, num5: number): number;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Accumulates the total multiplied value of the given collection of numerical values.
|
|
151
|
-
*
|
|
152
|
-
* ***Note***:
|
|
153
|
-
* - Using a zero (`0`) to multiply other given numerical values would always resulted to (`0`).
|
|
154
|
-
*
|
|
155
|
-
* @param nums - The collection of numerical values to multiply.
|
|
156
128
|
* @returns The total accumulated result of this operation.
|
|
157
129
|
*/
|
|
158
|
-
Multiply(
|
|
130
|
+
Multiply(num1: number, num2: number): number;
|
|
159
131
|
|
|
160
132
|
/**
|
|
161
|
-
* Accumulates the total subtracted value of the
|
|
133
|
+
* Accumulates the total subtracted value of the given collection of numerical values.
|
|
162
134
|
*
|
|
163
|
-
* @param
|
|
164
|
-
* @param num2 - The second numerical value to subtract with primary value.
|
|
135
|
+
* @param nums - The collection of numerical values to subtract.
|
|
165
136
|
* @returns The total accumulated result of this operation.
|
|
166
137
|
*/
|
|
167
|
-
Subtract(
|
|
138
|
+
Subtract(...nums: number[]): number;
|
|
168
139
|
|
|
169
140
|
/**
|
|
170
|
-
* Accumulates the total subtracted value of the first, second, and
|
|
141
|
+
* Accumulates the total subtracted value of the first, second, third, fourth, and fifth numerical values.
|
|
171
142
|
*
|
|
172
143
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
173
144
|
* @param num2 - The second numerical value to subtract with primary value.
|
|
174
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.
|
|
175
148
|
* @returns The total accumulated result of this operation.
|
|
176
149
|
*/
|
|
177
|
-
Subtract(num1: number, num2: number, num3: number): number;
|
|
150
|
+
Subtract(num1: number, num2: number, num3: number, num4: number, num5: number): number;
|
|
178
151
|
|
|
179
152
|
/**
|
|
180
153
|
* Accumulates the total subtracted value of the first, second, third, and fourth numerical values.
|
|
@@ -188,54 +161,43 @@ interface ArithmeticAPI {
|
|
|
188
161
|
Subtract(num1: number, num2: number, num3: number, num4: number): number;
|
|
189
162
|
|
|
190
163
|
/**
|
|
191
|
-
* Accumulates the total subtracted value of the first, second,
|
|
164
|
+
* Accumulates the total subtracted value of the first, second, and third numerical values.
|
|
192
165
|
*
|
|
193
166
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
194
167
|
* @param num2 - The second numerical value to subtract with primary value.
|
|
195
168
|
* @param num3 - The third numerical value to subtract with the given first 2 numerical values.
|
|
196
|
-
* @param num4 - The fourth numerical value to subtract with the given first 3 numerical values.
|
|
197
169
|
* @returns The total accumulated result of this operation.
|
|
198
170
|
*/
|
|
199
|
-
Subtract(num1: number, num2: number, num3: number
|
|
171
|
+
Subtract(num1: number, num2: number, num3: number): number;
|
|
200
172
|
|
|
201
173
|
/**
|
|
202
|
-
* Accumulates the total subtracted value of the first
|
|
174
|
+
* Accumulates the total subtracted value of the first and second numerical values.
|
|
203
175
|
*
|
|
204
176
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
205
177
|
* @param num2 - The second numerical value to subtract with primary value.
|
|
206
|
-
* @param num3 - The third numerical value to subtract with the given first 2 numerical values.
|
|
207
|
-
* @param num4 - The fourth numerical value to subtract with the given first 3 numerical values.
|
|
208
|
-
* @param num5 - The fifth numerical value to subtract with the other given 4 numerical values.
|
|
209
|
-
* @returns The total accumulated result of this operation.
|
|
210
|
-
*/
|
|
211
|
-
Subtract(num1: number, num2: number, num3: number, num4: number, num5: number): number;
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Accumulates the total subtracted value of the given collection of numerical values.
|
|
215
|
-
*
|
|
216
|
-
* @param nums - The collection of numerical values to subtract.
|
|
217
178
|
* @returns The total accumulated result of this operation.
|
|
218
179
|
*/
|
|
219
|
-
Subtract(
|
|
180
|
+
Subtract(num1: number, num2: number): number;
|
|
220
181
|
|
|
221
182
|
/**
|
|
222
|
-
* Accumulates the total summed value of the
|
|
183
|
+
* Accumulates the total summed value of the given collection of numerical values.
|
|
223
184
|
*
|
|
224
|
-
* @param
|
|
225
|
-
* @param num2 - The second numerical value to sum with primary value.
|
|
185
|
+
* @param nums - The collection of numerical values to sum.
|
|
226
186
|
* @returns The total accumulated result of this operation.
|
|
227
187
|
*/
|
|
228
|
-
Sum(
|
|
188
|
+
Sum(...nums: number[]): number;
|
|
229
189
|
|
|
230
190
|
/**
|
|
231
|
-
* Accumulates the total summed value of the first, second, and
|
|
191
|
+
* Accumulates the total summed value of the first, second, third, fourth, and fifth numerical values.
|
|
232
192
|
*
|
|
233
193
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
234
194
|
* @param num2 - The second numerical value to sum with primary value.
|
|
235
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.
|
|
236
198
|
* @returns The total accumulated result of this operation.
|
|
237
199
|
*/
|
|
238
|
-
Sum(num1: number, num2: number, num3: number): number;
|
|
200
|
+
Sum(num1: number, num2: number, num3: number, num4: number, num5: number): number;
|
|
239
201
|
|
|
240
202
|
/**
|
|
241
203
|
* Accumulates the total summed value of the first, second, third, and fourth numerical values.
|
|
@@ -249,33 +211,30 @@ interface ArithmeticAPI {
|
|
|
249
211
|
Sum(num1: number, num2: number, num3: number, num4: number): number;
|
|
250
212
|
|
|
251
213
|
/**
|
|
252
|
-
* Accumulates the total summed value of the first, second,
|
|
214
|
+
* Accumulates the total summed value of the first, second, and third numerical values.
|
|
253
215
|
*
|
|
254
216
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
255
217
|
* @param num2 - The second numerical value to sum with primary value.
|
|
256
218
|
* @param num3 - The third numerical value to sum with the given first 2 numerical values.
|
|
257
|
-
* @param num4 - The fourth numerical value to sum with the given first 3 numerical values.
|
|
258
219
|
* @returns The total accumulated result of this operation.
|
|
259
220
|
*/
|
|
260
|
-
Sum(num1: number, num2: number, num3: number
|
|
221
|
+
Sum(num1: number, num2: number, num3: number): number;
|
|
261
222
|
|
|
262
223
|
/**
|
|
263
|
-
* Accumulates the total summed value of the first
|
|
224
|
+
* Accumulates the total summed value of the first and second numerical values.
|
|
264
225
|
*
|
|
265
226
|
* @param num1 - The first or primary base numerical value of this operation.
|
|
266
227
|
* @param num2 - The second numerical value to sum with primary value.
|
|
267
|
-
* @param num3 - The third numerical value to sum with the given first 2 numerical values.
|
|
268
|
-
* @param num4 - The fourth numerical value to sum with the given first 3 numerical values.
|
|
269
|
-
* @param num5 - The fifth numerical value to sum with the other given 4 numerical values.
|
|
270
228
|
* @returns The total accumulated result of this operation.
|
|
271
229
|
*/
|
|
272
|
-
Sum(num1: number, num2: number
|
|
230
|
+
Sum(num1: number, num2: number): number;
|
|
231
|
+
}
|
|
273
232
|
|
|
233
|
+
declare global {
|
|
274
234
|
/**
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
* @param nums - The collection of numerical values to sum.
|
|
278
|
-
* @returns The total accumulated result of this operation.
|
|
235
|
+
* A collection of basic math operation.
|
|
279
236
|
*/
|
|
280
|
-
|
|
237
|
+
var Arithmetic: ArithmeticAPI;
|
|
281
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
8
|
+
new(meta: ArgumentErrorMeta): ArgumentErrorMeta;
|
|
7
9
|
};
|
|
8
10
|
/**
|
|
9
11
|
* A customized and enhanced `RangeError`.
|
|
10
12
|
*/
|
|
11
13
|
IndexOutOfBoundsError: {
|
|
12
|
-
new
|
|
14
|
+
new(meta: IndexOutOfBoundsErrorMeta): IndexOutOfBoundsErrorMeta;
|
|
13
15
|
};
|
|
14
16
|
/**
|
|
15
17
|
* A customized error for invalid properties.
|
|
16
18
|
*/
|
|
17
19
|
InvalidPropertyError: {
|
|
18
|
-
new
|
|
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
|
|
26
|
+
new(meta: MissingParameterErrorMeta): MissingParameterErrorMeta;
|
|
25
27
|
};
|
|
26
28
|
/**
|
|
27
29
|
* A customized error for missing property.
|
|
28
30
|
*/
|
|
29
31
|
MissingPropertyError: {
|
|
30
|
-
new
|
|
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
|
|
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
|
|
44
|
+
new(meta: NotSupportedErrorMeta): NotSupportedErrorMeta;
|
|
43
45
|
};
|
|
44
46
|
/**
|
|
45
47
|
* A customized error for unknown property.
|
|
46
48
|
*/
|
|
47
49
|
UnknownPropertyError: {
|
|
48
|
-
new
|
|
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
|
-
|
|
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
|
*
|
|
@@ -41,7 +41,7 @@ type CustomUtilitiesAPI = {
|
|
|
41
41
|
* @param data - The data of key-pair data.
|
|
42
42
|
* @param opt - A options of what would be the state configuration of the defined key-pair data.
|
|
43
43
|
*/
|
|
44
|
-
DefineProperty<K, D>(obj: { [prop: string]: any }, key: K, data: D, opt?: 'def' | 'hard' | 'med' | 'soft'): { [prop: string]: any } & { [prop in K]: D; };
|
|
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
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Defines the given key-pair data to the `globalThis` or `window` API.
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
91
|
+
NewToken(): string;
|
|
92
92
|
}
|