@bitbybit-dev/base 0.19.0-alpha.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.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/babel.config.cjs +14 -0
  4. package/babel.config.d.cts +5 -0
  5. package/index.d.ts +1 -0
  6. package/index.js +4 -0
  7. package/lib/api/index.d.ts +1 -0
  8. package/lib/api/index.js +1 -0
  9. package/lib/api/inputs/base-inputs.d.ts +35 -0
  10. package/lib/api/inputs/base-inputs.js +1 -0
  11. package/lib/api/inputs/color-inputs.d.ts +122 -0
  12. package/lib/api/inputs/color-inputs.js +164 -0
  13. package/lib/api/inputs/index.d.ts +8 -0
  14. package/lib/api/inputs/index.js +8 -0
  15. package/lib/api/inputs/inputs.d.ts +10 -0
  16. package/lib/api/inputs/inputs.js +10 -0
  17. package/lib/api/inputs/lists-inputs.d.ts +478 -0
  18. package/lib/api/inputs/lists-inputs.js +576 -0
  19. package/lib/api/inputs/logic-inputs.d.ts +163 -0
  20. package/lib/api/inputs/logic-inputs.js +111 -0
  21. package/lib/api/inputs/math-inputs.d.ts +311 -0
  22. package/lib/api/inputs/math-inputs.js +391 -0
  23. package/lib/api/inputs/point-inputs.d.ts +446 -0
  24. package/lib/api/inputs/point-inputs.js +521 -0
  25. package/lib/api/inputs/text-inputs.d.ts +83 -0
  26. package/lib/api/inputs/text-inputs.js +120 -0
  27. package/lib/api/inputs/transforms-inputs.d.ts +136 -0
  28. package/lib/api/inputs/transforms-inputs.js +200 -0
  29. package/lib/api/inputs/vector-inputs.d.ts +300 -0
  30. package/lib/api/inputs/vector-inputs.js +304 -0
  31. package/lib/api/services/color.d.ts +114 -0
  32. package/lib/api/services/color.js +170 -0
  33. package/lib/api/services/geometry-helper.d.ts +15 -0
  34. package/lib/api/services/geometry-helper.js +151 -0
  35. package/lib/api/services/index.d.ts +9 -0
  36. package/lib/api/services/index.js +9 -0
  37. package/lib/api/services/lists.d.ts +287 -0
  38. package/lib/api/services/lists.js +682 -0
  39. package/lib/api/services/logic.d.ts +99 -0
  40. package/lib/api/services/logic.js +203 -0
  41. package/lib/api/services/math.d.ts +349 -0
  42. package/lib/api/services/math.js +621 -0
  43. package/lib/api/services/point.d.ts +223 -0
  44. package/lib/api/services/point.js +351 -0
  45. package/lib/api/services/text.d.ts +69 -0
  46. package/lib/api/services/text.js +84 -0
  47. package/lib/api/services/transforms.d.ts +122 -0
  48. package/lib/api/services/transforms.js +256 -0
  49. package/lib/api/services/vector.d.ts +320 -0
  50. package/lib/api/services/vector.js +468 -0
  51. package/lib/index.d.ts +1 -0
  52. package/lib/index.js +1 -0
  53. package/package.json +93 -0
