@bitbybit-dev/base 1.2.0 → 1.3.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 (55) hide show
  1. package/lib/api/GlobalCDNProvider.js +1 -1
  2. package/lib/api/inputs/base-inputs.d.ts +13 -12
  3. package/lib/api/inputs/color-inputs.d.ts +97 -48
  4. package/lib/api/inputs/color-inputs.js +95 -46
  5. package/lib/api/inputs/dates-inputs.d.ts +67 -26
  6. package/lib/api/inputs/dates-inputs.js +57 -16
  7. package/lib/api/inputs/io-inputs.d.ts +13 -15
  8. package/lib/api/inputs/io-inputs.js +7 -8
  9. package/lib/api/inputs/line-inputs.d.ts +88 -33
  10. package/lib/api/inputs/line-inputs.js +61 -11
  11. package/lib/api/inputs/lists-inputs.d.ts +207 -96
  12. package/lib/api/inputs/lists-inputs.js +153 -45
  13. package/lib/api/inputs/logic-inputs.d.ts +52 -22
  14. package/lib/api/inputs/logic-inputs.js +41 -12
  15. package/lib/api/inputs/math-inputs.d.ts +113 -52
  16. package/lib/api/inputs/math-inputs.js +112 -51
  17. package/lib/api/inputs/mesh-inputs.d.ts +30 -11
  18. package/lib/api/inputs/mesh-inputs.js +21 -3
  19. package/lib/api/inputs/point-inputs.d.ts +240 -107
  20. package/lib/api/inputs/point-inputs.js +199 -73
  21. package/lib/api/inputs/polyline-inputs.d.ts +68 -28
  22. package/lib/api/inputs/polyline-inputs.js +48 -13
  23. package/lib/api/inputs/text-inputs.d.ts +117 -46
  24. package/lib/api/inputs/text-inputs.js +111 -41
  25. package/lib/api/inputs/transforms-inputs.d.ts +65 -23
  26. package/lib/api/inputs/transforms-inputs.js +64 -22
  27. package/lib/api/inputs/vector-inputs.d.ts +154 -76
  28. package/lib/api/inputs/vector-inputs.js +132 -57
  29. package/lib/api/models/point/hex-grid-data.d.ts +1 -1
  30. package/lib/api/models/point/hex-grid-data.js +1 -1
  31. package/lib/api/services/color.d.ts +149 -70
  32. package/lib/api/services/color.js +149 -70
  33. package/lib/api/services/dates.d.ts +313 -150
  34. package/lib/api/services/dates.js +313 -150
  35. package/lib/api/services/line.d.ts +138 -68
  36. package/lib/api/services/line.js +138 -68
  37. package/lib/api/services/lists.d.ts +357 -177
  38. package/lib/api/services/lists.js +357 -177
  39. package/lib/api/services/logic.d.ts +98 -45
  40. package/lib/api/services/logic.js +98 -45
  41. package/lib/api/services/math.d.ts +363 -211
  42. package/lib/api/services/math.js +363 -211
  43. package/lib/api/services/mesh.d.ts +73 -31
  44. package/lib/api/services/mesh.js +73 -31
  45. package/lib/api/services/point.d.ts +367 -147
  46. package/lib/api/services/point.js +367 -147
  47. package/lib/api/services/polyline.d.ts +146 -71
  48. package/lib/api/services/polyline.js +146 -71
  49. package/lib/api/services/text.d.ts +320 -165
  50. package/lib/api/services/text.js +320 -165
  51. package/lib/api/services/transforms.d.ts +145 -58
  52. package/lib/api/services/transforms.js +145 -58
  53. package/lib/api/services/vector.d.ts +381 -156
  54. package/lib/api/services/vector.js +381 -156
  55. package/package.json +1 -1
@@ -13,109 +13,139 @@ import { Base } from "./base-inputs";
13
13
 
14
14
  */
