@bitbybit-dev/base 0.20.13 → 0.20.14

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 (38) hide show
  1. package/lib/api/GlobalCDNProvider.js +1 -1
  2. package/lib/api/inputs/lists-inputs.d.ts +39 -0
  3. package/lib/api/inputs/lists-inputs.js +43 -0
  4. package/lib/api/inputs/math-inputs.d.ts +154 -0
  5. package/lib/api/inputs/math-inputs.js +217 -0
  6. package/lib/api/inputs/text-inputs.d.ts +139 -0
  7. package/lib/api/inputs/text-inputs.js +215 -0
  8. package/lib/api/inputs/vector-inputs.d.ts +8 -0
  9. package/lib/api/inputs/vector-inputs.js +8 -0
  10. package/lib/api/services/color.d.ts +27 -12
  11. package/lib/api/services/color.js +27 -12
  12. package/lib/api/services/dates.d.ts +62 -30
  13. package/lib/api/services/dates.js +62 -30
  14. package/lib/api/services/geometry-helper.d.ts +50 -0
  15. package/lib/api/services/geometry-helper.js +50 -2
  16. package/lib/api/services/helpers/dxf/dxf.d.ts +19 -9
  17. package/lib/api/services/helpers/dxf/dxf.js +19 -9
  18. package/lib/api/services/line.d.ts +34 -16
  19. package/lib/api/services/line.js +34 -16
  20. package/lib/api/services/lists.d.ts +175 -32
  21. package/lib/api/services/lists.js +275 -32
  22. package/lib/api/services/logic.d.ts +24 -13
  23. package/lib/api/services/logic.js +24 -13
  24. package/lib/api/services/math.d.ts +180 -35
  25. package/lib/api/services/math.js +215 -35
  26. package/lib/api/services/mesh.d.ts +17 -6
  27. package/lib/api/services/mesh.js +17 -6
  28. package/lib/api/services/point.d.ts +63 -32
  29. package/lib/api/services/point.js +63 -32
  30. package/lib/api/services/polyline.d.ts +27 -11
  31. package/lib/api/services/polyline.js +27 -11
  32. package/lib/api/services/text.d.ts +286 -7
  33. package/lib/api/services/text.js +350 -7
  34. package/lib/api/services/transforms.d.ts +30 -16
  35. package/lib/api/services/transforms.js +30 -16
  36. package/lib/api/services/vector.d.ts +85 -38
  37. package/lib/api/services/vector.js +87 -38
  38. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  export class GlobalCDNProvider {
2
2
  }
3
- GlobalCDNProvider.BITBYBIT_CDN_URL = "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.13";
3
+ GlobalCDNProvider.BITBYBIT_CDN_URL = "https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.14";
@@ -475,4 +475,43 @@ export declare namespace Lists {
475
475
  */
476
476
  clone?: boolean;
477
477
  }
478
+ class ConcatenateDto<T> {
479
+ constructor(lists?: T[][], clone?: boolean);
480
+ /**
481
+ * The lists to concatenate
482
+ * @default undefined
483
+ */
484
+ lists: T[][];
485
+ /**
486
+ * 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
487
+ * @default true
488
+ */
489
+ clone?: boolean;
490
+ }
491
+ class IncludesDto<T> {
492
+ constructor(list?: T[], item?: T);
493
+ /**
494
+ * The list to check
495
+ * @default undefined
496
+ */
497
+ list: T[];
498
+ /**
499
+ * The item to look for
500
+ * @default undefined
501
+ */
502
+ item: T;
503
+ }
504
+ class InterleaveDto<T> {
505
+ constructor(lists?: T[][], clone?: boolean);
506
+ /**
507
+ * The lists to interleave
508
+ * @default undefined
509
+ */
510
+ lists: T[][];
511
+ /**
512
+ * 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
513
+ * @default true
514
+ */
515
+ clone?: boolean;
516
+ }
478
517
  }
@@ -573,4 +573,47 @@ export var Lists;
573
573
  }
574
574
  }
