1 | import _ = require("../index");
|
2 | declare module "../index" {
|
3 | interface LoDashStatic {
|
4 | /**
|
5 | * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the
|
6 | * final chunk will be the remaining elements.
|
7 | *
|
8 | * @param array The array to process.
|
9 | * @param size The length of each chunk.
|
10 | * @return Returns the new array containing chunks.
|
11 | */
|
12 | chunk<T>(array: List<T> | null | undefined, size?: number): T[][];
|
13 | }
|
14 | interface Collection<T> {
|
15 | /**
|
16 | * @see _.chunk
|
17 | */
|
18 | chunk(size?: number): Collection<T[]>;
|
19 | }
|
20 | interface CollectionChain<T> {
|
21 | /**
|
22 | * @see _.chunk
|
23 | */
|
24 | chunk(size?: number): CollectionChain<T[]>;
|
25 | }
|
26 | interface LoDashStatic {
|
27 | /**
|
28 | * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are
|
29 | * falsey.
|
30 | *
|
31 | * @param array The array to compact.
|
32 | * @return Returns the new array of filtered values.
|
33 | */
|
34 | compact<T>(array: List<T | null | undefined | false | "" | 0> | null | undefined): T[];
|
35 | }
|
36 |
|
37 | type Truthy<T> = T extends null | undefined | false | "" | 0 ? never : T;
|
38 | interface Collection<T> {
|
39 | /**
|
40 | * @see _.compact
|
41 | */
|
42 | compact(): Collection<Truthy<T>>;
|
43 | }
|
44 | interface CollectionChain<T> {
|
45 | /**
|
46 | * @see _.compact
|
47 | */
|
48 | compact(): CollectionChain<Truthy<T>>;
|
49 | }
|
50 | interface LoDashStatic {
|
51 | /**
|
52 | * Creates a new array concatenating `array` with any additional arrays
|
53 | * and/or values.
|
54 | *
|
55 | * @category Array
|
56 | * @param [values] The array values to concatenate.
|
57 | * @returns Returns the new concatenated array.
|
58 | * @example
|
59 | *
|
60 | * var array = [1];
|
61 | * var other = _.concat(array, 2, [3], [[4]]);
|
62 | *
|
63 | * console.log(other);
|
64 | * // => [1, 2, 3, [4]]
|
65 | *
|
66 | * console.log(array);
|
67 | * // => [1]
|
68 | */
|
69 | concat<T>(...values: Array<Many<T>>): T[];
|
70 | }
|
71 | interface Primitive<T> {
|
72 | /**
|
73 | * @see _.concat
|
74 | */
|
75 | concat(...values: Array<Many<T>>): Collection<T>;
|
76 | }
|
77 | interface Collection<T> {
|
78 | /**
|
79 | * @see _.concat
|
80 | */
|
81 | concat(...values: Array<Many<T>>): Collection<T>;
|
82 | }
|
83 | interface Object<T> {
|
84 | /**
|
85 | * @see _.concat
|
86 | */
|
87 | concat(...values: Array<Many<T>>): Collection<T>;
|
88 | }
|
89 | interface PrimitiveChain<T> {
|
90 | /**
|
91 | * @see _.concat
|
92 | */
|
93 | concat(...values: Array<Many<T>>): CollectionChain<T>;
|
94 | }
|
95 | interface CollectionChain<T> {
|
96 | /**
|
97 | * @see _.concat
|
98 | */
|
99 | concat(...values: Array<Many<T>>): CollectionChain<T>;
|
100 | }
|
101 | interface ObjectChain<T> {
|
102 | /**
|
103 | * @see _.concat
|
104 | */
|
105 | concat(...values: Array<Many<T>>): CollectionChain<T>;
|
106 | }
|
107 | interface LoDashStatic {
|
108 | /**
|
109 | * Creates an array of `array` values not included in the other provided arrays using SameValueZero for
|
110 | * equality comparisons. The order and references of result values are determined by the first array.
|
111 | *
|
112 | * @param array The array to inspect.
|
113 | * @param values The arrays of values to exclude.
|
114 | * @return Returns the new array of filtered values.
|
115 | */
|
116 | difference<T>(array: List<T> | null | undefined, ...values: Array<List<T>>): T[];
|
117 | }
|
118 | interface Collection<T> {
|
119 | /**
|
120 | * @see _.difference
|
121 | */
|
122 | difference(...values: Array<List<T>>): Collection<T>;
|
123 | }
|
124 | interface CollectionChain<T> {
|
125 | /**
|
126 | * @see _.difference
|
127 | */
|
128 | difference(...values: Array<List<T>>): CollectionChain<T>;
|
129 | }
|
130 | interface LoDashStatic {
|
131 | /**
|
132 | * This method is like _.difference except that it accepts iteratee which is invoked for each element
|
133 | * of array and values to generate the criterion by which they're compared. The order and references
|
134 | * of result values are determined by the first array. The iteratee is invoked with one argument: (value).
|
135 | *
|
136 | * @param array The array to inspect.
|
137 | * @param values The values to exclude.
|
138 | * @param iteratee The iteratee invoked per element.
|
139 | * @returns Returns the new array of filtered values.
|
140 | */
|
141 | differenceBy<T1, T2>(array: List<T1> | null | undefined, values: List<T2>, iteratee: ValueIteratee<T1 | T2>): T1[];
|
142 | /**
|
143 | * @see _.differenceBy
|
144 | */
|
145 | differenceBy<T1, T2, T3>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, iteratee: ValueIteratee<T1 | T2 | T3>): T1[];
|
146 | /**
|
147 | * @see _.differenceBy
|
148 | */
|
149 | differenceBy<T1, T2, T3, T4>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, values3: List<T4>, iteratee: ValueIteratee<T1 | T2 | T3 | T4>): T1[];
|
150 | /**
|
151 | * @see _.differenceBy
|
152 | */
|
153 | differenceBy<T1, T2, T3, T4, T5>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, values3: List<T4>, values4: List<T5>, iteratee: ValueIteratee<T1 | T2 | T3 | T4 | T5>): T1[];
|
154 | /**
|
155 | * @see _.differenceBy
|
156 | */
|
157 | differenceBy<T1, T2, T3, T4, T5, T6>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, values3: List<T4>, values4: List<T5>, values5: List<T6>, iteratee: ValueIteratee<T1 | T2 | T3 | T4 | T5 | T6>): T1[];
|
158 | /**
|
159 | * @see _.differenceBy
|
160 | */
|
161 | differenceBy<T1, T2, T3, T4, T5, T6, T7>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, values3: List<T4>, values4: List<T5>, values5: List<T6>, ...values: Array<List<T7> | ValueIteratee<T1 | T2 | T3 | T4 | T5 | T6 | T7>>): T1[];
|
162 | /**
|
163 | * @see _.differenceBy
|
164 | */
|
165 | differenceBy<T>(array: List<T> | null | undefined, ...values: Array<List<T>>): T[];
|
166 | }
|
167 | interface Collection<T> {
|
168 | /**
|
169 | * @see _.differenceBy
|
170 | */
|
171 | differenceBy<T2>(values1: List<T2>, iteratee?: ValueIteratee<T | T2>): Collection<T>;
|
172 | /**
|
173 | * @see _.differenceBy
|
174 | */
|
175 | differenceBy(...values: Array<List<unknown> | ValueIteratee<T>>): Collection<T>;
|
176 | }
|
177 | interface CollectionChain<T> {
|
178 | /**
|
179 | * @see _.differenceBy
|
180 | */
|
181 | differenceBy<T2>(values1: List<T2>, iteratee?: ValueIteratee<T | T2>): CollectionChain<T>;
|
182 | /**
|
183 | * @see _.differenceBy
|
184 | */
|
185 | differenceBy(...values: Array<List<unknown> | ValueIteratee<T>>): CollectionChain<T>;
|
186 | }
|
187 | interface LoDashStatic {
|
188 | /**
|
189 | * This method is like _.difference except that it accepts comparator which is invoked to compare elements
|
190 | * of array to values. The order and references of result values are determined by the first array. The
|
191 | * comparator is invoked with two arguments: (arrVal, othVal).
|
192 | *
|
193 | * @category Array
|
194 | * @param [values] The arrays to inspect.
|
195 | * @param [comparator] The comparator invoked per element.
|
196 | * @returns Returns the new array of filtered values.
|
197 | * @example
|
198 | *
|
199 | * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
|
200 |
|
201 | * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
|
202 | * // => [{ 'x': 2, 'y': 1 }]
|
203 | */
|
204 | differenceWith<T1, T2>(array: List<T1> | null | undefined, values: List<T2>, comparator: Comparator2<T1, T2>): T1[];
|
205 | /**
|
206 | * @see _.differenceWith
|
207 | */
|
208 | differenceWith<T1, T2, T3>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, comparator: Comparator2<T1, T2 | T3>): T1[];
|
209 | /**
|
210 | * @see _.differenceWith
|
211 | */
|
212 | differenceWith<T1, T2, T3, T4>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, ...values: Array<List<T4> | Comparator2<T1, T2 | T3 | T4>>): T1[];
|
213 | /**
|
214 | * @see _.differenceWith
|
215 | */
|
216 | differenceWith<T>(array: List<T> | null | undefined, ...values: Array<List<T>>): T[];
|
217 | }
|
218 | interface Collection<T> {
|
219 | /**
|
220 | * @see _.differenceWith
|
221 | */
|
222 | differenceWith<T2>(values: List<T2>, comparator: Comparator2<T, T2>): Collection<T>;
|
223 | /**
|
224 | * @see _.differenceWith
|
225 | */
|
226 | differenceWith<T2, T3, T4>(...values: Array<List<unknown> | Comparator2<T, never>>): Collection<T>;
|
227 | }
|
228 | interface CollectionChain<T> {
|
229 | /**
|
230 | * @see _.differenceWith
|
231 | */
|
232 | differenceWith< T2>(values: List<T2>, comparator: Comparator2<T, T2>): CollectionChain<T>;
|
233 | /**
|
234 | * @see _.differenceWith
|
235 | */
|
236 | differenceWith< T2, T3, T4>(...values: Array<List<unknown> | Comparator2<T, never>>): CollectionChain<T>;
|
237 | }
|
238 | interface LoDashStatic {
|
239 | /**
|
240 | * Creates a slice of array with n elements dropped from the beginning.
|
241 | *
|
242 | * @param array The array to query.
|
243 | * @param n The number of elements to drop.
|
244 | * @return Returns the slice of array.
|
245 | */
|
246 | drop<T>(array: List<T> | null | undefined, n?: number): T[];
|
247 | }
|
248 | interface Collection<T> {
|
249 | /**
|
250 | * @see _.drop
|
251 | */
|
252 | drop(n?: number): Collection<T>;
|
253 | }
|
254 | interface CollectionChain<T> {
|
255 | /**
|
256 | * @see _.drop
|
257 | */
|
258 | drop(n?: number): CollectionChain<T>;
|
259 | }
|
260 | interface LoDashStatic {
|
261 | /**
|
262 | * Creates a slice of array with n elements dropped from the end.
|
263 | *
|
264 | * @param array The array to query.
|
265 | * @param n The number of elements to drop.
|
266 | * @return Returns the slice of array.
|
267 | */
|
268 | dropRight<T>(array: List<T> | null | undefined, n?: number): T[];
|
269 | }
|
270 | interface Collection<T> {
|
271 | /**
|
272 | * @see _.dropRight
|
273 | */
|
274 | dropRight(n?: number): Collection<T>;
|
275 | }
|
276 | interface CollectionChain<T> {
|
277 | /**
|
278 | * @see _.dropRight
|
279 | */
|
280 | dropRight(n?: number): CollectionChain<T>;
|
281 | }
|
282 | interface LoDashStatic {
|
283 | /**
|
284 | * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate
|
285 | * returns falsey. The predicate is invoked with three arguments: (value, index, array).
|
286 | *
|
287 | * @param array The array to query.
|
288 | * @param predicate The function invoked per iteration.
|
289 | * @return Returns the slice of array.
|
290 | */
|
291 | dropRightWhile<T>(array: List<T> | null | undefined, predicate?: ListIteratee<T>): T[];
|
292 | }
|
293 | interface Collection<T> {
|
294 | /**
|
295 | * @see _.dropRightWhile
|
296 | */
|
297 | dropRightWhile(predicate?: ListIteratee<T>): Collection<T>;
|
298 | }
|
299 | interface CollectionChain<T> {
|
300 | /**
|
301 | * @see _.dropRightWhile
|
302 | */
|
303 | dropRightWhile(predicate?: ListIteratee<T>): CollectionChain<T>;
|
304 | }
|
305 | interface LoDashStatic {
|
306 | /**
|
307 | * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate
|
308 | * returns falsey. The predicate is invoked with three arguments: (value, index, array).
|
309 | *
|
310 | * @param array The array to query.
|
311 | * @param predicate The function invoked per iteration.
|
312 | * @return Returns the slice of array.
|
313 | */
|
314 | dropWhile<T>(array: List<T> | null | undefined, predicate?: ListIteratee<T>): T[];
|
315 | }
|
316 | interface Collection<T> {
|
317 | /**
|
318 | * @see _.dropWhile
|
319 | */
|
320 | dropWhile(predicate?: ListIteratee<T>): Collection<T>;
|
321 | }
|
322 | interface CollectionChain<T> {
|
323 | /**
|
324 | * @see _.dropWhile
|
325 | */
|
326 | dropWhile(predicate?: ListIteratee<T>): CollectionChain<T>;
|
327 | }
|
328 | interface LoDashStatic {
|
329 | /**
|
330 | * Fills elements of array with value from start up to, but not including, end.
|
331 | *
|
332 | * Note: This method mutates array.
|
333 | *
|
334 | * @param array The array to fill.
|
335 | * @param value The value to fill array with.
|
336 | * @param start The start position.
|
337 | * @param end The end position.
|
338 | * @return Returns array.
|
339 | */
|
340 | fill<T>(array: any[] | null | undefined, value: T): T[];
|
341 | /**
|
342 | * @see _.fill
|
343 | */
|
344 | fill<T>(array: List<any> | null | undefined, value: T): List<T>;
|
345 | /**
|
346 | * @see _.fill
|
347 | */
|
348 | fill<T, U>(array: U[] | null | undefined, value: T, start?: number, end?: number): Array<T | U>;
|
349 | /**
|
350 | * @see _.fill
|
351 | */
|
352 | fill<T, U>(array: List<U> | null | undefined, value: T, start?: number, end?: number): List<T | U>;
|
353 | }
|
354 | interface Collection<T> {
|
355 | /**
|
356 | * @see _.fill
|
357 | */
|
358 | fill<U>(value: U, start?: number, end?: number): Collection<T | U>;
|
359 | }
|
360 | interface CollectionChain<T> {
|
361 | /**
|
362 | * @see _.fill
|
363 | */
|
364 | fill<U>(value: U, start?: number, end?: number): CollectionChain<T | U>;
|
365 | }
|
366 | interface LoDashStatic {
|
367 | /**
|
368 | * This method is like _.find except that it returns the index of the first element predicate returns truthy
|
369 | * for instead of the element itself.
|
370 | *
|
371 | * @param array The array to search.
|
372 | * @param predicate The function invoked per iteration.
|
373 | * @param fromIndex The index to search from.
|
374 | * @return Returns the index of the found element, else -1.
|
375 | */
|
376 | findIndex<T>(array: List<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): number;
|
377 | }
|
378 | interface Collection<T> {
|
379 | /**
|
380 | * @see _.findIndex
|
381 | */
|
382 | findIndex(predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): number;
|
383 | }
|
384 | interface CollectionChain<T> {
|
385 | /**
|
386 | * @see _.findIndex
|
387 | */
|
388 | findIndex(predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): PrimitiveChain<number>;
|
389 | }
|
390 | interface LoDashStatic {
|
391 | /**
|
392 | * This method is like _.findIndex except that it iterates over elements of collection from right to left.
|
393 | *
|
394 | * @param array The array to search.
|
395 | * @param predicate The function invoked per iteration.
|
396 | * @param fromIndex The index to search from.
|
397 | * @return Returns the index of the found element, else -1.
|
398 | */
|
399 | findLastIndex<T>(array: List<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): number;
|
400 | }
|
401 | interface Collection<T> {
|
402 | /**
|
403 | * @see _.findLastIndex
|
404 | */
|
405 | findLastIndex(predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): number;
|
406 | }
|
407 | interface CollectionChain<T> {
|
408 | /**
|
409 | * @see _.findLastIndex
|
410 | */
|
411 | findLastIndex(predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): PrimitiveChain<number>;
|
412 | }
|
413 | interface LoDashStatic {
|
414 | /**
|
415 | * @see _.head
|
416 | */
|
417 | first: LoDashStatic["head"];
|
418 | }
|
419 | interface String {
|
420 | /**
|
421 | * @see _.first
|
422 | */
|
423 | first(): string | undefined;
|
424 | }
|
425 | interface StringChain {
|
426 | /**
|
427 | * @see _.first
|
428 | */
|
429 | first(): StringNullableChain;
|
430 | }
|
431 | interface StringNullableChain {
|
432 | /**
|
433 | * @see _.first
|
434 | */
|
435 | first(): StringNullableChain;
|
436 | }
|
437 | interface Collection<T> {
|
438 | /**
|
439 | * @see _.first
|
440 | */
|
441 | first(): T | undefined;
|
442 | }
|
443 | interface CollectionChain<T> {
|
444 | /**
|
445 | * @see _.first
|
446 | */
|
447 | first(): ExpChain<T | undefined>;
|
448 | }
|
449 | interface RecursiveArray<T> extends Array<T|RecursiveArray<T>> {}
|
450 | interface ListOfRecursiveArraysOrValues<T> extends List<T|RecursiveArray<T>> {}
|
451 | interface LoDashStatic {
|
452 | /**
|
453 | * Flattens `array` a single level deep.
|
454 | *
|
455 | * @param array The array to flatten.
|
456 | * @return Returns the new flattened array.
|
457 | */
|
458 | flatten<T>(array: List<Many<T>> | null | undefined): T[];
|
459 | }
|
460 | interface String {
|
461 | /**
|
462 | * @see _.flatten
|
463 | */
|
464 | flatten(): Collection<string>;
|
465 | }
|
466 | interface StringChain {
|
467 | /**
|
468 | * @see _.flatten
|
469 | */
|
470 | flatten(): CollectionChain<string>;
|
471 | }
|
472 | interface StringNullableChain {
|
473 | /**
|
474 | * @see _.flatten
|
475 | */
|
476 | flatten(): CollectionChain<string>;
|
477 | }
|
478 | interface Collection<T> {
|
479 | /**
|
480 | * @see _.flatten
|
481 | */
|
482 | flatten(): T extends Many<infer U> ? Collection<U> : Collection<T>;
|
483 | }
|
484 | interface CollectionChain<T> {
|
485 | /**
|
486 | * @see _.flatten
|
487 | */
|
488 | flatten(): T extends Many<infer U> ? CollectionChain<U> : CollectionChain<T>;
|
489 | }
|
490 |
|
491 | type Flat<T> = T extends string ? T : (T extends List<any> ? never : T);
|
492 |
|
493 | interface LoDashStatic {
|
494 | /**
|
495 | * Recursively flattens a nested array.
|
496 | *
|
497 | * @param array The array to recursively flatten.
|
498 | * @return Returns the new flattened array.
|
499 | */
|
500 | flattenDeep<T>(array: ListOfRecursiveArraysOrValues<T> | null | undefined): Array<Flat<T>>;
|
501 | }
|
502 | interface Collection<T> {
|
503 | /**
|
504 | * @see _.flattenDeep
|
505 | */
|
506 | flattenDeep(): T extends ListOfRecursiveArraysOrValues<infer U> ? Collection<Flat<U>> : Collection<T>;
|
507 | }
|
508 | interface CollectionChain<T> {
|
509 | /**
|
510 | * @see _.flattenDeep
|
511 | */
|
512 | flattenDeep(): T extends ListOfRecursiveArraysOrValues<infer U> ? CollectionChain<Flat<U>> : CollectionChain<T>;
|
513 | }
|
514 | interface LoDashStatic {
|
515 | /**
|
516 | * Recursively flatten array up to depth times.
|
517 | *
|
518 | * @param array The array to recursively flatten.
|
519 | * @param number The maximum recursion depth.
|
520 | * @return Returns the new flattened array.
|
521 | */
|
522 | flattenDepth<T>(array: ListOfRecursiveArraysOrValues<T> | null | undefined, depth?: number): T[];
|
523 | }
|
524 | interface Collection<T> {
|
525 | /**
|
526 | * @see _.flattenDepth
|
527 | */
|
528 | flattenDepth(depth?: number): Collection<T>;
|
529 | }
|
530 | interface CollectionChain<T> {
|
531 | /**
|
532 | * @see _.flattenDepth
|
533 | */
|
534 | flattenDepth(depth?: number): CollectionChain<T>;
|
535 | }
|
536 | interface LoDashStatic {
|
537 | /**
|
538 | * The inverse of `_.toPairs`; this method returns an object composed
|
539 | * from key-value `pairs`.
|
540 | *
|
541 | * @category Array
|
542 | * @param pairs The key-value pairs.
|
543 | * @returns Returns the new object.
|
544 | * @example
|
545 | *
|
546 | * _.fromPairs([['fred', 30], ['barney', 40]]);
|
547 | * // => { 'fred': 30, 'barney': 40 }
|
548 | */
|
549 | fromPairs<T>(pairs: List<[PropertyName, T]> | null | undefined): Dictionary<T>;
|
550 | /**
|
551 | * @see _.fromPairs
|
552 | */
|
553 | fromPairs(pairs: List<any[]> | null | undefined): Dictionary<any>;
|
554 | }
|
555 | interface Collection<T> {
|
556 | /**
|
557 | * @see _.fromPairs
|
558 | */
|
559 | fromPairs(): Object<Dictionary<T extends [PropertyName, infer U] ? U : any>>;
|
560 | }
|
561 | interface CollectionChain<T> {
|
562 | /**
|
563 | * @see _.fromPairs
|
564 | */
|
565 | fromPairs(): ObjectChain<Dictionary<T extends [PropertyName, infer U] ? U : any>>;
|
566 | }
|
567 | interface LoDashStatic {
|
568 | /**
|
569 | * Gets the first element of array.
|
570 | *
|
571 | * @alias _.first
|
572 | *
|
573 | * @param array The array to query.
|
574 | * @return Returns the first element of array.
|
575 | */
|
576 | head<T>(array: List<T> | null | undefined): T | undefined;
|
577 | }
|
578 | interface String {
|
579 | /**
|
580 | * @see _.head
|
581 | */
|
582 | head(): string | undefined;
|
583 | }
|
584 | interface StringChain {
|
585 | /**
|
586 | * @see _.head
|
587 | */
|
588 | head(): StringNullableChain;
|
589 | }
|
590 | interface StringNullableChain {
|
591 | /**
|
592 | * @see _.head
|
593 | */
|
594 | head(): StringNullableChain;
|
595 | }
|
596 | interface Collection<T> {
|
597 | /**
|
598 | * @see _.head
|
599 | */
|
600 | head(): T | undefined;
|
601 | }
|
602 | interface CollectionChain<T> {
|
603 | /**
|
604 | * @see _.head
|
605 | */
|
606 | head(): ExpChain<T | undefined>;
|
607 | }
|
608 | interface LoDashStatic {
|
609 | /**
|
610 | * Gets the index at which the first occurrence of `value` is found in `array`
|
611 | * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
612 | * for equality comparisons. If `fromIndex` is negative, it's used as the offset
|
613 | * from the end of `array`.
|
614 | *
|
615 | * @category Array
|
616 | * @param array The array to search.
|
617 | * @param value The value to search for.
|
618 | * @param [fromIndex=0] The index to search from.
|
619 | * @returns Returns the index of the matched value, else `-1`.
|
620 | * @example
|
621 | *
|
622 | * _.indexOf([1, 2, 1, 2], 2);
|
623 | * // => 1
|
624 | *
|
625 | * // using `fromIndex`
|
626 | * _.indexOf([1, 2, 1, 2], 2, 2);
|
627 | * // => 3
|
628 | */
|
629 | indexOf<T>(array: List<T> | null | undefined, value: T, fromIndex?: number): number;
|
630 | }
|
631 | interface Collection<T> {
|
632 | /**
|
633 | * @see _.indexOf
|
634 | */
|
635 | indexOf(value: T, fromIndex?: number): number;
|
636 | }
|
637 | interface CollectionChain<T> {
|
638 | /**
|
639 | * @see _.indexOf
|
640 | */
|
641 | indexOf(value: T, fromIndex?: number): PrimitiveChain<number>;
|
642 | }
|
643 | interface LoDashStatic {
|
644 | /**
|
645 | * Gets all but the last element of array.
|
646 | *
|
647 | * @param array The array to query.
|
648 | * @return Returns the slice of array.
|
649 | */
|
650 | initial<T>(array: List<T> | null | undefined): T[];
|
651 | }
|
652 | interface Collection<T> {
|
653 | /**
|
654 | * @see _.initial
|
655 | */
|
656 | initial(): Collection<T>;
|
657 | }
|
658 | interface CollectionChain<T> {
|
659 | /**
|
660 | * @see _.initial
|
661 | */
|
662 | initial(): CollectionChain<T>;
|
663 | }
|
664 | interface LoDashStatic {
|
665 | /**
|
666 | * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for
|
667 | * equality comparisons.
|
668 | *
|
669 | * @param arrays The arrays to inspect.
|
670 | * @return Returns the new array of shared values.
|
671 | */
|
672 | intersection<T>(...arrays: Array<List<T> | null | undefined>): T[];
|
673 | }
|
674 | interface Collection<T> {
|
675 | /**
|
676 | * @see _.intersection
|
677 | */
|
678 | intersection(...arrays: Array<List<T> | null | undefined>): Collection<T>;
|
679 | }
|
680 | interface CollectionChain<T> {
|
681 | /**
|
682 | * @see _.intersection
|
683 | */
|
684 | intersection(...arrays: Array<List<T> | null | undefined>): CollectionChain<T>;
|
685 | }
|
686 | interface LoDashStatic {
|
687 | /**
|
688 | * This method is like `_.intersection` except that it accepts `iteratee`
|
689 | * which is invoked for each element of each `arrays` to generate the criterion
|
690 | * by which uniqueness is computed. The iteratee is invoked with one argument: (value).
|
691 | *
|
692 | * @category Array
|
693 | * @param [arrays] The arrays to inspect.
|
694 | * @param [iteratee=_.identity] The iteratee invoked per element.
|
695 | * @returns Returns the new array of shared values.
|
696 | * @example
|
697 | *
|
698 | * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
|
699 | * // => [2.1]
|
700 | *
|
701 | * // using the `_.property` iteratee shorthand
|
702 | * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
|
703 | * // => [{ 'x': 1 }]
|
704 | */
|
705 | intersectionBy<T1, T2>(array: List<T1> | null, values: List<T2>, iteratee: ValueIteratee<T1 | T2>): T1[];
|
706 | /**
|
707 | * @see _.intersectionBy
|
708 | */
|
709 | intersectionBy<T1, T2, T3>(array: List<T1> | null, values1: List<T2>, values2: List<T3>, iteratee: ValueIteratee<T1 | T2 | T3>): T1[];
|
710 | /**
|
711 | * @see _.intersectionBy
|
712 | */
|
713 | intersectionBy<T1, T2, T3, T4>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, ...values: Array<List<T4> | ValueIteratee<T1 | T2 | T3 | T4>>): T1[];
|
714 | /**
|
715 | * @see _.intersectionBy
|
716 | */
|
717 | intersectionBy<T>(array?: List<T> | null, ...values: Array<List<T>>): T[];
|
718 | /**
|
719 | * @see _.intersectionBy
|
720 | */
|
721 | intersectionBy<T>(...values: Array<List<T> | ValueIteratee<T>>): T[];
|
722 | }
|
723 | interface Collection<T> {
|
724 | /**
|
725 | * @see _.intersectionBy
|
726 | */
|
727 | intersectionBy<T2>(values: List<T2>, iteratee: ValueIteratee<T | T2>): Collection<T>;
|
728 | /**
|
729 | * @see _.intersectionBy
|
730 | */
|
731 | intersectionBy(...values: Array<List<unknown> | ValueIteratee<T>>): Collection<T>;
|
732 | }
|
733 | interface CollectionChain<T> {
|
734 | /**
|
735 | * @see _.intersectionBy
|
736 | */
|
737 | intersectionBy<T2>(values: List<T2>, iteratee: ValueIteratee<T | T2>): CollectionChain<T>;
|
738 | /**
|
739 | * @see _.intersectionBy
|
740 | */
|
741 | intersectionBy(...values: Array<List<unknown> | ValueIteratee<T>>): CollectionChain<T>;
|
742 | }
|
743 | interface LoDashStatic {
|
744 | /**
|
745 | * Creates an array of unique `array` values not included in the other
|
746 | * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
747 | * for equality comparisons.
|
748 | *
|
749 | * @category Array
|
750 | * @param [values] The arrays to inspect.
|
751 | * @param [comparator] The comparator invoked per element.
|
752 | * @returns Returns the new array of filtered values.
|
753 | * @example
|
754 | *
|
755 | * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
|
756 | * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
|
757 |
|
758 | * _.intersectionWith(objects, others, _.isEqual);
|
759 | * // => [{ 'x': 1, 'y': 2 }]
|
760 | */
|
761 | intersectionWith<T1, T2>(array: List<T1> | null | undefined, values: List<T2>, comparator: Comparator2<T1, T2>): T1[];
|
762 | /**
|
763 | * @see _.intersectionWith
|
764 | */
|
765 | intersectionWith<T1, T2, T3>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, comparator: Comparator2<T1, T2 | T3>): T1[];
|
766 | /**
|
767 | * @see _.intersectionWith
|
768 | */
|
769 | intersectionWith<T1, T2, T3, T4>(array: List<T1> | null | undefined, values1: List<T2>, values2: List<T3>, ...values: Array<List<T4> | Comparator2<T1, T2 | T3 | T4>>): T1[];
|
770 | /**
|
771 | * @see _.intersectionWith
|
772 | */
|
773 | intersectionWith<T>(array?: List<T> | null, ...values: Array<List<T> | Comparator2<T, never>>): T[];
|
774 | }
|
775 | interface Collection<T> {
|
776 | /**
|
777 | * @see _.intersectionWith
|
778 | */
|
779 | intersectionWith<T2>(values: List<T2>, comparator: Comparator2<T, T2>): Collection<T>;
|
780 | /**
|
781 | * @see _.intersectionWith
|
782 | */
|
783 | intersectionWith(...values: Array<List<unknown> | Comparator2<T, never>>): Collection<T>;
|
784 | }
|
785 | interface CollectionChain<T> {
|
786 | /**
|
787 | * @see _.intersectionWith
|
788 | */
|
789 | intersectionWith<T2>(values: List<T2>, comparator: Comparator2<T, T2>): CollectionChain<T>;
|
790 | /**
|
791 | * @see _.intersectionWith
|
792 | */
|
793 | intersectionWith(...values: Array<List<unknown> | Comparator2<T, never>>): CollectionChain<T>;
|
794 | }
|
795 | interface LoDashStatic {
|
796 | /**
|
797 | * Converts all elements in `array` into a string separated by `separator`.
|
798 | *
|
799 | * @param array The array to convert.
|
800 | * @param separator The element separator.
|
801 | * @returns Returns the joined string.
|
802 | */
|
803 | join(array: List<any> | null | undefined, separator?: string): string;
|
804 | }
|
805 | interface String {
|
806 | /**
|
807 | * @see _.join
|
808 | */
|
809 | join(separator?: string): string;
|
810 | }
|
811 | interface StringChain {
|
812 | /**
|
813 | * @see _.join
|
814 | */
|
815 | join(separator?: string): StringChain;
|
816 | }
|
817 | interface StringNullableChain {
|
818 | /**
|
819 | * @see _.join
|
820 | */
|
821 | join(separator?: string): StringChain;
|
822 | }
|
823 | interface Collection<T> {
|
824 | /**
|
825 | * @see _.join
|
826 | */
|
827 | join(separator?: string): string;
|
828 | }
|
829 | interface CollectionChain<T> {
|
830 | /**
|
831 | * @see _.join
|
832 | */
|
833 | join(separator?: string): StringChain;
|
834 | }
|
835 | interface LoDashStatic {
|
836 | /**
|
837 | * Gets the last element of array.
|
838 | *
|
839 | * @param array The array to query.
|
840 | * @return Returns the last element of array.
|
841 | */
|
842 | last<T>(array: List<T> | null | undefined): T | undefined;
|
843 | }
|
844 | interface Collection<T> {
|
845 | /**
|
846 | * @see _.last
|
847 | */
|
848 | last(): T | undefined;
|
849 | }
|
850 | interface CollectionChain<T> {
|
851 | /**
|
852 | * @see _.last
|
853 | */
|
854 | last(): ExpChain<T | undefined>;
|
855 | }
|
856 | interface String {
|
857 | /**
|
858 | * @see _.last
|
859 | */
|
860 | last(): string | undefined;
|
861 | }
|
862 | interface StringChain {
|
863 | /**
|
864 | * @see _.last
|
865 | */
|
866 | last(): StringNullableChain;
|
867 | }
|
868 | interface StringNullableChain {
|
869 | /**
|
870 | * @see _.last
|
871 | */
|
872 | last(): StringNullableChain;
|
873 | }
|
874 | interface LoDashStatic {
|
875 | /**
|
876 | * This method is like _.indexOf except that it iterates over elements of array from right to left.
|
877 | *
|
878 | * @param array The array to search.
|
879 | * @param value The value to search for.
|
880 | * @param fromIndex The index to search from or true to perform a binary search on a sorted array.
|
881 | * @return Returns the index of the matched value, else -1.
|
882 | */
|
883 | lastIndexOf<T>(array: List<T> | null | undefined, value: T, fromIndex?: true|number): number;
|
884 | }
|
885 | interface Collection<T> {
|
886 | /**
|
887 | * @see _.lastIndexOf
|
888 | */
|
889 | lastIndexOf(value: T, fromIndex?: true|number): number;
|
890 | }
|
891 | interface CollectionChain<T> {
|
892 | /**
|
893 | * @see _.lastIndexOf
|
894 | */
|
895 | lastIndexOf(value: T, fromIndex?: true|number): PrimitiveChain<number>;
|
896 | }
|
897 | interface LoDashStatic {
|
898 | /**
|
899 | * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned.
|
900 | *
|
901 | * @param array array The array to query.
|
902 | * @param value The index of the element to return.
|
903 | * @return Returns the nth element of `array`.
|
904 | */
|
905 | nth<T>(array: List<T> | null | undefined, n?: number): T | undefined;
|
906 | }
|
907 | interface Collection<T> {
|
908 | /**
|
909 | * @see _.nth
|
910 | */
|
911 | nth(n?: number): T | undefined;
|
912 | }
|
913 | interface CollectionChain<T> {
|
914 | /**
|
915 | * @see _.nth
|
916 | */
|
917 | nth(n?: number): ExpChain<T | undefined>;
|
918 | }
|
919 | interface LoDashStatic {
|
920 | /**
|
921 | * Removes all provided values from array using SameValueZero for equality comparisons.
|
922 | *
|
923 | * Note: Unlike _.without, this method mutates array.
|
924 | *
|
925 | * @param array The array to modify.
|
926 | * @param values The values to remove.
|
927 | * @return Returns array.
|
928 | */
|
929 | pull<T>(array: T[], ...values: T[]): T[];
|
930 | /**
|
931 | * @see _.pull
|
932 | */
|
933 | pull<T>(array: List<T>, ...values: T[]): List<T>;
|
934 | }
|
935 | interface Collection<T> {
|
936 | /**
|
937 | * @see _.pull
|
938 | */
|
939 | pull(...values: T[]): Collection<T>;
|
940 | }
|
941 | interface CollectionChain<T> {
|
942 | /**
|
943 | * @see _.pull
|
944 | */
|
945 | pull(...values: T[]): CollectionChain<T>;
|
946 | }
|
947 | interface LoDashStatic {
|
948 | /**
|
949 | * This method is like `_.pull` except that it accepts an array of values to remove.
|
950 | *
|
951 | * **Note:** Unlike `_.difference`, this method mutates `array`.
|
952 | *
|
953 | * @category Array
|
954 | * @param array The array to modify.
|
955 | * @param values The values to remove.
|
956 | * @returns Returns `array`.
|
957 | * @example
|
958 | *
|
959 | * var array = [1, 2, 3, 1, 2, 3];
|
960 | *
|
961 | * _.pull(array, [2, 3]);
|
962 | * console.log(array);
|
963 | * // => [1, 1]
|
964 | */
|
965 | pullAll<T>(array: T[], values?: List<T>): T[];
|
966 | /**
|
967 | * @see _.pullAll
|
968 | */
|
969 | pullAll<T>(array: List<T>, values?: List<T>): List<T>;
|
970 | }
|
971 | interface Collection<T> {
|
972 | /**
|
973 | * @see _.pullAll
|
974 | */
|
975 | pullAll(values?: List<T>): Collection<T>;
|
976 | }
|
977 | interface CollectionChain<T> {
|
978 | /**
|
979 | * @see _.pullAll
|
980 | */
|
981 | pullAll(values?: List<T>): CollectionChain<T>;
|
982 | }
|
983 | interface LoDashStatic {
|
984 | /**
|
985 | * This method is like `_.pullAll` except that it accepts `iteratee` which is
|
986 | * invoked for each element of `array` and `values` to to generate the criterion
|
987 | * by which uniqueness is computed. The iteratee is invoked with one argument: (value).
|
988 | *
|
989 | * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
|
990 | *
|
991 | * @category Array
|
992 | * @param array The array to modify.
|
993 | * @param values The values to remove.
|
994 | * @param [iteratee=_.identity] The iteratee invoked per element.
|
995 | * @returns Returns `array`.
|
996 | * @example
|
997 | *
|
998 | * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
|
999 | *
|
1000 | * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
|
1001 | * console.log(array);
|
1002 | * // => [{ 'x': 2 }]
|
1003 | */
|
1004 | pullAllBy<T>(array: T[], values?: List<T>, iteratee?: ValueIteratee<T>): T[];
|
1005 | /**
|
1006 | * @see _.pullAllBy
|
1007 | */
|
1008 | pullAllBy<T>(array: List<T>, values?: List<T>, iteratee?: ValueIteratee<T>): List<T>;
|
1009 | /**
|
1010 | * @see _.pullAllBy
|
1011 | */
|
1012 | pullAllBy<T1, T2>(array: T1[], values: List<T2>, iteratee: ValueIteratee<T1 | T2>): T1[];
|
1013 | /**
|
1014 | * @see _.pullAllBy
|
1015 | */
|
1016 | pullAllBy<T1, T2>(array: List<T1>, values: List<T2>, iteratee: ValueIteratee<T1 | T2>): List<T1>;
|
1017 | }
|
1018 | interface Collection<T> {
|
1019 | /**
|
1020 | * @see _.pullAllBy
|
1021 | */
|
1022 | pullAllBy<T2>(values?: List<T2>, iteratee?: ValueIteratee<T | T2>): Collection<T>;
|
1023 | }
|
1024 | interface CollectionChain<T> {
|
1025 | /**
|
1026 | * @see _.pullAllBy
|
1027 | */
|
1028 | pullAllBy<T2>(values?: List<T2>, iteratee?: ValueIteratee<T | T2>): CollectionChain<T>;
|
1029 | }
|
1030 | interface LoDashStatic {
|
1031 | /**
|
1032 | * This method is like `_.pullAll` except that it accepts `comparator` which is
|
1033 | * invoked to compare elements of array to values. The comparator is invoked with
|
1034 | * two arguments: (arrVal, othVal).
|
1035 | *
|
1036 | * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
|
1037 | *
|
1038 | * @category Array
|
1039 | * @param array The array to modify.
|
1040 | * @param values The values to remove.
|
1041 | * @param [iteratee=_.identity] The iteratee invoked per element.
|
1042 | * @returns Returns `array`.
|
1043 | * @example
|
1044 | *
|
1045 | * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
|
1046 | *
|
1047 | * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
|
1048 | * console.log(array);
|
1049 | * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
|
1050 | */
|
1051 | pullAllWith<T>(array: T[], values?: List<T>, comparator?: Comparator<T>): T[];
|
1052 | /**
|
1053 | * @see _.pullAllWith
|
1054 | */
|
1055 | pullAllWith<T>(array: List<T>, values?: List<T>, comparator?: Comparator<T>): List<T>;
|
1056 | /**
|
1057 | * @see _.pullAllWith
|
1058 | */
|
1059 | pullAllWith<T1, T2>(array: T1[], values: List<T2>, comparator: Comparator2<T1, T2>): T1[];
|
1060 | /**
|
1061 | * @see _.pullAllWith
|
1062 | */
|
1063 | pullAllWith<T1, T2>(array: List<T1>, values: List<T2>, comparator: Comparator2<T1, T2>): List<T1>;
|
1064 | }
|
1065 | interface Collection<T> {
|
1066 | /**
|
1067 | * @see _.pullAllWith
|
1068 | */
|
1069 | pullAllWith<T2>(values?: List<T2>, comparator?: Comparator2<T, T2>): Collection<T>;
|
1070 | }
|
1071 | interface CollectionChain<T> {
|
1072 | /**
|
1073 | * @see _.pullAllWith
|
1074 | */
|
1075 | pullAllWith<T2>(values?: List<T2>, comparator?: Comparator2<T, T2>): CollectionChain<T>;
|
1076 | }
|
1077 | interface LoDashStatic {
|
1078 | /**
|
1079 | * Removes elements from array corresponding to the given indexes and returns an array of the removed elements.
|
1080 | * Indexes may be specified as an array of indexes or as individual arguments.
|
1081 | *
|
1082 | * Note: Unlike _.at, this method mutates array.
|
1083 | *
|
1084 | * @param array The array to modify.
|
1085 | * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes.
|
1086 | * @return Returns the new array of removed elements.
|
1087 | */
|
1088 | pullAt<T>(array: T[], ...indexes: Array<Many<number>>): T[];
|
1089 | /**
|
1090 | * @see _.pullAt
|
1091 | */
|
1092 | pullAt<T>(array: List<T>, ...indexes: Array<Many<number>>): List<T>;
|
1093 | }
|
1094 | interface Collection<T> {
|
1095 | /**
|
1096 | * @see _.pullAt
|
1097 | */
|
1098 | pullAt(...indexes: Array<Many<number>>): Collection<T>;
|
1099 | }
|
1100 | interface CollectionChain<T> {
|
1101 | /**
|
1102 | * @see _.pullAt
|
1103 | */
|
1104 | pullAt(...indexes: Array<Many<number>>): CollectionChain<T>;
|
1105 | }
|
1106 | interface LoDashStatic {
|
1107 | /**
|
1108 | * Removes all elements from array that predicate returns truthy for and returns an array of the removed
|
1109 | * elements. The predicate is invoked with three arguments: (value, index, array).
|
1110 | *
|
1111 | * Note: Unlike _.filter, this method mutates array.
|
1112 | *
|
1113 | * @param array The array to modify.
|
1114 | * @param predicate The function invoked per iteration.
|
1115 | * @return Returns the new array of removed elements.
|
1116 | */
|
1117 | remove<T>(array: List<T>, predicate?: ListIteratee<T>): T[];
|
1118 | }
|
1119 | interface Collection<T> {
|
1120 | /**
|
1121 | * @see _.remove
|
1122 | */
|
1123 | remove(predicate?: ListIteratee<T>): Collection<T>;
|
1124 | }
|
1125 | interface CollectionChain<T> {
|
1126 | /**
|
1127 | * @see _.remove
|
1128 | */
|
1129 | remove(predicate?: ListIteratee<T>): CollectionChain<T>;
|
1130 | }
|
1131 | interface LoDashStatic {
|
1132 | /**
|
1133 | * Reverses `array` so that the first element becomes the last, the second
|
1134 | * element becomes the second to last, and so on.
|
1135 | *
|
1136 | * **Note:** This method mutates `array` and is based on
|
1137 | * [`Array#reverse`](https://mdn.io/Array/reverse).
|
1138 | *
|
1139 | * @category Array
|
1140 | * @returns Returns `array`.
|
1141 | * @example
|
1142 | *
|
1143 | * var array = [1, 2, 3];
|
1144 | *
|
1145 | * _.reverse(array);
|
1146 | * // => [3, 2, 1]
|
1147 | *
|
1148 | * console.log(array);
|
1149 | * // => [3, 2, 1]
|
1150 | */
|
1151 | reverse<TList extends List<any>>(array: TList): TList;
|
1152 | }
|
1153 | interface LoDashStatic {
|
1154 | /**
|
1155 | * Creates a slice of array from start up to, but not including, end.
|
1156 | *
|
1157 | * @param array The array to slice.
|
1158 | * @param start The start position.
|
1159 | * @param end The end position.
|
1160 | * @return Returns the slice of array.
|
1161 | */
|
1162 | slice<T>(array: List<T> | null | undefined, start?: number, end?: number): T[];
|
1163 | }
|
1164 | interface Collection<T> {
|
1165 | /**
|
1166 | * @see _.slice
|
1167 | */
|
1168 | slice(start?: number, end?: number): Collection<T>;
|
1169 | }
|
1170 | interface CollectionChain<T> {
|
1171 | /**
|
1172 | * @see _.slice
|
1173 | */
|
1174 | slice(start?: number, end?: number): CollectionChain<T>;
|
1175 | }
|
1176 | interface LoDashStatic {
|
1177 | /**
|
1178 | * Uses a binary search to determine the lowest index at which `value` should
|
1179 | * be inserted into `array` in order to maintain its sort order.
|
1180 | *
|
1181 | * @category Array
|
1182 | * @param array The sorted array to inspect.
|
1183 | * @param value The value to evaluate.
|
1184 | * @returns Returns the index at which `value` should be inserted into `array`.
|
1185 | * @example
|
1186 | *
|
1187 | * _.sortedIndex([30, 50], 40);
|
1188 | * // => 1
|
1189 | *
|
1190 | * _.sortedIndex([4, 5], 4);
|
1191 | * // => 0
|
1192 | */
|
1193 | sortedIndex<T>(array: List<T> | null | undefined, value: T): number;
|
1194 | }
|
1195 | interface Collection<T> {
|
1196 | /**
|
1197 | * @see _.sortedIndex
|
1198 | */
|
1199 | sortedIndex(value: T): number;
|
1200 | }
|
1201 | interface CollectionChain<T> {
|
1202 | /**
|
1203 | * @see _.sortedIndex
|
1204 | */
|
1205 | sortedIndex(value: T): PrimitiveChain<number>;
|
1206 | }
|
1207 | interface LoDashStatic {
|
1208 | /**
|
1209 | * Uses a binary search to determine the lowest index at which `value` should
|
1210 | * be inserted into `array` in order to maintain its sort order.
|
1211 | *
|
1212 | * @category Array
|
1213 | * @param array The sorted array to inspect.
|
1214 | * @param value The value to evaluate.
|
1215 | * @returns Returns the index at which `value` should be inserted into `array`.
|
1216 | * @example
|
1217 | *
|
1218 | * _.sortedIndex([30, 50], 40);
|
1219 | * // => 1
|
1220 | *
|
1221 | * _.sortedIndex([4, 5], 4);
|
1222 | * // => 0
|
1223 | */
|
1224 | sortedIndex<T>(array: List<T> | null | undefined, value: T): number;
|
1225 | }
|
1226 | interface Collection<T> {
|
1227 | /**
|
1228 | * @see _.sortedIndex
|
1229 | */
|
1230 | sortedIndex(value: T): number;
|
1231 | }
|
1232 | interface CollectionChain<T> {
|
1233 | /**
|
1234 | * @see _.sortedIndex
|
1235 | */
|
1236 | sortedIndex(value: T): PrimitiveChain<number>;
|
1237 | }
|
1238 | interface LoDashStatic {
|
1239 | /**
|
1240 | * This method is like `_.sortedIndex` except that it accepts `iteratee`
|
1241 | * which is invoked for `value` and each element of `array` to compute their
|
1242 | * sort ranking. The iteratee is invoked with one argument: (value).
|
1243 | *
|
1244 | * @category Array
|
1245 | * @param array The sorted array to inspect.
|
1246 | * @param value The value to evaluate.
|
1247 | * @param [iteratee=_.identity] The iteratee invoked per element.
|
1248 | * @returns Returns the index at which `value` should be inserted into `array`.
|
1249 | * @example
|
1250 | *
|
1251 | * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
|
1252 | *
|
1253 | * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
|
1254 | * // => 1
|
1255 | *
|
1256 | * // using the `_.property` iteratee shorthand
|
1257 | * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
|
1258 | * // => 0
|
1259 | */
|
1260 | sortedIndexBy<T>(array: List<T> | null | undefined, value: T, iteratee?: ValueIteratee<T>): number;
|
1261 | }
|
1262 | interface Collection<T> {
|
1263 | /**
|
1264 | * @see _.sortedIndexBy
|
1265 | */
|
1266 | sortedIndexBy(value: T, iteratee?: ValueIteratee<T>): number;
|
1267 | }
|
1268 | interface CollectionChain<T> {
|
1269 | /**
|
1270 | * @see _.sortedIndexBy
|
1271 | */
|
1272 | sortedIndexBy(value: T, iteratee?: ValueIteratee<T>): PrimitiveChain<number>;
|
1273 | }
|
1274 | interface LoDashStatic {
|
1275 | /**
|
1276 | * This method is like `_.indexOf` except that it performs a binary
|
1277 | * search on a sorted `array`.
|
1278 | *
|
1279 | * @category Array
|
1280 | * @param array The array to search.
|
1281 | * @param value The value to search for.
|
1282 | * @returns Returns the index of the matched value, else `-1`.
|
1283 | * @example
|
1284 | *
|
1285 | * _.sortedIndexOf([1, 1, 2, 2], 2);
|
1286 | * // => 2
|
1287 | */
|
1288 | sortedIndexOf<T>(array: List<T> | null | undefined, value: T): number;
|
1289 | }
|
1290 | interface Collection<T> {
|
1291 | /**
|
1292 | * @see _.sortedIndexOf
|
1293 | */
|
1294 | sortedIndexOf(value: T): number;
|
1295 | }
|
1296 | interface CollectionChain<T> {
|
1297 | /**
|
1298 | * @see _.sortedIndexOf
|
1299 | */
|
1300 | sortedIndexOf(value: T): PrimitiveChain<number>;
|
1301 | }
|
1302 | interface LoDashStatic {
|
1303 | /**
|
1304 | * This method is like `_.sortedIndex` except that it returns the highest
|
1305 | * index at which `value` should be inserted into `array` in order to
|
1306 | * maintain its sort order.
|
1307 | *
|
1308 | * @category Array
|
1309 | * @param array The sorted array to inspect.
|
1310 | * @param value The value to evaluate.
|
1311 | * @returns Returns the index at which `value` should be inserted into `array`.
|
1312 | * @example
|
1313 | *
|
1314 | * _.sortedLastIndex([4, 5], 4);
|
1315 | * // => 1
|
1316 | */
|
1317 | sortedLastIndex<T>(array: List<T> | null | undefined, value: T): number;
|
1318 | }
|
1319 | interface Collection<T> {
|
1320 | /**
|
1321 | * @see _.sortedLastIndex
|
1322 | */
|
1323 | sortedLastIndex(value: T): number;
|
1324 | }
|
1325 | interface CollectionChain<T> {
|
1326 | /**
|
1327 | * @see _.sortedLastIndex
|
1328 | */
|
1329 | sortedLastIndex(value: T): PrimitiveChain<number>;
|
1330 | }
|
1331 | interface LoDashStatic {
|
1332 | /**
|
1333 | * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
|
1334 | * which is invoked for `value` and each element of `array` to compute their
|
1335 | * sort ranking. The iteratee is invoked with one argument: (value).
|
1336 | *
|
1337 | * @category Array
|
1338 | * @param array The sorted array to inspect.
|
1339 | * @param value The value to evaluate.
|
1340 | * @param [iteratee=_.identity] The iteratee invoked per element.
|
1341 | * @returns Returns the index at which `value` should be inserted into `array`.
|
1342 | * @example
|
1343 | *
|
1344 | * // using the `_.property` iteratee shorthand
|
1345 | * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
|
1346 | * // => 1
|
1347 | */
|
1348 | sortedLastIndexBy<T>(array: List<T> | null | undefined, value: T, iteratee: ValueIteratee<T>): number;
|
1349 | }
|
1350 | interface Collection<T> {
|
1351 | /**
|
1352 | * @see _.sortedLastIndexBy
|
1353 | */
|
1354 | sortedLastIndexBy(value: T, iteratee: ValueIteratee<T>): number;
|
1355 | }
|
1356 | interface CollectionChain<T> {
|
1357 | /**
|
1358 | * @see _.sortedLastIndexBy
|
1359 | */
|
1360 | sortedLastIndexBy(value: T, iteratee: ValueIteratee<T>): PrimitiveChain<number>;
|
1361 | }
|
1362 | interface LoDashStatic {
|
1363 | /**
|
1364 | * This method is like `_.lastIndexOf` except that it performs a binary
|
1365 | * search on a sorted `array`.
|
1366 | *
|
1367 | * @category Array
|
1368 | * @param array The array to search.
|
1369 | * @param value The value to search for.
|
1370 | * @returns Returns the index of the matched value, else `-1`.
|
1371 | * @example
|
1372 | *
|
1373 | * _.sortedLastIndexOf([1, 1, 2, 2], 2);
|
1374 | * // => 3
|
1375 | */
|
1376 | sortedLastIndexOf<T>(array: List<T> | null | undefined, value: T): number;
|
1377 | }
|
1378 | interface Collection<T> {
|
1379 | /**
|
1380 | * @see _.sortedLastIndexOf
|
1381 | */
|
1382 | sortedLastIndexOf(value: T): number;
|
1383 | }
|
1384 | interface CollectionChain<T> {
|
1385 | /**
|
1386 | * @see _.sortedLastIndexOf
|
1387 | */
|
1388 | sortedLastIndexOf(value: T): PrimitiveChain<number>;
|
1389 | }
|
1390 | interface LoDashStatic {
|
1391 | /**
|
1392 | * This method is like `_.uniq` except that it's designed and optimized
|
1393 | * for sorted arrays.
|
1394 | *
|
1395 | * @category Array
|
1396 | * @param array The array to inspect.
|
1397 | * @returns Returns the new duplicate free array.
|
1398 | * @example
|
1399 | *
|
1400 | * _.sortedUniq([1, 1, 2]);
|
1401 | * // => [1, 2]
|
1402 | */
|
1403 | sortedUniq<T>(array: List<T> | null | undefined): T[];
|
1404 | }
|
1405 | interface Collection<T> {
|
1406 | /**
|
1407 | * @see _.sortedUniq
|
1408 | */
|
1409 | sortedUniq(): Collection<T>;
|
1410 | }
|
1411 | interface CollectionChain<T> {
|
1412 | /**
|
1413 | * @see _.sortedUniq
|
1414 | */
|
1415 | sortedUniq(): CollectionChain<T>;
|
1416 | }
|
1417 | interface LoDashStatic {
|
1418 | /**
|
1419 | * This method is like `_.uniqBy` except that it's designed and optimized
|
1420 | * for sorted arrays.
|
1421 | *
|
1422 | * @category Array
|
1423 | * @param array The array to inspect.
|
1424 | * @param [iteratee] The iteratee invoked per element.
|
1425 | * @returns Returns the new duplicate free array.
|
1426 | * @example
|
1427 | *
|
1428 | * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
|
1429 | * // => [1.1, 2.3]
|
1430 | */
|
1431 | sortedUniqBy<T>(array: List<T> | null | undefined, iteratee: ValueIteratee<T>): T[];
|
1432 | }
|
1433 | interface Collection<T> {
|
1434 | /**
|
1435 | * @see _.sortedUniqBy
|
1436 | */
|
1437 | sortedUniqBy(iteratee: ValueIteratee<T>): Collection<T>;
|
1438 | }
|
1439 | interface CollectionChain<T> {
|
1440 | /**
|
1441 | * @see _.sortedUniqBy
|
1442 | */
|
1443 | sortedUniqBy(iteratee: ValueIteratee<T>): CollectionChain<T>;
|
1444 | }
|
1445 | interface LoDashStatic {
|
1446 | /**
|
1447 | * Gets all but the first element of array.
|
1448 | *
|
1449 | * @param array The array to query.
|
1450 | * @return Returns the slice of array.
|
1451 | */
|
1452 | tail<T>(array: List<T> | null | undefined): T[];
|
1453 | }
|
1454 | interface Collection<T> {
|
1455 | /**
|
1456 | * @see _.tail
|
1457 | */
|
1458 | tail(): Collection<T>;
|
1459 | }
|
1460 | interface CollectionChain<T> {
|
1461 | /**
|
1462 | * @see _.tail
|
1463 | */
|
1464 | tail(): CollectionChain<T>;
|
1465 | }
|
1466 | interface LoDashStatic {
|
1467 | /**
|
1468 | * Creates a slice of array with n elements taken from the beginning.
|
1469 | *
|
1470 | * @param array The array to query.
|
1471 | * @param n The number of elements to take.
|
1472 | * @return Returns the slice of array.
|
1473 | */
|
1474 | take<T>(array: List<T> | null | undefined, n?: number): T[];
|
1475 | }
|
1476 | interface Collection<T> {
|
1477 | /**
|
1478 | * @see _.take
|
1479 | */
|
1480 | take(n?: number): Collection<T>;
|
1481 | }
|
1482 | interface CollectionChain<T> {
|
1483 | /**
|
1484 | * @see _.take
|
1485 | */
|
1486 | take(n?: number): CollectionChain<T>;
|
1487 | }
|
1488 | interface LoDashStatic {
|
1489 | /**
|
1490 | * Creates a slice of array with n elements taken from the end.
|
1491 | *
|
1492 | * @param array The array to query.
|
1493 | * @param n The number of elements to take.
|
1494 | * @return Returns the slice of array.
|
1495 | */
|
1496 | takeRight<T>(array: List<T> | null | undefined, n?: number): T[];
|
1497 | }
|
1498 | interface Collection<T> {
|
1499 | /**
|
1500 | * @see _.takeRight
|
1501 | */
|
1502 | takeRight(n?: number): Collection<T>;
|
1503 | }
|
1504 | interface CollectionChain<T> {
|
1505 | /**
|
1506 | * @see _.takeRight
|
1507 | */
|
1508 | takeRight(n?: number): CollectionChain<T>;
|
1509 | }
|
1510 | interface LoDashStatic {
|
1511 | /**
|
1512 | * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns
|
1513 | * falsey. The predicate is invoked with three arguments: (value, index, array).
|
1514 | *
|
1515 | * @param array The array to query.
|
1516 | * @param predicate The function invoked per iteration.
|
1517 | * @return Returns the slice of array.
|
1518 | */
|
1519 | takeRightWhile<T>(array: List<T> | null | undefined, predicate?: ListIteratee<T>): T[];
|
1520 | }
|
1521 | interface Collection<T> {
|
1522 | /**
|
1523 | * @see _.takeRightWhile
|
1524 | */
|
1525 | takeRightWhile(predicate?: ListIteratee<T>): Collection<T>;
|
1526 | }
|
1527 | interface CollectionChain<T> {
|
1528 | /**
|
1529 | * @see _.takeRightWhile
|
1530 | */
|
1531 | takeRightWhile(predicate?: ListIteratee<T>): CollectionChain<T>;
|
1532 | }
|
1533 | interface LoDashStatic {
|
1534 | /**
|
1535 | * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns
|
1536 | * falsey. The predicate is invoked with three arguments: (value, index, array).
|
1537 | *
|
1538 | * @param array The array to query.
|
1539 | * @param predicate The function invoked per iteration.
|
1540 | * @return Returns the slice of array.
|
1541 | */
|
1542 | takeWhile<T>(array: List<T> | null | undefined, predicate?: ListIteratee<T>): T[];
|
1543 | }
|
1544 | interface Collection<T> {
|
1545 | /**
|
1546 | * @see _.takeWhile
|
1547 | */
|
1548 | takeWhile(predicate?: ListIteratee<T>): Collection<T>;
|
1549 | }
|
1550 | interface CollectionChain<T> {
|
1551 | /**
|
1552 | * @see _.takeWhile
|
1553 | */
|
1554 | takeWhile(predicate?: ListIteratee<T>): CollectionChain<T>;
|
1555 | }
|
1556 | interface LoDashStatic {
|
1557 | /**
|
1558 | * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for
|
1559 | * equality comparisons.
|
1560 | *
|
1561 | * @param arrays The arrays to inspect.
|
1562 | * @return Returns the new array of combined values.
|
1563 | */
|
1564 | union<T>(...arrays: Array<List<T> | null | undefined>): T[];
|
1565 | }
|
1566 | interface Collection<T> {
|
1567 | /**
|
1568 | * @see _.union
|
1569 | */
|
1570 | union(...arrays: Array<List<T> | null | undefined>): Collection<T>;
|
1571 | }
|
1572 | interface CollectionChain<T> {
|
1573 | /**
|
1574 | * @see _.union
|
1575 | */
|
1576 | union(...arrays: Array<List<T> | null | undefined>): CollectionChain<T>;
|
1577 | }
|
1578 | interface LoDashStatic {
|
1579 | /**
|
1580 | * This method is like `_.union` except that it accepts `iteratee` which is
|
1581 | * invoked for each element of each `arrays` to generate the criterion by which
|
1582 | * uniqueness is computed. The iteratee is invoked with one argument: (value).
|
1583 | *
|
1584 | * @param arrays The arrays to inspect.
|
1585 | * @param iteratee The iteratee invoked per element.
|
1586 | * @return Returns the new array of combined values.
|
1587 | */
|
1588 | unionBy<T>(arrays: List<T> | null | undefined, iteratee?: ValueIteratee<T>): T[];
|
1589 | /**
|
1590 | * @see _.unionBy
|
1591 | */
|
1592 | unionBy<T>(arrays1: List<T> | null | undefined, arrays2: List<T> | null | undefined, iteratee?: ValueIteratee<T>): T[];
|
1593 | /**
|
1594 | * @see _.unionBy
|
1595 | */
|
1596 | unionBy<T>(arrays1: List<T> | null | undefined, arrays2: List<T> | null | undefined, arrays3: List<T> | null | undefined, iteratee?: ValueIteratee<T>): T[];
|
1597 | /**
|
1598 | * @see _.unionBy
|
1599 | */
|
1600 | unionBy<T>(arrays1: List<T> | null | undefined, arrays2: List<T> | null | undefined, arrays3: List<T> | null | undefined, arrays4: List<T> | null | undefined, iteratee?: ValueIteratee<T>): T[];
|
1601 | /**
|
1602 | * @see _.unionBy
|
1603 | */
|
1604 | unionBy<T>(arrays1: List<T> | null | undefined, arrays2: List<T> | null | undefined, arrays3: List<T> | null | undefined, arrays4: List<T> | null | undefined, arrays5: List<T> | null | undefined, ...iteratee: Array<ValueIteratee<T> | List<T> | null | undefined>): T[];
|
1605 | }
|
1606 | interface Collection<T> {
|
1607 | /**
|
1608 | * @see _.unionBy
|
1609 | */
|
1610 | unionBy(arrays2: List<T> | null | undefined, iteratee?: ValueIteratee<T>): Collection<T>;
|
1611 | /**
|
1612 | * @see _.unionBy
|
1613 | */
|
1614 | unionBy(...iteratee: Array<ValueIteratee<T> | List<T> | null | undefined>): Collection<T>;
|
1615 | }
|
1616 | interface CollectionChain<T> {
|
1617 | /**
|
1618 | * @see _.unionBy
|
1619 | */
|
1620 | unionBy(arrays2: List<T> | null | undefined, iteratee?: ValueIteratee<T>): CollectionChain<T>;
|
1621 | /**
|
1622 | * @see _.unionBy
|
1623 | */
|
1624 | unionBy(...iteratee: Array<ValueIteratee<T> | List<T> | null | undefined>): CollectionChain<T>;
|
1625 | }
|
1626 | interface LoDashStatic {
|
1627 | /**
|
1628 | * This method is like `_.union` except that it accepts `comparator` which
|
1629 | * is invoked to compare elements of `arrays`. The comparator is invoked
|
1630 | * with two arguments: (arrVal, othVal).
|
1631 | *
|
1632 | * @category Array
|
1633 | * @param [arrays] The arrays to inspect.
|
1634 | * @param [comparator] The comparator invoked per element.
|
1635 | * @returns Returns the new array of combined values.
|
1636 | * @example
|
1637 | *
|
1638 | * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
|
1639 | * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
|
1640 | *
|
1641 | * _.unionWith(objects, others, _.isEqual);
|
1642 | * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
|
1643 | */
|
1644 | unionWith<T>(arrays: List<T> | null | undefined, comparator?: Comparator<T>): T[];
|
1645 | /**
|
1646 | * @see _.unionWith
|
1647 | */
|
1648 | unionWith<T>(arrays: List<T> | null | undefined, arrays2: List<T> | null | undefined, comparator?: Comparator<T>): T[];
|
1649 | /**
|
1650 | * @see _.unionWith
|
1651 | */
|
1652 | unionWith<T>(arrays: List<T> | null | undefined, arrays2: List<T> | null | undefined, arrays3: List<T> | null | undefined, ...comparator: Array<Comparator<T> | List<T> | null | undefined>): T[];
|
1653 | }
|
1654 | interface Collection<T> {
|
1655 | /**
|
1656 | * @see _.unionWith
|
1657 | */
|
1658 | unionWith(arrays2: List<T> | null | undefined, comparator?: Comparator<T>): Collection<T>;
|
1659 | /**
|
1660 | * @see _.unionWith
|
1661 | */
|
1662 | unionWith(...comparator: Array<Comparator<T> | List<T> | null | undefined>): Collection<T>;
|
1663 | }
|
1664 | interface CollectionChain<T> {
|
1665 | /**
|
1666 | * @see _.unionWith
|
1667 | */
|
1668 | unionWith(arrays2: List<T> | null | undefined, comparator?: Comparator<T>): CollectionChain<T>;
|
1669 | /**
|
1670 | * @see _.unionWith
|
1671 | */
|
1672 | unionWith(...comparator: Array<Comparator<T> | List<T> | null | undefined>): CollectionChain<T>;
|
1673 | }
|
1674 | interface LoDashStatic {
|
1675 | /**
|
1676 | * Creates a duplicate-free version of an array, using
|
1677 | * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
1678 | * for equality comparisons, in which only the first occurrence of each element
|
1679 | * is kept.
|
1680 | *
|
1681 | * @category Array
|
1682 | * @param array The array to inspect.
|
1683 | * @returns Returns the new duplicate free array.
|
1684 | * @example
|
1685 | *
|
1686 | * _.uniq([2, 1, 2]);
|
1687 | * // => [2, 1]
|
1688 | */
|
1689 | uniq<T>(array: List<T> | null | undefined): T[];
|
1690 | }
|
1691 | interface Collection<T> {
|
1692 | /**
|
1693 | * @see _.uniq
|
1694 | */
|
1695 | uniq(): Collection<T>;
|
1696 | }
|
1697 | interface CollectionChain<T> {
|
1698 | /**
|
1699 | * @see _.uniq
|
1700 | */
|
1701 | uniq(): CollectionChain<T>;
|
1702 | }
|
1703 | interface LoDashStatic {
|
1704 | /**
|
1705 | * This method is like `_.uniq` except that it accepts `iteratee` which is
|
1706 | * invoked for each element in `array` to generate the criterion by which
|
1707 | * uniqueness is computed. The iteratee is invoked with one argument: (value).
|
1708 | *
|
1709 | * @category Array
|
1710 | * @param array The array to inspect.
|
1711 | * @param [iteratee=_.identity] The iteratee invoked per element.
|
1712 | * @returns Returns the new duplicate free array.
|
1713 | * @example
|
1714 | *
|
1715 | * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
|
1716 | * // => [2.1, 1.2]
|
1717 | *
|
1718 | * // using the `_.property` iteratee shorthand
|
1719 | * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
|
1720 | * // => [{ 'x': 1 }, { 'x': 2 }]
|
1721 | */
|
1722 | uniqBy<T>(array: List<T> | null | undefined, iteratee: ValueIteratee<T>): T[];
|
1723 | }
|
1724 | interface Collection<T> {
|
1725 | /**
|
1726 | * @see _.uniqBy
|
1727 | */
|
1728 | uniqBy(iteratee: ValueIteratee<T>): Collection<T>;
|
1729 | }
|
1730 | interface CollectionChain<T> {
|
1731 | /**
|
1732 | * @see _.uniqBy
|
1733 | */
|
1734 | uniqBy(iteratee: ValueIteratee<T>): CollectionChain<T>;
|
1735 | }
|
1736 | interface LoDashStatic {
|
1737 | /**
|
1738 | * This method is like `_.uniq` except that it accepts `comparator` which
|
1739 | * is invoked to compare elements of `array`. The comparator is invoked with
|
1740 | * two arguments: (arrVal, othVal).
|
1741 | *
|
1742 | * @category Array
|
1743 | * @param array The array to inspect.
|
1744 | * @param [comparator] The comparator invoked per element.
|
1745 | * @returns Returns the new duplicate free array.
|
1746 | * @example
|
1747 | *
|
1748 | * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
|
1749 | *
|
1750 | * _.uniqWith(objects, _.isEqual);
|
1751 | * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
|
1752 | */
|
1753 | uniqWith<T>(array: List<T> | null | undefined, comparator?: Comparator<T>): T[];
|
1754 | }
|
1755 | interface Collection<T> {
|
1756 | /**
|
1757 | * @see _.uniqWith
|
1758 | */
|
1759 | uniqWith(comparator?: Comparator<T>): Collection<T>;
|
1760 | }
|
1761 | interface CollectionChain<T> {
|
1762 | /**
|
1763 | * @see _.uniqWith
|
1764 | */
|
1765 | uniqWith(comparator?: Comparator<T>): CollectionChain<T>;
|
1766 | }
|
1767 | interface LoDashStatic {
|
1768 | /**
|
1769 | * This method is like _.zip except that it accepts an array of grouped elements and creates an array
|
1770 | * regrouping the elements to their pre-zip configuration.
|
1771 | *
|
1772 | * @param array The array of grouped elements to process.
|
1773 | * @return Returns the new array of regrouped elements.
|
1774 | */
|
1775 | unzip<T>(array: T[][] | List<List<T>> | null | undefined): T[][];
|
1776 | }
|
1777 | interface Collection<T> {
|
1778 | /**
|
1779 | * @see _.unzip
|
1780 | */
|
1781 | unzip(): T extends List<infer U> ? Collection<U[]> : unknown;
|
1782 | }
|
1783 | interface CollectionChain<T> {
|
1784 | /**
|
1785 | * @see _.unzip
|
1786 | */
|
1787 | unzip(): T extends List<infer U> ? CollectionChain<U[]> : unknown;
|
1788 | }
|
1789 | interface LoDashStatic {
|
1790 | /**
|
1791 | * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be
|
1792 | * combined. The iteratee is invoked with four arguments: (accumulator, value, index, group).
|
1793 | *
|
1794 | * @param array The array of grouped elements to process.
|
1795 | * @param iteratee The function to combine regrouped values.
|
1796 | * @return Returns the new array of regrouped elements.
|
1797 | */
|
1798 | unzipWith<T, TResult>(array: List<List<T>> | null | undefined, iteratee: (...values: T[]) => TResult): TResult[];
|
1799 | /**
|
1800 | * @see _.unzipWith
|
1801 | */
|
1802 | unzipWith<T>(array: List<List<T>> | null | undefined): T[][];
|
1803 | }
|
1804 | interface Collection<T> {
|
1805 | /**
|
1806 | * @see _.unzipWith
|
1807 | */
|
1808 | unzipWith<TResult>(iteratee: (...values: Array<T extends List<infer U> ? U : unknown>) => TResult): Collection<TResult>;
|
1809 | /**
|
1810 | * @see _.unzipWith
|
1811 | */
|
1812 | unzipWith(): T extends List<infer U> ? Collection<U[]> : unknown;
|
1813 | }
|
1814 | interface CollectionChain<T> {
|
1815 | /**
|
1816 | * @see _.unzipWith
|
1817 | */
|
1818 | unzipWith<TResult>(iteratee: (...values: Array<T extends List<infer U> ? U : unknown>) => TResult): CollectionChain<TResult>;
|
1819 | /**
|
1820 | * @see _.unzipWith
|
1821 | */
|
1822 | unzipWith(): T extends List<infer U> ? CollectionChain<U[]> : unknown;
|
1823 | }
|
1824 | interface LoDashStatic {
|
1825 | /**
|
1826 | * Creates an array excluding all provided values using SameValueZero for equality comparisons.
|
1827 | *
|
1828 | * @param array The array to filter.
|
1829 | * @param values The values to exclude.
|
1830 | * @return Returns the new array of filtered values.
|
1831 | */
|
1832 | without<T>(array: List<T> | null | undefined, ...values: T[]): T[];
|
1833 | }
|
1834 | interface Collection<T> {
|
1835 | /**
|
1836 | * @see _.without
|
1837 | */
|
1838 | without(...values: T[]): Collection<T>;
|
1839 | }
|
1840 | interface CollectionChain<T> {
|
1841 | /**
|
1842 | * @see _.without
|
1843 | */
|
1844 | without(...values: T[]): CollectionChain<T>;
|
1845 | }
|
1846 | interface LoDashStatic {
|
1847 | /**
|
1848 | * Creates an array of unique values that is the symmetric difference of the provided arrays.
|
1849 | *
|
1850 | * @param arrays The arrays to inspect.
|
1851 | * @return Returns the new array of values.
|
1852 | */
|
1853 | xor<T>(...arrays: Array<List<T> | null | undefined>): T[];
|
1854 | }
|
1855 | interface Collection<T> {
|
1856 | /**
|
1857 | * @see _.xor
|
1858 | */
|
1859 | xor(...arrays: Array<List<T> | null | undefined>): Collection<T>;
|
1860 | }
|
1861 | interface CollectionChain<T> {
|
1862 | /**
|
1863 | * @see _.xor
|
1864 | */
|
1865 | xor(...arrays: Array<List<T> | null | undefined>): CollectionChain<T>;
|
1866 | }
|
1867 | interface LoDashStatic {
|
1868 | /**
|
1869 | * This method is like `_.xor` except that it accepts `iteratee` which is
|
1870 | * invoked for each element of each `arrays` to generate the criterion by which
|
1871 | * uniqueness is computed. The iteratee is invoked with one argument: (value).
|
1872 | *
|
1873 | * @category Array
|
1874 | * @param [arrays] The arrays to inspect.
|
1875 | * @param [iteratee=_.identity] The iteratee invoked per element.
|
1876 | * @returns Returns the new array of values.
|
1877 | * @example
|
1878 | *
|
1879 | * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
|
1880 | * // => [1.2, 4.3]
|
1881 | *
|
1882 | * // using the `_.property` iteratee shorthand
|
1883 | * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
|
1884 | * // => [{ 'x': 2 }]
|
1885 | */
|
1886 | xorBy<T>(arrays: List<T> | null | undefined, iteratee?: ValueIteratee<T>): T[];
|
1887 | /**
|
1888 | * @see _.xorBy
|
1889 | */
|
1890 | xorBy<T>(arrays: List<T> | null | undefined, arrays2: List<T> | null | undefined, iteratee?: ValueIteratee<T>): T[];
|
1891 | /**
|
1892 | * @see _.xorBy
|
1893 | */
|
1894 | xorBy<T>(arrays: List<T> | null | undefined, arrays2: List<T> | null | undefined, arrays3: List<T> | null | undefined, ...iteratee: Array<ValueIteratee<T> | List<T> | null | undefined>): T[];
|
1895 | }
|
1896 | interface Collection<T> {
|
1897 | /**
|
1898 | * @see _.xorBy
|
1899 | */
|
1900 | xorBy(arrays2: List<T> | null | undefined, iteratee?: ValueIteratee<T>): Collection<T>;
|
1901 | /**
|
1902 | * @see _.xorBy
|
1903 | */
|
1904 | xorBy(...iteratee: Array<ValueIteratee<T> | List<T> | null | undefined>): Collection<T>;
|
1905 | }
|
1906 | interface CollectionChain<T> {
|
1907 | /**
|
1908 | * @see _.xorBy
|
1909 | */
|
1910 | xorBy(arrays2: List<T> | null | undefined, iteratee?: ValueIteratee<T>): CollectionChain<T>;
|
1911 | /**
|
1912 | * @see _.xorBy
|
1913 | */
|
1914 | xorBy(...iteratee: Array<ValueIteratee<T> | List<T> | null | undefined>): CollectionChain<T>;
|
1915 | }
|
1916 | interface LoDashStatic {
|
1917 | /**
|
1918 | * This method is like `_.xor` except that it accepts `comparator` which is
|
1919 | * invoked to compare elements of `arrays`. The comparator is invoked with
|
1920 | * two arguments: (arrVal, othVal).
|
1921 | *
|
1922 | * @category Array
|
1923 | * @param [arrays] The arrays to inspect.
|
1924 | * @param [comparator] The comparator invoked per element.
|
1925 | * @returns Returns the new array of values.
|
1926 | * @example
|
1927 | *
|
1928 | * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
|
1929 | * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
|
1930 | *
|
1931 | * _.xorWith(objects, others, _.isEqual);
|
1932 | * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
|
1933 | */
|
1934 | xorWith<T>(arrays: List<T> | null | undefined, comparator?: Comparator<T>): T[];
|
1935 | /**
|
1936 | * @see _.xorWith
|
1937 | */
|
1938 | xorWith<T>(arrays: List<T> | null | undefined, arrays2: List<T> | null | undefined, comparator?: Comparator<T>): T[];
|
1939 | /**
|
1940 | * @see _.xorWith
|
1941 | */
|
1942 | xorWith<T>(arrays: List<T> | null | undefined, arrays2: List<T> | null | undefined, arrays3: List<T> | null | undefined, ...comparator: Array<Comparator<T> | List<T> | null | undefined>): T[];
|
1943 | }
|
1944 | interface Collection<T> {
|
1945 | /**
|
1946 | * @see _.xorWith
|
1947 | */
|
1948 | xorWith(arrays2: List<T> | null | undefined, comparator?: Comparator<T>): Collection<T>;
|
1949 | /**
|
1950 | * @see _.xorWith
|
1951 | */
|
1952 | xorWith(...comparator: Array<Comparator<T> | List<T> | null | undefined>): Collection<T>;
|
1953 | }
|
1954 | interface CollectionChain<T> {
|
1955 | /**
|
1956 | * @see _.xorWith
|
1957 | */
|
1958 | xorWith(arrays2: List<T> | null | undefined, comparator?: Comparator<T>): CollectionChain<T>;
|
1959 | /**
|
1960 | * @see _.xorWith
|
1961 | */
|
1962 | xorWith(...comparator: Array<Comparator<T> | List<T> | null | undefined>): CollectionChain<T>;
|
1963 | }
|
1964 | interface LoDashStatic {
|
1965 | /**
|
1966 | * Creates an array of grouped elements, the first of which contains the first elements of the given arrays,
|
1967 | * the second of which contains the second elements of the given arrays, and so on.
|
1968 | *
|
1969 | * @param arrays The arrays to process.
|
1970 | * @return Returns the new array of grouped elements.
|
1971 | */
|
1972 | zip<T1, T2>(arrays1: List<T1>, arrays2: List<T2>): Array<[T1 | undefined, T2 | undefined]>;
|
1973 | /**
|
1974 | * @see _.zip
|
1975 | */
|
1976 | zip<T1, T2, T3>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>): Array<[T1 | undefined, T2 | undefined, T3 | undefined]>;
|
1977 | /**
|
1978 | * @see _.zip
|
1979 | */
|
1980 | zip<T1, T2, T3, T4>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined]>;
|
1981 | /**
|
1982 | * @see _.zip
|
1983 | */
|
1984 | zip<T1, T2, T3, T4, T5>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>, arrays5: List<T5>): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined, T5 | undefined]>;
|
1985 | /**
|
1986 | * @see _.zip
|
1987 | */
|
1988 | zip<T>(...arrays: Array<List<T> | null | undefined>): Array<Array<T | undefined>>;
|
1989 | }
|
1990 | interface Collection<T> {
|
1991 | /**
|
1992 | * @see _.zip
|
1993 | */
|
1994 | zip<T2>(arrays2: List<T2>): Collection<[T | undefined, T2 | undefined]>;
|
1995 | /**
|
1996 | * @see _.zip
|
1997 | */
|
1998 | zip(...arrays: Array<List<T> | null | undefined>): Collection<Array<T | undefined>>;
|
1999 | }
|
2000 | interface CollectionChain<T> {
|
2001 | /**
|
2002 | * @see _.zip
|
2003 | */
|
2004 | zip<T2>(arrays2: List<T2>): CollectionChain<[T | undefined, T2 | undefined]>;
|
2005 | /**
|
2006 | * @see _.zip
|
2007 | */
|
2008 | zip(...arrays: Array<List<T> | null | undefined>): CollectionChain<Array<T | undefined>>;
|
2009 | }
|
2010 | interface LoDashStatic {
|
2011 | /**
|
2012 | * This method is like _.fromPairs except that it accepts two arrays, one of property
|
2013 | * identifiers and one of corresponding values.
|
2014 | *
|
2015 | * @param props The property names.
|
2016 | * @param values The property values.
|
2017 | * @return Returns the new object.
|
2018 | */
|
2019 | zipObject<T>(props: List<PropertyName>, values: List<T>): Dictionary<T>;
|
2020 | /**
|
2021 | * @see _.zipObject
|
2022 | */
|
2023 | zipObject(props?: List<PropertyName>): Dictionary<undefined>;
|
2024 | }
|
2025 | interface Collection<T> {
|
2026 | /**
|
2027 | * @see _.zipObject
|
2028 | */
|
2029 | zipObject<U>(values: List<U>): Object<Dictionary<U>>;
|
2030 | /**
|
2031 | * @see _.zipObject
|
2032 | */
|
2033 | zipObject(): Object<Dictionary<undefined>>;
|
2034 | }
|
2035 | interface CollectionChain<T> {
|
2036 | /**
|
2037 | * @see _.zipObject
|
2038 | */
|
2039 | zipObject<U>(values: List<U>): ObjectChain<Dictionary<U>>;
|
2040 | /**
|
2041 | * @see _.zipObject
|
2042 | */
|
2043 | zipObject(): ObjectChain<Dictionary<undefined>>;
|
2044 | }
|
2045 | interface LoDashStatic {
|
2046 | /**
|
2047 | * This method is like _.zipObject except that it supports property paths.
|
2048 | *
|
2049 | * @param paths The property names.
|
2050 | * @param values The property values.
|
2051 | * @return Returns the new object.
|
2052 | */
|
2053 | zipObjectDeep(paths?: List<PropertyPath>, values?: List<any>): object;
|
2054 | }
|
2055 | interface Collection<T> {
|
2056 | /**
|
2057 | * @see _.zipObjectDeep
|
2058 | */
|
2059 | zipObjectDeep(values?: List<any>): Object<object>;
|
2060 | }
|
2061 | interface CollectionChain<T> {
|
2062 | /**
|
2063 | * @see _.zipObjectDeep
|
2064 | */
|
2065 | zipObjectDeep(values?: List<any>): ObjectChain<object>;
|
2066 | }
|
2067 | interface LoDashStatic {
|
2068 | /**
|
2069 | * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be
|
2070 | * combined. The iteratee is invoked with four arguments: (accumulator, value, index,
|
2071 | * group).
|
2072 | * @param arrays The arrays to process.
|
2073 | * @param iteratee The function to combine grouped values.
|
2074 | * @return Returns the new array of grouped elements.
|
2075 | */
|
2076 | zipWith<T, TResult>(arrays: List<T>, iteratee: (value1: T) => TResult): TResult[];
|
2077 | /**
|
2078 | * @see _.zipWith
|
2079 | */
|
2080 | zipWith<T1, T2, TResult>(arrays1: List<T1>, arrays2: List<T2>, iteratee: (value1: T1, value2: T2) => TResult): TResult[];
|
2081 | /**
|
2082 | * @see _.zipWith
|
2083 | */
|
2084 | zipWith<T1, T2, T3, TResult>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, iteratee: (value1: T1, value2: T2, value3: T3) => TResult): TResult[];
|
2085 | /**
|
2086 | * @see _.zipWith
|
2087 | */
|
2088 | zipWith<T1, T2, T3, T4, TResult>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>, iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult): TResult[];
|
2089 | /**
|
2090 | * @see _.zipWith
|
2091 | */
|
2092 | zipWith<T1, T2, T3, T4, T5, TResult>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>, arrays5: List<T5>, iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult): TResult[];
|
2093 | /**
|
2094 | * @see _.zipWith
|
2095 | */
|
2096 | zipWith<T, TResult>(...iteratee: Array<((...group: T[]) => TResult) | List<T> | null | undefined>): TResult[];
|
2097 | }
|
2098 | interface Collection<T> {
|
2099 | /**
|
2100 | * @see _.zipWith
|
2101 | */
|
2102 | zipWith<T2, TResult>(arrays2: List<T2>, iteratee: (value1: T, value2: T2) => TResult): Collection<TResult>;
|
2103 | /**
|
2104 | * @see _.zipWith
|
2105 | */
|
2106 | zipWith<T2, T3, TResult>(arrays2: List<T2>, arrays3: List<T3>, iteratee: (value1: T, value2: T2, value3: T3) => TResult): Collection<TResult>;
|
2107 | /**
|
2108 | * @see _.zipWith
|
2109 | */
|
2110 | zipWith<TResult>(...iteratee: Array<((...group: T[]) => TResult) | List<T> | null | undefined>): Collection<TResult>;
|
2111 | }
|
2112 | interface CollectionChain<T> {
|
2113 | /**
|
2114 | * @see _.zipWith
|
2115 | */
|
2116 | zipWith<T2, TResult>(arrays2: List<T2>, iteratee: (value1: T, value2: T2) => TResult): CollectionChain<TResult>;
|
2117 | /**
|
2118 | * @see _.zipWith
|
2119 | */
|
2120 | zipWith<T2, T3, TResult>(arrays2: List<T2>, arrays3: List<T3>, iteratee: (value1: T, value2: T2, value3: T3) => TResult): CollectionChain<TResult>;
|
2121 | /**
|
2122 | * @see _.zipWith
|
2123 | */
|
2124 | zipWith<TResult>(...iteratee: Array<((...group: T[]) => TResult) | List<T> | null | undefined>): CollectionChain<TResult>;
|
2125 | }
|
2126 | }
|
2127 |
|
\ | No newline at end of file |