@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,478 @@
1
+ export declare namespace Lists {
2
+ enum firstLastEnum {
3
+ first = "first",
4
+ last = "last"
5
+ }
6
+ class ListItemDto<T> {
7
+ constructor(list?: T[], index?: number, clone?: boolean);
8
+ /**
9
+ * The list to interrogate
10
+ * @default undefined
11
+ */
12
+ list: T[];
13
+ /**
14
+ * Index of the item in the list - 0 means first.
15
+ * @default 0
16
+ * @minimum 0
17
+ * @maximum Infinity
18
+ * @step 1
19
+ */
20
+ index: number;
21
+ /**
22
+ * 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
23
+ * @default true
24
+ */
25
+ clone?: boolean;
26
+ }
27
+ class SubListDto<T> {
28
+ constructor(list?: T[], indexStart?: number, indexEnd?: number, clone?: boolean);
29
+ /**
30
+ * The list to split into a sublist
31
+ * @default undefined
32
+ */
33
+ list: T[];
34
+ /**
35
+ * Index from which to start the sublist - 0 means first.
36
+ * @default 0
37
+ * @minimum 0
38
+ * @maximum Infinity
39
+ * @step 1
40
+ */
41
+ indexStart: number;
42
+ /**
43
+ * Index to which to end the sublist - 0 means first.
44
+ * @default 1
45
+ * @minimum 0
46
+ * @maximum Infinity
47
+ * @step 1
48
+ */
49
+ indexEnd: number;
50
+ /**
51
+ * Tries to clone the data in the component, sometimes it may not be possible if structure is circular
52
+ * @default true
53
+ */
54
+ clone?: boolean;
55
+ }
56
+ class ListCloneDto<T> {
57
+ constructor(list?: T[], clone?: boolean);
58
+ /**
59
+ * The list to interrogate
60
+ * @default undefined
61
+ */
62
+ list: T[];
63
+ /**
64
+ * 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
65
+ * @default true
66
+ */
67
+ clone?: boolean;
68
+ }
69
+ class RepeatInPatternDto<T> {
70
+ constructor(list?: T[]);
71
+ /**
72
+ * The list to interrogate
73
+ * @default undefined
74
+ */
75
+ list: T[];
76
+ /**
77
+ * 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
78
+ * @default true
79
+ */
80
+ clone?: boolean;
81
+ /**
82
+ * The limit of the length of the list
83
+ * @default 100
84
+ * @minimum 1
85
+ * @maximum Infinity
86
+ * @step 1
87
+ */
88
+ lengthLimit: number;
89
+ }
90
+ class SortDto<T> {
91
+ constructor(list?: T[], clone?: boolean, orderAsc?: boolean);
92
+ /**
93
+ * The list to interrogate
94
+ * @default undefined
95
+ */
96
+ list: T[];
97
+ /**
98
+ * 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
99
+ * @default true
100
+ */
101
+ clone?: boolean;
102
+ /**
103
+ * If true, the list will be sorted in ascending order, otherwise in descending order
104
+ * @default true
105
+ */
106
+ orderAsc: boolean;
107
+ }
108
+ class SortJsonDto<T> {
109
+ constructor(list?: T[], clone?: boolean, orderAsc?: boolean);
110
+ /**
111
+ * The list to interrogate
112
+ * @default undefined
113
+ */
114
+ list: T[];
115
+ /**
116
+ * 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
117
+ * @default true
118
+ */
119
+ clone?: boolean;
120
+ /**
121
+ * If true, the list will be sorted in ascending order, otherwise in descending order
122
+ * @default true
123
+ */
124
+ orderAsc: boolean;
125
+ /**
126
+ * The property to sort by
127
+ * @default propName
128
+ */
129
+ property: string;
130
+ }
131
+ class ListDto<T> {
132
+ constructor(list?: T[]);
133
+ /**
134
+ * The list
135
+ * @default undefined
136
+ */
137
+ list: T[];
138
+ }
139
+ class GroupListDto<T> {
140
+ constructor(list?: T[], nrElements?: number, keepRemainder?: boolean);
141
+ /**
142
+ * The list of elements to group together
143
+ * @default undefined
144
+ */
145
+ list: T[];
146
+ /**
147
+ * The number of elements in each group
148
+ * @default 2
149
+ * @minimum 1
150
+ * @maximum Infinity
151
+ * @step 1
152
+ */
153
+ nrElements: number;
154
+ /**
155
+ * If true, the remainder of the list will be added as a separate group
156
+ * @default false
157
+ */
158
+ keepRemainder: boolean;
159
+ }
160
+ class MultiplyItemDto<T> {
161
+ constructor(item?: T, times?: number);
162
+ /**
163
+ * The item to multiply
164
+ * @default undefined
165
+ */
166
+ item: T;
167
+ /**
168
+ * Times to multiply
169
+ * @default 10
170
+ * @minimum 0
171
+ * @maximum Infinity
172
+ * @step 1
173
+ */
174
+ times: number;
175
+ }
176
+ class AddItemAtIndexDto<T> {
177
+ constructor(list?: T[], item?: T, index?: number, clone?: boolean);
178
+ /**
179
+ * The list to which item needs to be added
180
+ * @default undefined
181
+ */
182
+ list: T[];
183
+ /**
184
+ * The item to add
185
+ * @default undefined
186
+ */
187
+ item: T;
188
+ /**
189
+ * The index to add the item at
190
+ * @default 0
191
+ * @minimum 0
192
+ * @maximum Infinity
193
+ * @step 1
194
+ */
195
+ index: number;
196
+ /**
197
+ * 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
198
+ * @default true
199
+ */
200
+ clone?: boolean;
201
+ }
202
+ class AddItemAtIndexesDto<T> {
203
+ constructor(list?: T[], item?: T, indexes?: number[], clone?: boolean);
204
+ /**
205
+ * The list to which item needs to be added
206
+ * @default undefined
207
+ */
208
+ list: T[];
209
+ /**
210
+ * The item to add
211
+ * @default undefined
212
+ */
213
+ item: T;
214
+ /**
215
+ * The index to add the item at
216
+ * @default [0]
217
+ */
218
+ indexes: number[];
219
+ /**
220
+ * 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
221
+ * @default true
222
+ */
223
+ clone?: boolean;
224
+ }
225
+ class AddItemsAtIndexesDto<T> {
226
+ constructor(list?: T[], items?: T[], indexes?: number[], clone?: boolean);
227
+ /**
228
+ * The list to which item needs to be added
229
+ * @default undefined
230
+ */
231
+ list: T[];
232
+ /**
233
+ * The item to add
234
+ * @default undefined
235
+ */
236
+ items: T[];
237
+ /**
238
+ * The index to add the item at
239
+ * @default [0]
240
+ */
241
+ indexes: number[];
242
+ /**
243
+ * 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
244
+ * @default true
245
+ */
246
+ clone?: boolean;
247
+ }
248
+ class RemoveItemAtIndexDto<T> {
249
+ constructor(list?: T[], index?: number, clone?: boolean);
250
+ /**
251
+ * The list from which item needs to be removed
252
+ * @default undefined
253
+ */
254
+ list: T[];
255
+ /**
256
+ * The index to on which remove item
257
+ * @default 0
258
+ * @minimum 0
259
+ * @maximum Infinity
260
+ * @step 1
261
+ */
262
+ index: number;
263
+ /**
264
+ * 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
265
+ * @default true
266
+ */
267
+ clone?: boolean;
268
+ }
269
+ class RemoveItemsAtIndexesDto<T> {
270
+ constructor(list?: T[], indexes?: number[], clone?: boolean);
271
+ /**
272
+ * The list from which item needs to be removed
273
+ * @default undefined
274
+ */
275
+ list: T[];
276
+ /**
277
+ * The indexes that should be removed
278
+ * @default undefined
279
+ */
280
+ indexes: number[];
281
+ /**
282
+ * 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
283
+ * @default true
284
+ */
285
+ clone?: boolean;
286
+ }
287
+ class RemoveNthItemDto<T> {
288
+ constructor(list?: T[], nth?: number, offset?: number, clone?: boolean);
289
+ /**
290
+ * The list from which item needs to be removed
291
+ * @default undefined
292
+ */
293
+ list: T[];
294
+ /**
295
+ * The nth item to remove
296
+ * @default 2
297
+ * @minimum 1
298
+ * @maximum Infinity
299
+ * @step 1
300
+ */
301
+ nth: number;
302
+ /**
303
+ * The offset from which to start counting
304
+ * @default 0
305
+ * @minimum 0
306
+ * @maximum Infinity
307
+ * @step 1
308
+ */
309
+ offset: number;
310
+ /**
311
+ * 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
312
+ * @default true
313
+ */
314
+ clone?: boolean;
315
+ }
316
+ class RandomThresholdDto<T> {
317
+ constructor(list?: T[], threshold?: number, clone?: boolean);
318
+ /**
319
+ * The list from which item needs to be updated
320
+ * @default undefined
321
+ */
322
+ list: T[];
323
+ /**
324
+ * Threshold for items
325
+ * @default 0.5
326
+ * @minimum 0
327
+ * @maximum 1
328
+ * @step 1
329
+ */
330
+ threshold: number;
331
+ /**
332
+ * 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
333
+ * @default true
334
+ */
335
+ clone?: boolean;
336
+ }
337
+ class RemoveDuplicatesDto<T> {
338
+ constructor(list?: T[], clone?: boolean);
339
+ /**
340
+ * The list from which item needs to be removed
341
+ * @default undefined
342
+ */
343
+ list: T[];
344
+ /**
345
+ * 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
346
+ * @default true
347
+ */
348
+ clone?: boolean;
349
+ }
350
+ class RemoveDuplicatesToleranceDto<T> {
351
+ constructor(list?: T[], clone?: boolean, tolerance?: number);
352
+ /**
353
+ * The list from which item needs to be removed
354
+ * @default undefined
355
+ */
356
+ list: T[];
357
+ /**
358
+ * The tolerance to apply
359
+ * @default 1e-7
360
+ * @minimum 0
361
+ * @maximum Infinity
362
+ * @step 1e-7
363
+ */
364
+ tolerance: number;
365
+ /**
366
+ * 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
367
+ * @default true
368
+ */
369
+ clone?: boolean;
370
+ }
371
+ class GetByPatternDto<T> {
372
+ constructor(list?: T[], pattern?: boolean[]);
373
+ /**
374
+ * The list from which we need to get an item
375
+ * @default undefined
376
+ */
377
+ list: T[];
378
+ /**
379
+ * The list of booleans to be used as a pattern (true means get, false means skip)
380
+ * @default [true, true, false]
381
+ */
382
+ pattern: boolean[];
383
+ }
384
+ class GetNthItemDto<T> {
385
+ constructor(list?: T[], nth?: number, offset?: number, clone?: boolean);
386
+ /**
387
+ * The list from which we need to get an item
388
+ * @default undefined
389
+ */
390
+ list: T[];
391
+ /**
392
+ * The nth item to get
393
+ * @default 2
394
+ * @minimum 1
395
+ * @maximum Infinity
396
+ * @step 1
397
+ */
398
+ nth: number;
399
+ /**
400
+ * The offset from which to start counting
401
+ * @default 0
402
+ * @minimum 0
403
+ * @maximum Infinity
404
+ * @step 1
405
+ */
406
+ offset: number;
407
+ /**
408
+ * 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
409
+ * @default true
410
+ */
411
+ clone?: boolean;
412
+ }
413
+ class GetLongestListLength<T> {
414
+ constructor(lists?: T[]);
415
+ /**
416
+ * The list from which we need to get an item
417
+ * @default undefined
418
+ */
419
+ lists: T[];
420
+ }
421
+ class MergeElementsOfLists<T> {
422
+ constructor(lists?: T[], level?: number);
423
+ /**
424
+ * The list from which we need to get an item
425
+ * @default undefined
426
+ */
427
+ lists: T[];
428
+ /**
429
+ * The level on which to merge the elements. 0 means first level
430
+ * @default 0
431
+ * @minimum 0
432
+ * @maximum Infinity
433
+ * @step 1
434
+ */
435
+ level: number;
436
+ }
437
+ class AddItemDto<T> {
438
+ constructor(list?: T[], item?: T, clone?: boolean);
439
+ /**
440
+ * The list to which item needs to be added
441
+ * @default undefined
442
+ */
443
+ list: T[];
444
+ /**
445
+ * The item to add
446
+ * @default undefined
447
+ */
448
+ item: T;
449
+ /**
450
+ * 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
451
+ * @default true
452
+ */
453
+ clone?: boolean;
454
+ }
455
+ class AddItemFirstLastDto<T> {
456
+ constructor(list?: T[], item?: T, position?: firstLastEnum, clone?: boolean);
457
+ /**
458
+ * The list to which item needs to be added
459
+ * @default undefined
460
+ */
461
+ list: T[];
462
+ /**
463
+ * The item to add
464
+ * @default undefined
465
+ */
466
+ item: T;
467
+ /**
468
+ * The option if the item needs to be added at the beginning or the end of the list
469
+ * @default last
470
+ */
471
+ position: firstLastEnum;
472
+ /**
473
+ * 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
474
+ * @default true
475
+ */
476
+ clone?: boolean;
477
+ }
478
+ }