@bitbybit-dev/base 1.3.2-rc.1 → 1.4.0-rc.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 (77) hide show
  1. package/README.md +1 -1
  2. package/lib/api/GlobalCDNProvider.js +1 -1
  3. package/lib/api/index.d.ts +2 -0
  4. package/lib/api/index.js +2 -0
  5. package/lib/api/inputs/base-inputs.d.ts +10 -4
  6. package/lib/api/inputs/color-inputs.d.ts +24 -23
  7. package/lib/api/inputs/color-inputs.js +1 -0
  8. package/lib/api/inputs/dates-inputs.d.ts +16 -16
  9. package/lib/api/inputs/frame-inputs.d.ts +515 -0
  10. package/lib/api/inputs/frame-inputs.js +617 -0
  11. package/lib/api/inputs/index.d.ts +1 -0
  12. package/lib/api/inputs/index.js +1 -0
  13. package/lib/api/inputs/io-inputs.d.ts +3 -3
  14. package/lib/api/inputs/io-inputs.js +1 -1
  15. package/lib/api/inputs/lists-inputs.d.ts +23 -23
  16. package/lib/api/inputs/logic-inputs.d.ts +11 -11
  17. package/lib/api/inputs/math-inputs.d.ts +49 -49
  18. package/lib/api/inputs/math-inputs.js +4 -4
  19. package/lib/api/inputs/mesh-inputs.d.ts +3 -3
  20. package/lib/api/inputs/mesh-inputs.js +3 -3
  21. package/lib/api/inputs/point-inputs.d.ts +39 -38
  22. package/lib/api/inputs/point-inputs.js +6 -5
  23. package/lib/api/inputs/polyline-inputs.d.ts +5 -4
  24. package/lib/api/inputs/polyline-inputs.js +3 -3
  25. package/lib/api/inputs/text-inputs.d.ts +34 -33
  26. package/lib/api/inputs/text-inputs.js +15 -12
  27. package/lib/api/inputs/transforms-inputs.d.ts +16 -16
  28. package/lib/api/inputs/vector-inputs.d.ts +26 -25
  29. package/lib/api/inputs/vector-inputs.js +2 -1
  30. package/lib/api/kernel-calls/call-by-path.d.ts +12 -0
  31. package/lib/api/kernel-calls/call-by-path.js +36 -0
  32. package/lib/api/kernel-calls/constraints.d.ts +53 -0
  33. package/lib/api/kernel-calls/constraints.js +21 -0
  34. package/lib/api/kernel-calls/describe-failure.d.ts +32 -0
  35. package/lib/api/kernel-calls/describe-failure.js +164 -0
  36. package/lib/api/kernel-calls/errors.d.ts +55 -0
  37. package/lib/api/kernel-calls/errors.js +42 -0
  38. package/lib/api/kernel-calls/failure-message.d.ts +18 -0
  39. package/lib/api/kernel-calls/failure-message.js +36 -0
  40. package/lib/api/kernel-calls/index.d.ts +10 -0
  41. package/lib/api/kernel-calls/index.js +10 -0
  42. package/lib/api/kernel-calls/input-rules.d.ts +67 -0
  43. package/lib/api/kernel-calls/input-rules.js +135 -0
  44. package/lib/api/kernel-calls/input-validation.d.ts +130 -0
  45. package/lib/api/kernel-calls/input-validation.js +221 -0
  46. package/lib/api/kernel-calls/rehydrate.d.ts +16 -0
  47. package/lib/api/kernel-calls/rehydrate.js +38 -0
  48. package/lib/api/kernel-calls/resolve-dto.d.ts +59 -0
  49. package/lib/api/kernel-calls/resolve-dto.js +61 -0
  50. package/lib/api/kernel-calls/with-defaults.d.ts +16 -0
  51. package/lib/api/kernel-calls/with-defaults.js +53 -0
  52. package/lib/api/resolved-inputs/index.d.ts +304 -0
  53. package/lib/api/resolved-inputs/index.js +1 -0
  54. package/lib/api/services/color.js +43 -26
  55. package/lib/api/services/dates.js +53 -33
  56. package/lib/api/services/frame.d.ts +670 -0
  57. package/lib/api/services/frame.js +1040 -0
  58. package/lib/api/services/helpers/dxf/dxf-generator.d.ts +2 -3
  59. package/lib/api/services/helpers/dxf/dxf-generator.js +27 -37
  60. package/lib/api/services/helpers/dxf/dxf.js +10 -4
  61. package/lib/api/services/helpers/frame-axes.d.ts +36 -0
  62. package/lib/api/services/helpers/frame-axes.js +57 -0
  63. package/lib/api/services/helpers/matrices.d.ts +17 -0
  64. package/lib/api/services/helpers/matrices.js +51 -0
  65. package/lib/api/services/index.d.ts +1 -0
  66. package/lib/api/services/index.js +1 -0
  67. package/lib/api/services/line.js +15 -12
  68. package/lib/api/services/lists.js +174 -136
  69. package/lib/api/services/logic.js +44 -34
  70. package/lib/api/services/math.js +127 -82
  71. package/lib/api/services/mesh.js +20 -13
  72. package/lib/api/services/point.js +62 -46
  73. package/lib/api/services/polyline.js +22 -18
  74. package/lib/api/services/text.js +81 -46
  75. package/lib/api/services/transforms.js +38 -25
  76. package/lib/api/services/vector.js +37 -22
  77. package/package.json +1 -1