575
575
  Lists.AddItemFirstLastDto = AddItemFirstLastDto;
576
+ class ConcatenateDto {
577
+ constructor(lists, clone) {
578
+ /**
579
+ * 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
580
+ * @default true
581
+ */
582
+ this.clone = true;
583
+ if (lists !== undefined) {
584
+ this.lists = lists;
585
+ }
586
+ if (clone !== undefined) {
587
+ this.clone = clone;
588
+ }
589
+ }
590
+ }
591
+ Lists.ConcatenateDto = ConcatenateDto;
592
+ class IncludesDto {
593
+ constructor(list, item) {
594
+ if (list !== undefined) {
595
+ this.list = list;
596
+ }
597
+ if (item !== undefined) {
598
+ this.item = item;
599
+ }
600
+ }
601
+ }
602
+ Lists.IncludesDto = IncludesDto;
603
+ class InterleaveDto {
604
+ constructor(lists, clone) {
605
+ /**
606
+ * 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
607
+ * @default true
608
+ */
609
+ this.clone = true;
610
+ if (lists !== undefined) {
611
+ this.lists = lists;
612
+ }
613
+ if (clone !== undefined) {
614
+ this.clone = clone;
615
+ }
616
+ }
617
+ }
618
+ Lists.InterleaveDto = InterleaveDto;
576
619
  })(Lists || (Lists = {}));
@@ -308,4 +308,158 @@ export declare namespace Math {
308
308
  */
309
309
  decimalPlaces: number;
310
310
  }
311
+ class ClampDto {
312
+ constructor(number?: number, min?: number, max?: number);
313
+ /**
314
+ * Number to clamp
315
+ * @default 0.5
316
+ * @minimum -Infinity
317
+ * @maximum Infinity
318
+ * @step 0.1
319
+ */
320
+ number: number;
321
+ /**
322
+ * Minimum value
323
+ * @default 0
324
+ * @minimum -Infinity
325
+ * @maximum Infinity
326
+ * @step 0.1
327
+ */
328
+ min: number;
329
+ /**
330
+ * Maximum value
331
+ * @default 1
332
+ * @minimum -Infinity
333
+ * @maximum Infinity
334
+ * @step 0.1
335
+ */
336
+ max: number;
337
+ }
338
+ class LerpDto {
339
+ constructor(start?: number, end?: number, t?: number);
340
+ /**
341
+ * Start value
342
+ * @default 0
343
+ * @minimum -Infinity
344
+ * @maximum Infinity
345
+ * @step 0.1
346
+ */
347
+ start: number;
348
+ /**
349
+ * End value
350
+ * @default 1
351
+ * @minimum -Infinity
352
+ * @maximum Infinity
353
+ * @step 0.1
354
+ */
355
+ end: number;
356
+ /**
357
+ * Interpolation value (0-1)
358
+ * @default 0.5
359
+ * @minimum -Infinity
360
+ * @maximum Infinity
361
+ * @step 0.01
362
+ */
363
+ t: number;
364
+ }
365
+ class InverseLerpDto {
366
+ constructor(start?: number, end?: number, value?: number);
367
+ /**
368
+ * Start value
369
+ * @default 0
370
+ * @minimum -Infinity
371
+ * @maximum Infinity
372
+ * @step 0.1
373
+ */
374
+ start: number;
375
+ /**
376
+ * End value
377
+ * @default 1
378
+ * @minimum -Infinity
379
+ * @maximum Infinity
380
+ * @step 0.1
381
+ */
382
+ end: number;
383
+ /**
384
+ * Value to find t for
385
+ * @default 0.5
386
+ * @minimum -Infinity
387
+ * @maximum Infinity
388
+ * @step 0.1
389
+ */
390
+ value: number;
391
+ }
392
+ class WrapDto {
393
+ constructor(number?: number, min?: number, max?: number);
394
+ /**
395
+ * Number to wrap
396
+ * @default 1.5
397
+ * @minimum -Infinity
398
+ * @maximum Infinity
399
+ * @step 0.1
400
+ */
401
+ number: number;
402
+ /**
403
+ * Minimum value
404
+ * @default 0
405
+ * @minimum -Infinity
406
+ * @maximum Infinity
407
+ * @step 0.1
408
+ */
409
+ min: number;
410
+ /**
411
+ * Maximum value
412
+ * @default 1
413
+ * @minimum -Infinity
414
+ * @maximum Infinity
415
+ * @step 0.1
416
+ */
417
+ max: number;
418
+ }
419
+ class PingPongDto {
420
+ constructor(t?: number, length?: number);
421
+ /**
422
+ * Time value
423
+ * @default 0.5
424
+ * @minimum -Infinity
425
+ * @maximum Infinity
426
+ * @step 0.1
427
+ */
428
+ t: number;
429
+ /**
430
+ * Length of ping pong
431
+ * @default 1
432
+ * @minimum -Infinity
433
+ * @maximum Infinity
434
+ * @step 0.1
435
+ */
436
+ length: number;
437
+ }
438
+ class MoveTowardsDto {
439
+ constructor(current?: number, target?: number, maxDelta?: number);
440
+ /**
441
+ * Current value
442
+ * @default 0
443
+ * @minimum -Infinity
444
+ * @maximum Infinity
445
+ * @step 0.1
446
+ */
447
+ current: number;
448
+ /**
449
+ * Target value
450
+ * @default 1
451
+ * @minimum -Infinity
452
+ * @maximum Infinity
453
+ * @step 0.1
454
+ */
455
+ target: number;
456
+ /**
457
+ * Maximum change amount
458
+ * @default 0.1
459
+ * @minimum -Infinity
460
+ * @maximum Infinity
461
+ * @step 0.01
462
+ */
463
+ maxDelta: number;
464
+ }
311
465
  }
