@bitbybit-dev/base 0.19.8 → 0.20.0
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/babel.config.cjs +1 -0
- package/babel.config.d.cts +5 -0
- package/index.d.ts +1 -0
- package/{index.ts → index.js} +1 -2
- package/lib/api/index.js +1 -0
- package/lib/api/inputs/base-inputs.d.ts +35 -0
- package/lib/api/inputs/base-inputs.js +1 -0
- package/lib/api/inputs/{color-inputs.ts → color-inputs.d.ts} +26 -48
- package/lib/api/inputs/color-inputs.js +164 -0
- package/lib/api/inputs/dates-inputs.d.ts +216 -0
- package/lib/api/inputs/dates-inputs.js +271 -0
- package/lib/api/inputs/{index.ts → index.d.ts} +1 -0
- package/lib/api/inputs/index.js +10 -0
- package/lib/api/inputs/{inputs.ts → inputs.d.ts} +1 -0
- package/lib/api/inputs/inputs.js +10 -0
- package/lib/api/inputs/{lists-inputs.ts → lists-inputs.d.ts} +91 -190
- package/lib/api/inputs/lists-inputs.js +576 -0
- package/lib/api/inputs/{logic-inputs.ts → logic-inputs.d.ts} +24 -46
- package/lib/api/inputs/logic-inputs.js +111 -0
- package/lib/api/inputs/{math-inputs.ts → math-inputs.d.ts} +53 -97
- package/lib/api/inputs/math-inputs.js +391 -0
- package/lib/api/inputs/{point-inputs.ts → point-inputs.d.ts} +77 -168
- package/lib/api/inputs/point-inputs.js +521 -0
- package/lib/api/inputs/text-inputs.d.ts +83 -0
- package/lib/api/inputs/text-inputs.js +120 -0
- package/lib/api/inputs/{transforms-inputs.ts → transforms-inputs.d.ts} +35 -64
- package/lib/api/inputs/transforms-inputs.js +200 -0
- package/lib/api/inputs/{vector-inputs.ts → vector-inputs.d.ts} +48 -104
- package/lib/api/inputs/vector-inputs.js +304 -0
- package/lib/api/services/color.d.ts +114 -0
- package/lib/api/services/{color.ts → color.js} +15 -34
- package/lib/api/services/dates.d.ts +367 -0
- package/lib/api/services/dates.js +450 -0
- package/lib/api/services/geometry-helper.d.ts +15 -0
- package/lib/api/services/{geometry-helper.ts → geometry-helper.js} +31 -43
- package/lib/api/services/{index.ts → index.d.ts} +2 -1
- package/lib/api/services/index.js +10 -0
- package/lib/api/services/lists.d.ts +287 -0
- package/lib/api/services/{lists.ts → lists.js} +59 -83
- package/lib/api/services/logic.d.ts +99 -0
- package/lib/api/services/{logic.ts → logic.js} +24 -32
- package/lib/api/services/math.d.ts +349 -0
- package/lib/api/services/{math.ts → math.js} +71 -136
- package/lib/api/services/point.d.ts +222 -0
- package/lib/api/services/{point.ts → point.js} +32 -67
- package/lib/api/services/text.d.ts +69 -0
- package/lib/api/services/{text.ts → text.js} +7 -17
- package/lib/api/services/transforms.d.ts +122 -0
- package/lib/api/services/{transforms.ts → transforms.js} +37 -83
- package/lib/api/services/vector.d.ts +320 -0
- package/lib/api/services/{vector.ts → vector.js} +42 -80
- package/lib/{index.ts → index.d.ts} +0 -1
- package/lib/index.js +1 -0
- package/package.json +1 -1
- package/lib/api/inputs/base-inputs.ts +0 -18
- package/lib/api/inputs/text-inputs.ts +0 -108
- package/lib/api/services/color.test.ts +0 -86
- package/lib/api/services/lists.test.ts +0 -612
- package/lib/api/services/logic.test.ts +0 -187
- package/lib/api/services/math.test.ts +0 -622
- package/lib/api/services/text.test.ts +0 -55
- package/lib/api/services/vector.test.ts +0 -360
- package/tsconfig.bitbybit.json +0 -26
- package/tsconfig.json +0 -24
- /package/lib/api/{index.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
2
|
+
// tslint:disable-next-line: no-namespace
|
|
3
|
+
export var Math;
|
|
4
|
+
(function (Math) {
|
|
5
|
+
let mathTwoNrOperatorEnum;
|
|
6
|
+
(function (mathTwoNrOperatorEnum) {
|
|
7
|
+
mathTwoNrOperatorEnum["add"] = "add";
|
|
8
|
+
mathTwoNrOperatorEnum["subtract"] = "subtract";
|
|
9
|
+
mathTwoNrOperatorEnum["multiply"] = "multiply";
|
|
10
|
+
mathTwoNrOperatorEnum["divide"] = "divide";
|
|
11
|
+
mathTwoNrOperatorEnum["power"] = "power";
|
|
12
|
+
mathTwoNrOperatorEnum["modulus"] = "modulus";
|
|
13
|
+
})(mathTwoNrOperatorEnum = Math.mathTwoNrOperatorEnum || (Math.mathTwoNrOperatorEnum = {}));
|
|
14
|
+
let mathOneNrOperatorEnum;
|
|
15
|
+
(function (mathOneNrOperatorEnum) {
|
|
16
|
+
mathOneNrOperatorEnum["absolute"] = "absolute";
|
|
17
|
+
mathOneNrOperatorEnum["negate"] = "negate";
|
|
18
|
+
mathOneNrOperatorEnum["ln"] = "ln";
|
|
19
|
+
mathOneNrOperatorEnum["log10"] = "log10";
|
|
20
|
+
mathOneNrOperatorEnum["tenPow"] = "tenPow";
|
|
21
|
+
mathOneNrOperatorEnum["round"] = "round";
|
|
22
|
+
mathOneNrOperatorEnum["floor"] = "floor";
|
|
23
|
+
mathOneNrOperatorEnum["ceil"] = "ceil";
|
|
24
|
+
mathOneNrOperatorEnum["sqrt"] = "sqrt";
|
|
25
|
+
mathOneNrOperatorEnum["sin"] = "sin";
|
|
26
|
+
mathOneNrOperatorEnum["cos"] = "cos";
|
|
27
|
+
mathOneNrOperatorEnum["tan"] = "tan";
|
|
28
|
+
mathOneNrOperatorEnum["asin"] = "asin";
|
|
29
|
+
mathOneNrOperatorEnum["acos"] = "acos";
|
|
30
|
+
mathOneNrOperatorEnum["atan"] = "atan";
|
|
31
|
+
mathOneNrOperatorEnum["log"] = "log";
|
|
32
|
+
mathOneNrOperatorEnum["exp"] = "exp";
|
|
33
|
+
mathOneNrOperatorEnum["radToDeg"] = "radToDeg";
|
|
34
|
+
mathOneNrOperatorEnum["degToRad"] = "degToRad";
|
|
35
|
+
})(mathOneNrOperatorEnum = Math.mathOneNrOperatorEnum || (Math.mathOneNrOperatorEnum = {}));
|
|
36
|
+
let easeEnum;
|
|
37
|
+
(function (easeEnum) {
|
|
38
|
+
easeEnum["easeInSine"] = "easeInSine";
|
|
39
|
+
easeEnum["easeOutSine"] = "easeOutSine";
|
|
40
|
+
easeEnum["easeInOutSine"] = "easeInOutSine";
|
|
41
|
+
easeEnum["easeInQuad"] = "easeInQuad";
|
|
42
|
+
easeEnum["easeOutQuad"] = "easeOutQuad";
|
|
43
|
+
easeEnum["easeInOutQuad"] = "easeInOutQuad";
|
|
44
|
+
easeEnum["easeInCubic"] = "easeInCubic";
|
|
45
|
+
easeEnum["easeOutCubic"] = "easeOutCubic";
|
|
46
|
+
easeEnum["easeInOutCubic"] = "easeInOutCubic";
|
|
47
|
+
easeEnum["easeInQuart"] = "easeInQuart";
|
|
48
|
+
easeEnum["easeOutQuart"] = "easeOutQuart";
|
|
49
|
+
easeEnum["easeInOutQuart"] = "easeInOutQuart";
|
|
50
|
+
easeEnum["easeInQuint"] = "easeInQuint";
|
|
51
|
+
easeEnum["easeOutQuint"] = "easeOutQuint";
|
|
52
|
+
easeEnum["easeInOutQuint"] = "easeInOutQuint";
|
|
53
|
+
easeEnum["easeInExpo"] = "easeInExpo";
|
|
54
|
+
easeEnum["easeOutExpo"] = "easeOutExpo";
|
|
55
|
+
easeEnum["easeInOutExpo"] = "easeInOutExpo";
|
|
56
|
+
easeEnum["easeInCirc"] = "easeInCirc";
|
|
57
|
+
easeEnum["easeOutCirc"] = "easeOutCirc";
|
|
58
|
+
easeEnum["easeInOutCirc"] = "easeInOutCirc";
|
|
59
|
+
easeEnum["easeInElastic"] = "easeInElastic";
|
|
60
|
+
easeEnum["easeOutElastic"] = "easeOutElastic";
|
|
61
|
+
easeEnum["easeInOutElastic"] = "easeInOutElastic";
|
|
62
|
+
easeEnum["easeInBack"] = "easeInBack";
|
|
63
|
+
easeEnum["easeOutBack"] = "easeOutBack";
|
|
64
|
+
easeEnum["easeInOutBack"] = "easeInOutBack";
|
|
65
|
+
easeEnum["easeInBounce"] = "easeInBounce";
|
|
66
|
+
easeEnum["easeOutBounce"] = "easeOutBounce";
|
|
67
|
+
easeEnum["easeInOutBounce"] = "easeInOutBounce";
|
|
68
|
+
})(easeEnum = Math.easeEnum || (Math.easeEnum = {}));
|
|
69
|
+
class ModulusDto {
|
|
70
|
+
constructor(number, modulus) {
|
|
71
|
+
/**
|
|
72
|
+
* Number
|
|
73
|
+
* @default 1
|
|
74
|
+
* @minimum -Infinity
|
|
75
|
+
* @maximum Infinity
|
|
76
|
+
* @step 0.1
|
|
77
|
+
*/
|
|
78
|
+
this.number = 1;
|
|
79
|
+
/**
|
|
80
|
+
* Modulus
|
|
81
|
+
* @default 1
|
|
82
|
+
* @minimum -Infinity
|
|
83
|
+
* @maximum Infinity
|
|
84
|
+
* @step 0.1
|
|
85
|
+
*/
|
|
86
|
+
this.modulus = 2;
|
|
87
|
+
if (number !== undefined) {
|
|
88
|
+
this.number = number;
|
|
89
|
+
}
|
|
90
|
+
if (modulus !== undefined) {
|
|
91
|
+
this.modulus = modulus;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
Math.ModulusDto = ModulusDto;
|
|
96
|
+
class NumberDto {
|
|
97
|
+
constructor(number) {
|
|
98
|
+
/**
|
|
99
|
+
* Number
|
|
100
|
+
* @default 1
|
|
101
|
+
* @minimum -Infinity
|
|
102
|
+
* @maximum Infinity
|
|
103
|
+
* @step 0.1
|
|
104
|
+
*/
|
|
105
|
+
this.number = 1;
|
|
106
|
+
if (number !== undefined) {
|
|
107
|
+
this.number = number;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
Math.NumberDto = NumberDto;
|
|
112
|
+
class EaseDto {
|
|
113
|
+
constructor(x) {
|
|
114
|
+
/**
|
|
115
|
+
* X value param between 0-1
|
|
116
|
+
* @default 0.5
|
|
117
|
+
* @minimum 0
|
|
118
|
+
* @maximum 1
|
|
119
|
+
* @step 0.1
|
|
120
|
+
*/
|
|
121
|
+
this.x = 0.5;
|
|
122
|
+
/**
|
|
123
|
+
* Minimum value
|
|
124
|
+
* @default 0
|
|
125
|
+
* @minimum -Infinity
|
|
126
|
+
* @maximum Infinity
|
|
127
|
+
* @step 0.1
|
|
128
|
+
*/
|
|
129
|
+
this.min = 0;
|
|
130
|
+
/**
|
|
131
|
+
* Maximum value
|
|
132
|
+
* @default 1
|
|
133
|
+
* @minimum -Infinity
|
|
134
|
+
* @maximum Infinity
|
|
135
|
+
* @step 0.1
|
|
136
|
+
*/
|
|
137
|
+
this.max = 1;
|
|
138
|
+
if (x !== undefined) {
|
|
139
|
+
this.x = x;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
Math.EaseDto = EaseDto;
|
|
144
|
+
class RoundToDecimalsDto {
|
|
145
|
+
constructor(number, decimalPlaces) {
|
|
146
|
+
/**
|
|
147
|
+
* Number to round
|
|
148
|
+
* @default 1.123456
|
|
149
|
+
* @minimum -Infinity
|
|
150
|
+
* @maximum Infinity
|
|
151
|
+
* @step 0.1
|
|
152
|
+
*/
|
|
153
|
+
this.number = 1.123456;
|
|
154
|
+
/**
|
|
155
|
+
* Number of decimal places
|
|
156
|
+
* @default 2
|
|
157
|
+
* @minimum -Infinity
|
|
158
|
+
* @maximum Infinity
|
|
159
|
+
* @step 1
|
|
160
|
+
*/
|
|
161
|
+
this.decimalPlaces = 2;
|
|
162
|
+
if (number !== undefined) {
|
|
163
|
+
this.number = number;
|
|
164
|
+
}
|
|
165
|
+
if (decimalPlaces !== undefined) {
|
|
166
|
+
this.decimalPlaces = decimalPlaces;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
Math.RoundToDecimalsDto = RoundToDecimalsDto;
|
|
171
|
+
class ActionOnTwoNumbersDto {
|
|
172
|
+
constructor(first, second, operation) {
|
|
173
|
+
/**
|
|
174
|
+
* First number
|
|
175
|
+
* @default 1
|
|
176
|
+
* @minimum -Infinity
|
|
177
|
+
* @maximum Infinity
|
|
178
|
+
* @step 0.1
|
|
179
|
+
*/
|
|
180
|
+
this.first = 1;
|
|
181
|
+
/**
|
|
182
|
+
* Second number
|
|
183
|
+
* @default 1
|
|
184
|
+
* @minimum -Infinity
|
|
185
|
+
* @maximum Infinity
|
|
186
|
+
* @step 0.1
|
|
187
|
+
*/
|
|
188
|
+
this.second = 1;
|
|
189
|
+
if (first !== undefined) {
|
|
190
|
+
this.first = first;
|
|
191
|
+
}
|
|
192
|
+
if (second !== undefined) {
|
|
193
|
+
this.second = second;
|
|
194
|
+
}
|
|
195
|
+
if (operation !== undefined) {
|
|
196
|
+
this.operation = operation;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
Math.ActionOnTwoNumbersDto = ActionOnTwoNumbersDto;
|
|
201
|
+
class TwoNumbersDto {
|
|
202
|
+
constructor(first, second) {
|
|
203
|
+
/**
|
|
204
|
+
* First number
|
|
205
|
+
* @default 1
|
|
206
|
+
* @minimum -Infinity
|
|
207
|
+
* @maximum Infinity
|
|
208
|
+
* @step 0.1
|
|
209
|
+
*/
|
|
210
|
+
this.first = 1;
|
|
211
|
+
/**
|
|
212
|
+
* Second number
|
|
213
|
+
* @default 2
|
|
214
|
+
* @minimum -Infinity
|
|
215
|
+
* @maximum Infinity
|
|
216
|
+
* @step 0.1
|
|
217
|
+
*/
|
|
218
|
+
this.second = 2;
|
|
219
|
+
if (first !== undefined) {
|
|
220
|
+
this.first = first;
|
|
221
|
+
}
|
|
222
|
+
if (second !== undefined) {
|
|
223
|
+
this.second = second;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
Math.TwoNumbersDto = TwoNumbersDto;
|
|
228
|
+
class ActionOnOneNumberDto {
|
|
229
|
+
constructor(number, operation) {
|
|
230
|
+
/**
|
|
231
|
+
* First number
|
|
232
|
+
* @default 1
|
|
233
|
+
* @minimum -Infinity
|
|
234
|
+
* @maximum Infinity
|
|
235
|
+
* @step 0.1
|
|
236
|
+
*/
|
|
237
|
+
this.number = 1;
|
|
238
|
+
if (number !== undefined) {
|
|
239
|
+
this.number = number;
|
|
240
|
+
}
|
|
241
|
+
if (operation !== undefined) {
|
|
242
|
+
this.operation = operation;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
Math.ActionOnOneNumberDto = ActionOnOneNumberDto;
|
|
247
|
+
class RemapNumberDto {
|
|
248
|
+
constructor(number, fromLow, fromHigh, toLow, toHigh) {
|
|
249
|
+
/**
|
|
250
|
+
* Number to remap
|
|
251
|
+
* @default 0.5
|
|
252
|
+
* @minimum -Infinity
|
|
253
|
+
* @maximum Infinity
|
|
254
|
+
* @step 0.1
|
|
255
|
+
*/
|
|
256
|
+
this.number = 0.5;
|
|
257
|
+
/**
|
|
258
|
+
* First number range min
|
|
259
|
+
* @default 0
|
|
260
|
+
* @minimum -Infinity
|
|
261
|
+
* @maximum Infinity
|
|
262
|
+
* @step 0.1
|
|
263
|
+
*/
|
|
264
|
+
this.fromLow = 0;
|
|
265
|
+
/**
|
|
266
|
+
* Map to range min
|
|
267
|
+
* @default 1
|
|
268
|
+
* @minimum -Infinity
|
|
269
|
+
* @maximum Infinity
|
|
270
|
+
* @step 0.1
|
|
271
|
+
*/
|
|
272
|
+
this.fromHigh = 1;
|
|
273
|
+
/**
|
|
274
|
+
* First number range max
|
|
275
|
+
* @default 1
|
|
276
|
+
* @minimum -Infinity
|
|
277
|
+
* @maximum Infinity
|
|
278
|
+
* @step 0.1
|
|
279
|
+
*/
|
|
280
|
+
this.toLow = 1;
|
|
281
|
+
/**
|
|
282
|
+
* Map to range max
|
|
283
|
+
* @default 2
|
|
284
|
+
* @minimum -Infinity
|
|
285
|
+
* @maximum Infinity
|
|
286
|
+
* @step 0.1
|
|
287
|
+
*/
|
|
288
|
+
this.toHigh = 2;
|
|
289
|
+
if (number !== undefined) {
|
|
290
|
+
this.number = number;
|
|
291
|
+
}
|
|
292
|
+
if (fromLow !== undefined) {
|
|
293
|
+
this.fromLow = fromLow;
|
|
294
|
+
}
|
|
295
|
+
if (fromHigh !== undefined) {
|
|
296
|
+
this.fromHigh = fromHigh;
|
|
297
|
+
}
|
|
298
|
+
if (toLow !== undefined) {
|
|
299
|
+
this.toLow = toLow;
|
|
300
|
+
}
|
|
301
|
+
if (toHigh !== undefined) {
|
|
302
|
+
this.toHigh = toHigh;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
Math.RemapNumberDto = RemapNumberDto;
|
|
307
|
+
class RandomNumberDto {
|
|
308
|
+
constructor(low, high) {
|
|
309
|
+
/**
|
|
310
|
+
* Low range of random value
|
|
311
|
+
* @default 0
|
|
312
|
+
* @minimum -Infinity
|
|
313
|
+
* @maximum Infinity
|
|
314
|
+
* @step 0.1
|
|
315
|
+
*/
|
|
316
|
+
this.low = 0;
|
|
317
|
+
/**
|
|
318
|
+
* High range of random value
|
|
319
|
+
* @default 1
|
|
320
|
+
* @minimum -Infinity
|
|
321
|
+
* @maximum Infinity
|
|
322
|
+
* @step 0.1
|
|
323
|
+
*/
|
|
324
|
+
this.high = 1;
|
|
325
|
+
if (low !== undefined) {
|
|
326
|
+
this.low = low;
|
|
327
|
+
}
|
|
328
|
+
if (high !== undefined) {
|
|
329
|
+
this.high = high;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
Math.RandomNumberDto = RandomNumberDto;
|
|
334
|
+
class RandomNumbersDto {
|
|
335
|
+
constructor(low, high, count) {
|
|
336
|
+
/**
|
|
337
|
+
* Low range of random value
|
|
338
|
+
* @default 0
|
|
339
|
+
* @minimum -Infinity
|
|
340
|
+
* @maximum Infinity
|
|
341
|
+
* @step 0.1
|
|
342
|
+
*/
|
|
343
|
+
this.low = 0;
|
|
344
|
+
/**
|
|
345
|
+
* High range of random value
|
|
346
|
+
* @default 1
|
|
347
|
+
* @minimum -Infinity
|
|
348
|
+
* @maximum Infinity
|
|
349
|
+
* @step 0.1
|
|
350
|
+
*/
|
|
351
|
+
this.high = 1;
|
|
352
|
+
/**
|
|
353
|
+
* Number of produced random values
|
|
354
|
+
* @default 10
|
|
355
|
+
* @minimum -Infinity
|
|
356
|
+
* @maximum Infinity
|
|
357
|
+
* @step 1
|
|
358
|
+
*/
|
|
359
|
+
this.count = 10;
|
|
360
|
+
if (low !== undefined) {
|
|
361
|
+
this.low = low;
|
|
362
|
+
}
|
|
363
|
+
if (high !== undefined) {
|
|
364
|
+
this.high = high;
|
|
365
|
+
}
|
|
366
|
+
if (count !== undefined) {
|
|
367
|
+
this.count = count;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
Math.RandomNumbersDto = RandomNumbersDto;
|
|
372
|
+
class ToFixedDto {
|
|
373
|
+
constructor(number, decimalPlaces) {
|
|
374
|
+
/**
|
|
375
|
+
* Number of decimal places
|
|
376
|
+
* @default 2
|
|
377
|
+
* @minimum -Infinity
|
|
378
|
+
* @maximum Infinity
|
|
379
|
+
* @step 1
|
|
380
|
+
*/
|
|
381
|
+
this.decimalPlaces = 2;
|
|
382
|
+
if (number !== undefined) {
|
|
383
|
+
this.number = number;
|
|
384
|
+
}
|
|
385
|
+
if (decimalPlaces !== undefined) {
|
|
386
|
+
this.decimalPlaces = decimalPlaces;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
Math.ToFixedDto = ToFixedDto;
|
|
391
|
+
})(Math || (Math = {}));
|