@@ -198,7 +198,7 @@ export var Math;
198
198
  /**
199
199
  * How many digits to keep after the decimal point; 0 rounds to a whole number.
200
200
  * @default 2
201
- * @minimum -Infinity
201
+ * @minimum 0
202
202
  * @maximum Infinity
203
203
  * @step 1
204
204
  */
@@ -426,7 +426,7 @@ export var Math;
426
426
  /**
427
427
  * How many random numbers to produce.
428
428
  * @default 10
429
- * @minimum -Infinity
429
+ * @minimum 0
430
430
  * @maximum Infinity
431
431
  * @step 1
432
432
  */
@@ -451,8 +451,8 @@ export var Math;
451
451
  /**
452
452
  * How many digits to show after the decimal point, padding with zeros.
453
453
  * @default 2
454
- * @minimum -Infinity
455
- * @maximum Infinity
454
+ * @minimum 0
455
+ * @maximum 100
456
456
  * @step 1
457
457
  */
458
458
  this.decimalPlaces = 2;
@@ -46,7 +46,7 @@ export declare namespace Mesh {
46
46
  /**
47
47
  * A triangle whose normal is shorter than this counts as having no area.
48
48
  * @default 1e-7
49
- * @minimum -Infinity
49
+ * @minimum 0
50
50
  * @maximum Infinity
51
51
  * @step 1e-7
52
52
  */
@@ -71,7 +71,7 @@ export declare namespace Mesh {
71
71
  * Distances below this, in model units, count as zero when deciding whether the triangles
72
72
  * touch.
73
73
  * @default 1e-7
74
- * @minimum -Infinity
74
+ * @minimum 0
75
75
  * @maximum Infinity
76
76
  * @step 1e-7
77
77
  */
@@ -97,7 +97,7 @@ export declare namespace Mesh {
97
97
  * Distances below this, in model units, count as zero: when deciding whether triangles
98
98
  * touch and when joining segment ends into polylines.
99
99
  * @default 1e-7
100
- * @minimum -Infinity
100
+ * @minimum 0
101
101
  * @maximum Infinity
102
102
  * @step 1e-7
103
103
  */
@@ -39,7 +39,7 @@ export var Mesh;
39
39
  /**
40
40
  * A triangle whose normal is shorter than this counts as having no area.
41
41
  * @default 1e-7
42
- * @minimum -Infinity
42
+ * @minimum 0
43
43
  * @maximum Infinity
44
44
  * @step 1e-7
45
45
  */
@@ -59,7 +59,7 @@ export var Mesh;
59
59
  * Distances below this, in model units, count as zero when deciding whether the triangles
60
60
  * touch.
61
61
  * @default 1e-7
62
- * @minimum -Infinity
62
+ * @minimum 0
63
63
  * @maximum Infinity
64
64
  * @step 1e-7
65
65
  */
@@ -86,7 +86,7 @@ export var Mesh;
86
86
  * Distances below this, in model units, count as zero: when deciding whether triangles
87
87
  * touch and when joining segment ends into polylines.
88
88
  * @default 1e-7
89
- * @minimum -Infinity
89
+ * @minimum 0
90
90
  * @maximum Infinity
91
91
  * @step 1e-7
92
92
  */
@@ -29,7 +29,7 @@ export declare namespace Point {
29
29
  * @maximum Infinity
30
30
  * @step 0.1
31
31
  */
32
- x: number;
32
+ x?: number | undefined;
33
33
  /**
34
34
  * The Y value, the second entry; Y is up.
35
35
  * @default 0
@@ -37,7 +37,7 @@ export declare namespace Point {
37
37
  * @maximum Infinity
38
38
  * @step 0.1
39
39
  */
40
- y: number;
40
+ y?: number | undefined;
41
41
  /**
42
42
  * The Z value, the third entry.
43
43
  * @default 0
@@ -45,7 +45,7 @@ export declare namespace Point {
45
45
  * @maximum Infinity
46
46
  * @step 0.1
47
47
  */
48
- z: number;
48
+ z?: number | undefined;
49
49
  }
50
50
  /**
51
51
  * The two values `point.pointXY` puts together into `[x, y]`.
@@ -59,7 +59,7 @@ export declare namespace Point {
59
59
  * @maximum Infinity
60
60
  * @step 0.1
61
61
  */
62
- x: number;
62
+ x?: number | undefined;
63
63
  /**
64
64
  * The Y value, the second entry.
65
65
  * @default 0
@@ -67,7 +67,7 @@ export declare namespace Point {
67
67
  * @maximum Infinity
68
68
  * @step 0.1
69
69
  */
70
- y: number;
70
+ y?: number | undefined;
71
71
  }
72
72
  /**
73
73
  * A list of points for the methods that read them together: `point.boundingBoxOfPoints`,
@@ -118,27 +118,27 @@ export declare namespace Point {
118
118
  * @maximum 1
119
119
  * @step 0.1
120
120
  */
121
- opacity: number;
121
+ opacity?: number | undefined;
122
122
  /**
123
123
  * Size of the drawn point, in model units.
124
- * @default 3
124
+ * @default 0.1
125
125
  * @minimum 0
126
126
  * @maximum Infinity
127
127
  * @step 0.1
128
128
  */
129
- size: number;
129
+ size?: number | undefined;
130
130
  /**
131
131
  * Color of the point as a hex string such as `#ff0000`; a list of strings is also
132
132
  * accepted.
133
133
  * @default #444444
134
134
  */
135
- colours: string | string[];
135
+ colours?: string | string[] | undefined;
136
136
  /**
137
137
  * When true, the drawn mesh is built so its position can be changed later without
138
138
  * redrawing.
139
139
  * @default false
140
140
  */
141
- updatable: boolean;
141
+ updatable?: boolean | undefined;
142
142
  /**
143
143
  * A mesh drawn earlier for this point; when given it is updated in place instead of a new
144
144
  * one being made.
@@ -168,7 +168,7 @@ export declare namespace Point {
168
168
  * @maximum 1
169
169
  * @step 0.1
170
170
  */
171
- opacity: number;
171
+ opacity?: number | undefined;
172
172
  /**
173
173
  * Size of each drawn point, in model units.
174
174
  * @default 0.1
@@ -176,18 +176,18 @@ export declare namespace Point {
176
176
  * @maximum Infinity
177
177
  * @step 0.1
178
178
  */
179
- size: number;
179
+ size?: number | undefined;
180
180
  /**
181
181
  * One hex color string for all points, or one string per point.
182
182
  * @default #444444
183
183
  */
184
- colours: string | string[];
184
+ colours?: string | string[] | undefined;
185
185
  /**
186
186
  * When true, the drawn mesh is built so the positions can be changed later without
187
187
  * redrawing.
188
188
  * @default false
189
189
  */
190
- updatable: boolean;
190
+ updatable?: boolean | undefined;
191
191
  /**
192
192
  * A mesh drawn earlier for these points; when given it is updated in place instead of a new
193
193
  * one being made.
@@ -275,17 +275,17 @@ export declare namespace Point {
275
275
  * Distance to move along X, in model units.
276
276
  * @default 0
277
277
  */
278
- x: number;
278
+ x?: number | undefined;
279
279
  /**
280
280
  * Distance to move along Y, which is up, in model units.
281
281
  * @default 1
282
282
  */
283
- y: number;
283
+ y?: number | undefined;
284
284
  /**
285
285
  * Distance to move along Z, in model units.
286
286
  * @default 0
287
287
  */
288
- z: number;
288
+ z?: number | undefined;
289
289
  }
290
290
  /**
291
291
  * Points, a center and a factor per axis for `point.scalePointsCenterXYZ`.
@@ -301,13 +301,13 @@ export declare namespace Point {
301
301
  * The point that stays in place while the others move away from it or toward it.
302
302
  * @default [0, 0, 0]
303
303
  */
304
- center: Base.Point3;
304
+ center?: Base.Point3 | undefined;
305
305
  /**
306
306
  * The factor for each axis as `[x, y, z]`: `[1, 2, 1]` doubles distances along Y and leaves
307
307
  * X and Z as they are.
308
308
  * @default [1, 1, 1]
309
309
  */
310
- scaleXyz: Base.Vector3;
310
+ scaleXyz?: Base.Vector3 | undefined;
311
311
  }
