|
1 | 1 | interface Array<T> { |
2 | | - Order: Array<Linq4JS.OrderEntry>; |
| 2 | + Order: Linq4JS.OrderEntry[]; |
3 | 3 | GroupValue: any; |
4 | 4 |
|
5 | 5 | /** |
6 | 6 | * Creates a copy of the array |
7 | 7 | */ |
8 | | - Clone(): Array<T>; |
| 8 | + Clone(): T[]; |
9 | 9 |
|
10 | 10 | /** |
11 | 11 | * Gets the index of the first item found by a filter |
|
29 | 29 | * Executes a method for each item in the array |
30 | 30 | * @param action A function (or function-string) that gets executed for each element. If it returns false the loop stops. |
31 | 31 | */ |
32 | | - ForEach(action: ((item: T, index?: number) => boolean | any) | string): Array<T>; |
| 32 | + ForEach(action: ((item: T, index?: number) => boolean | any) | string): T[]; |
33 | 33 |
|
34 | 34 | /** |
35 | 35 | * Updates an object in the array |
36 | 36 | * @param object The object to update |
37 | 37 | * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array |
38 | 38 | */ |
39 | | - Update(object: T, primaryKeySelector?: ((item: T) => any) | string): Array<T>; |
| 39 | + Update(object: T, primaryKeySelector?: ((item: T) => any) | string): T[]; |
40 | 40 |
|
41 | 41 | /** |
42 | 42 | * Updates objects in the array |
43 | 43 | * @param objects The array of objects to update |
44 | 44 | * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array |
45 | 45 | */ |
46 | | - UpdateRange(objects: Array<T>, primaryKeySelector?: ((item: T) => any) | string): Array<T>; |
| 46 | + UpdateRange(objects: T[], primaryKeySelector?: ((item: T) => any) | string): T[]; |
47 | 47 |
|
48 | 48 | /** |
49 | 49 | * Removes an object from the array |
50 | 50 | * @param object The object to remove |
51 | 51 | * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array |
52 | 52 | */ |
53 | | - Remove(object: T, primaryKeySelector?: ((item: T) => any) | string): Array<T>; |
| 53 | + Remove(object: T, primaryKeySelector?: ((item: T) => any) | string): T[]; |
54 | 54 |
|
55 | 55 | /** |
56 | 56 | * Removes objects from the array |
57 | 57 | * @param objects The array of objects to remove |
58 | 58 | * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array |
59 | 59 | */ |
60 | | - RemoveRange(objects: Array<T>, primaryKeySelector?: ((item: T) => any) | string): Array<T>; |
| 60 | + RemoveRange(objects: T[], primaryKeySelector?: ((item: T) => any) | string): T[]; |
61 | 61 |
|
62 | 62 | /** |
63 | 63 | * Adds an object to the array |
64 | 64 | * @param object The object to add |
65 | 65 | * @param generateId Auto-generate a property to identify object in later processes |
66 | 66 | */ |
67 | | - Add(object: T, generateId?: boolean): Array<T>; |
| 67 | + Add(object: T, generateId?: boolean): T[]; |
68 | 68 |
|
69 | 69 | /** |
70 | 70 | * Adds objects to the array |
71 | 71 | * @param objects The array of objects to add |
72 | 72 | */ |
73 | | - AddRange(objects: Array<T>, generateId?: boolean): Array<T>; |
| 73 | + AddRange(objects: T[], generateId?: boolean): T[]; |
74 | 74 |
|
75 | 75 | /** |
76 | 76 | * Inserts an entry at a specific position |
77 | 77 | * @param object The object to insert |
78 | 78 | * @param index The position to insert |
79 | 79 | */ |
80 | | - Insert(object: T, index: number): Array<T>; |
| 80 | + Insert(object: T, index: number): T[]; |
81 | 81 |
|
82 | 82 | /** |
83 | 83 | * Searches for all items in array that match the given filter |
84 | 84 | * @param filter A function (or function-string) that returns a boolean when matching element was found |
85 | 85 | */ |
86 | | - Where(filter: ((item: T, index?: number) => boolean) | string): Array<T>; |
| 86 | + Where(filter: ((item: T, index?: number) => boolean) | string): T[]; |
87 | 87 |
|
88 | 88 | /** |
89 | 89 | * Takes items in a specific range |
90 | 90 | * @param start The start position |
91 | 91 | * @param length The number of elements to take |
92 | 92 | */ |
93 | | - Range(start: number, length: number): Array<T>; |
| 93 | + Range(start: number, length: number): T[]; |
94 | 94 |
|
95 | 95 | /** |
96 | 96 | * Repeats an object in the array |
97 | 97 | * @param object The object to repeat |
98 | 98 | * @param count The count of repeats |
99 | 99 | */ |
100 | | - Repeat(object: T, count: number): Array<T>; |
| 100 | + Repeat(object: T, count: number): T[]; |
101 | 101 |
|
102 | 102 | /** |
103 | 103 | * Returns the length of the array |
|
151 | 151 | * Limits the number of entries taken |
152 | 152 | * @param count The count of elements taken |
153 | 153 | */ |
154 | | - Take(count: number): Array<T>; |
| 154 | + Take(count: number): T[]; |
155 | 155 |
|
156 | 156 | /** |
157 | 157 | * Takes entries as long as a condition is true |
158 | 158 | * @param condition The condition-function (or function-string) that returns a boolean. All elements until a false gets created are taken |
159 | 159 | * @param initial A initial-function (or function-string) that gets executed once at the start of the loop |
160 | 160 | * @param after A function that gets executed after every element-iteration after the condition-function was evaluated |
161 | 161 | */ |
162 | | - TakeWhile(condition: ((item: T, storage?: any) => boolean) | string, initial?: ((storage: any) => void) | string, after?: ((item: T, storage: any) => void) | string): Array<T>; |
| 162 | + TakeWhile(condition: ((item: T, storage?: any) => boolean) | string, initial?: ((storage: any) => void) | string, after?: ((item: T, storage: any) => void) | string): T[]; |
163 | 163 |
|
164 | 164 | /** |
165 | 165 | * Skips entries |
166 | 166 | * @param count The count of elements skipped |
167 | 167 | */ |
168 | | - Skip(count: number): Array<T>; |
| 168 | + Skip(count: number): T[]; |
169 | 169 |
|
170 | 170 | /** |
171 | 171 | * Orders array by property or value in ascending direction |
172 | 172 | * @param valueSelector The selector-function (or function-string) that selects the property for sorting |
173 | 173 | */ |
174 | | - OrderBy(valueSelector: ((item: T) => any) | string): Array<T>; |
| 174 | + OrderBy(valueSelector: ((item: T) => any) | string): T[]; |
175 | 175 |
|
176 | 176 | /** |
177 | 177 | * Orders array by additional properties in ascending direction in combination with OrderBy/OrderByDescending |
178 | 178 | * @param valueSelector The selector-function (or function-string) that selects the property for sorting |
179 | 179 | */ |
180 | | - ThenBy(valueSelector: ((item: T) => any) | string): Array<T>; |
| 180 | + ThenBy(valueSelector: ((item: T) => any) | string): T[]; |
181 | 181 |
|
182 | 182 | /** |
183 | 183 | * Orders array by property or value in descending direction |
184 | 184 | * @param valueSelector The selector-function (or function-string) that selects the property for sorting |
185 | 185 | */ |
186 | | - OrderByDescending(valueSelector: ((item: T) => any) | string): Array<T>; |
| 186 | + OrderByDescending(valueSelector: ((item: T) => any) | string): T[]; |
187 | 187 |
|
188 | 188 | /** |
189 | 189 | * Orders array by additional properties in descending direction in combination with OrderBy/OrderByDescending |
190 | 190 | * @param valueSelector The selector-function (or function-string) that selects the property for sorting |
191 | 191 | */ |
192 | | - ThenByDescending(valueSelector: ((item: T) => any) | string): Array<T>; |
| 192 | + ThenByDescending(valueSelector: ((item: T) => any) | string): T[]; |
193 | 193 |
|
194 | 194 | /** |
195 | 195 | * Returns the smallest element in array |
|
207 | 207 | * Groups array by property |
208 | 208 | * @param selector The selector-function (or function-string) that selects the property for grouping |
209 | 209 | */ |
210 | | - GroupBy(selector: ((item: T) => any) | string): Array<Array<T>>; |
| 210 | + GroupBy(selector: ((item: T) => any) | string): T[][]; |
211 | 211 |
|
212 | 212 | /** |
213 | 213 | * Moves an item from one index to another |
214 | 214 | * @param oldIndex The current position of the item |
215 | 215 | * @param newIndex The new position of the item |
216 | 216 | */ |
217 | | - Move(oldIndex: number, newIndex: number): Array<T>; |
| 217 | + Move(oldIndex: number, newIndex: number): T[]; |
218 | 218 |
|
219 | 219 | /** |
220 | 220 | * Makes all values unique |
221 | 221 | * @param valueSelector A selector-function (or function-string) to select property for comparison and distinction |
222 | 222 | */ |
223 | | - Distinct(valueSelector?: ((item: T) => any) | string): Array<T>; |
| 223 | + Distinct(valueSelector?: ((item: T) => any) | string): T[]; |
224 | 224 |
|
225 | 225 | /** |
226 | 226 | * Tests if array contains specific object |
|
232 | 232 | * Combines two arrays |
233 | 233 | * @param array The array to combine |
234 | 234 | */ |
235 | | - Concat(array: Array<T>): Array<T>; |
| 235 | + Concat(array: T[]): T[]; |
236 | 236 |
|
237 | 237 | /** |
238 | 238 | * Combines two arrays but only applies values that are in both arrays |
239 | 239 | * @param array The array to combine |
240 | 240 | */ |
241 | | - Intersect(array: Array<T>): Array<T>; |
| 241 | + Intersect(array: T[]): T[]; |
242 | 242 |
|
243 | 243 | /** |
244 | 244 | * Joins the entries by a given char |
|
257 | 257 | /** |
258 | 258 | * Reverses the array |
259 | 259 | */ |
260 | | - Reverse(): Array<T>; |
| 260 | + Reverse(): T[]; |
261 | 261 |
|
262 | 262 | /** |
263 | 263 | * Computes the average of the elements |
|
277 | 277 | * Compares to sequences of objects |
278 | 278 | * @param array The array to compare |
279 | 279 | */ |
280 | | - SequenceEqual(array: Array<T>): boolean; |
| 280 | + SequenceEqual(array: T[]): boolean; |
281 | 281 |
|
282 | 282 | /** |
283 | 283 | * Combines the entries of two arrays using a custom function |
284 | 284 | * @param array The array to combine |
285 | 285 | * @param result The function (or function-string) to combine elements |
286 | 286 | */ |
287 | | - Zip<T, X>(array: Array<X>, result: ((first: T, second: X) => any) | string): Array<any>; |
| 287 | + Zip<T, X>(array: X[], result: ((first: T, second: X) => any) | string): any[]; |
288 | 288 |
|
289 | 289 | /** |
290 | 290 | * Combines two arrays without duplicates |
291 | 291 | * @param array The array to combine |
292 | 292 | */ |
293 | | - Union(array: Array<T>): Array<T>; |
| 293 | + Union(array: T[]): T[]; |
294 | 294 |
|
295 | 295 | /** |
296 | 296 | * Converts the array to a dictionary |
|
0 commit comments