@@ -388,4 +388,221 @@ export var Math;
388
388
  }
389
389
  }
390
390
  Math.ToFixedDto = ToFixedDto;
391
+ class ClampDto {
392
+ constructor(number, min, max) {
393
+ /**
394
+ * Number to clamp
395
+ * @default 0.5
396
+ * @minimum -Infinity
397
+ * @maximum Infinity
398
+ * @step 0.1
399
+ */
400
+ this.number = 0.5;
401
+ /**
402
+ * Minimum value
403
+ * @default 0
404
+ * @minimum -Infinity
405
+ * @maximum Infinity
406
+ * @step 0.1
407
+ */
408
+ this.min = 0;
409
+ /**
410
+ * Maximum value
411
+ * @default 1
412
+ * @minimum -Infinity
413
+ * @maximum Infinity
414
+ * @step 0.1
415
+ */
416
+ this.max = 1;
417
+ if (number !== undefined) {
418
+ this.number = number;
419
+ }
420
+ if (min !== undefined) {
421
+ this.min = min;
422
+ }
423
+ if (max !== undefined) {
424
+ this.max = max;
425
+ }
426
+ }
427
+ }
428
+ Math.ClampDto = ClampDto;
429
+ class LerpDto {
430
+ constructor(start, end, t) {
431
+ /**
432
+ * Start value
433
+ * @default 0
434
+ * @minimum -Infinity
435
+ * @maximum Infinity
436
+ * @step 0.1
437
+ */
438
+ this.start = 0;
439
+ /**
440
+ * End value
441
+ * @default 1
442
+ * @minimum -Infinity
443
+ * @maximum Infinity
444
+ * @step 0.1
445
+ */
446
+ this.end = 1;
447
+ /**
448
+ * Interpolation value (0-1)
449
+ * @default 0.5
450
+ * @minimum -Infinity
451
+ * @maximum Infinity
452
+ * @step 0.01
453
+ */
454
+ this.t = 0.5;
455
+ if (start !== undefined) {
456
+ this.start = start;
457
+ }
458
+ if (end !== undefined) {
459
+ this.end = end;
460
+ }
461
+ if (t !== undefined) {
462
+ this.t = t;
463
+ }
464
+ }
465
+ }
466
+ Math.LerpDto = LerpDto;
467
+ class InverseLerpDto {
468
+ constructor(start, end, value) {
469
+ /**
470
+ * Start value
471
+ * @default 0
472
+ * @minimum -Infinity
473
+ * @maximum Infinity
474
+ * @step 0.1
475
+ */
476
+ this.start = 0;
477
+ /**
478
+ * End value
479
+ * @default 1
480
+ * @minimum -Infinity
481
+ * @maximum Infinity
482
+ * @step 0.1
483
+ */
484
+ this.end = 1;
485
+ /**
486
+ * Value to find t for
487
+ * @default 0.5
488
+ * @minimum -Infinity
489
+ * @maximum Infinity
490
+ * @step 0.1
491
+ */
492
+ this.value = 0.5;
493
+ if (start !== undefined) {
494
+ this.start = start;
495
+ }
496
+ if (end !== undefined) {
497
+ this.end = end;
498
+ }
499
+ if (value !== undefined) {
500
+ this.value = value;
501
+ }
502
+ }
503
+ }
504
+ Math.InverseLerpDto = InverseLerpDto;
505
+ class WrapDto {
506
+ constructor(number, min, max) {
507
+ /**
508
+ * Number to wrap
509
+ * @default 1.5
510
+ * @minimum -Infinity
511
+ * @maximum Infinity
512
+ * @step 0.1
513
+ */
514
+ this.number = 1.5;
515
+ /**
516
+ * Minimum value
517
+ * @default 0
518
+ * @minimum -Infinity
519
+ * @maximum Infinity
520
+ * @step 0.1
521
+ */
522
+ this.min = 0;
523
+ /**
524
+ * Maximum value
525
+ * @default 1
526
+ * @minimum -Infinity
527
+ * @maximum Infinity
528
+ * @step 0.1
529
+ */
530
+ this.max = 1;
531
+ if (number !== undefined) {
532
+ this.number = number;
533
+ }
534
+ if (min !== undefined) {
535
+ this.min = min;
536
+ }
537
+ if (max !== undefined) {
538
+ this.max = max;
539
+ }
540
+ }
541
+ }
542
+ Math.WrapDto = WrapDto;
543
+ class PingPongDto {
544
+ constructor(t, length) {
545
+ /**
546
+ * Time value
547
+ * @default 0.5
548
+ * @minimum -Infinity
549
+ * @maximum Infinity
550
+ * @step 0.1
551
+ */
552
+ this.t = 0.5;
553
+ /**
554
+ * Length of ping pong
555
+ * @default 1
556
+ * @minimum -Infinity
557
+ * @maximum Infinity
558
+ * @step 0.1
559
+ */
560
+ this.length = 1;
561
+ if (t !== undefined) {
562
+ this.t = t;
563
+ }
564
+ if (length !== undefined) {
565
+ this.length = length;
566
+ }
567
+ }
568
+ }
569
+ Math.PingPongDto = PingPongDto;
570
+ class MoveTowardsDto {
571
+ constructor(current, target, maxDelta) {
572
+ /**
573
+ * Current value
574
+ * @default 0
575
+ * @minimum -Infinity
576
+ * @maximum Infinity
577
+ * @step 0.1
578
+ */
579
+ this.current = 0;
580
+ /**
581
+ * Target value
582
+ * @default 1
583
+ * @minimum -Infinity
584
+ * @maximum Infinity
585
+ * @step 0.1
586
+ */
587
+ this.target = 1;
588
+ /**
589
+ * Maximum change amount
590
+ * @default 0.1
591
+ * @minimum -Infinity
592
+ * @maximum Infinity
593
+ * @step 0.01
594
+ */
595
+ this.maxDelta = 0.1;
596
+ if (current !== undefined) {
597
+ this.current = current;
598
+ }
599
+ if (target !== undefined) {
600
+ this.target = target;
601
+ }
602
+ if (maxDelta !== undefined) {
603
+ this.maxDelta = maxDelta;
604
+ }
605
+ }
606
+ }
607
+ Math.MoveTowardsDto = MoveTowardsDto;
391
608
  })(Math || (Math = {}));
