@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.
- package/lib/api/GlobalCDNProvider.js +1 -1
- package/lib/api/inputs/base-inputs.d.ts +13 -12
- package/lib/api/inputs/color-inputs.d.ts +97 -48
- package/lib/api/inputs/color-inputs.js +95 -46
- package/lib/api/inputs/dates-inputs.d.ts +67 -26
- package/lib/api/inputs/dates-inputs.js +57 -16
- package/lib/api/inputs/io-inputs.d.ts +13 -15
- package/lib/api/inputs/io-inputs.js +7 -8
- package/lib/api/inputs/line-inputs.d.ts +88 -33
- package/lib/api/inputs/line-inputs.js +61 -11
- package/lib/api/inputs/lists-inputs.d.ts +207 -96
- package/lib/api/inputs/lists-inputs.js +153 -45
- package/lib/api/inputs/logic-inputs.d.ts +52 -22
- package/lib/api/inputs/logic-inputs.js +41 -12
- package/lib/api/inputs/math-inputs.d.ts +113 -52
- package/lib/api/inputs/math-inputs.js +112 -51
- package/lib/api/inputs/mesh-inputs.d.ts +30 -11
- package/lib/api/inputs/mesh-inputs.js +21 -3
- package/lib/api/inputs/point-inputs.d.ts +240 -107
- package/lib/api/inputs/point-inputs.js +199 -73
- package/lib/api/inputs/polyline-inputs.d.ts +68 -28
- package/lib/api/inputs/polyline-inputs.js +48 -13
- package/lib/api/inputs/text-inputs.d.ts +117 -46
- package/lib/api/inputs/text-inputs.js +111 -41
- package/lib/api/inputs/transforms-inputs.d.ts +65 -23
- package/lib/api/inputs/transforms-inputs.js +64 -22
- package/lib/api/inputs/vector-inputs.d.ts +154 -76
- package/lib/api/inputs/vector-inputs.js +132 -57
- package/lib/api/models/point/hex-grid-data.d.ts +1 -1
- package/lib/api/models/point/hex-grid-data.js +1 -1
- package/lib/api/services/color.d.ts +149 -70
- package/lib/api/services/color.js +149 -70
- package/lib/api/services/dates.d.ts +313 -150
- package/lib/api/services/dates.js +313 -150
- package/lib/api/services/line.d.ts +138 -68
- package/lib/api/services/line.js +138 -68
- package/lib/api/services/lists.d.ts +357 -177
- package/lib/api/services/lists.js +357 -177
- package/lib/api/services/logic.d.ts +98 -45
- package/lib/api/services/logic.js +98 -45
- package/lib/api/services/math.d.ts +363 -211
- package/lib/api/services/math.js +363 -211
- package/lib/api/services/mesh.d.ts +73 -31
- package/lib/api/services/mesh.js +73 -31
- package/lib/api/services/point.d.ts +367 -147
- package/lib/api/services/point.js +367 -147
- package/lib/api/services/polyline.d.ts +146 -71
- package/lib/api/services/polyline.js +146 -71
- package/lib/api/services/text.d.ts +320 -165
- package/lib/api/services/text.js +320 -165
- package/lib/api/services/transforms.d.ts +145 -58
- package/lib/api/services/transforms.js +145 -58
- package/lib/api/services/vector.d.ts +381 -156
- package/lib/api/services/vector.js +381 -156
- package/package.json +1 -1
|
@@ -11,15 +11,18 @@ export declare namespace Lists {
|
|
|
11
11
|
first = "first",
|
|
12
12
|
last = "last"
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* A list and a position for `lists.getItem`.
|
|
16
|
+
*/
|
|
14
17
|
class ListItemDto<T> {
|
|
15
18
|
constructor(list?: T[], index?: number, clone?: boolean);
|
|
16
19
|
/**
|
|
17
|
-
* The list to
|
|
20
|
+
* The list to read from.
|
|
18
21
|
* @default undefined
|
|
19
22
|
*/
|
|
20
23
|
list: T[];
|
|
21
24
|
/**
|
|
22
|
-
*
|
|
25
|
+
* Position of the item, counting from 0; outside the list it throws.
|
|
23
26
|
* @default 0
|
|
24
27
|
* @minimum 0
|
|
25
28
|
* @maximum Infinity
|
|
@@ -27,20 +30,24 @@ export declare namespace Lists {
|
|
|
27
30
|
*/
|
|
28
31
|
index: number;
|
|
29
32
|
/**
|
|
30
|
-
*
|
|
33
|
+
* When true, the item is deep-copied so the caller cannot change the list through it; an
|
|
34
|
+
* item that cannot be copied, such as one with circular references, throws.
|
|
31
35
|
* @default true
|
|
32
36
|
*/
|
|
33
37
|
clone?: boolean | undefined;
|
|
34
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* A list and a range of positions for `lists.getSubList`.
|
|
41
|
+
*/
|
|
35
42
|
class SubListDto<T> {
|
|
36
43
|
constructor(list?: T[], indexStart?: number, indexEnd?: number, clone?: boolean);
|
|
37
44
|
/**
|
|
38
|
-
* The list to
|
|
45
|
+
* The list to cut from.
|
|
39
46
|
* @default undefined
|
|
40
47
|
*/
|
|
41
48
|
list: T[];
|
|
42
49
|
/**
|
|
43
|
-
*
|
|
50
|
+
* Position of the first item to take, counting from 0.
|
|
44
51
|
* @default 0
|
|
45
52
|
* @minimum 0
|
|
46
53
|
* @maximum Infinity
|
|
@@ -48,7 +55,7 @@ export declare namespace Lists {
|
|
|
48
55
|
*/
|
|
49
56
|
indexStart: number;
|
|
50
57
|
/**
|
|
51
|
-
*
|
|
58
|
+
* Position just after the last item to take; it is not included.
|
|
52
59
|
* @default 1
|
|
53
60
|
* @minimum 0
|
|
54
61
|
* @maximum Infinity
|
|
@@ -56,38 +63,49 @@ export declare namespace Lists {
|
|
|
56
63
|
*/
|
|
57
64
|
indexEnd: number;
|
|
58
65
|
/**
|
|
59
|
-
*
|
|
66
|
+
* When true, the items are deep-copied so the caller cannot change the list through them;
|
|
67
|
+
* an item that cannot be copied throws.
|
|
60
68
|
* @default true
|
|
61
69
|
*/
|
|
62
70
|
clone?: boolean | undefined;
|
|
63
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* A list for the methods that read or reshape it whole: `lists.reverse`, `lists.shuffle`,
|
|
74
|
+
* `lists.flipLists`, `lists.getFirstItem` and the others.
|
|
75
|
+
*/
|
|
64
76
|
class ListCloneDto<T> {
|
|
65
77
|
constructor(list?: T[], clone?: boolean);
|
|
66
78
|
/**
|
|
67
|
-
* The list to
|
|
79
|
+
* The list to work on.
|
|
68
80
|
* @default undefined
|
|
69
81
|
*/
|
|
70
82
|
list: T[];
|
|
71
83
|
/**
|
|
72
|
-
*
|
|
84
|
+
* When true, the list is deep-copied first so the input is never changed; when false the
|
|
85
|
+
* modifying methods work in place. Circular data cannot be copied and throws.
|
|
73
86
|
* @default true
|
|
74
87
|
*/
|
|
75
88
|
clone?: boolean | undefined;
|
|
76
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* A pattern and a length for `lists.repeatInPattern`, which repeats the pattern until the list
|
|
92
|
+
* is that long.
|
|
93
|
+
*/
|
|
77
94
|
class RepeatInPatternDto<T> {
|
|
78
95
|
constructor(list?: T[]);
|
|
79
96
|
/**
|
|
80
|
-
* The
|
|
97
|
+
* The items to repeat, in order.
|
|
81
98
|
* @default undefined
|
|
82
99
|
*/
|
|
83
100
|
list: T[];
|
|
84
101
|
/**
|
|
85
|
-
*
|
|
102
|
+
* When true, the pattern is deep-copied first so the input is never changed. Data with
|
|
103
|
+
* circular references cannot be copied and throws.
|
|
86
104
|
* @default true
|
|
87
105
|
*/
|
|
88
106
|
clone?: boolean | undefined;
|
|
89
107
|
/**
|
|
90
|
-
* The
|
|
108
|
+
* The length of the result; the pattern is cut off there.
|
|
91
109
|
* @default 100
|
|
92
110
|
* @minimum 1
|
|
93
111
|
* @maximum Infinity
|
|
@@ -95,64 +113,79 @@ export declare namespace Lists {
|
|
|
95
113
|
*/
|
|
96
114
|
lengthLimit: number;
|
|
97
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* A list and a direction for `lists.sortNumber` and `lists.sortTexts`.
|
|
118
|
+
*/
|
|
98
119
|
class SortDto<T> {
|
|
99
120
|
constructor(list?: T[], clone?: boolean, orderAsc?: boolean);
|
|
100
121
|
/**
|
|
101
|
-
* The
|
|
122
|
+
* The numbers or texts to sort.
|
|
102
123
|
* @default undefined
|
|
103
124
|
*/
|
|
104
125
|
list: T[];
|
|
105
126
|
/**
|
|
106
|
-
*
|
|
127
|
+
* When true, the list is deep-copied first so the input stays in its old order; when false
|
|
128
|
+
* it is sorted in place.
|
|
107
129
|
* @default true
|
|
108
130
|
*/
|
|
109
131
|
clone?: boolean | undefined;
|
|
110
132
|
/**
|
|
111
|
-
*
|
|
133
|
+
* When true, the smallest or alphabetically first item comes first; when false the order is
|
|
134
|
+
* reversed.
|
|
112
135
|
* @default true
|
|
113
136
|
*/
|
|
114
137
|
orderAsc: boolean;
|
|
115
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Objects, the property to compare and a direction for `lists.sortByPropValue`.
|
|
141
|
+
*/
|
|
116
142
|
class SortJsonDto<T> {
|
|
117
143
|
constructor(list?: T[], clone?: boolean, orderAsc?: boolean);
|
|
118
144
|
/**
|
|
119
|
-
* The
|
|
145
|
+
* The objects to sort; each should carry the property.
|
|
120
146
|
* @default undefined
|
|
121
147
|
*/
|
|
122
148
|
list: T[];
|
|
123
149
|
/**
|
|
124
|
-
*
|
|
150
|
+
* When true, the list is deep-copied first so the input stays in its old order; when false
|
|
151
|
+
* it is sorted in place.
|
|
125
152
|
* @default true
|
|
126
153
|
*/
|
|
127
154
|
clone?: boolean | undefined;
|
|
128
155
|
/**
|
|
129
|
-
*
|
|
156
|
+
* When true, the object with the smallest value comes first; when false the largest.
|
|
130
157
|
* @default true
|
|
131
158
|
*/
|
|
132
159
|
orderAsc: boolean;
|
|
133
160
|
/**
|
|
134
|
-
*
|
|
161
|
+
* Name of the property whose numeric value decides the order.
|
|
135
162
|
* @default propName
|
|
136
163
|
*/
|
|
137
164
|
property: string;
|
|
138
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* A list for `lists.removeAllItems`, which empties it in place.
|
|
168
|
+
*/
|
|
139
169
|
class ListDto<T> {
|
|
140
170
|
constructor(list?: T[]);
|
|
141
171
|
/**
|
|
142
|
-
* The list
|
|
172
|
+
* The list to empty.
|
|
143
173
|
* @default undefined
|
|
144
174
|
*/
|
|
145
175
|
list: T[];
|
|
146
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* A list and a group size for `lists.groupNth`.
|
|
179
|
+
*/
|
|
147
180
|
class GroupListDto<T> {
|
|
148
181
|
constructor(list?: T[], nrElements?: number, keepRemainder?: boolean);
|
|
149
182
|
/**
|
|
150
|
-
* The
|
|
183
|
+
* The items to split into groups, in order.
|
|
151
184
|
* @default undefined
|
|
152
185
|
*/
|
|
153
186
|
list: T[];
|
|
154
187
|
/**
|
|
155
|
-
*
|
|
188
|
+
* How many items go in each group.
|
|
156
189
|
* @default 2
|
|
157
190
|
* @minimum 1
|
|
158
191
|
* @maximum Infinity
|
|
@@ -160,20 +193,24 @@ export declare namespace Lists {
|
|
|
160
193
|
*/
|
|
161
194
|
nrElements: number;
|
|
162
195
|
/**
|
|
163
|
-
*
|
|
196
|
+
* When true, the items left over at the end form a shorter last group; when false they are
|
|
197
|
+
* dropped.
|
|
164
198
|
* @default false
|
|
165
199
|
*/
|
|
166
200
|
keepRemainder: boolean;
|
|
167
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* An item and a count for `lists.repeat`.
|
|
204
|
+
*/
|
|
168
205
|
class MultiplyItemDto<T> {
|
|
169
206
|
constructor(item?: T, times?: number);
|
|
170
207
|
/**
|
|
171
|
-
* The item to
|
|
208
|
+
* The item to repeat; every entry of the result is this same item.
|
|
172
209
|
* @default undefined
|
|
173
210
|
*/
|
|
174
211
|
item: T;
|
|
175
212
|
/**
|
|
176
|
-
*
|
|
213
|
+
* How many entries the result has.
|
|
177
214
|
* @default 10
|
|
178
215
|
* @minimum 0
|
|
179
216
|
* @maximum Infinity
|
|
@@ -181,20 +218,24 @@ export declare namespace Lists {
|
|
|
181
218
|
*/
|
|
182
219
|
times: number;
|
|
183
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* A list, an item and a position for `lists.addItemAtIndex`.
|
|
223
|
+
*/
|
|
184
224
|
class AddItemAtIndexDto<T> {
|
|
185
225
|
constructor(list?: T[], item?: T, index?: number, clone?: boolean);
|
|
186
226
|
/**
|
|
187
|
-
* The list to
|
|
227
|
+
* The list to insert into.
|
|
188
228
|
* @default undefined
|
|
189
229
|
*/
|
|
190
230
|
list: T[];
|
|
191
231
|
/**
|
|
192
|
-
* The item to
|
|
232
|
+
* The item to insert.
|
|
193
233
|
* @default undefined
|
|
194
234
|
*/
|
|
195
235
|
item: T;
|
|
196
236
|
/**
|
|
197
|
-
* The
|
|
237
|
+
* The position the item takes, counting from 0; the item there and everything after it
|
|
238
|
+
* shift up by one.
|
|
198
239
|
* @default 0
|
|
199
240
|
* @minimum 0
|
|
200
241
|
* @maximum Infinity
|
|
@@ -202,66 +243,81 @@ export declare namespace Lists {
|
|
|
202
243
|
*/
|
|
203
244
|
index: number;
|
|
204
245
|
/**
|
|
205
|
-
*
|
|
246
|
+
* When true, the list is deep-copied first so the input is never changed; when false the
|
|
247
|
+
* item is inserted in place.
|
|
206
248
|
* @default true
|
|
207
249
|
*/
|
|
208
250
|
clone?: boolean | undefined;
|
|
209
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* A list, an item and several positions for `lists.addItemAtIndexes`.
|
|
254
|
+
*/
|
|
210
255
|
class AddItemAtIndexesDto<T> {
|
|
211
256
|
constructor(list?: T[], item?: T, indexes?: number[], clone?: boolean);
|
|
212
257
|
/**
|
|
213
|
-
* The list to
|
|
258
|
+
* The list to insert into.
|
|
214
259
|
* @default undefined
|
|
215
260
|
*/
|
|
216
261
|
list: T[];
|
|
217
262
|
/**
|
|
218
|
-
* The item to
|
|
263
|
+
* The item to insert at every position.
|
|
219
264
|
* @default undefined
|
|
220
265
|
*/
|
|
221
266
|
item: T;
|
|
222
267
|
/**
|
|
223
|
-
* The
|
|
268
|
+
* The positions, counted on the list as it was before any insertion; positions outside the
|
|
269
|
+
* list are ignored.
|
|
224
270
|
* @default [0]
|
|
225
271
|
*/
|
|
226
272
|
indexes: number[];
|
|
227
273
|
/**
|
|
228
|
-
*
|
|
274
|
+
* When true, the list is deep-copied first so the input is never changed; when false the
|
|
275
|
+
* items are inserted in place.
|
|
229
276
|
* @default true
|
|
230
277
|
*/
|
|
231
278
|
clone?: boolean | undefined;
|
|
232
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* A list, several items and one position per item for `lists.addItemsAtIndexes`.
|
|
282
|
+
*/
|
|
233
283
|
class AddItemsAtIndexesDto<T> {
|
|
234
284
|
constructor(list?: T[], items?: T[], indexes?: number[], clone?: boolean);
|
|
235
285
|
/**
|
|
236
|
-
* The list to
|
|
286
|
+
* The list to insert into.
|
|
237
287
|
* @default undefined
|
|
238
288
|
*/
|
|
239
289
|
list: T[];
|
|
240
290
|
/**
|
|
241
|
-
* The
|
|
291
|
+
* The items to insert, one per index, in the same order.
|
|
242
292
|
* @default undefined
|
|
243
293
|
*/
|
|
244
294
|
items: T[];
|
|
245
295
|
/**
|
|
246
|
-
*
|
|
296
|
+
* One position per item, in ascending order, counted on the list as it was before any
|
|
297
|
+
* insertion; a wrong count or order throws.
|
|
247
298
|
* @default [0]
|
|
248
299
|
*/
|
|
249
300
|
indexes: number[];
|
|
250
301
|
/**
|
|
251
|
-
*
|
|
302
|
+
* When true, the list is deep-copied first so the input is never changed; when false the
|
|
303
|
+
* items are inserted in place.
|
|
252
304
|
* @default true
|
|
253
305
|
*/
|
|
254
306
|
clone?: boolean | undefined;
|
|
255
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* A list and a position for `lists.removeItemAtIndex` and `lists.removeItemAtIndexFromEnd`.
|
|
310
|
+
*/
|
|
256
311
|
class RemoveItemAtIndexDto<T> {
|
|
257
312
|
constructor(list?: T[], index?: number, clone?: boolean);
|
|
258
313
|
/**
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
314
|
+
* The list to take the item out of.
|
|
315
|
+
* @default undefined
|
|
316
|
+
*/
|
|
262
317
|
list: T[];
|
|
263
318
|
/**
|
|
264
|
-
* The
|
|
319
|
+
* The position to remove, counting from 0 at the start, or from 0 at the end for the
|
|
320
|
+
* from-end method; outside the list nothing is removed.
|
|
265
321
|
* @default 0
|
|
266
322
|
* @minimum 0
|
|
267
323
|
* @maximum Infinity
|
|
@@ -269,38 +325,47 @@ export declare namespace Lists {
|
|
|
269
325
|
*/
|
|
270
326
|
index: number;
|
|
271
327
|
/**
|
|
272
|
-
*
|
|
328
|
+
* When true, the list is deep-copied first so the input is never changed; when false the
|
|
329
|
+
* item is removed in place.
|
|
273
330
|
* @default true
|
|
274
331
|
*/
|
|
275
332
|
clone?: boolean | undefined;
|
|
276
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* A list and several positions for `lists.removeItemsAtIndexes`.
|
|
336
|
+
*/
|
|
277
337
|
class RemoveItemsAtIndexesDto<T> {
|
|
278
338
|
constructor(list?: T[], indexes?: number[], clone?: boolean);
|
|
279
339
|
/**
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
340
|
+
* The list to take the items out of.
|
|
341
|
+
* @default undefined
|
|
342
|
+
*/
|
|
283
343
|
list: T[];
|
|
284
344
|
/**
|
|
285
|
-
* The
|
|
345
|
+
* The positions to remove, counted on the list as it was before any removal; positions
|
|
346
|
+
* outside the list are ignored.
|
|
286
347
|
* @default undefined
|
|
287
348
|
*/
|
|
288
349
|
indexes: number[];
|
|
289
350
|
/**
|
|
290
|
-
*
|
|
351
|
+
* When true, the list is deep-copied first so the input is never changed; when false the
|
|
352
|
+
* items are removed in place.
|
|
291
353
|
* @default true
|
|
292
354
|
*/
|
|
293
355
|
clone?: boolean | undefined;
|
|
294
356
|
}
|
|
357
|
+
/**
|
|
358
|
+
* A list, a step and an offset for `lists.removeNthItem`.
|
|
359
|
+
*/
|
|
295
360
|
class RemoveNthItemDto<T> {
|
|
296
361
|
constructor(list?: T[], nth?: number, offset?: number, clone?: boolean);
|
|
297
362
|
/**
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
363
|
+
* The list to thin out.
|
|
364
|
+
* @default undefined
|
|
365
|
+
*/
|
|
301
366
|
list: T[];
|
|
302
367
|
/**
|
|
303
|
-
* The nth item
|
|
368
|
+
* The step: every nth item, counted from the offset, is removed.
|
|
304
369
|
* @default 2
|
|
305
370
|
* @minimum 1
|
|
306
371
|
* @maximum Infinity
|
|
@@ -308,7 +373,7 @@ export declare namespace Lists {
|
|
|
308
373
|
*/
|
|
309
374
|
nth: number;
|
|
310
375
|
/**
|
|
311
|
-
*
|
|
376
|
+
* Position of the first item to remove, counting from 0.
|
|
312
377
|
* @default 0
|
|
313
378
|
* @minimum 0
|
|
314
379
|
* @maximum Infinity
|
|
@@ -316,54 +381,67 @@ export declare namespace Lists {
|
|
|
316
381
|
*/
|
|
317
382
|
offset: number;
|
|
318
383
|
/**
|
|
319
|
-
*
|
|
384
|
+
* When true, the list is deep-copied first so the input is never changed; when false the
|
|
385
|
+
* items are removed in place.
|
|
320
386
|
* @default true
|
|
321
387
|
*/
|
|
322
388
|
clone?: boolean | undefined;
|
|
323
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* A list and a probability for `lists.randomGetThreshold` and `lists.randomRemoveThreshold`.
|
|
392
|
+
*/
|
|
324
393
|
class RandomThresholdDto<T> {
|
|
325
394
|
constructor(list?: T[], threshold?: number, clone?: boolean);
|
|
326
395
|
/**
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
396
|
+
* The list to pick from.
|
|
397
|
+
* @default undefined
|
|
398
|
+
*/
|
|
330
399
|
list: T[];
|
|
331
400
|
/**
|
|
332
|
-
*
|
|
401
|
+
* The probability, from 0 to 1, that any one item is kept by the get method or dropped by
|
|
402
|
+
* the remove method.
|
|
333
403
|
* @default 0.5
|
|
334
404
|
* @minimum 0
|
|
335
405
|
* @maximum 1
|
|
336
|
-
* @step 1
|
|
406
|
+
* @step 0.1
|
|
337
407
|
*/
|
|
338
408
|
threshold: number;
|
|
339
409
|
/**
|
|
340
|
-
*
|
|
410
|
+
* When true, the list is deep-copied first so the input is never changed.
|
|
341
411
|
* @default true
|
|
342
412
|
*/
|
|
343
413
|
clone?: boolean | undefined;
|
|
344
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* A list for `lists.removeDuplicates` and `lists.removeDuplicateNumbers`, which drop repeated
|
|
417
|
+
* items.
|
|
418
|
+
*/
|
|
345
419
|
class RemoveDuplicatesDto<T> {
|
|
346
420
|
constructor(list?: T[], clone?: boolean);
|
|
347
421
|
/**
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
422
|
+
* The list to remove repeats from; the first occurrence of each item stays.
|
|
423
|
+
* @default undefined
|
|
424
|
+
*/
|
|
351
425
|
list: T[];
|
|
352
426
|
/**
|
|
353
|
-
*
|
|
427
|
+
* When true, the list is deep-copied first so the input is never changed.
|
|
354
428
|
* @default true
|
|
355
429
|
*/
|
|
356
430
|
clone?: boolean | undefined;
|
|
357
431
|
}
|
|
432
|
+
/**
|
|
433
|
+
* Numbers and a tolerance for `lists.removeDuplicateNumbersTolerance`, which drops
|
|
434
|
+
* near-repeats.
|
|
435
|
+
*/
|
|
358
436
|
class RemoveDuplicatesToleranceDto<T> {
|
|
359
437
|
constructor(list?: T[], clone?: boolean, tolerance?: number);
|
|
360
438
|
/**
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
439
|
+
* The numbers to remove near-repeats from; the first of each group stays.
|
|
440
|
+
* @default undefined
|
|
441
|
+
*/
|
|
364
442
|
list: T[];
|
|
365
443
|
/**
|
|
366
|
-
*
|
|
444
|
+
* Numbers closer together than this count as the same.
|
|
367
445
|
* @default 1e-7
|
|
368
446
|
* @minimum 0
|
|
369
447
|
* @maximum Infinity
|
|
@@ -371,33 +449,40 @@ export declare namespace Lists {
|
|
|
371
449
|
*/
|
|
372
450
|
tolerance: number;
|
|
373
451
|
/**
|
|
374
|
-
*
|
|
452
|
+
* When true, the list is deep-copied first so the input is never changed.
|
|
375
453
|
* @default true
|
|
376
454
|
*/
|
|
377
455
|
clone?: boolean | undefined;
|
|
378
456
|
}
|
|
457
|
+
/**
|
|
458
|
+
* A list and a repeating pattern for `lists.getByPattern`.
|
|
459
|
+
*/
|
|
379
460
|
class GetByPatternDto<T> {
|
|
380
461
|
constructor(list?: T[], pattern?: boolean[]);
|
|
381
462
|
/**
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
463
|
+
* The list to filter.
|
|
464
|
+
* @default undefined
|
|
465
|
+
*/
|
|
385
466
|
list: T[];
|
|
386
467
|
/**
|
|
387
|
-
* The
|
|
468
|
+
* The pattern of `true` (keep) and `false` (skip) applied item by item and repeated until
|
|
469
|
+
* the list ends.
|
|
388
470
|
* @default [true, true, false]
|
|
389
471
|
*/
|
|
390
472
|
pattern: boolean[];
|
|
391
473
|
}
|
|
474
|
+
/**
|
|
475
|
+
* A list, a step and an offset for `lists.getNthItem`.
|
|
476
|
+
*/
|
|
392
477
|
class GetNthItemDto<T> {
|
|
393
478
|
constructor(list?: T[], nth?: number, offset?: number, clone?: boolean);
|
|
394
479
|
/**
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
480
|
+
* The list to pick from.
|
|
481
|
+
* @default undefined
|
|
482
|
+
*/
|
|
398
483
|
list: T[];
|
|
399
484
|
/**
|
|
400
|
-
* The nth item
|
|
485
|
+
* The step: every nth item, counted from the offset, is kept.
|
|
401
486
|
* @default 2
|
|
402
487
|
* @minimum 1
|
|
403
488
|
* @maximum Infinity
|
|
@@ -405,7 +490,7 @@ export declare namespace Lists {
|
|
|
405
490
|
*/
|
|
406
491
|
nth: number;
|
|
407
492
|
/**
|
|
408
|
-
*
|
|
493
|
+
* Position of the first item to keep, counting from 0.
|
|
409
494
|
* @default 0
|
|
410
495
|
* @minimum 0
|
|
411
496
|
* @maximum Infinity
|
|
@@ -413,28 +498,35 @@ export declare namespace Lists {
|
|
|
413
498
|
*/
|
|
414
499
|
offset: number;
|
|
415
500
|
/**
|
|
416
|
-
*
|
|
501
|
+
* When true, the items are deep-copied so the caller cannot change the list through them.
|
|
417
502
|
* @default true
|
|
418
503
|
*/
|
|
419
504
|
clone?: boolean | undefined;
|
|
420
505
|
}
|
|
506
|
+
/**
|
|
507
|
+
* Several lists for `lists.getLongestListLength`, which measures the longest of them.
|
|
508
|
+
*/
|
|
421
509
|
class GetLongestListLength<T> {
|
|
422
510
|
constructor(lists?: T[]);
|
|
423
511
|
/**
|
|
424
|
-
* The
|
|
512
|
+
* The lists to measure.
|
|
425
513
|
* @default undefined
|
|
426
514
|
*/
|
|
427
515
|
lists: T[];
|
|
428
516
|
}
|
|
517
|
+
/**
|
|
518
|
+
* Nested lists and a depth for `lists.mergeElementsOfLists`, which regroups items by position.
|
|
519
|
+
*/
|
|
429
520
|
class MergeElementsOfLists<T> {
|
|
430
521
|
constructor(lists?: T[], level?: number);
|
|
431
522
|
/**
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
523
|
+
* The lists whose items are regrouped by position.
|
|
524
|
+
* @default undefined
|
|
525
|
+
*/
|
|
435
526
|
lists: T[];
|
|
436
527
|
/**
|
|
437
|
-
*
|
|
528
|
+
* How many levels of nesting to flatten inside each list before regrouping; 0 regroups the
|
|
529
|
+
* lists as they are.
|
|
438
530
|
* @default 0
|
|
439
531
|
* @minimum 0
|
|
440
532
|
* @maximum Infinity
|
|
@@ -442,82 +534,101 @@ export declare namespace Lists {
|
|
|
442
534
|
*/
|
|
443
535
|
level: number;
|
|
444
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* A list and an item for `lists.addItem` and `lists.prependItem`.
|
|
539
|
+
*/
|
|
445
540
|
class AddItemDto<T> {
|
|
446
541
|
constructor(list?: T[], item?: T, clone?: boolean);
|
|
447
542
|
/**
|
|
448
|
-
* The list
|
|
543
|
+
* The list that receives the item.
|
|
449
544
|
* @default undefined
|
|
450
545
|
*/
|
|
451
546
|
list: T[];
|
|
452
547
|
/**
|
|
453
|
-
* The item to add
|
|
548
|
+
* The item to add at the end or the start.
|
|
454
549
|
* @default undefined
|
|
455
550
|
*/
|
|
456
551
|
item: T;
|
|
457
552
|
/**
|
|
458
|
-
*
|
|
553
|
+
* When true, the list is deep-copied first so the input is never changed; when false the
|
|
554
|
+
* item is added in place.
|
|
459
555
|
* @default true
|
|
460
556
|
*/
|
|
461
557
|
clone?: boolean | undefined;
|
|
462
558
|
}
|
|
559
|
+
/**
|
|
560
|
+
* A list, an item and an end for `lists.addItemFirstLast`.
|
|
561
|
+
*/
|
|
463
562
|
class AddItemFirstLastDto<T> {
|
|
464
563
|
constructor(list?: T[], item?: T, position?: firstLastEnum, clone?: boolean);
|
|
465
564
|
/**
|
|
466
|
-
* The list
|
|
565
|
+
* The list that receives the item.
|
|
467
566
|
* @default undefined
|
|
468
567
|
*/
|
|
469
568
|
list: T[];
|
|
470
569
|
/**
|
|
471
|
-
* The item
|
|
570
|
+
* The item that goes at the chosen end.
|
|
472
571
|
* @default undefined
|
|
473
572
|
*/
|
|
474
573
|
item: T;
|
|
475
574
|
/**
|
|
476
|
-
*
|
|
575
|
+
* Whether the item goes at the start (`first`) or the end (`last`).
|
|
477
576
|
* @default last
|
|
478
577
|
*/
|
|
479
578
|
position: firstLastEnum;
|
|
480
579
|
/**
|
|
481
|
-
*
|
|
580
|
+
* When true, the list is deep-copied first so the input is never changed; when false the
|
|
581
|
+
* item is added in place.
|
|
482
582
|
* @default true
|
|
483
583
|
*/
|
|
484
584
|
clone?: boolean | undefined;
|
|
485
585
|
}
|
|
586
|
+
/**
|
|
587
|
+
* Several lists for `lists.concatenate`, joined end to end.
|
|
588
|
+
*/
|
|
486
589
|
class ConcatenateDto<T> {
|
|
487
590
|
constructor(lists?: T[][], clone?: boolean);
|
|
488
591
|
/**
|
|
489
|
-
* The lists to
|
|
592
|
+
* The lists to join, in the order they should appear.
|
|
490
593
|
* @default undefined
|
|
491
594
|
*/
|
|
492
595
|
lists: T[][];
|
|
493
596
|
/**
|
|
494
|
-
*
|
|
597
|
+
* When true, the lists are deep-copied first so the inputs are never changed.
|
|
495
598
|
* @default true
|
|
496
599
|
*/
|
|
497
600
|
clone?: boolean | undefined;
|
|
498
601
|
}
|
|
602
|
+
/**
|
|
603
|
+
* A list and an item for `lists.includes` and `lists.findIndex`.
|
|
604
|
+
*/
|
|
499
605
|
class IncludesDto<T> {
|
|
500
606
|
constructor(list?: T[], item?: T);
|
|
501
607
|
/**
|
|
502
|
-
* The list to
|
|
608
|
+
* The list to search.
|
|
503
609
|
* @default undefined
|
|
504
610
|
*/
|
|
505
611
|
list: T[];
|
|
506
612
|
/**
|
|
507
|
-
* The item to look for
|
|
613
|
+
* The item to look for; it must be the very same value or object, not just an equal-looking
|
|
614
|
+
* one.
|
|
508
615
|
* @default undefined
|
|
509
616
|
*/
|
|
510
617
|
item: T;
|
|
511
618
|
}
|
|
619
|
+
/**
|
|
620
|
+
* Several lists for `lists.interleave`, which weaves them together item by item.
|
|
621
|
+
*/
|
|
512
622
|
class InterleaveDto<T> {
|
|
513
623
|
constructor(lists?: T[][], clone?: boolean);
|
|
514
624
|
/**
|
|
515
|
-
* The lists to
|
|
625
|
+
* The lists to weave; the first item of each comes first, then the second of each, and so
|
|
626
|
+
* on.
|
|
516
627
|
* @default undefined
|
|
517
628
|
*/
|
|
518
629
|
lists: T[][];
|
|
519
630
|
/**
|
|
520
|
-
*
|
|
631
|
+
* When true, the lists are deep-copied first so the inputs are never changed.
|
|
521
632
|
* @default true
|
|
522
633
|
*/
|
|
523
634
|
clone?: boolean | undefined;
|