312
312
  /**
313
313
  * Points, a center, a direction and a factor for `point.stretchPointsDirFromCenter`, which
@@ -358,17 +358,17 @@ export declare namespace Point {
358
358
  * @maximum Infinity
359
359
  * @step 1
360
360
  */
361
- angle: number;
361
+ angle?: number | undefined;
362
362
  /**
363
363
  * The direction of the axis to turn around.
364
364
  * @default [0, 1, 0]
365
365
  */
366
- axis: Base.Vector3;
366
+ axis?: Base.Vector3 | undefined;
367
367
  /**
368
368
  * A point the axis passes through.
369
369
  * @default [0, 0, 0]
370
370
  */
371
- center: Base.Point3;
371
+ center?: Base.Point3 | undefined;
372
372
  }
373
373
  /**
374
374
  * Points and one transformation per point for `point.transformsForPoints`; the two lists must
@@ -414,7 +414,7 @@ export declare namespace Point {
414
414
  * When true, the normal is flipped to point the other way.
415
415
  * @default false
416
416
  */
417
- reverseNormal: boolean;
417
+ reverseNormal?: boolean | undefined;
418
418
  }
419
419
  /**
420
420
  * A corner for `point.maxFilletRadius` and `point.maxFilletRadiusHalfLine`: the corner point is
@@ -441,11 +441,11 @@ export declare namespace Point {
441
441
  * A segment shorter than this, or an angle within it of straight or folded back, gives a
442
442
  * radius of 0.
443
443
  * @default 1e-7
444
- * @minimum -Infinity
444
+ * @minimum 0
445
445
  * @maximum Infinity
446
446
  * @step 1e-7
447
447
  */