@@ -81,6 +81,145 @@ export declare namespace Text {
81
81
  */
82
82
  values: string[];
83
83
  }
84
+ class TextSearchDto {
85
+ constructor(text?: string, search?: string);
86
+ /**
87
+ * Text to search in
88
+ * @default hello world
89
+ */
90
+ text: string;
91
+ /**
92
+ * Text to search for
93
+ * @default world
94
+ */
95
+ search: string;
96
+ }
97
+ class TextSubstringDto {
98
+ constructor(text?: string, start?: number, end?: number);
99
+ /**
100
+ * Text to extract from
101
+ * @default hello world
102
+ */
103
+ text: string;
104
+ /**
105
+ * Start index
106
+ * @default 0
107
+ * @minimum 0
108
+ * @maximum Infinity
109
+ * @step 1
110
+ */
111
+ start: number;
112
+ /**
113
+ * End index
114
+ * @default 5
115
+ * @minimum 0
116
+ * @maximum Infinity
117
+ * @step 1
118
+ */
119
+ end?: number;
120
+ }
121
+ class TextIndexDto {
122
+ constructor(text?: string, index?: number);
123
+ /**
124
+ * Text to get character from
125
+ * @default hello
126
+ */
127
+ text: string;
128
+ /**
129
+ * Index of character
130
+ * @default 0
131
+ * @minimum 0
132
+ * @maximum Infinity
133
+ * @step 1
134
+ */
135
+ index: number;
136
+ }
137
+ class TextPadDto {
138
+ constructor(text?: string, length?: number, padString?: string);
139
+ /**
140
+ * Text to pad
141
+ * @default x
142
+ */
143
+ text: string;
144
+ /**
145
+ * Target length
146
+ * @default 3
147
+ * @minimum 0
148
+ * @maximum Infinity
149
+ * @step 1
150
+ */
151
+ length: number;
152
+ /**
153
+ * String to pad with
154
+ * @default a
155
+ */
156
+ padString: string;
157
+ }
158
+ class TextRepeatDto {
159
+ constructor(text?: string, count?: number);
160
+ /**
161
+ * Text to repeat
162
+ * @default ha
163
+ */
164
+ text: string;
165
+ /**
166
+ * Number of repetitions
167
+ * @default 3
168
+ * @minimum 0
169
+ * @maximum Infinity
170
+ * @step 1
171
+ */
172
+ count: number;
173
+ }
174
+ class TextConcatDto {
175
+ constructor(texts?: string[]);
176
+ /**
177
+ * Texts to concatenate
178
+ * @default ["hello", " ", "world"]
179
+ */
180
+ texts: string[];
181
+ }
182
+ class TextRegexDto {
183
+ constructor(text?: string, pattern?: string, flags?: string);
184
+ /**
185
+ * Text to search in
186
+ * @default hello123world
187
+ */
188
+ text: string;
189
+ /**
190
+ * Regular expression pattern
191
+ * @default [0-9]+
192
+ */
193
+ pattern: string;
194
+ /**
195
+ * Regular expression flags (g, i, m, s, u, y)
196
+ * @default g
197
+ */
198
+ flags: string;
199
+ }
200
+ class TextRegexReplaceDto {
201
+ constructor(text?: string, pattern?: string, flags?: string, replaceWith?: string);
202
+ /**
203
+ * Text to search in
204
+ * @default hello123world456
205
+ */
206
+ text: string;
207
+ /**
208
+ * Regular expression pattern
209
+ * @default [0-9]+
210
+ */
211
+ pattern: string;
212
+ /**
213
+ * Regular expression flags (g, i, m, s, u, y)
214
+ * @default g
215
+ */
216
+ flags: string;
217
+ /**
218
+ * Text to replace matches with
219
+ * @default X
220
+ */
221
+ replaceWith: string;
222
+ }
84
223
  class VectorCharDto {
85
224
  constructor(char?: string, xOffset?: number, yOffset?: number, height?: number, extrudeOffset?: number);
86
225
  /**