@@ -0,0 +1,576 @@
1
+ /* eslint-disable @typescript-eslint/no-namespace */
2
+ // tslint:disable-next-line: no-namespace
3
+ export var Lists;
4
+ (function (Lists) {
5
+ let firstLastEnum;
6
+ (function (firstLastEnum) {
7
+ firstLastEnum["first"] = "first";
8
+ firstLastEnum["last"] = "last";
9
+ })(firstLastEnum = Lists.firstLastEnum || (Lists.firstLastEnum = {}));
10
+ class ListItemDto {
11
+ constructor(list, index, clone) {
12
+ /**
13
+ * Index of the item in the list - 0 means first.
14
+ * @default 0
15
+ * @minimum 0
16
+ * @maximum Infinity
17
+ * @step 1
18
+ */
19
+ this.index = 0;
20
+ /**
21
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
22
+ * @default true
23
+ */
24
+ this.clone = true;
25
+ if (list !== undefined) {
26
+ this.list = list;
27
+ }
28
+ if (index !== undefined) {
29
+ this.index = index;
30
+ }
31
+ if (clone !== undefined) {
32
+ this.clone = clone;
33
+ }
34
+ }
35
+ }
36
+ Lists.ListItemDto = ListItemDto;
37
+ class SubListDto {
38
+ constructor(list, indexStart, indexEnd, clone) {
39
+ /**
40
+ * Index from which to start the sublist - 0 means first.
41
+ * @default 0
42
+ * @minimum 0
43
+ * @maximum Infinity
44
+ * @step 1
45
+ */
46
+ this.indexStart = 0;
47
+ /**
48
+ * Index to which to end the sublist - 0 means first.
49
+ * @default 1
50
+ * @minimum 0
51
+ * @maximum Infinity
52
+ * @step 1
53
+ */
54
+ this.indexEnd = 1;
55
+ /**
56
+ * Tries to clone the data in the component, sometimes it may not be possible if structure is circular
57
+ * @default true
58
+ */
59
+ this.clone = true;
60
+ if (list !== undefined) {
61
+ this.list = list;
62
+ }
63
+ if (indexStart !== undefined) {
64
+ this.indexStart = indexStart;
65
+ }
66
+ if (indexEnd !== undefined) {
67
+ this.indexEnd = indexEnd;
68
+ }
69
+ if (clone !== undefined) {
70
+ this.clone = clone;
71
+ }
72
+ }
73
+ }
74
+ Lists.SubListDto = SubListDto;
75
+ class ListCloneDto {
76
+ constructor(list, clone) {
77
+ /**
78
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
79
+ * @default true
80
+ */
81
+ this.clone = true;
82
+ if (list !== undefined) {
83
+ this.list = list;
84
+ }
85
+ if (clone !== undefined) {
86
+ this.clone = clone;
87
+ }
88
+ }
89
+ }
90
+ Lists.ListCloneDto = ListCloneDto;
91
+ class RepeatInPatternDto {
92
+ constructor(list) {
93
+ /**
94
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
95
+ * @default true
96
+ */
97
+ this.clone = true;
98
+ /**
99
+ * The limit of the length of the list
100
+ * @default 100
101
+ * @minimum 1
102
+ * @maximum Infinity
103
+ * @step 1
104
+ */
105
+ this.lengthLimit = 100;
106
+ if (list !== undefined) {
107
+ this.list = list;
108
+ }
109
+ }
110
+ }
111
+ Lists.RepeatInPatternDto = RepeatInPatternDto;
112
+ class SortDto {
113
+ constructor(list, clone, orderAsc) {
114
+ /**
115
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
116
+ * @default true
117
+ */
118
+ this.clone = true;
119
+ /**
120
+ * If true, the list will be sorted in ascending order, otherwise in descending order
121
+ * @default true
122
+ */
123
+ this.orderAsc = true;
124
+ if (list !== undefined) {
125
+ this.list = list;
126
+ }
127
+ if (clone !== undefined) {
128
+ this.clone = clone;
129
+ }
130
+ if (orderAsc !== undefined) {
131
+ this.orderAsc = orderAsc;
132
+ }
133
+ }
134
+ }
135
+ Lists.SortDto = SortDto;
136
+ class SortJsonDto {
137
+ constructor(list, clone, orderAsc) {
138
+ /**
139
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
140
+ * @default true
141
+ */
142
+ this.clone = true;
143
+ /**
144
+ * If true, the list will be sorted in ascending order, otherwise in descending order
145
+ * @default true
146
+ */
147
+ this.orderAsc = true;
148
+ /**
149
+ * The property to sort by
150
+ * @default propName
151
+ */
152
+ this.property = "propName";
153
+ if (list !== undefined) {
154
+ this.list = list;
155
+ }
156
+ if (clone !== undefined) {
157
+ this.clone = clone;
158
+ }
159
+ if (orderAsc !== undefined) {
160
+ this.orderAsc = orderAsc;
161
+ }
162
+ }
163
+ }
164
+ Lists.SortJsonDto = SortJsonDto;
165
+ class ListDto {
166
+ constructor(list) {
167
+ if (list !== undefined) {
168
+ this.list = list;
169
+ }
170
+ }
171
+ }
172
+ Lists.ListDto = ListDto;
173
+ class GroupListDto {
174
+ constructor(list, nrElements, keepRemainder) {
175
+ /**
176
+ * The number of elements in each group
177
+ * @default 2
178
+ * @minimum 1
179
+ * @maximum Infinity
180
+ * @step 1
181
+ */
182
+ this.nrElements = 2;
183
+ /**
184
+ * If true, the remainder of the list will be added as a separate group
185
+ * @default false
186
+ */
187
+ this.keepRemainder = false;
188
+ if (list !== undefined) {
189
+ this.list = list;
190
+ }
191
+ if (nrElements !== undefined) {
192
+ this.nrElements = nrElements;
193
+ }
194
+ if (keepRemainder !== undefined) {
195
+ this.keepRemainder = keepRemainder;
196
+ }
197
+ }
198
+ }
199
+ Lists.GroupListDto = GroupListDto;
200
+ class MultiplyItemDto {
201
+ constructor(item, times) {
202
+ if (item !== undefined) {
203
+ this.item = item;
204
+ }
205
+ if (times !== undefined) {
206
+ this.times = times;
207
+ }
208
+ }
209
+ }
210
+ Lists.MultiplyItemDto = MultiplyItemDto;
211
+ class AddItemAtIndexDto {
212
+ constructor(list, item, index, clone) {
213
+ /**
214
+ * The index to add the item at
215
+ * @default 0
216
+ * @minimum 0
217
+ * @maximum Infinity
218
+ * @step 1
219
+ */
220
+ this.index = 0;
221
+ /**
222
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
223
+ * @default true
224
+ */
225
+ this.clone = true;
226
+ if (list !== undefined) {
227
+ this.list = list;
228
+ }
229
+ if (item !== undefined) {
230
+ this.item = item;
231
+ }
232
+ if (index !== undefined) {
233
+ this.index = index;
234
+ }
235
+ if (clone !== undefined) {
236
+ this.clone = clone;
237
+ }
238
+ }
239
+ }
240
+ Lists.AddItemAtIndexDto = AddItemAtIndexDto;
241
+ class AddItemAtIndexesDto {
242
+ constructor(list, item, indexes, clone) {
243
+ /**
244
+ * The index to add the item at
245
+ * @default [0]
246
+ */
247
+ this.indexes = [0];
248
+ /**
249
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
250
+ * @default true
251
+ */
252
+ this.clone = true;
253
+ if (list !== undefined) {
254
+ this.list = list;
255
+ }
256
+ if (item !== undefined) {
257
+ this.item = item;
258
+ }
259
+ if (indexes !== undefined) {
260
+ this.indexes = indexes;
261
+ }
262
+ if (clone !== undefined) {
263
+ this.clone = clone;
264
+ }
265
+ }
266
+ }
267
+ Lists.AddItemAtIndexesDto = AddItemAtIndexesDto;
268
+ class AddItemsAtIndexesDto {
269
+ constructor(list, items, indexes, clone) {
270
+ /**
271
+ * The index to add the item at
272
+ * @default [0]
273
+ */
274
+ this.indexes = [0];
275
+ /**
276
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
277
+ * @default true
278
+ */
279
+ this.clone = true;
280
+ if (list !== undefined) {
281
+ this.list = list;
282
+ }
283
+ if (items !== undefined) {
284
+ this.items = items;
285
+ }
286
+ if (indexes !== undefined) {
287
+ this.indexes = indexes;
288
+ }
289
+ if (clone !== undefined) {
290
+ this.clone = clone;
291
+ }
292
+ }
293
+ }
294
+ Lists.AddItemsAtIndexesDto = AddItemsAtIndexesDto;
295
+ class RemoveItemAtIndexDto {
296
+ constructor(list, index, clone) {
297
+ /**
298
+ * The index to on which remove item
299
+ * @default 0
300
+ * @minimum 0
301
+ * @maximum Infinity
302
+ * @step 1
303
+ */
304
+ this.index = 0;
305
+ /**
306
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
307
+ * @default true
308
+ */
309
+ this.clone = true;
310
+ if (list !== undefined) {
311
+ this.list = list;
312
+ }
313
+ if (index !== undefined) {
314
+ this.index = index;
315
+ }
316
+ if (clone !== undefined) {
317
+ this.clone = clone;
318
+ }
319
+ }
320
+ }
321
+ Lists.RemoveItemAtIndexDto = RemoveItemAtIndexDto;
322
+ class RemoveItemsAtIndexesDto {
323
+ constructor(list, indexes, clone) {
324
+ /**
325
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
326
+ * @default true
327
+ */
328
+ this.clone = true;
329
+ if (list !== undefined) {
330
+ this.list = list;
331
+ }
332
+ if (indexes !== undefined) {
333
+ this.indexes = indexes;
334
+ }
335
+ if (clone !== undefined) {
336
+ this.clone = clone;
337
+ }
338
+ }
339
+ }
340
+ Lists.RemoveItemsAtIndexesDto = RemoveItemsAtIndexesDto;
341
+ class RemoveNthItemDto {
342
+ constructor(list, nth, offset, clone) {
343
+ /**
344
+ * The nth item to remove
345
+ * @default 2
346
+ * @minimum 1
347
+ * @maximum Infinity
348
+ * @step 1
349
+ */
350
+ this.nth = 2;
351
+ /**
352
+ * The offset from which to start counting
353
+ * @default 0
354
+ * @minimum 0
355
+ * @maximum Infinity
356
+ * @step 1
357
+ */
358
+ this.offset = 0;
359
+ /**
360
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
361
+ * @default true
362
+ */
363
+ this.clone = true;
364
+ if (list !== undefined) {
365
+ this.list = list;
366
+ }
367
+ if (nth !== undefined) {
368
+ this.nth = nth;
369
+ }
370
+ if (offset !== undefined) {
371
+ this.offset = offset;
372
+ }
373
+ if (clone !== undefined) {
374
+ this.clone = clone;
375
+ }
376
+ }
377
+ }
378
+ Lists.RemoveNthItemDto = RemoveNthItemDto;
379
+ class RandomThresholdDto {
380
+ constructor(list, threshold, clone) {
381
+ /**
382
+ * Threshold for items
383
+ * @default 0.5
384
+ * @minimum 0
385
+ * @maximum 1
386
+ * @step 1
387
+ */
388
+ this.threshold = 1;
389
+ /**
390
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
391
+ * @default true
392
+ */
393
+ this.clone = true;
394
+ if (list !== undefined) {
395
+ this.list = list;
396
+ }
397
+ if (threshold !== undefined) {
398
+ this.threshold = threshold;
399
+ }
400
+ if (clone !== undefined) {
401
+ this.clone = clone;
402
+ }
403
+ }
404
+ }
405
+ Lists.RandomThresholdDto = RandomThresholdDto;
406
+ class RemoveDuplicatesDto {
407
+ constructor(list, clone) {
408
+ /**
409
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
410
+ * @default true
411
+ */
412
+ this.clone = true;
413
+ if (list !== undefined) {
414
+ this.list = list;
415
+ }
416
+ if (clone !== undefined) {
417
+ this.clone = clone;
418
+ }
419
+ }
420
+ }
421
+ Lists.RemoveDuplicatesDto = RemoveDuplicatesDto;
422
+ class RemoveDuplicatesToleranceDto {
423
+ constructor(list, clone, tolerance) {
424
+ /**
425
+ * The tolerance to apply
426
+ * @default 1e-7
427
+ * @minimum 0
428
+ * @maximum Infinity
429
+ * @step 1e-7
430
+ */
431
+ this.tolerance = 1e-7;
432
+ /**
433
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
434
+ * @default true
435
+ */
436
+ this.clone = true;
437
+ if (list !== undefined) {
438
+ this.list = list;
439
+ }
440
+ if (tolerance !== undefined) {
441
+ this.tolerance = tolerance;
442
+ }
443
+ if (clone !== undefined) {
444
+ this.clone = clone;
445
+ }
446
+ }
447
+ }
448
+ Lists.RemoveDuplicatesToleranceDto = RemoveDuplicatesToleranceDto;
449
+ class GetByPatternDto {
450
+ constructor(list, pattern) {
451
+ /**
452
+ * The list of booleans to be used as a pattern (true means get, false means skip)
453
+ * @default [true, true, false]
454
+ */
455
+ this.pattern = [true, true, false];
456
+ if (list !== undefined) {
457
+ this.list = list;
458
+ }
459
+ if (pattern !== undefined) {
460
+ this.pattern = pattern;
461
+ }
462
+ }
463
+ }
464
+ Lists.GetByPatternDto = GetByPatternDto;
465
+ class GetNthItemDto {
466
+ constructor(list, nth, offset, clone) {
467
+ /**
468
+ * The nth item to get
469
+ * @default 2
470
+ * @minimum 1
471
+ * @maximum Infinity
472
+ * @step 1
473
+ */
474
+ this.nth = 2;
475
+ /**
476
+ * The offset from which to start counting
477
+ * @default 0
478
+ * @minimum 0
479
+ * @maximum Infinity
480
+ * @step 1
481
+ */
482
+ this.offset = 0;
483
+ /**
484
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
485
+ * @default true
486
+ */
487
+ this.clone = true;
488
+ if (list !== undefined) {
489
+ this.list = list;
490
+ }
491
+ if (nth !== undefined) {
492
+ this.nth = nth;
493
+ }
494
+ if (offset !== undefined) {
495
+ this.offset = offset;
496
+ }
497
+ if (clone !== undefined) {
498
+ this.clone = clone;
499
+ }
500
+ }
501
+ }
502
+ Lists.GetNthItemDto = GetNthItemDto;
503
+ class GetLongestListLength {
504
+ constructor(lists) {
505
+ if (lists !== undefined) {
506
+ this.lists = lists;
507
+ }
508
+ }
509
+ }
510
+ Lists.GetLongestListLength = GetLongestListLength;
511
+ class MergeElementsOfLists {
512
+ constructor(lists, level) {
513
+ /**
514
+ * The level on which to merge the elements. 0 means first level
515
+ * @default 0
516
+ * @minimum 0
517
+ * @maximum Infinity
518
+ * @step 1
519
+ */
520
+ this.level = 0;
521
+ if (lists !== undefined) {
522
+ this.lists = lists;
523
+ }
524
+ if (level !== undefined) {
525
+ this.level = level;
526
+ }
527
+ }
528
+ }
529
+ Lists.MergeElementsOfLists = MergeElementsOfLists;
530
+ class AddItemDto {
531
+ constructor(list, item, clone) {
532
+ /**
533
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
534
+ * @default true
535
+ */
536
+ this.clone = true;
537
+ if (list !== undefined) {
538
+ this.list = list;
539
+ }
540
+ if (item !== undefined) {
541
+ this.item = item;
542
+ }
543
+ if (clone !== undefined) {
544
+ this.clone = clone;
545
+ }
546
+ }
547
+ }
548
+ Lists.AddItemDto = AddItemDto;
549
+ class AddItemFirstLastDto {
550
+ constructor(list, item, position, clone) {
551
+ /**
552
+ * The option if the item needs to be added at the beginning or the end of the list
553
+ * @default last
554
+ */
555
+ this.position = firstLastEnum.last;
556
+ /**
557
+ * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error
558
+ * @default true
559
+ */
560
+ this.clone = true;
561
+ if (list !== undefined) {
562
+ this.list = list;
563
+ }
564
+ if (item !== undefined) {
565
+ this.item = item;
566
+ }
567
+ if (position !== undefined) {
568
+ this.position = position;
569
+ }
570
+ if (clone !== undefined) {
571
+ this.clone = clone;
572
+ }
573
+ }
574
+ }
575
+ Lists.AddItemFirstLastDto = AddItemFirstLastDto;
576
+ })(Lists || (Lists = {}));