448
- tolerance: number;
448
+ tolerance?: number | undefined;
449
449
  }
450
450
  /**
451
451
  * A polyline's points for `point.maxFilletsHalfLine` and `point.safestPointsMaxFilletHalfLine`,
@@ -468,7 +468,7 @@ export declare namespace Point {
468
468
  * A segment shorter than this, or an angle within it of straight or folded back, gives a
469
469
  * radius of 0.
470
470
  * @default 1e-7
471
- * @minimum -Infinity
471
+ * @minimum 0
472
472
  * @maximum Infinity
473
473
  * @step 1e-7
474
474
  */
@@ -496,8 +496,9 @@ export declare namespace Point {
496
496
  /**
497
497
  * When true, a last point that repeats the first is dropped as well, which closes a loop
498
498
  * cleanly.
499
+ * @default false
499
500
  */
500
- checkFirstAndLast: boolean;
501
+ checkFirstAndLast?: boolean | undefined;
501
502
  }
502
503
  /**
503
504
  * A point and a list to search for `point.closestPointFromPoints`,
@@ -534,7 +535,7 @@ export declare namespace Point {
534
535
  /**
535
536
  * The points count as equal when the distance between them is below this.
536
537
  * @default 1e-7
537
- * @minimum -Infinity
538
+ * @minimum 0
538
539
  * @maximum Infinity
539
540
  * @step 1e-7
540
541
  */