15
15
  export declare namespace Text {
16
+ /**
17
+ * One text for the single-text methods of `text`: `trim`, `toUpperCase`, `reverse`, `length`,
18
+ * `isEmpty` and the rest.
19
+ */
16
20
  class TextDto {
17
21
  constructor(text?: string);
18
22
  /**
19
- * The text
23
+ * The text the method works on; it is not changed, a new text is returned.
20
24
  * @default Hello World
21
25
  */
22
26
  text: string;
23
27
  }
28
+ /**
29
+ * A text and a separator for `text.split`.
30
+ */
24
31
  class TextSplitDto {
25
32
  constructor(text?: string, separator?: string);
26
33
  /**
27
- * Text to split
34
+ * The text to cut into pieces.
28
35
  * @default a,b,c
29
36
  */
30
37
  text: string;
31
38
  /**
32
- * Text to split by
39
+ * The text that marks a cut; it is dropped from the pieces.
33
40
  * @default ,
34
41
  */
35
42
  separator: string;
36
43
  }
44
+ /**
45
+ * A text, what to look for in it and what to put in its place, for `text.replaceAll`.
46
+ */
37
47
  class TextReplaceDto {
38
48
  constructor(text?: string, search?: string, replaceWith?: string);
39
49
  /**
40
- * Text to replace
50
+ * The text to make the replacements in.
41
51
  * @default a-c
42
52
  */
43
53
  text: string;
44
54
  /**
45
- * Text to search for
55
+ * The text to look for; every occurrence is replaced.
46
56
  * @default -
47
57
  */
48
58
  search: string;
49
59
  /**
50
- * Text to replace found occurences
60
+ * The text that takes the place of each occurrence.
51
61
  * @default b
52
62
  */
53
63
  replaceWith: string;
54
64
  }
65
+ /**
66
+ * Texts and a separator for `text.join`, which writes them one after another.
67
+ */
55
68
  class TextJoinDto {
56
69
  constructor(list?: string[], separator?: string);
57
70
  /**
58
- * Text to join
71
+ * The texts to join, in order.
59
72
  * @default undefined
60
73
  */
61
74
  list: string[];
62
75
  /**
63
- * Text to join by
76
+ * The text placed between neighbors; an empty text joins them directly.
64
77
  * @default ,
65
78
  */
66
79
  separator: string;
67
80
  }
81
+ /**
82
+ * Any value for `text.toString`, which turns it into text the way JavaScript prints it.
83
+ */
68
84
  class ToStringDto<T> {
69
85
  constructor(item?: T);
70
86
  /**
71
- * Item to stringify
87
+ * The value to turn into text.
72
88
  * @default undefined
73
89
  */
74
90
  item: T;
75
91
  }
92
+ /**
93
+ * A list of values for `text.toStringEach`, which turns each into text the way JavaScript
94
+ * prints it.
95
+ */
76
96
  class ToStringEachDto<T> {
77
97
  constructor(list?: T[]);
78
98
  /**
79
- * Item to stringify
99
+ * The values to turn into text, one by one.
80
100
  * @default undefined
81
101
  */
82
102
  list: T[];
83
103
  }
104
+ /**
105
+ * A text with numbered placeholders and the values for `text.format` to fill in.
106
+ */
84
107
  class TextFormatDto {
85
108
  constructor(text?: string, values?: string[]);
86
109
  /**
87
- * Text to format
110
+ * The text with placeholders such as `{0}` and `{1}`.
88
111
  * @default Hello {0}
89
112
  */
90
113
  text: string;
91
114
  /**
92
- * Values to format
115
+ * The values, in placeholder order: the first fills `{0}`, the second `{1}`.
93
116
  * @default ["World"]
94
117
  */
95
118
  values: string[];
96
119
  }
120
+ /**
121
+ * A text and something to look for in it, for `text.includes`, `text.startsWith`,
122
+ * `text.endsWith`, `text.indexOf` and `text.lastIndexOf`.
123
+ */
97
124
  class TextSearchDto {
98
125
  constructor(text?: string, search?: string);
99
126
  /**
100
- * Text to search in
127
+ * The text to look in.
101
128
  * @default hello world
102
129
  */
103
130
  text: string;
104
131
  /**
105
- * Text to search for
132
+ * The text to look for, matched exactly, including case.
106
133
  * @default world
107
134
  */
108
135
  search: string;
109
136
  }
137
+ /**
138
+ * A text and a range of positions for `text.substring` and `text.slice`.
139
+ */
110
140
  class TextSubstringDto {
111
141
  constructor(text?: string, start?: number, end?: number);
112
142
  /**
113
- * Text to extract from
143
+ * The text to take characters from.
114
144
  * @default hello world
115
145
  */
116
146
  text: string;
117
147
  /**
118
- * Start index
148
+ * Position of the first character to take, counting from 0.
119
149
  * @default 0
120
150
  * @minimum 0
121
151
  * @maximum Infinity
@@ -123,7 +153,8 @@ export declare namespace Text {
123
153
  */
124
154
  start: number;
125
155
  /**
126
- * End index
156
+ * Position just after the last character to take; leave it out to take everything to the
157
+ * end.
127
158
  * @default 5
128
159
  * @minimum 0
129
160
  * @maximum Infinity
@@ -131,15 +162,18 @@ export declare namespace Text {
131
162
  */
132
163
  end?: number | undefined;
133
164
  }
165
+ /**
166
+ * A text and a position for `text.charAt`.
167
+ */
134
168
  class TextIndexDto {
135
169
  constructor(text?: string, index?: number);
136
170
  /**
137
- * Text to get character from
171
+ * The text to read a character from.
138
172
  * @default hello
139
173
  */
140
174
  text: string;
141
175
  /**
142
- * Index of character
176
+ * Position of the character, counting from 0.
143
177
  * @default 0
144
178
  * @minimum 0
145
179
  * @maximum Infinity
@@ -147,15 +181,18 @@ export declare namespace Text {
147
181
  */
148
182
  index: number;
149
183
  }
184
+ /**
185
+ * A text, a length and a filler for `text.padStart` and `text.padEnd`.
186
+ */
150
187
  class TextPadDto {
151
188
  constructor(text?: string, length?: number, padString?: string);
152
189
  /**
153
- * Text to pad
190
+ * The text to lengthen.
154
191
  * @default x
155
192
  */
156
193
  text: string;
157
194
  /**
158
- * Target length
195
+ * The length to reach; a text already that long stays as it is.
159
196
  * @default 3
160
197
  * @minimum 0
161
198
  * @maximum Infinity
@@ -163,20 +200,23 @@ export declare namespace Text {
163
200
  */
164
201
  length: number;
165
202
  /**
166
- * String to pad with
203
+ * The filler repeated until the length is reached; the last repeat is cut short if needed.
167
204
  * @default a
168
205
  */
169
206
  padString: string;
170
207
  }
208
+ /**
209
+ * A text and a count for `text.repeat`.
210
+ */
171
211
  class TextRepeatDto {
172
212
  constructor(text?: string, count?: number);
173
213
  /**
174
- * Text to repeat
214
+ * The text that is written out again and again.
175
215
  * @default ha
176
216
  */
177
217
  text: string;
178
218
  /**
179
- * Number of repetitions
219
+ * How many times the text appears in the result.
180
220
  * @default 3
181
221
  * @minimum 0
182
222
  * @maximum Infinity
@@ -184,64 +224,84 @@ export declare namespace Text {
184
224
  */
185
225
  count: number;
186
226
  }
227
+ /**
228
+ * Texts for `text.concat`, joined with nothing between them.
229
+ */
187
230
  class TextConcatDto {
188
231
  constructor(texts?: string[]);
189
232
  /**
190
- * Texts to concatenate
233
+ * The texts to join, in order.
191
234
  * @default ["hello", " ", "world"]
192
235
  */
193
236
  texts: string[];
194
237
  }
238
+ /**
239
+ * A text and a regular expression for `text.regexTest`, `text.regexMatch`, `text.regexSearch`
240
+ * and `text.regexSplit`.
241
+ */
195
242
  class TextRegexDto {
196
243
  constructor(text?: string, pattern?: string, flags?: string);
197
244
  /**
198
- * Text to search in
245
+ * The text the pattern is applied to.
199
246
  * @default hello123world
200
247
  */
201
248
  text: string;
202
249
  /**
203
- * Regular expression pattern
250
+ * The regular expression, written as it would be between the slashes in JavaScript, such as
251
+ * `[0-9]+`.
204
252
  * @default [0-9]+
205
253
  */
206
254
  pattern: string;
207
255
  /**
208
- * Regular expression flags (g, i, m, s, u, y)
256
+ * The regular expression flags: `g` for every match, `i` to ignore case, `m` for
257
+ * line-by-line anchors, and `s`, `u`, `y` as in JavaScript.
209
258
  * @default g
210
259
  */
211
260
  flags: string;
212
261
  }
262
+ /**
263
+ * A text, a regular expression and a replacement for `text.regexReplace`.
264
+ */
213
265
  class TextRegexReplaceDto {
214
266
  constructor(text?: string, pattern?: string, flags?: string, replaceWith?: string);
215
267
  /**
216
- * Text to search in
268
+ * The text to make the replacements in.
217
269
  * @default hello123world456
218
270
  */
219
271
  text: string;
220
272
  /**
221
- * Regular expression pattern
273
+ * The regular expression, written as it would be between the slashes in JavaScript, such as
274
+ * `[0-9]+`.
222
275
  * @default [0-9]+
223
276
  */
224
277
  pattern: string;
225
278
  /**
226
- * Regular expression flags (g, i, m, s, u, y)
279
+ * The regular expression flags: `g` replaces every match instead of the first, `i` ignores
280
+ * case, and `m`, `s`, `u`, `y` work as in JavaScript.
227
281
  * @default g
228
282
  */
229
283
  flags: string;
230
284
  /**
231
- * Text to replace matches with
285
+ * The text that takes the place of each match; `$1` and the like refer to capture groups,
286
+ * as in JavaScript.
232
287
  * @default X
233
288
  */
234
289
  replaceWith: string;
235
290
  }
291
+ /**
292
+ * One character and its size and placement for `text.vectorChar`, which draws it as stroke
293
+ * paths on the XZ plane.
294
+ */
236
295
  class VectorCharDto {
237
296
  constructor(char?: string, xOffset?: number, yOffset?: number, height?: number, extrudeOffset?: number);
238
297
  /**
239
- * The text
298
+ * The character to draw; only its first character is used, and an unknown one is drawn as a
299
+ * question mark.
240
300
  * @default A
241
301
  */
242
302
  char: string;
243
303
  /**
244
- * The x offset
304
+ * How far to shift the strokes along X, in model units.
245
305
  * @default 0
246
306
  * @minimum -Infinity
247
307
  * @maximum Infinity
@@ -249,14 +309,16 @@ export declare namespace Text {
249
309
  */
250
310
  xOffset?: number | undefined;
251
311
  /**
252
- * The y offset
312
+ * How far to shift the strokes along the second axis of the character plane, in model
313
+ * units.
253
314
  * @minimum -Infinity
254
315
  * @maximum Infinity
255
316
  * @step 0.1
317
+ * @optional true
256
318
  */
257
319
  yOffset?: number | undefined;
258
320
  /**
259
- * The height of the text
321
+ * The height of a capital letter, in model units; the strokes are scaled to it.
260
322
  * @default 1
261
323
  * @minimum -Infinity
262
324
  * @maximum Infinity
@@ -264,7 +326,8 @@ export declare namespace Text {
264
326
  */
265
327
  height?: number | undefined;
266
328
  /**
267
- * The extrude offset
329
+ * A margin, in model units, taken off the height and split above and below, so an extruded
330
+ * character keeps its full size.
268
331
  * @default 0
269
332
  * @minimum -Infinity
270
333
  * @maximum Infinity
@@ -272,15 +335,19 @@ export declare namespace Text {
272
335
  */
273
336
  extrudeOffset?: number | undefined;
274
337
  }
338
+ /**
339
+ * A text and its layout for `text.vectorText`, which draws it line by line as stroke paths on
340
+ * the XZ plane.
341
+ */
275
342
  class VectorTextDto {
276
343
  constructor(text?: string, xOffset?: number, yOffset?: number, height?: number, lineSpacing?: number, letterSpacing?: number, align?: Base.horizontalAlignEnum, extrudeOffset?: number, centerOnOrigin?: boolean);
277
344
  /**
278
- * The text
345
+ * The text to draw; a line break starts a new line.
279
346
  * @default Hello World
280
347
  */
281
348
  text?: string | undefined;
282
349
  /**
283
- * The x offset
350
+ * How far to shift the whole block along X, in model units.
284
351
  * @default 0
285
352
  * @minimum -Infinity
286
353
  * @maximum Infinity
@@ -288,7 +355,7 @@ export declare namespace Text {
288
355
  */
289
356
  xOffset?: number | undefined;
290
357
  /**
291
- * The y offset
358
+ * How far to shift the whole block along the second axis of the text plane, in model units.
292
359
  * @default 0
293
360
  * @minimum -Infinity
294
361
  * @maximum Infinity
@@ -296,7 +363,7 @@ export declare namespace Text {
296
363
  */
297
364
  yOffset?: number | undefined;
298
365
  /**
299
- * The height of the text
366
+ * The height of a capital letter, in model units.
300
367
  * @default 1
301
368
  * @minimum -Infinity
302
369
  * @maximum Infinity
@@ -304,7 +371,8 @@ export declare namespace Text {
304
371
  */
305
372
  height?: number | undefined;
306
373
  /**
307
- * The line spacing
374
+ * The distance between lines as a multiple of the height; 1.4 leaves a little air between
375
+ * them.
308
376
  * @default 1.4
309
377
  * @minimum -Infinity
310
378
  * @maximum Infinity
@@ -312,7 +380,8 @@ export declare namespace Text {
312
380
  */
313
381
  lineSpacing?: number | undefined;
314
382
  /**
315
- * The letter spacing offset
383
+ * Extra space between characters as a multiple of the height; 0 uses the font's own
384
+ * spacing.
316
385
  * @default 0
317
386
  * @minimum -Infinity
318
387
  * @maximum Infinity
@@ -320,12 +389,14 @@ export declare namespace Text {
320
389
  */
321
390
  letterSpacing?: number | undefined;
322
391
  /**
323
- * The extrude offset
392
+ * How lines of different length line up: at their left edge, their center or their right
393
+ * edge.
324
394
  * @default left
325
395
  */
326
396
  align?: Base.horizontalAlignEnum | undefined;
327
397
  /**
328
- * The extrude offset
398
+ * A margin, in model units, taken off the height and split above and below each character,
399
+ * so extruded text keeps its full size.
329
400
  * @default 0
330
401
  * @minimum -Infinity
331
402
  * @maximum Infinity
@@ -333,7 +404,7 @@ export declare namespace Text {
333
404
  */
334
405
  extrudeOffset?: number | undefined;
335
406
  /**
336
- * Will center text on 0, 0, 0
407
+ * When true, the middle of the whole text block is moved to the origin.
337
408
  * @default false
338
409
  */
339
410
  centerOnOrigin?: boolean | undefined;