@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.
- package/lib/api/GlobalCDNProvider.js +1 -1
- package/lib/api/inputs/lists-inputs.d.ts +39 -0
- package/lib/api/inputs/lists-inputs.js +43 -0
- package/lib/api/inputs/math-inputs.d.ts +154 -0
- package/lib/api/inputs/math-inputs.js +217 -0
- package/lib/api/inputs/text-inputs.d.ts +139 -0
- package/lib/api/inputs/text-inputs.js +215 -0
- package/lib/api/inputs/vector-inputs.d.ts +8 -0
- package/lib/api/inputs/vector-inputs.js +8 -0
- package/lib/api/services/color.d.ts +27 -12
- package/lib/api/services/color.js +27 -12
- package/lib/api/services/dates.d.ts +62 -30
- package/lib/api/services/dates.js +62 -30
- package/lib/api/services/geometry-helper.d.ts +50 -0
- package/lib/api/services/geometry-helper.js +50 -2
- package/lib/api/services/helpers/dxf/dxf.d.ts +19 -9
- package/lib/api/services/helpers/dxf/dxf.js +19 -9
- package/lib/api/services/line.d.ts +34 -16
- package/lib/api/services/line.js +34 -16
- package/lib/api/services/lists.d.ts +175 -32
- package/lib/api/services/lists.js +275 -32
- package/lib/api/services/logic.d.ts +24 -13
- package/lib/api/services/logic.js +24 -13
- package/lib/api/services/math.d.ts +180 -35
- package/lib/api/services/math.js +215 -35
- package/lib/api/services/mesh.d.ts +17 -6
- package/lib/api/services/mesh.js +17 -6
- package/lib/api/services/point.d.ts +63 -32
- package/lib/api/services/point.js +63 -32
- package/lib/api/services/polyline.d.ts +27 -11
- package/lib/api/services/polyline.js +27 -11
- package/lib/api/services/text.d.ts +286 -7
- package/lib/api/services/text.js +350 -7
- package/lib/api/services/transforms.d.ts +30 -16
- package/lib/api/services/transforms.js +30 -16
- package/lib/api/services/vector.d.ts +85 -38
- package/lib/api/services/vector.js +87 -38
- package/package.json +1 -1
|
@@ -7,7 +7,8 @@ import * as Inputs from "../inputs";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class Lists {
|
|
9
9
|
/**
|
|
10
|
-
* Gets an item from the list
|
|
10
|
+
* Gets an item from the list at a specific position using zero-based indexing.
|
|
11
|
+
* Example: From [10, 20, 30, 40], getting index 2 returns 30
|
|
11
12
|
* @param inputs a list and an index
|
|
12
13
|
* @returns item
|
|
13
14
|
* @group get
|
|
@@ -16,7 +17,28 @@ export declare class Lists {
|
|
|
16
17
|
*/
|
|
17
18
|
getItem<T>(inputs: Inputs.Lists.ListItemDto<T>): T;
|
|
18
19
|
/**
|
|
19
|
-
* Gets
|
|
20
|
+
* Gets the first item from the list.
|
|
21
|
+
* Example: From [10, 20, 30, 40], returns 10
|
|
22
|
+
* @param inputs a list
|
|
23
|
+
* @returns first item
|
|
24
|
+
* @group get
|
|
25
|
+
* @shortname first item
|
|
26
|
+
* @drawable false
|
|
27
|
+
*/
|
|
28
|
+
getFirstItem<T>(inputs: Inputs.Lists.ListCloneDto<T>): T;
|
|
29
|
+
/**
|
|
30
|
+
* Gets the last item from the list.
|
|
31
|
+
* Example: From [10, 20, 30, 40], returns 40
|
|
32
|
+
* @param inputs a list
|
|
33
|
+
* @returns last item
|
|
34
|
+
* @group get
|
|
35
|
+
* @shortname last item
|
|
36
|
+
* @drawable false
|
|
37
|
+
*/
|
|
38
|
+
getLastItem<T>(inputs: Inputs.Lists.ListCloneDto<T>): T;
|
|
39
|
+
/**
|
|
40
|
+
* Randomly keeps items from the list based on a probability threshold (0 to 1).
|
|
41
|
+
* Example: From [1, 2, 3, 4, 5] with threshold 0.5, might return [1, 3, 5] (50% chance for each item)
|
|
20
42
|
* @param inputs a list and a threshold for randomization of items to remove
|
|
21
43
|
* @returns list with remaining items
|
|
22
44
|
* @group get
|
|
@@ -25,7 +47,8 @@ export declare class Lists {
|
|
|
25
47
|
*/
|
|
26
48
|
randomGetThreshold<T>(inputs: Inputs.Lists.RandomThresholdDto<T>): T[];
|
|
27
49
|
/**
|
|
28
|
-
*
|
|
50
|
+
* Extracts a portion of the list between start and end positions (end is exclusive).
|
|
51
|
+
* Example: From [10, 20, 30, 40, 50] with start=1 and end=4, returns [20, 30, 40]
|
|
29
52
|
* @param inputs a list and start and end indexes
|
|
30
53
|
* @returns sub list
|
|
31
54
|
* @group get
|
|
@@ -34,7 +57,9 @@ export declare class Lists {
|
|
|
34
57
|
*/
|
|
35
58
|
getSubList<T>(inputs: Inputs.Lists.SubListDto<T>): T[];
|
|
36
59
|
/**
|
|
37
|
-
* Gets nth item
|
|
60
|
+
* Gets every nth item from the list, starting from an optional offset position.
|
|
61
|
+
* Example: From [0, 1, 2, 3, 4, 5, 6, 7, 8] with nth=3 and offset=0, returns [0, 3, 6]
|
|
62
|
+
* Example: From [0, 1, 2, 3, 4, 5, 6, 7, 8] with nth=2 and offset=1, returns [1, 3, 5, 7]
|
|
38
63
|
* @param inputs a list and index
|
|
39
64
|
* @returns list with filtered items
|
|
40
65
|
* @group get
|
|
@@ -43,7 +68,8 @@ export declare class Lists {
|
|
|
43
68
|
*/
|
|
44
69
|
getNthItem<T>(inputs: Inputs.Lists.GetNthItemDto<T>): T[];
|
|
45
70
|
/**
|
|
46
|
-
*
|
|
71
|
+
* Filters items from the list using a repeating true/false pattern.
|
|
72
|
+
* Example: From [0, 1, 2, 3, 4, 5] with pattern [true, true, false], returns [0, 1, 3, 4] (keeps items where pattern is true)
|
|
47
73
|
* @param inputs a list and index
|
|
48
74
|
* @returns list with filtered items
|
|
49
75
|
* @group get
|
|
@@ -52,7 +78,8 @@ export declare class Lists {
|
|
|
52
78
|
*/
|
|
53
79
|
getByPattern<T>(inputs: Inputs.Lists.GetByPatternDto<T>): T[];
|
|
54
80
|
/**
|
|
55
|
-
*
|
|
81
|
+
* Merges elements from multiple lists at a specific nesting level, grouping elements by position.
|
|
82
|
+
* Example: From [[0, 1, 2], [3, 4, 5]] at level 0, returns [[0, 3], [1, 4], [2, 5]]
|
|
56
83
|
* @param inputs lists, level and flatten data
|
|
57
84
|
* @returns list with merged lists and flattened lists
|
|
58
85
|
* @group get
|
|
@@ -61,7 +88,8 @@ export declare class Lists {
|
|
|
61
88
|
*/
|
|
62
89
|
mergeElementsOfLists<T>(inputs: Inputs.Lists.MergeElementsOfLists<T[]>): T[];
|
|
63
90
|
/**
|
|
64
|
-
*
|
|
91
|
+
* Finds the length of the longest list among multiple lists.
|
|
92
|
+
* Example: From [[1, 2], [3, 4, 5, 6], [7]], returns 4 (length of [3, 4, 5, 6])
|
|
65
93
|
* @param inputs a list of lists
|
|
66
94
|
* @returns number of max length
|
|
67
95
|
* @group get
|
|
@@ -70,7 +98,8 @@ export declare class Lists {
|
|
|
70
98
|
*/
|
|
71
99
|
getLongestListLength<T>(inputs: Inputs.Lists.GetLongestListLength<T[]>): number;
|
|
72
100
|
/**
|
|
73
|
-
*
|
|
101
|
+
* Reverses the order of items in the list.
|
|
102
|
+
* Example: From [1, 2, 3, 4, 5], returns [5, 4, 3, 2, 1]
|
|
74
103
|
* @param inputs a list and an index
|
|
75
104
|
* @returns item
|
|
76
105
|
* @group edit
|
|
@@ -79,7 +108,18 @@ export declare class Lists {
|
|
|
79
108
|
*/
|
|
80
109
|
reverse<T>(inputs: Inputs.Lists.ListCloneDto<T>): T[];
|
|
81
110
|
/**
|
|
82
|
-
*
|
|
111
|
+
* Randomly rearranges all items in the list (using Fisher-Yates algorithm).
|
|
112
|
+
* Example: From [1, 2, 3, 4, 5], might return [3, 1, 5, 2, 4] (order varies each time)
|
|
113
|
+
* @param inputs a list
|
|
114
|
+
* @returns shuffled list
|
|
115
|
+
* @group edit
|
|
116
|
+
* @shortname shuffle
|
|
117
|
+
* @drawable false
|
|
118
|
+
*/
|
|
119
|
+
shuffle<T>(inputs: Inputs.Lists.ListCloneDto<T>): T[];
|
|
120
|
+
/**
|
|
121
|
+
* Transposes a 2D list by swapping rows and columns (all sublists must be equal length).
|
|
122
|
+
* Example: From [[0, 1, 2], [3, 4, 5]], returns [[0, 3], [1, 4], [2, 5]]
|
|
83
123
|
* @param inputs a list of lists to flip
|
|
84
124
|
* @returns item
|
|
85
125
|
* @group edit
|
|
@@ -88,7 +128,9 @@ export declare class Lists {
|
|
|
88
128
|
*/
|
|
89
129
|
flipLists<T>(inputs: Inputs.Lists.ListCloneDto<T[]>): T[][];
|
|
90
130
|
/**
|
|
91
|
-
*
|
|
131
|
+
* Splits the list into smaller lists of n elements each.
|
|
132
|
+
* Example: From [0, 1, 2, 3, 4, 5, 6, 7, 8] with n=3, returns [[0, 1, 2], [3, 4, 5], [6, 7, 8]]
|
|
133
|
+
* Example: From [0, 1, 2, 3, 4] with n=2 and keepRemainder=true, returns [[0, 1], [2, 3], [4]]
|
|
92
134
|
* @param inputs a list
|
|
93
135
|
* @returns items grouped in lists of n elements
|
|
94
136
|
* @group edit
|
|
@@ -97,7 +139,28 @@ export declare class Lists {
|
|
|
97
139
|
*/
|
|
98
140
|
groupNth<T>(inputs: Inputs.Lists.GroupListDto<T>): T[][];
|
|
99
141
|
/**
|
|
100
|
-
*
|
|
142
|
+
* Checks whether the list contains a specific item.
|
|
143
|
+
* Example: List [10, 20, 30, 40] with item 30 returns true, with item 50 returns false
|
|
144
|
+
* @param inputs a list and an item
|
|
145
|
+
* @returns true if item is in list
|
|
146
|
+
* @group get
|
|
147
|
+
* @shortname contains item
|
|
148
|
+
* @drawable false
|
|
149
|
+
*/
|
|
150
|
+
includes<T>(inputs: Inputs.Lists.IncludesDto<T>): boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Finds the position (index) of the first occurrence of an item in the list.
|
|
153
|
+
* Example: In [10, 20, 30, 20, 40], finding 20 returns 1 (first occurrence), finding 50 returns -1 (not found)
|
|
154
|
+
* @param inputs a list and an item
|
|
155
|
+
* @returns index of the item or -1 if not found
|
|
156
|
+
* @group get
|
|
157
|
+
* @shortname find index
|
|
158
|
+
* @drawable false
|
|
159
|
+
*/
|
|
160
|
+
findIndex<T>(inputs: Inputs.Lists.IncludesDto<T>): number;
|
|
161
|
+
/**
|
|
162
|
+
* Determines the maximum nesting level (depth) of a list structure.
|
|
163
|
+
* Example: [1, 2, 3] has depth 1, [[1, 2], [3, 4]] has depth 2, [[[1]]] has depth 3
|
|
101
164
|
* @param inputs a list
|
|
102
165
|
* @returns number of depth
|
|
103
166
|
* @group get
|
|
@@ -106,7 +169,8 @@ export declare class Lists {
|
|
|
106
169
|
*/
|
|
107
170
|
getListDepth(inputs: Inputs.Lists.ListCloneDto<[]>): number;
|
|
108
171
|
/**
|
|
109
|
-
*
|
|
172
|
+
* Returns the number of items in the list.
|
|
173
|
+
* Example: [10, 20, 30, 40, 50] returns 5, [] returns 0
|
|
110
174
|
* @param inputs a length list
|
|
111
175
|
* @returns a number
|
|
112
176
|
* @group get
|
|
@@ -115,7 +179,8 @@ export declare class Lists {
|
|
|
115
179
|
*/
|
|
116
180
|
listLength<T>(inputs: Inputs.Lists.ListCloneDto<T>): number;
|
|
117
181
|
/**
|
|
118
|
-
*
|
|
182
|
+
* Inserts an item at a specific position in the list.
|
|
183
|
+
* Example: In [10, 20, 30, 40], adding 99 at index 2 gives [10, 20, 99, 30, 40]
|
|
119
184
|
* @param inputs a list, item and an index
|
|
120
185
|
* @returns list with added item
|
|
121
186
|
* @group add
|
|
@@ -124,7 +189,8 @@ export declare class Lists {
|
|
|
124
189
|
*/
|
|
125
190
|
addItemAtIndex<T>(inputs: Inputs.Lists.AddItemAtIndexDto<T>): T[];
|
|
126
191
|
/**
|
|
127
|
-
*
|
|
192
|
+
* Inserts the same item at multiple specified positions in the list.
|
|
193
|
+
* Example: In [10, 20, 30], adding 99 at indexes [0, 2] gives [99, 10, 20, 99, 30]
|
|
128
194
|
* @param inputs a list, item and an indexes
|
|
129
195
|
* @returns list with added item
|
|
130
196
|
* @group add
|
|
@@ -133,7 +199,8 @@ export declare class Lists {
|
|
|
133
199
|
*/
|
|
134
200
|
addItemAtIndexes<T>(inputs: Inputs.Lists.AddItemAtIndexesDto<T>): T[];
|
|
135
201
|
/**
|
|
136
|
-
*
|
|
202
|
+
* Inserts multiple items at corresponding positions (first item at first index, second item at second index, etc.).
|
|
203
|
+
* Example: In [10, 20, 30], adding items [88, 99] at indexes [1, 2] gives [10, 88, 20, 99, 30]
|
|
137
204
|
* @param inputs a list, items and an indexes
|
|
138
205
|
* @returns list with added items
|
|
139
206
|
* @group add
|
|
@@ -142,7 +209,8 @@ export declare class Lists {
|
|
|
142
209
|
*/
|
|
143
210
|
addItemsAtIndexes<T>(inputs: Inputs.Lists.AddItemsAtIndexesDto<T>): T[];
|
|
144
211
|
/**
|
|
145
|
-
*
|
|
212
|
+
* Removes the item at a specific position in the list.
|
|
213
|
+
* Example: From [10, 20, 30, 40, 50], removing index 2 gives [10, 20, 40, 50]
|
|
146
214
|
* @param inputs a list and index
|
|
147
215
|
* @returns list with removed item
|
|
148
216
|
* @group remove
|
|
@@ -151,7 +219,38 @@ export declare class Lists {
|
|
|
151
219
|
*/
|
|
152
220
|
removeItemAtIndex<T>(inputs: Inputs.Lists.RemoveItemAtIndexDto<T>): T[];
|
|
153
221
|
/**
|
|
154
|
-
*
|
|
222
|
+
* Removes the first item from the list.
|
|
223
|
+
* Example: From [10, 20, 30, 40], returns [20, 30, 40]
|
|
224
|
+
* @param inputs a list
|
|
225
|
+
* @returns list with first item removed
|
|
226
|
+
* @group remove
|
|
227
|
+
* @shortname remove first item
|
|
228
|
+
* @drawable false
|
|
229
|
+
*/
|
|
230
|
+
removeFirstItem<T>(inputs: Inputs.Lists.ListCloneDto<T>): T[];
|
|
231
|
+
/**
|
|
232
|
+
* Removes the last item from the list.
|
|
233
|
+
* Example: From [10, 20, 30, 40], returns [10, 20, 30]
|
|
234
|
+
* @param inputs a list
|
|
235
|
+
* @returns list with last item removed
|
|
236
|
+
* @group remove
|
|
237
|
+
* @shortname remove last item
|
|
238
|
+
* @drawable false
|
|
239
|
+
*/
|
|
240
|
+
removeLastItem<T>(inputs: Inputs.Lists.ListCloneDto<T>): T[];
|
|
241
|
+
/**
|
|
242
|
+
* Removes an item counting from the end of the list (index 0 = last item, 1 = second-to-last, etc.).
|
|
243
|
+
* Example: From [10, 20, 30, 40, 50], removing index 1 from end gives [10, 20, 30, 50] (removes 40)
|
|
244
|
+
* @param inputs a list and index from end
|
|
245
|
+
* @returns list with removed item
|
|
246
|
+
* @group remove
|
|
247
|
+
* @shortname remove item from end
|
|
248
|
+
* @drawable false
|
|
249
|
+
*/
|
|
250
|
+
removeItemAtIndexFromEnd<T>(inputs: Inputs.Lists.RemoveItemAtIndexDto<T>): T[];
|
|
251
|
+
/**
|
|
252
|
+
* Removes items at multiple specified positions from the list.
|
|
253
|
+
* Example: From [10, 20, 30, 40, 50], removing indexes [1, 3] gives [10, 30, 50]
|
|
155
254
|
* @param inputs a list and indexes
|
|
156
255
|
* @returns list with removed items
|
|
157
256
|
* @group remove
|
|
@@ -160,7 +259,8 @@ export declare class Lists {
|
|
|
160
259
|
*/
|
|
161
260
|
removeItemsAtIndexes<T>(inputs: Inputs.Lists.RemoveItemsAtIndexesDto<T>): T[];
|
|
162
261
|
/**
|
|
163
|
-
*
|
|
262
|
+
* Clears all items from the list, resulting in an empty list.
|
|
263
|
+
* Example: From [10, 20, 30, 40], returns []
|
|
164
264
|
* @param inputs a list
|
|
165
265
|
* @returns The length is set to 0 and same array memory object is returned
|
|
166
266
|
* @group remove
|
|
@@ -169,7 +269,8 @@ export declare class Lists {
|
|
|
169
269
|
*/
|
|
170
270
|
removeAllItems<T>(inputs: Inputs.Lists.ListDto<T>): T[];
|
|
171
271
|
/**
|
|
172
|
-
*
|
|
272
|
+
* Removes every nth item from the list, starting from an optional offset position.
|
|
273
|
+
* Example: From [0, 1, 2, 3, 4, 5, 6, 7, 8] with nth=3 and offset=0, returns [1, 2, 4, 5, 7, 8] (removes 0, 3, 6)
|
|
173
274
|
* @param inputs a list and index
|
|
174
275
|
* @returns list with removed item
|
|
175
276
|
* @group remove
|
|
@@ -178,7 +279,8 @@ export declare class Lists {
|
|
|
178
279
|
*/
|
|
179
280
|
removeNthItem<T>(inputs: Inputs.Lists.RemoveNthItemDto<T>): T[];
|
|
180
281
|
/**
|
|
181
|
-
*
|
|
282
|
+
* Randomly removes items from the list based on a probability threshold (0 to 1).
|
|
283
|
+
* Example: From [1, 2, 3, 4, 5] with threshold 0.5, might return [2, 4] (50% chance to remove each item)
|
|
182
284
|
* @param inputs a list and a threshold for randomization of items to remove
|
|
183
285
|
* @returns list with removed items
|
|
184
286
|
* @group remove
|
|
@@ -187,16 +289,18 @@ export declare class Lists {
|
|
|
187
289
|
*/
|
|
188
290
|
randomRemoveThreshold<T>(inputs: Inputs.Lists.RandomThresholdDto<T>): T[];
|
|
189
291
|
/**
|
|
190
|
-
*
|
|
292
|
+
* Removes duplicate numbers from the list, keeping only the first occurrence of each value.
|
|
293
|
+
* Example: From [1, 2, 3, 2, 4, 3, 5], returns [1, 2, 3, 4, 5]
|
|
191
294
|
* @param inputs a list of numbers
|
|
192
295
|
* @returns list with unique numbers
|
|
193
296
|
* @group remove
|
|
194
|
-
* @shortname remove
|
|
297
|
+
* @shortname remove duplicate numbers
|
|
195
298
|
* @drawable false
|
|
196
299
|
*/
|
|
197
300
|
removeDuplicateNumbers(inputs: Inputs.Lists.RemoveDuplicatesDto<number>): number[];
|
|
198
301
|
/**
|
|
199
|
-
*
|
|
302
|
+
* Removes duplicate numbers that are within a specified tolerance range of each other.
|
|
303
|
+
* Example: From [1.0, 1.001, 2.0, 2.002, 3.0] with tolerance 0.01, returns [1.0, 2.0, 3.0]
|
|
200
304
|
* @param inputs a list of numbers and the tolerance
|
|
201
305
|
* @returns list with unique numbers
|
|
202
306
|
* @group remove
|
|
@@ -205,7 +309,18 @@ export declare class Lists {
|
|
|
205
309
|
*/
|
|
206
310
|
removeDuplicateNumbersTolerance(inputs: Inputs.Lists.RemoveDuplicatesToleranceDto<number>): number[];
|
|
207
311
|
/**
|
|
208
|
-
*
|
|
312
|
+
* Removes duplicate items from the list using strict equality comparison (works with any type).
|
|
313
|
+
* Example: From ['a', 'b', 'c', 'a', 'd', 'b'], returns ['a', 'b', 'c', 'd']
|
|
314
|
+
* @param inputs a list
|
|
315
|
+
* @returns list with unique items
|
|
316
|
+
* @group remove
|
|
317
|
+
* @shortname remove duplicates
|
|
318
|
+
* @drawable false
|
|
319
|
+
*/
|
|
320
|
+
removeDuplicates<T>(inputs: Inputs.Lists.RemoveDuplicatesDto<T>): T[];
|
|
321
|
+
/**
|
|
322
|
+
* Appends an item to the end of the list.
|
|
323
|
+
* Example: To [10, 20, 30], adding 40 gives [10, 20, 30, 40]
|
|
209
324
|
* @param inputs a list and an item
|
|
210
325
|
* @returns list with added item
|
|
211
326
|
* @group add
|
|
@@ -214,7 +329,8 @@ export declare class Lists {
|
|
|
214
329
|
*/
|
|
215
330
|
addItem<T>(inputs: Inputs.Lists.AddItemDto<T>): T[];
|
|
216
331
|
/**
|
|
217
|
-
*
|
|
332
|
+
* Adds an item to the beginning of the list.
|
|
333
|
+
* Example: To [10, 20, 30], prepending 5 gives [5, 10, 20, 30]
|
|
218
334
|
* @param inputs a list and an item
|
|
219
335
|
* @returns list with added item
|
|
220
336
|
* @group add
|
|
@@ -223,7 +339,8 @@ export declare class Lists {
|
|
|
223
339
|
*/
|
|
224
340
|
prependItem<T>(inputs: Inputs.Lists.AddItemDto<T>): T[];
|
|
225
341
|
/**
|
|
226
|
-
*
|
|
342
|
+
* Adds an item either at the beginning or end of the list based on the position parameter.
|
|
343
|
+
* Example: To [10, 20, 30], adding 5 at 'first' gives [5, 10, 20, 30], at 'last' gives [10, 20, 30, 5]
|
|
227
344
|
* @param inputs a list, item and an option for first or last position
|
|
228
345
|
* @returns list with added item
|
|
229
346
|
* @group add
|
|
@@ -232,7 +349,18 @@ export declare class Lists {
|
|
|
232
349
|
*/
|
|
233
350
|
addItemFirstLast<T>(inputs: Inputs.Lists.AddItemFirstLastDto<T>): T[];
|
|
234
351
|
/**
|
|
235
|
-
*
|
|
352
|
+
* Combines multiple lists into a single list by joining them end-to-end.
|
|
353
|
+
* Example: From [[1, 2], [3, 4], [5, 6]], returns [1, 2, 3, 4, 5, 6]
|
|
354
|
+
* @param inputs lists to concatenate
|
|
355
|
+
* @returns concatenated list
|
|
356
|
+
* @group add
|
|
357
|
+
* @shortname concatenate lists
|
|
358
|
+
* @drawable false
|
|
359
|
+
*/
|
|
360
|
+
concatenate<T>(inputs: Inputs.Lists.ConcatenateDto<T>): T[];
|
|
361
|
+
/**
|
|
362
|
+
* Creates a new empty list with no items.
|
|
363
|
+
* Example: Returns []
|
|
236
364
|
* @returns an empty array list
|
|
237
365
|
* @group create
|
|
238
366
|
* @shortname empty list
|
|
@@ -240,7 +368,8 @@ export declare class Lists {
|
|
|
240
368
|
*/
|
|
241
369
|
createEmptyList(): [];
|
|
242
370
|
/**
|
|
243
|
-
*
|
|
371
|
+
* Creates a new list by repeating an item a specified number of times.
|
|
372
|
+
* Example: Repeating 5 three times returns [5, 5, 5]
|
|
244
373
|
* @param inputs an item to multiply
|
|
245
374
|
* @returns list
|
|
246
375
|
* @group create
|
|
@@ -249,7 +378,8 @@ export declare class Lists {
|
|
|
249
378
|
*/
|
|
250
379
|
repeat<T>(inputs: Inputs.Lists.MultiplyItemDto<T>): T[];
|
|
251
380
|
/**
|
|
252
|
-
*
|
|
381
|
+
* Repeats a pattern of items cyclically until reaching a target list length.
|
|
382
|
+
* Example: Pattern [1, 2, 3] with length 7 returns [1, 2, 3, 1, 2, 3, 1]
|
|
253
383
|
* @param inputs a list to multiply and a length limit
|
|
254
384
|
* @returns list
|
|
255
385
|
* @group create
|
|
@@ -258,7 +388,8 @@ export declare class Lists {
|
|
|
258
388
|
*/
|
|
259
389
|
repeatInPattern<T>(inputs: Inputs.Lists.RepeatInPatternDto<T>): T[];
|
|
260
390
|
/**
|
|
261
|
-
*
|
|
391
|
+
* Sorts numbers in ascending (lowest to highest) or descending (highest to lowest) order.
|
|
392
|
+
* Example: [5, 2, 8, 1, 9] ascending returns [1, 2, 5, 8, 9], descending returns [9, 8, 5, 2, 1]
|
|
262
393
|
* @param inputs a list of numbers to sort and an option for ascending or descending order
|
|
263
394
|
* @returns list
|
|
264
395
|
* @group sorting
|
|
@@ -267,7 +398,8 @@ export declare class Lists {
|
|
|
267
398
|
*/
|
|
268
399
|
sortNumber(inputs: Inputs.Lists.SortDto<number>): number[];
|
|
269
400
|
/**
|
|
270
|
-
*
|
|
401
|
+
* Sorts text strings alphabetically in ascending (A to Z) or descending (Z to A) order.
|
|
402
|
+
* Example: ['dog', 'apple', 'cat', 'banana'] ascending returns ['apple', 'banana', 'cat', 'dog']
|
|
271
403
|
* @param inputs a list of texts to sort and an option for ascending or descending order
|
|
272
404
|
* @returns list
|
|
273
405
|
* @group sorting
|
|
@@ -276,7 +408,8 @@ export declare class Lists {
|
|
|
276
408
|
*/
|
|
277
409
|
sortTexts(inputs: Inputs.Lists.SortDto<string>): string[];
|
|
278
410
|
/**
|
|
279
|
-
*
|
|
411
|
+
* Sorts objects by comparing numeric values of a specified property.
|
|
412
|
+
* Example: [{age: 30}, {age: 20}, {age: 25}] sorted by 'age' ascending returns [{age: 20}, {age: 25}, {age: 30}]
|
|
280
413
|
* @param inputs a list to sort, a property to sort by and an option for ascending or descending order
|
|
281
414
|
* @returns list
|
|
282
415
|
* @group sorting
|
|
@@ -284,4 +417,14 @@ export declare class Lists {
|
|
|
284
417
|
* @drawable false
|
|
285
418
|
*/
|
|
286
419
|
sortByPropValue(inputs: Inputs.Lists.SortJsonDto<any>): any[];
|
|
420
|
+
/**
|
|
421
|
+
* Combines multiple lists by alternating elements from each list (first from list1, first from list2, second from list1, etc.).
|
|
422
|
+
* Example: From [[0, 1, 2], [3, 4, 5]], returns [0, 3, 1, 4, 2, 5]
|
|
423
|
+
* @param inputs Lists to interleave
|
|
424
|
+
* @returns Flattened interleaved list
|
|
425
|
+
* @group transform
|
|
426
|
+
* @shortname interleave lists
|
|
427
|
+
* @drawable false
|
|
428
|
+
*/
|
|
429
|
+
interleave<T>(inputs: Inputs.Lists.InterleaveDto<T>): T[];
|
|
287
430
|
}
|