@@ -602,7 +603,7 @@ export declare namespace Point {
602
603
  * @maximum Infinity
603
604
  * @step 0.1
604
605
  */
605
- phi: number;
606
+ phi?: number | undefined;
606
607
  /**
607
608
  * How many points to place along the spiral.
608
609
  * @default 200
@@ -610,7 +611,7 @@ export declare namespace Point {
610
611
  * @maximum Infinity
611
612
  * @step 10
612
613
  */
613
- numberPoints: number;
614
+ numberPoints?: number | undefined;
614
615
  /**
615
616
  * How much the spiral widens per turn; larger values spread the turns further apart.
616
617
  * @default 3
@@ -618,7 +619,7 @@ export declare namespace Point {
618
619
  * @maximum Infinity
619
620
  * @step 0.1
620
621
  */
621
- widening: number;
622
+ widening?: number | undefined;
622
623
  /**
623
624
  * The distance from the origin the last point reaches, in model units.
624
625
  * @default 6
@@ -626,7 +627,7 @@ export declare namespace Point {
626
627
  * @maximum Infinity
627
628
  * @step 0.1
628
629
  */
629
- radius: number;
630
+ radius?: number | undefined;
630
631
  /**
631
632
  * Scales the distance before the angle is computed, which turns the whole spiral; 1 leaves
632
633
  * it as it is.
@@ -635,7 +636,7 @@ export declare namespace Point {
635
636
  * @maximum Infinity
636
637
  * @step 0.1
637
638
  */
638
- factor: number;
639
+ factor?: number | undefined;
639
640
  }
640
641
  /**
641
642
  * The area, counts and orientation for `point.hexGridScaledToFit`, which sizes hexagons so the
@@ -730,7 +731,7 @@ export declare namespace Point {
730
731
  * @maximum Infinity
731
732
  * @step 1
732
733
  */
733
- nrHexagonsY: number;
734
+ nrHexagonsY?: number | undefined;
734
735
  /**
735
736
  * How many columns of hexagons along X.
736
737
  * @default 21
@@ -738,7 +739,7 @@ export declare namespace Point {
738
739
  * @maximum Infinity
739
740
  * @step 1
740
741
  */
741
- nrHexagonsX: number;
742
+ nrHexagonsX?: number | undefined;
742
743
  /**
743
744
  * Distance from a hexagon's center to one of its corners, in model units.
744
745
  * @default 0.2
@@ -746,16 +747,16 @@ export declare namespace Point {
746
747
  * @maximum Infinity
747
748
  * @step 0.1
748
749
  */
749
- radiusHexagon: number;
750
+ radiusHexagon?: number | undefined;
750
751
  /**
751
752
  * When true, the middle of the grid sits at the origin instead of its corner.
752
753
  * @default false
753
754
  */
754
- orientOnCenter: boolean;
755
+ orientOnCenter?: boolean | undefined;
755
756
  /**
756
757
  * When true, the grid lies on the XZ ground plane (Y becomes 0) instead of the XY plane.
757
758
  * @default false
758
759
  */
759
- pointsOnGround: boolean;
760
+ pointsOnGround?: boolean | undefined;
760
761
  }
761
762
  }
@@ -133,12 +133,12 @@ export var Point;
133
133
  this.opacity = 1;
134
134
  /**
135
135
  * Size of the drawn point, in model units.
136
- * @default 3
136
+ * @default 0.1
137
137
  * @minimum 0
138
138
  * @maximum Infinity
139
139
  * @step 0.1
140
140
  */
141
- this.size = 3;
141
+ this.size = 0.1;
142
142
  /**
143
143
  * Color of the point as a hex string such as `#ff0000`; a list of strings is also
144
144
  * accepted.
@@ -478,7 +478,7 @@ export var Point;
478
478
  * A segment shorter than this, or an angle within it of straight or folded back, gives a
479
479
  * radius of 0.
480
480
  * @default 1e-7
481
- * @minimum -Infinity
481
+ * @minimum 0
482
482
  * @maximum Infinity
483
483
  * @step 1e-7
484
484
  */
@@ -514,7 +514,7 @@ export var Point;
514
514
  * A segment shorter than this, or an angle within it of straight or folded back, gives a
515
515
  * radius of 0.
516
516
  * @default 1e-7
517
- * @minimum -Infinity
517
+ * @minimum 0
518
518
  * @maximum Infinity
519
519
  * @step 1e-7
520
520
  */
@@ -548,6 +548,7 @@ export var Point;
548
548
  /**
549
549
  * When true, a last point that repeats the first is dropped as well, which closes a loop
550
550
  * cleanly.
551
+ * @default false
551
552
  */
552
553
  this.checkFirstAndLast = false;
553
554
  if (points !== undefined) {
@@ -585,7 +586,7 @@ export var Point;
585
586
  /**
586
587
  * The points count as equal when the distance between them is below this.
587
588
  * @default 1e-7
588
- * @minimum -Infinity
589
+ * @minimum 0
589
590
  * @maximum Infinity
590
591
  * @step 1e-7
591
592
  */
@@ -46,7 +46,8 @@ export declare namespace Polyline {
46
46
  /**
47
47
  * A color used when the polyline is drawn, as a hex text such as `#ff0000` or as `[r, g,
48
48
  * b]` values from 0 to 1.
49
- * @default #444444
49
+ * @default undefined
50
+ * @optional true
50
51
  */
51
52
  color?: string | number[] | undefined;
52
53
  }
@@ -198,7 +199,7 @@ export declare namespace Polyline {
198
199
  /**
199
200
  * Two segment ends closer than this, in model units, count as touching.
200
201
  * @default 1e-5
201
- * @minimum -Infinity
202
+ * @minimum 0
202
203
  * @maximum Infinity
203
204
  * @step 1e-5
204
205
  */
@@ -218,7 +219,7 @@ export declare namespace Polyline {
218
219
  /**
219
220
  * Distance, in model units, below which two points count as the same.
220
221
  * @default 1e-5
221
- * @minimum -Infinity
222
+ * @minimum 0
222
223
  * @maximum Infinity
223
224
  * @step 1e-5
224
225
  */
@@ -242,7 +243,7 @@ export declare namespace Polyline {
242
243
  /**
243
244
  * Crossing points closer together than this, in model units, are reported once.
244
245
  * @default 1e-5
245
- * @minimum -Infinity
246
+ * @minimum 0
246
247
  * @maximum Infinity
247
248
  * @step 1e-5
248
249
  */
@@ -207,7 +207,7 @@ export var Polyline;
207
207
  /**
208
208
  * Two segment ends closer than this, in model units, count as touching.
209
209
  * @default 1e-5
210
- * @minimum -Infinity
210
+ * @minimum 0
211
211
  * @maximum Infinity
212
212
  * @step 1e-5
213
213
  */
@@ -227,7 +227,7 @@ export var Polyline;
227
227
  /**
228
228
  * Distance, in model units, below which two points count as the same.
229
229
  * @default 1e-5
230
- * @minimum -Infinity
230
+ * @minimum 0
231
231
  * @maximum Infinity
232
232
  * @step 1e-5
233
233
  */
@@ -249,7 +249,7 @@ export var Polyline;
249
249
  /**
250
250
  * Crossing points closer together than this, in model units, are reported once.
251
251
  * @default 1e-5
252
- * @minimum -Infinity
252
+ * @minimum 0
253
253
  * @maximum Infinity
254
254
  * @step 1e-5
255
255
  */