UNPKG

247 kBTypeScriptView Raw
1declare var _: _.UnderscoreStatic;
2export = _;
3export as namespace _;
4
5// The DOM is not required to be present, but these definitions reference type Element for the
6// isElement check. If the DOM is present, this declaration will merge.
7declare global {
8 interface Element {}
9}
10
11declare namespace _ {
12 /**
13 * underscore.js _.throttle options.
14 */
15 interface ThrottleSettings {
16 /**
17 * If you'd like to disable the leading-edge call, pass this as false.
18 */
19 leading?: boolean | undefined;
20
21 /**
22 * If you'd like to disable the execution on the trailing-edge, pass false.
23 */
24 trailing?: boolean | undefined;
25 }
26
27 /**
28 * underscore.js template settings, set templateSettings or pass as an argument
29 * to 'template()' to override defaults.
30 */
31 interface TemplateSettings {
32 /**
33 * Default value is '/<%([\s\S]+?)%>/g'.
34 */
35 evaluate?: RegExp | undefined;
36
37 /**
38 * Default value is '/<%=([\s\S]+?)%>/g'.
39 */
40 interpolate?: RegExp | undefined;
41
42 /**
43 * Default value is '/<%-([\s\S]+?)%>/g'.
44 */
45 escape?: RegExp | undefined;
46
47 /**
48 * By default, 'template()' places the values from your data in the local scope via the 'with' statement.
49 * However, you can specify a single variable name with this setting.
50 */
51 variable?: string | undefined;
52 }
53
54 interface CompiledTemplate {
55 (data?: any): string;
56 source: string;
57 }
58
59 // Common interface between Arrays and jQuery objects
60 interface List<T> {
61 [index: number]: T;
62 length: number;
63 }
64
65 interface Dictionary<T> {
66 [index: string]: T;
67 }
68
69 type Collection<T> = List<T> | Dictionary<T>;
70
71 type CollectionKey<V> = V extends never ? any
72 : V extends List<any> ? number
73 : V extends Dictionary<any> ? string
74 : V extends undefined ? undefined
75 : never;
76
77 interface Predicate<T> {
78 (value: T): boolean;
79 }
80
81 interface CollectionIterator<T extends TypeOfList<V> | TypeOfDictionary<V, any>, TResult, V = Collection<T>> {
82 (element: T, key: CollectionKey<V>, collection: V): TResult;
83 }
84
85 interface ListIterator<T extends TypeOfList<V>, TResult, V = List<T>> extends CollectionIterator<T, TResult, V> {}
86
87 interface ObjectIterator<T extends TypeOfDictionary<V, any>, TResult, V = Dictionary<T>>
88 extends CollectionIterator<T, TResult, V>
89 {}
90
91 type Iteratee<V, R, T extends TypeOfCollection<V, any> = TypeOfCollection<V>> =
92 | CollectionIterator<T, R, V>
93 | string
94 | number
95 | Array<string | number>
96 | Partial<T>
97 | null
98 | undefined;
99
100 type IterateeResult<I, T> = I extends (...args: any[]) => infer R ? R
101 : I extends keyof T ? T[I]
102 : I extends string | number | Array<string | number> ? any
103 : I extends object ? boolean
104 : I extends null | undefined ? T
105 : never;
106
107 type PropertyTypeOrAny<T, K> = K extends keyof T ? T[K] : any;
108
109 interface MemoCollectionIterator<T extends TypeOfList<V> | TypeOfDictionary<V, any>, TResult, V = Collection<T>> {
110 (prev: TResult, curr: T, key: CollectionKey<V>, collection: V): TResult;
111 }
112
113 interface MemoIterator<T extends TypeOfList<V>, TResult, V = List<T>>
114 extends MemoCollectionIterator<T, TResult, V>
115 {}
116
117 interface MemoObjectIterator<T extends TypeOfDictionary<V>, TResult, V = Dictionary<T>>
118 extends MemoCollectionIterator<T, TResult, V>
119 {}
120
121 type TypeOfList<V> = V extends never ? any
122 : V extends List<infer T> ? T
123 : never;
124
125 type TypeOfDictionary<V, TDefault = never> = V extends never ? any
126 : V extends Dictionary<infer T> ? T
127 : TDefault;
128
129 type TypeOfCollection<V, TObjectDefault = never> = V extends List<any> ? TypeOfList<V>
130 : TypeOfDictionary<V, TObjectDefault>;
131
132 type DeepTypeOfCollection<V, P> = P extends [infer H, ...infer R]
133 ? H extends keyof V ? DeepTypeOfCollection<V[H], R>
134 : never
135 : V;
136
137 type ListItemOrSelf<T> = T extends List<infer TItem> ? TItem : T;
138
139 // unfortunately it's not possible to recursively collapse all possible list dimensions to T[] at this time,
140 // so give up after one dimension since that's likely the most common case
141 // '& object' prevents strings from being matched by list checks so types like string[] don't end up resulting in any
142 type DeepestListItemOrSelf<T> = T extends List<infer TItem> & object ? TItem extends List<any> & object ? any
143 : TItem
144 : T;
145
146 // if T is an inferrable pair, the value type for the pair
147 // if T is a list, assume that it contains pairs of some type, so any
148 // if T isn't a list, there's no way that it can provide pairs, so never
149 type PairValue<T> = T extends Readonly<[string | number, infer TValue]> ? TValue
150 : T extends List<infer TValue> ? TValue
151 : never;
152
153 type AnyFalsy = undefined | null | false | "" | 0;
154
155 type Truthy<T> = Exclude<T, AnyFalsy>;
156
157 type _Pick<V, K extends string> = Extract<K, keyof V> extends never ? Partial<V>
158 : Pick<V, Extract<K, keyof V>>;
159
160 // switch to Omit when the minimum TS version moves past 3.5
161 type _Omit<V, K extends string> = V extends never ? any
162 : Extract<K, keyof V> extends never ? Partial<V>
163 : Pick<V, Exclude<keyof V, K>>;
164
165 type _ChainSingle<V> = _Chain<TypeOfCollection<V>, V>;
166
167 type TypedArray =
168 | Int8Array
169 | Uint8Array
170 | Int16Array
171 | Uint16Array
172 | Int32Array
173 | Uint32Array
174 | Uint8ClampedArray
175 | Float32Array
176 | Float64Array;
177
178 interface Cancelable {
179 cancel(): void;
180 }
181
182 interface UnderscoreStatic {
183 /*******
184 * OOP *
185 *******/
186
187 /**
188 * Underscore OOP Wrapper, all Underscore functions that take an object
189 * as the first parameter can be invoked through this function.
190 * @param value First argument to Underscore object functions.
191 * @returns An Underscore wrapper around the supplied value.
192 */
193 <V>(value: V): Underscore<TypeOfCollection<V>, V>;
194
195 /***************
196 * Collections *
197 ***************/
198
199 /**
200 * Iterates over a `collection` of elements, yielding each in turn to
201 * an `iteratee`. The `iteratee` is bound to the context object, if one
202 * is passed.
203 * @param collection The collection of elements to iterate over.
204 * @param iteratee The iteratee to call for each element in
205 * `collection`.
206 * @param context 'this' object in `iteratee`, optional.
207 * @returns The original collection.
208 */
209 each<V extends Collection<any>>(
210 collection: V,
211 iteratee: CollectionIterator<TypeOfCollection<V>, void, V>,
212 context?: any,
213 ): V;
214
215 /**
216 * @see each
217 */
218 forEach: UnderscoreStatic["each"];
219
220 /**
221 * Produces a new array of values by mapping each value in `collection`
222 * through a transformation `iteratee`.
223 * @param collection The collection to transform.
224 * @param iteratee The iteratee to use to transform each item in
225 * `collection`.
226 * @param context `this` object in `iteratee`, optional.
227 * @returns The mapped result.
228 */
229 map<V extends Collection<any>, I extends Iteratee<V, any>>(
230 collection: V,
231 iteratee: I,
232 context?: any,
233 ): Array<IterateeResult<I, TypeOfCollection<V>>>;
234
235 /**
236 * @see map
237 */
238 collect: UnderscoreStatic["map"];
239
240 /**
241 * Also known as inject and foldl, reduce boils down a `collection` of
242 * values into a single value. `memo` is the initial state of the
243 * reduction, and each successive step of it should be returned by
244 * `iteratee`.
245 *
246 * If no memo is passed to the initial invocation of reduce, `iteratee`
247 * is not invoked on the first element of `collection`. The first
248 * element is instead passed as the memo in the invocation of
249 * `iteratee` on the next element in `collection`.
250 * @param collection The collection to reduce.
251 * @param iteratee The function to call on each iteration to reduce the
252 * collection.
253 * @param memo The initial reduce state or undefined to use the first
254 * item in `collection` as initial state.
255 * @param context `this` object in `iteratee`, optional.
256 * @returns The reduced result.
257 */
258 reduce<V extends Collection<any>, TResult>(
259 collection: V,
260 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult, V>,
261 memo: TResult,
262 context?: any,
263 ): TResult;
264 reduce<V extends Collection<any>, TResult = TypeOfCollection<V>>(
265 collection: V,
266 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult | TypeOfCollection<V>, V>,
267 ): TResult | TypeOfCollection<V> | undefined;
268
269 /**
270 * @see reduce
271 */
272 inject: UnderscoreStatic["reduce"];
273
274 /**
275 * @see reduce
276 */
277 foldl: UnderscoreStatic["reduce"];
278
279 /**
280 * The right-associative version of reduce.
281 *
282 * This is not as useful in JavaScript as it would be in a language
283 * with lazy evaluation.
284 * @param collection The collection to reduce.
285 * @param iteratee The function to call on each iteration to reduce the
286 * collection.
287 * @param memo The initial reduce state or undefined to use the first
288 * item in `collection` as the initial state.
289 * @param context `this` object in `iteratee`, optional.
290 * @returns The reduced result.
291 */
292 reduceRight<V extends Collection<any>, TResult>(
293 collection: V,
294 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult, V>,
295 memo: TResult,
296 context?: any,
297 ): TResult;
298 reduceRight<V extends Collection<any>, TResult = TypeOfCollection<V>>(
299 collection: V,
300 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult | TypeOfCollection<V>, V>,
301 ): TResult | TypeOfCollection<V> | undefined;
302
303 /**
304 * @see reduceRight
305 */
306 foldr: UnderscoreStatic["reduceRight"];
307
308 /**
309 * Looks through each value in `collection`, returning the first one
310 * that passes a truth test (`iteratee`), or undefined if no value
311 * passes the test. The function returns as soon as it finds an
312 * acceptable element, and doesn't traverse the entire collection.
313 * @param collection The collection to search.
314 * @param iteratee The truth test to apply.
315 * @param context `this` object in `iteratee`, optional.
316 * @returns The first element in `collection` that passes the truth
317 * test or undefined if no elements pass.
318 */
319 find<V extends Collection<any>>(
320 collection: V,
321 iteratee?: Iteratee<V, boolean>,
322 context?: any,
323 ): TypeOfCollection<V> | undefined;
324
325 /**
326 * @see find
327 */
328 detect: UnderscoreStatic["find"];
329
330 /**
331 * Looks through each value in `collection`, returning an array of
332 * all the values that pass a truth test (`iteratee`).
333 * @param collection The collection to filter.
334 * @param iteratee The truth test to apply.
335 * @param context `this` object in `iteratee`, optional.
336 * @returns The set of values that pass the truth test.
337 */
338 filter<V extends Collection<any>>(
339 collection: V,
340 iteratee?: Iteratee<V, boolean>,
341 context?: any,
342 ): Array<TypeOfCollection<V>>;
343
344 /**
345 * @see filter
346 */
347 select: UnderscoreStatic["filter"];
348
349 /**
350 * Looks through each value in `collection`, returning an array of all
351 * the elements that match the key-value pairs listed in `properties`.
352 * @param collection The collection in which to find elements that
353 * match `properties`.
354 * @param properties The properties to check for on the elements within
355 * `collection`.
356 * @returns The elements in `collection` that match `properties`.
357 */
358 where<V extends Collection<any>>(
359 collection: V,
360 properties: Partial<TypeOfCollection<V>>,
361 ): Array<TypeOfCollection<V>>;
362
363 /**
364 * Looks through `collection` and returns the first value that matches
365 * all of the key-value pairs listed in `properties`. If no match is
366 * found, or if list is empty, undefined will be returned.
367 * @param collection The collection in which to find an element that
368 * matches `properties`.
369 * @param properties The properties to check for on the elements within
370 * `collection`.
371 * @returns The first element in `collection` that matches `properties`
372 * or undefined if no match is found.
373 */
374 findWhere<V extends Collection<any>>(
375 collection: V,
376 properties: Partial<TypeOfCollection<V>>,
377 ): TypeOfCollection<V> | undefined;
378
379 /**
380 * Returns the values in `collection` without the elements that pass a
381 * truth test (`iteratee`).
382 * The opposite of filter.
383 * @param collection The collection to filter.
384 * @param iteratee The truth test to apply.
385 * @param context `this` object in `iteratee`, optional.
386 * @returns The set of values that fail the truth test.
387 */
388 reject<V extends Collection<any>>(
389 collection: V,
390 iteratee?: Iteratee<V, boolean>,
391 context?: any,
392 ): Array<TypeOfCollection<V>>;
393
394 /**
395 * Returns true if all of the values in `collection` pass the
396 * `iteratee` truth test. Short-circuits and stops traversing
397 * `collection` if a false element is found.
398 * @param collection The collection to evaluate.
399 * @param iteratee The truth test to apply.
400 * @param context `this` object in `iteratee`, optional.
401 * @returns True if all elements pass the truth test, otherwise false.
402 */
403 every<V extends Collection<any>>(
404 collection: V,
405 iteratee?: Iteratee<V, boolean>,
406 context?: any,
407 ): boolean;
408
409 /**
410 * @see every
411 */
412 all: UnderscoreStatic["every"];
413
414 /**
415 * Returns true if any of the values in `collection` pass the
416 * `iteratee` truth test. Short-circuits and stops traversing
417 * `collection` if a true element is found.
418 * @param collection The collection to evaluate.
419 * @param iteratee The truth test to apply.
420 * @param context `this` object in `iteratee`, optional.
421 * @returns True if any element passed the truth test, otherwise false.
422 */
423 some<V extends Collection<any>>(
424 collection: V,
425 iteratee?: Iteratee<V, boolean>,
426 context?: any,
427 ): boolean;
428
429 /**
430 * @see some
431 */
432 any: UnderscoreStatic["some"];
433
434 /**
435 * Returns true if the value is present in `collection`. Uses indexOf
436 * internally, if `collection` is a List. Use `fromIndex` to start your
437 * search at a given index.
438 * @param collection The collection to check for `value`.
439 * @param value The value to check `collection` for.
440 * @param fromIndex The index to start searching from, optional,
441 * default = 0, only used when `collection` is a List.
442 * @returns True if `value` is present in `collection` after
443 * `fromIndex`, otherwise false.
444 */
445 contains<V extends Collection<any>>(
446 collection: V,
447 value: any,
448 fromIndex?: number,
449 ): boolean;
450
451 /**
452 * @see contains
453 */
454 include: UnderscoreStatic["contains"];
455
456 /**
457 * @see contains
458 */
459 includes: UnderscoreStatic["contains"];
460
461 /**
462 * Calls the method named by `methodName` on each value in
463 * `collection`. Any extra arguments passed to invoke will be forwarded
464 * on to the method invocation.
465 * @param collection The collection of elements to invoke `methodName`
466 * on.
467 * @param methodName The name of the method to call on each element in
468 * `collection`.
469 * @param args Additional arguments to pass to method `methodName`.
470 * @returns An array containing the result of the method call for each
471 * item in `collection`.
472 */
473 invoke(
474 list: Collection<any>,
475 methodName: string,
476 ...args: any[]
477 ): any[];
478
479 /**
480 * A convenient version of what is perhaps the most common use-case for
481 * map: extracting a list of property values.
482 * @param collection The collection of items.
483 * @param propertyName The name of a specific property to retrieve from
484 * all items in `collection`.
485 * @returns The set of values for the specified `propertyName` for each
486 * item in `collection`.
487 */
488 pluck<V extends Collection<any>, K extends string | number>(
489 collection: V,
490 propertyName: K,
491 ): Array<PropertyTypeOrAny<TypeOfCollection<V>, K>>;
492
493 /**
494 * Returns the maximum value in `collection`. If an `iteratee` is
495 * provided, it will be used on each element to generate the criterion
496 * by which the element is ranked. -Infinity is returned if list is
497 * empty. Non-numerical values returned by `iteratee` will be ignored.
498 * @param collection The collection in which to find the maximum value.
499 * @param iteratee The iteratee that provides the criterion by which
500 * each element is ranked, optional if evaluating a collection of
501 * numbers.
502 * @param context `this` object in `iteratee`, optional.
503 * @returns The maximum element within `collection` or -Infinity if
504 * `collection` is empty.
505 */
506 max<V extends Collection<any>>(
507 collection: V,
508 iteratee?: Iteratee<V, any>,
509 context?: any,
510 ): TypeOfCollection<V> | number;
511
512 /**
513 * Returns the minimum value in `collection`. If an `iteratee` is
514 * provided, it will be used on each element to generate the criterion
515 * by which the element is ranked. Infinity is returned if list is
516 * empty. Non-numerical values returned by `iteratee` will be ignored.
517 * @param collection The collection in which to find the minimum value.
518 * @param iteratee The iteratee that provides the criterion by which
519 * each element is ranked, optional if evaluating a collection of
520 * numbers.
521 * @param context `this` object in `iteratee`, optional.
522 * @returns The minimum element within `collection` or Infinity if
523 * `collection` is empty.
524 */
525 min<V extends Collection<any>>(
526 list: V,
527 iteratee?: Iteratee<V, any>,
528 context?: any,
529 ): TypeOfCollection<V> | number;
530
531 /**
532 * Returns a (stably) sorted copy of `collection`, ranked in ascending
533 * order by the results of running each value through `iteratee`.
534 * @param collection The collection to sort.
535 * @param iteratee An iteratee that provides the value to sort by for
536 * each item in `collection`.
537 * @param context `this` object in `iteratee`, optional.
538 * @returns A sorted copy of `collection`.
539 */
540 sortBy<V extends Collection<any>>(
541 collection: V,
542 iteratee?: Iteratee<V, any>,
543 context?: any,
544 ): Array<TypeOfCollection<V>>;
545
546 /**
547 * Splits `collection` into sets that are grouped by the result of
548 * running each value through `iteratee`.
549 * @param collection The collection to group.
550 * @param iteratee An iteratee that provides the value to group by for
551 * each item in `collection`.
552 * @param context `this` object in `iteratee`, optional.
553 * @returns A dictionary with the group names provided by `iteratee` as
554 * properties where each property contains the grouped elements from
555 * `collection`.
556 */
557 groupBy<V extends Collection<any>>(
558 collection: V,
559 iteratee?: Iteratee<V, string | number>,
560 context?: any,
561 ): Dictionary<Array<TypeOfCollection<V>>>;
562
563 /**
564 * Given a `collection` and an `iteratee` function that returns a key
565 * for each element in `collection`, returns an object that acts as an
566 * index of each item. Just like `groupBy`, but for when you know your
567 * keys are unique.
568 * @param collection The collection to index.
569 * @param iteratee An iteratee that provides the value to index by for
570 * each item in `collection`.
571 * @param context `this` object in `iteratee`, optional.
572 * @returns A dictionary where each item in `collection` is assigned to
573 * the property designated by `iteratee`.
574 */
575 indexBy<V extends Collection<any>>(
576 collection: V,
577 iteratee?: Iteratee<V, string | number>,
578 context?: any,
579 ): Dictionary<TypeOfCollection<V>>;
580
581 /**
582 * Sorts `collection` into groups and returns a count for the number of
583 * objects in each group. Similar to `groupBy`, but instead of
584 * returning a list of values, returns a count for the number of values
585 * in that group.
586 * @param collection The collection to count.
587 * @param iteratee An iteratee that provides the value to count by for
588 * each item in `collection`.
589 * @param context `this` object in `iteratee`, optional.
590 * @returns A dictionary with the group names provided by `iteratee` as
591 * properties where each property contains the count of the grouped
592 * elements from `collection`.
593 */
594 countBy<V extends Collection<any>>(
595 collection: V,
596 iteratee?: Iteratee<V, string | number>,
597 context?: any,
598 ): Dictionary<number>;
599
600 /**
601 * Returns a shuffled copy of `collection`, using a version of the
602 * Fisher-Yates shuffle.
603 * @param collection The collection to shuffle.
604 * @returns A shuffled copy of `collection`.
605 */
606 shuffle<V extends Collection<any>>(
607 collection: V,
608 ): Array<TypeOfCollection<V>>;
609
610 /**
611 * Produce a random sample from `collection`. Pass a number to return
612 * `n` random elements from `collection`. Otherwise a single random
613 * item will be returned.
614 * @param collection The collection to sample.
615 * @param n The number of elements to sample from `collection`.
616 * @returns A random sample of `n` elements from `collection` or a
617 * single element if `n` is not specified.
618 */
619 sample<V extends Collection<any>>(
620 collection: V,
621 n: number,
622 ): Array<TypeOfCollection<V>>;
623 sample<V extends Collection<any>>(
624 collection: V,
625 ): TypeOfCollection<V> | undefined;
626
627 /**
628 * Creates a real Array from `collection` (anything that can be
629 * iterated over). Useful for transmuting the arguments object.
630 * @param collection The collection to transform into an array.
631 * @returns An array containing the elements of `collection`.
632 */
633 toArray<V extends Collection<any>>(
634 collection: V,
635 ): Array<TypeOfCollection<V>>;
636
637 /**
638 * Determines the number of values in `collection`.
639 * @param collection The collection to determine the number of values
640 * for.
641 * @returns The number of values in `collection`.
642 */
643 size(collection: Collection<any>): number;
644
645 /**
646 * Splits `collection` into two arrays: one whose elements all satisfy
647 * `iteratee` and one whose elements all do not satisfy `iteratee`.
648 * @param collection The collection to partition.
649 * @param iteratee The iteratee that defines the partitioning scheme
650 * for each element in `collection`.
651 * @param context `this` object in `iteratee`, optional.
652 * @returns An array composed of two elements, where the first element
653 * contains the elements in `collection` that satisfied the predicate
654 * and the second element contains the elements that did not.
655 */
656 partition<V extends Collection<any>>(
657 list: V,
658 iteratee?: Iteratee<V, boolean>,
659 context?: any,
660 ): [Array<TypeOfCollection<V>>, Array<TypeOfCollection<V>>];
661
662 /**********
663 * Arrays *
664 **********/
665
666 /**
667 * Returns the first element of `list`. Passing `n` will return the
668 * first `n` elements of `list`.
669 * @param list The list to retrieve elements from.
670 * @param n The number of elements to retrieve, optional.
671 * @returns The first `n` elements of `list` or the first element if
672 * `n` is omitted.
673 */
674 first<V extends List<any>>(
675 list: V,
676 ): TypeOfList<V> | undefined;
677 first<V extends List<any>>(
678 list: V,
679 n: number,
680 ): Array<TypeOfList<V>>;
681
682 /**
683 * @see first
684 */
685 head: UnderscoreStatic["first"];
686
687 /**
688 * @see first
689 */
690 take: UnderscoreStatic["first"];
691
692 /**
693 * Returns everything but the last entry of `list`. Especially useful
694 * on the arguments object. Pass `n` to exclude the last
695 * `n` elements from the result.
696 * @param list The list to retrieve elements from.
697 * @param n The number of elements from the end of `list` to omit,
698 * optional, default = 1.
699 * @returns The elements of `list` with the last `n` items omitted.
700 */
701 initial<V extends List<any>>(
702 list: V,
703 n?: number,
704 ): Array<TypeOfList<V>>;
705
706 /**
707 * Returns the last element of `list`. Passing `n` will return the last
708 * `n` elements of `list`.
709 * @param list The list to retrieve elements from.
710 * @param n The number of elements to retrieve, optional.
711 * @returns The last `n` elements of `list` or the last element if `n`
712 * is omitted.
713 */
714 last<V extends List<any>>(
715 list: V,
716 ): TypeOfList<V> | undefined;
717 last<V extends List<any>>(
718 list: V,
719 n: number,
720 ): Array<TypeOfList<V>>;
721
722 /**
723 * Returns the rest of the elements in `list`. Pass an `index` to
724 * return the values of the list from that index onward.
725 * @param list The list to retrieve elements from.
726 * @param index The index to start retrieving elements from, optional,
727 * default = 1.
728 * @returns The elements of `list` from `index` to the end of the list.
729 */
730 rest<V extends List<any>>(
731 list: V,
732 index?: number,
733 ): Array<TypeOfList<V>>;
734
735 /**
736 * @see rest
737 */
738 tail: UnderscoreStatic["rest"];
739
740 /**
741 * @see rest
742 */
743 drop: UnderscoreStatic["rest"];
744
745 /**
746 * Returns a copy of `list` with all falsy values removed. In
747 * JavaScript, false, null, 0, "", undefined and NaN are all falsy.
748 * @param list The list to compact.
749 * @returns An array containing the elements of `list` without falsy
750 * values.
751 */
752 compact<V extends List<any> | null | undefined>(
753 list: V,
754 ): Array<Truthy<TypeOfList<V>>>;
755
756 /**
757 * Flattens a nested `list` (the nesting can be to any depth). If you
758 * pass true or 1 as the depth, the `list` will only be flattened a
759 * single level. Passing a greater number will cause the flattening to
760 * descend deeper into the nesting hierarchy. Omitting the depth
761 * argument, or passing false or Infinity, flattens the `list` all the
762 * way to the deepest nesting level.
763 * @param list The list to flatten.
764 * @param depth True to only flatten one level, optional,
765 * default = false.
766 * @returns The flattened `list`.
767 */
768 flatten<V extends List<any>>(
769 list: V,
770 depth: 1 | true,
771 ): Array<ListItemOrSelf<TypeOfList<V>>>;
772 flatten<V extends List<any>>(
773 list: V,
774 depth?: number | false,
775 ): Array<DeepestListItemOrSelf<TypeOfList<V>>>;
776
777 /**
778 * Returns a copy of `list` with all instances of `values` removed.
779 * @param list The list to exclude `values` from.
780 * @param values The values to exclude from `list`.
781 * @returns An array that contains all elements of `list` except for
782 * `values`.
783 */
784 without<V extends List<any>>(
785 list: V,
786 ...values: Array<TypeOfList<V>>
787 ): Array<TypeOfList<V>>;
788
789 /**
790 * Computes the union of the passed-in `lists`: the list of unique
791 * items, examined in order from first list to last list, that are
792 * present in one or more of the lists.
793 * @param lists The lists to compute the union of.
794 * @returns The union of elements within `lists`.
795 */
796 union<T>(...lists: Array<List<T>>): T[];
797
798 /**
799 * Computes the list of values that are the intersection of the
800 * passed-in `lists`. Each value in the result is present in each of
801 * the lists.
802 * @param lists The lists to compute the intersection of.
803 * @returns The intersection of elements within the `lists`.
804 */
805 intersection<T>(...lists: Array<List<T>>): T[];
806
807 /**
808 * Similar to without, but returns the values from `list` that are not
809 * present in `others`.
810 * @param list The starting list.
811 * @param others The lists of values to exclude from `list`.
812 * @returns The contents of `list` without the values in `others`.
813 */
814 difference<T>(
815 list: List<T>,
816 ...others: Array<List<T>>
817 ): T[];
818
819 /**
820 * Produces a duplicate-free version of `list`, using === to test
821 * object equality. If you know in advance that `list` is sorted,
822 * passing true for isSorted will run a much faster algorithm. If you
823 * want to compute unique items based on a transformation, pass an
824 * iteratee function.
825 * @param list The list to remove duplicates from.
826 * @param isSorted True if `list` is already sorted, optional,
827 * default = false.
828 * @param iteratee Transform the elements of `list` before comparisons
829 * for uniqueness.
830 * @param context 'this' object in `iteratee`, optional.
831 * @returns An array containing only the unique elements in `list`.
832 */
833 uniq<V extends List<any>>(
834 list: V,
835 isSorted?: boolean,
836 iteratee?: Iteratee<V, any>,
837 context?: any,
838 ): Array<TypeOfList<V>>;
839 uniq<V extends List<any>>(
840 list: V,
841 iteratee?: Iteratee<V, any>,
842 context?: any,
843 ): Array<TypeOfList<V>>;
844
845 /**
846 * @see uniq
847 */
848 unique: UnderscoreStatic["uniq"];
849
850 /**
851 * Merges together the values of each of the `lists` with the values at
852 * the corresponding position. Useful when you have separate data
853 * sources that are coordinated through matching list indexes.
854 * @param lists The lists to zip.
855 * @returns The zipped version of `lists`.
856 */
857 zip(): [];
858 zip<T, U, V>(...lists: [List<T>, List<U>, List<V>]): Array<[T, U, V]>;
859 zip<T, U>(...lists: [List<T>, List<U>]): Array<[T, U]>;
860 zip<T>(...lists: [List<T>]): Array<[T]>; // eslint-disable-line @definitelytyped/no-single-element-tuple-type
861 zip<T>(...lists: Array<List<T>>): T[][];
862 zip(...lists: Array<List<any>>): any[][];
863
864 /**
865 * The opposite of zip. Given a list of lists, returns a series of new
866 * arrays, the first of which contains all of the first elements in the
867 * input lists, the second of which contains all of the second
868 * elements, and so on. (alias: transpose)
869 * @param lists The lists to unzip.
870 * @returns The unzipped version of `lists`.
871 */
872 unzip<T, U, V>(lists: List<[T, U, V]>): [T[], U[], V[]];
873 unzip<T, U>(lists: List<[T, U]>): [T[], U[]];
874 unzip<T>(lists: List<[T]>): [T[]]; // eslint-disable-line @definitelytyped/no-single-element-tuple-type
875 unzip<T>(lists: List<List<T>>): T[][];
876 unzip(lists: List<List<any>>): any[][];
877 unzip(): [];
878 transpose<T, U, V>(lists: List<[T, U, V]>): [T[], U[], V[]];
879 transpose<T, U>(lists: List<[T, U]>): [T[], U[]];
880 transpose<T>(lists: List<[T]>): [T[]]; // eslint-disable-line @definitelytyped/no-single-element-tuple-type
881 transpose<T>(lists: List<List<T>>): T[][];
882 transpose(lists: List<List<any>>): any[][];
883 transpose(): [];
884
885 /**
886 * Converts lists into objects. Pass either a single `list` of
887 * [key, value] pairs, or a `list` of keys and a list of `values`.
888 * Passing by pairs is the reverse of pairs. If duplicate keys exist,
889 * the last value wins.
890 * @param list A list of [key, value] pairs or a list of keys.
891 * @param values If `list` is a list of keys, a list of values
892 * corresponding to those keys.
893 * @returns An object comprised of the provided keys and values.
894 */
895 object<TList extends List<string | number>, TValue>(
896 list: TList,
897 values: List<TValue>,
898 ): Dictionary<TValue | undefined>;
899 object<TList extends List<List<any>>>(
900 list: TList,
901 ): Dictionary<PairValue<TypeOfList<TList>>>;
902
903 /**
904 * Returns the index at which `value` can be found in `list`, or -1 if
905 * `value` is not present. If you're working with a large list and you
906 * know that the list is already sorted, pass true for
907 * `isSortedOrFromIndex` to use a faster binary search...or, pass a
908 * number in order to look for the first matching value in the list
909 * after the given index.
910 * @param list The list to search for the index of `value`.
911 * @param value The value to search for within `list`.
912 * @param isSortedOrFromIndex True if `list` is already sorted OR the
913 * starting index for the search, optional.
914 * @returns The index of the first occurrence of `value` within `list`
915 * or -1 if `value` is not found.
916 */
917 indexOf<V extends List<any>>(
918 list: V,
919 value: TypeOfList<V>,
920 isSortedOrFromIndex?: boolean | number,
921 ): number;
922
923 /**
924 * Returns the index of the last occurrence of `value` in `list`, or -1
925 * if `value` is not present. Pass `fromIndex` to start your search at
926 * a given index.
927 * @param list The list to search for the last occurrence of `value`.
928 * @param value The value to search for within `list`.
929 * @param fromIndex The starting index for the search, optional.
930 * @returns The index of the last occurrence of `value` within `list`
931 * or -1 if `value` is not found.
932 */
933 lastIndexOf<V extends List<any>>(
934 list: V,
935 value: TypeOfList<V>,
936 fromIndex?: number,
937 ): number;
938
939 /**
940 * Returns the first index of an element in `list` where the `iteratee`
941 * truth test passes, otherwise returns -1.
942 * @param list The list to search for the index of the first element
943 * that passes the truth test.
944 * @param iteratee The truth test to apply.
945 * @param context `this` object in `iteratee`, optional.
946 * @returns The index of the first element in `list` where the
947 * truth test passes or -1 if no elements pass.
948 */
949 findIndex<V extends List<any>>(
950 list: V,
951 iteratee?: Iteratee<V, boolean>,
952 context?: any,
953 ): number;
954
955 /**
956 * Returns the last index of an element in `list` where the `iteratee`
957 * truth test passes, otherwise returns -1.
958 * @param list The list to search for the index of the last element
959 * that passes the truth test.
960 * @param iteratee The truth test to apply.
961 * @param context `this` object in `iteratee`, optional.
962 * @returns The index of the last element in `list` where the
963 * truth test passes or -1 if no elements pass.
964 */
965 findLastIndex<V extends List<any>>(
966 list: V,
967 iteratee?: Iteratee<V, boolean>,
968 context?: any,
969 ): number;
970
971 /**
972 * Uses a binary search to determine the lowest index at which the
973 * value should be inserted into `list` in order to maintain `list`'s
974 * sorted order. If an iteratee is provided, it will be used to compute
975 * the sort ranking of each value, including the value you pass.
976 * @param list A sorted list.
977 * @param value The value to determine an insert index for to mainain
978 * the sorting in `list`.
979 * @param iteratee Iteratee to compute the sort ranking of each
980 * element including `value`, optional.
981 * @param context `this` object in `iteratee`, optional.
982 * @returns The index where `value` should be inserted into `list`.
983 */
984 sortedIndex<V extends List<any>>(
985 list: V,
986 value: TypeOfList<V>,
987 iteratee?: Iteratee<V | undefined, any>,
988 context?: any,
989 ): number;
990
991 /**
992 * A function to create flexibly-numbered lists of integers, handy for
993 * `each` and `map` loops. Returns a list of integers from
994 * `startOrStop` (inclusive) to `stop` (exclusive), incremented
995 * (or decremented) by `step`. Note that ranges that `stop` before they
996 * `start` are considered to be zero-length instead of negative - if
997 * you'd like a negative range, use a negative `step`.
998 *
999 * If `stop` is not specified, `startOrStop` will be the number to stop
1000 * at and the default start of 0 will be used.
1001 * @param startOrStop If `stop` is specified, the number to start at.
1002 * Otherwise, this is the number to stop at and the default start of 0
1003 * will be used.
1004 * @param stop The number to stop at.
1005 * @param step The number to count up by each iteration, optional,
1006 * default = 1.
1007 * @returns An array of numbers from start to `stop` with increments
1008 * of `step`.
1009 */
1010 range(
1011 startOrStop: number,
1012 stop?: number,
1013 step?: number,
1014 ): number[];
1015
1016 /**
1017 * Chunks `list` into multiple arrays, each containing `length` or
1018 * fewer items.
1019 * @param list The list to chunk.
1020 * @param length The maximum size of the chunks.
1021 * @returns The contents of `list` in chunks no greater than `length`
1022 * in size.
1023 */
1024 chunk<V extends List<any>>(list: V, length: number): Array<Array<TypeOfList<V>>>;
1025
1026 /*************
1027 * Functions *
1028 *************/
1029
1030 /**
1031 * Bind a function to an object, meaning that whenever the function is called, the value of this will
1032 * be the object. Optionally, bind arguments to the function to pre-fill them, also known as partial application.
1033 * @param func The function to bind `this` to `object`.
1034 * @param context The `this` pointer whenever `fn` is called.
1035 * @param arguments Additional arguments to pass to `fn` when called.
1036 * @return `fn` with `this` bound to `object`.
1037 */
1038 bind(
1039 func: Function,
1040 context: any,
1041 ...args: any[]
1042 ): () => any;
1043
1044 /**
1045 * Binds a number of methods on the object, specified by methodNames, to be run in the context of that object
1046 * whenever they are invoked. Very handy for binding functions that are going to be used as event handlers,
1047 * which would otherwise be invoked with a fairly useless this. If no methodNames are provided, all of the
1048 * object's function properties will be bound to it.
1049 * @param object The object to bind the methods `methodName` to.
1050 * @param methodNames The methods to bind to `object`, optional and if not provided all of `object`'s
1051 * methods are bound.
1052 */
1053 bindAll(
1054 object: any,
1055 ...methodNames: string[]
1056 ): any;
1057
1058 /**
1059 * Partially apply a function by filling in any number of its arguments, without changing its dynamic this value.
1060 * A close cousin of bind. You may pass _ in your list of arguments to specify an argument that should not be
1061 * pre-filled, but left open to supply at call-time.
1062 * @param fn Function to partially fill in arguments.
1063 * @param arguments The partial arguments.
1064 * @return `fn` with partially filled in arguments.
1065 */
1066
1067 partial<T1, T2>(
1068 fn: { (p1: T1): T2 },
1069 p1: T1,
1070 ): { (): T2 };
1071
1072 partial<T1, T2, T3>(
1073 fn: { (p1: T1, p2: T2): T3 },
1074 p1: T1,
1075 ): { (p2: T2): T3 };
1076
1077 partial<T1, T2, T3>(
1078 fn: { (p1: T1, p2: T2): T3 },
1079 p1: T1,
1080 p2: T2,
1081 ): { (): T3 };
1082
1083 partial<T1, T2, T3>(
1084 fn: { (p1: T1, p2: T2): T3 },
1085 stub1: UnderscoreStatic,
1086 p2: T2,
1087 ): { (p1: T1): T3 };
1088
1089 partial<T1, T2, T3, T4>(
1090 fn: { (p1: T1, p2: T2, p3: T3): T4 },
1091 p1: T1,
1092 ): { (p2: T2, p3: T3): T4 };
1093
1094 partial<T1, T2, T3, T4>(
1095 fn: { (p1: T1, p2: T2, p3: T3): T4 },
1096 p1: T1,
1097 p2: T2,
1098 ): { (p3: T3): T4 };
1099
1100 partial<T1, T2, T3, T4>(
1101 fn: { (p1: T1, p2: T2, p3: T3): T4 },
1102 stub1: UnderscoreStatic,
1103 p2: T2,
1104 ): { (p1: T1, p3: T3): T4 };
1105
1106 partial<T1, T2, T3, T4>(
1107 fn: { (p1: T1, p2: T2, p3: T3): T4 },
1108 p1: T1,
1109 p2: T2,
1110 p3: T3,
1111 ): { (): T4 };
1112
1113 partial<T1, T2, T3, T4>(
1114 fn: { (p1: T1, p2: T2, p3: T3): T4 },
1115 stub1: UnderscoreStatic,
1116 p2: T2,
1117 p3: T3,
1118 ): { (p1: T1): T4 };
1119
1120 partial<T1, T2, T3, T4>(
1121 fn: { (p1: T1, p2: T2, p3: T3): T4 },
1122 p1: T1,
1123 stub2: UnderscoreStatic,
1124 p3: T3,
1125 ): { (p2: T2): T4 };
1126
1127 partial<T1, T2, T3, T4>(
1128 fn: { (p1: T1, p2: T2, p3: T3): T4 },
1129 stub1: UnderscoreStatic,
1130 stub2: UnderscoreStatic,
1131 p3: T3,
1132 ): { (p1: T1, p2: T2): T4 };
1133
1134 partial<T1, T2, T3, T4, T5>(
1135 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1136 p1: T1,
1137 ): { (p2: T2, p3: T3, p4: T4): T5 };
1138
1139 partial<T1, T2, T3, T4, T5>(
1140 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1141 p1: T1,
1142 p2: T2,
1143 ): { (p3: T3, p4: T4): T5 };
1144
1145 partial<T1, T2, T3, T4, T5>(
1146 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1147 stub1: UnderscoreStatic,
1148 p2: T2,
1149 ): { (p1: T1, p3: T3, p4: T4): T5 };
1150
1151 partial<T1, T2, T3, T4, T5>(
1152 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1153 p1: T1,
1154 p2: T2,
1155 p3: T3,
1156 ): { (p4: T4): T5 };
1157
1158 partial<T1, T2, T3, T4, T5>(
1159 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1160 stub1: UnderscoreStatic,
1161 p2: T2,
1162 p3: T3,
1163 ): { (p1: T1, p4: T4): T5 };
1164
1165 partial<T1, T2, T3, T4, T5>(
1166 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1167 p1: T1,
1168 stub2: UnderscoreStatic,
1169 p3: T3,
1170 ): { (p2: T2, p4: T4): T5 };
1171
1172 partial<T1, T2, T3, T4, T5>(
1173 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1174 stub1: UnderscoreStatic,
1175 stub2: UnderscoreStatic,
1176 p3: T3,
1177 ): { (p1: T1, p2: T2, p4: T4): T5 };
1178
1179 partial<T1, T2, T3, T4, T5>(
1180 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1181 p1: T1,
1182 p2: T2,
1183 p3: T3,
1184 p4: T4,
1185 ): { (): T5 };
1186
1187 partial<T1, T2, T3, T4, T5>(
1188 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1189 stub1: UnderscoreStatic,
1190 p2: T2,
1191 p3: T3,
1192 p4: T4,
1193 ): { (p1: T1): T5 };
1194
1195 partial<T1, T2, T3, T4, T5>(
1196 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1197 p1: T1,
1198 stub2: UnderscoreStatic,
1199 p3: T3,
1200 p4: T4,
1201 ): { (p2: T2): T5 };
1202
1203 partial<T1, T2, T3, T4, T5>(
1204 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1205 stub1: UnderscoreStatic,
1206 stub2: UnderscoreStatic,
1207 p3: T3,
1208 p4: T4,
1209 ): { (p1: T1, p2: T2): T5 };
1210
1211 partial<T1, T2, T3, T4, T5>(
1212 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1213 p1: T1,
1214 p2: T2,
1215 stub3: UnderscoreStatic,
1216 p4: T4,
1217 ): { (p3: T3): T5 };
1218
1219 partial<T1, T2, T3, T4, T5>(
1220 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1221 stub1: UnderscoreStatic,
1222 p2: T2,
1223 stub3: UnderscoreStatic,
1224 p4: T4,
1225 ): { (p1: T1, p3: T3): T5 };
1226
1227 partial<T1, T2, T3, T4, T5>(
1228 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1229 p1: T1,
1230 stub2: UnderscoreStatic,
1231 stub3: UnderscoreStatic,
1232 p4: T4,
1233 ): { (p2: T2, p3: T3): T5 };
1234
1235 partial<T1, T2, T3, T4, T5>(
1236 fn: { (p1: T1, p2: T2, p3: T3, p4: T4): T5 },
1237 stub1: UnderscoreStatic,
1238 stub2: UnderscoreStatic,
1239 stub3: UnderscoreStatic,
1240 p4: T4,
1241 ): { (p1: T1, p2: T2, p3: T3): T5 };
1242
1243 partial<T1, T2, T3, T4, T5, T6>(
1244 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1245 p1: T1,
1246 ): { (p2: T2, p3: T3, p4: T4, p5: T5): T6 };
1247
1248 partial<T1, T2, T3, T4, T5, T6>(
1249 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1250 p1: T1,
1251 p2: T2,
1252 ): { (p3: T3, p4: T4, p5: T5): T6 };
1253
1254 partial<T1, T2, T3, T4, T5, T6>(
1255 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1256 stub1: UnderscoreStatic,
1257 p2: T2,
1258 ): { (p1: T1, p3: T3, p4: T4, p5: T5): T6 };
1259
1260 partial<T1, T2, T3, T4, T5, T6>(
1261 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1262 p1: T1,
1263 p2: T2,
1264 p3: T3,
1265 ): { (p4: T4, p5: T5): T6 };
1266
1267 partial<T1, T2, T3, T4, T5, T6>(
1268 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1269 stub1: UnderscoreStatic,
1270 p2: T2,
1271 p3: T3,
1272 ): { (p1: T1, p4: T4, p5: T5): T6 };
1273
1274 partial<T1, T2, T3, T4, T5, T6>(
1275 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1276 p1: T1,
1277 stub2: UnderscoreStatic,
1278 p3: T3,
1279 ): { (p2: T2, p4: T4, p5: T5): T6 };
1280
1281 partial<T1, T2, T3, T4, T5, T6>(
1282 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1283 stub1: UnderscoreStatic,
1284 stub2: UnderscoreStatic,
1285 p3: T3,
1286 ): { (p1: T1, p2: T2, p4: T4, p5: T5): T6 };
1287
1288 partial<T1, T2, T3, T4, T5, T6>(
1289 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1290 p1: T1,
1291 p2: T2,
1292 p3: T3,
1293 p4: T4,
1294 ): { (p5: T5): T6 };
1295
1296 partial<T1, T2, T3, T4, T5, T6>(
1297 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1298 stub1: UnderscoreStatic,
1299 p2: T2,
1300 p3: T3,
1301 p4: T4,
1302 ): { (p1: T1, p5: T5): T6 };
1303
1304 partial<T1, T2, T3, T4, T5, T6>(
1305 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1306 p1: T1,
1307 stub2: UnderscoreStatic,
1308 p3: T3,
1309 p4: T4,
1310 ): { (p2: T2, p5: T5): T6 };
1311
1312 partial<T1, T2, T3, T4, T5, T6>(
1313 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1314 stub1: UnderscoreStatic,
1315 stub2: UnderscoreStatic,
1316 p3: T3,
1317 p4: T4,
1318 ): { (p1: T1, p2: T2, p5: T5): T6 };
1319
1320 partial<T1, T2, T3, T4, T5, T6>(
1321 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1322 p1: T1,
1323 p2: T2,
1324 stub3: UnderscoreStatic,
1325 p4: T4,
1326 ): { (p3: T3, p5: T5): T6 };
1327
1328 partial<T1, T2, T3, T4, T5, T6>(
1329 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1330 stub1: UnderscoreStatic,
1331 p2: T2,
1332 stub3: UnderscoreStatic,
1333 p4: T4,
1334 ): { (p1: T1, p3: T3, p5: T5): T6 };
1335
1336 partial<T1, T2, T3, T4, T5, T6>(
1337 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1338 p1: T1,
1339 stub2: UnderscoreStatic,
1340 stub3: UnderscoreStatic,
1341 p4: T4,
1342 ): { (p2: T2, p3: T3, p5: T5): T6 };
1343
1344 partial<T1, T2, T3, T4, T5, T6>(
1345 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1346 stub1: UnderscoreStatic,
1347 stub2: UnderscoreStatic,
1348 stub3: UnderscoreStatic,
1349 p4: T4,
1350 ): { (p1: T1, p2: T2, p3: T3, p5: T5): T6 };
1351
1352 partial<T1, T2, T3, T4, T5, T6>(
1353 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1354 p1: T1,
1355 p2: T2,
1356 p3: T3,
1357 p4: T4,
1358 p5: T5,
1359 ): { (): T6 };
1360
1361 partial<T1, T2, T3, T4, T5, T6>(
1362 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1363 stub1: UnderscoreStatic,
1364 p2: T2,
1365 p3: T3,
1366 p4: T4,
1367 p5: T5,
1368 ): { (p1: T1): T6 };
1369
1370 partial<T1, T2, T3, T4, T5, T6>(
1371 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1372 p1: T1,
1373 stub2: UnderscoreStatic,
1374 p3: T3,
1375 p4: T4,
1376 p5: T5,
1377 ): { (p2: T2): T6 };
1378
1379 partial<T1, T2, T3, T4, T5, T6>(
1380 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1381 stub1: UnderscoreStatic,
1382 stub2: UnderscoreStatic,
1383 p3: T3,
1384 p4: T4,
1385 p5: T5,
1386 ): { (p1: T1, p2: T2): T6 };
1387
1388 partial<T1, T2, T3, T4, T5, T6>(
1389 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1390 p1: T1,
1391 p2: T2,
1392 stub3: UnderscoreStatic,
1393 p4: T4,
1394 p5: T5,
1395 ): { (p3: T3): T6 };
1396
1397 partial<T1, T2, T3, T4, T5, T6>(
1398 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1399 stub1: UnderscoreStatic,
1400 p2: T2,
1401 stub3: UnderscoreStatic,
1402 p4: T4,
1403 p5: T5,
1404 ): { (p1: T1, p3: T3): T6 };
1405
1406 partial<T1, T2, T3, T4, T5, T6>(
1407 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1408 p1: T1,
1409 stub2: UnderscoreStatic,
1410 stub3: UnderscoreStatic,
1411 p4: T4,
1412 p5: T5,
1413 ): { (p2: T2, p3: T3): T6 };
1414
1415 partial<T1, T2, T3, T4, T5, T6>(
1416 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1417 stub1: UnderscoreStatic,
1418 stub2: UnderscoreStatic,
1419 stub3: UnderscoreStatic,
1420 p4: T4,
1421 p5: T5,
1422 ): { (p1: T1, p2: T2, p3: T3): T6 };
1423
1424 partial<T1, T2, T3, T4, T5, T6>(
1425 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1426 p1: T1,
1427 p2: T2,
1428 p3: T3,
1429 stub4: UnderscoreStatic,
1430 p5: T5,
1431 ): { (p4: T4): T6 };
1432
1433 partial<T1, T2, T3, T4, T5, T6>(
1434 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1435 stub1: UnderscoreStatic,
1436 p2: T2,
1437 p3: T3,
1438 stub4: UnderscoreStatic,
1439 p5: T5,
1440 ): { (p1: T1, p4: T4): T6 };
1441
1442 partial<T1, T2, T3, T4, T5, T6>(
1443 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1444 p1: T1,
1445 stub2: UnderscoreStatic,
1446 p3: T3,
1447 stub4: UnderscoreStatic,
1448 p5: T5,
1449 ): { (p2: T2, p4: T4): T6 };
1450
1451 partial<T1, T2, T3, T4, T5, T6>(
1452 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1453 stub1: UnderscoreStatic,
1454 stub2: UnderscoreStatic,
1455 p3: T3,
1456 stub4: UnderscoreStatic,
1457 p5: T5,
1458 ): { (p1: T1, p2: T2, p4: T4): T6 };
1459
1460 partial<T1, T2, T3, T4, T5, T6>(
1461 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1462 p1: T1,
1463 p2: T2,
1464 stub3: UnderscoreStatic,
1465 stub4: UnderscoreStatic,
1466 p5: T5,
1467 ): { (p3: T3, p4: T4): T6 };
1468
1469 partial<T1, T2, T3, T4, T5, T6>(
1470 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1471 stub1: UnderscoreStatic,
1472 p2: T2,
1473 stub3: UnderscoreStatic,
1474 stub4: UnderscoreStatic,
1475 p5: T5,
1476 ): { (p1: T1, p3: T3, p4: T4): T6 };
1477
1478 partial<T1, T2, T3, T4, T5, T6>(
1479 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1480 p1: T1,
1481 stub2: UnderscoreStatic,
1482 stub3: UnderscoreStatic,
1483 stub4: UnderscoreStatic,
1484 p5: T5,
1485 ): { (p2: T2, p3: T3, p4: T4): T6 };
1486
1487 partial<T1, T2, T3, T4, T5, T6>(
1488 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T6 },
1489 stub1: UnderscoreStatic,
1490 stub2: UnderscoreStatic,
1491 stub3: UnderscoreStatic,
1492 stub4: UnderscoreStatic,
1493 p5: T5,
1494 ): { (p1: T1, p2: T2, p3: T3, p4: T4): T6 };
1495
1496 partial<T1, T2, T3, T4, T5, T6, T7>(
1497 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1498 p1: T1,
1499 ): { (p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 };
1500
1501 partial<T1, T2, T3, T4, T5, T6, T7>(
1502 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1503 p1: T1,
1504 p2: T2,
1505 ): { (p3: T3, p4: T4, p5: T5, p6: T6): T7 };
1506
1507 partial<T1, T2, T3, T4, T5, T6, T7>(
1508 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1509 stub1: UnderscoreStatic,
1510 p2: T2,
1511 ): { (p1: T1, p3: T3, p4: T4, p5: T5, p6: T6): T7 };
1512
1513 partial<T1, T2, T3, T4, T5, T6, T7>(
1514 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1515 p1: T1,
1516 p2: T2,
1517 p3: T3,
1518 ): { (p4: T4, p5: T5, p6: T6): T7 };
1519
1520 partial<T1, T2, T3, T4, T5, T6, T7>(
1521 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1522 stub1: UnderscoreStatic,
1523 p2: T2,
1524 p3: T3,
1525 ): { (p1: T1, p4: T4, p5: T5, p6: T6): T7 };
1526
1527 partial<T1, T2, T3, T4, T5, T6, T7>(
1528 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1529 p1: T1,
1530 stub2: UnderscoreStatic,
1531 p3: T3,
1532 ): { (p2: T2, p4: T4, p5: T5, p6: T6): T7 };
1533
1534 partial<T1, T2, T3, T4, T5, T6, T7>(
1535 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1536 stub1: UnderscoreStatic,
1537 stub2: UnderscoreStatic,
1538 p3: T3,
1539 ): { (p1: T1, p2: T2, p4: T4, p5: T5, p6: T6): T7 };
1540
1541 partial<T1, T2, T3, T4, T5, T6, T7>(
1542 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1543 p1: T1,
1544 p2: T2,
1545 p3: T3,
1546 p4: T4,
1547 ): { (p5: T5, p6: T6): T7 };
1548
1549 partial<T1, T2, T3, T4, T5, T6, T7>(
1550 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1551 stub1: UnderscoreStatic,
1552 p2: T2,
1553 p3: T3,
1554 p4: T4,
1555 ): { (p1: T1, p5: T5, p6: T6): T7 };
1556
1557 partial<T1, T2, T3, T4, T5, T6, T7>(
1558 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1559 p1: T1,
1560 stub2: UnderscoreStatic,
1561 p3: T3,
1562 p4: T4,
1563 ): { (p2: T2, p5: T5, p6: T6): T7 };
1564
1565 partial<T1, T2, T3, T4, T5, T6, T7>(
1566 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1567 stub1: UnderscoreStatic,
1568 stub2: UnderscoreStatic,
1569 p3: T3,
1570 p4: T4,
1571 ): { (p1: T1, p2: T2, p5: T5, p6: T6): T7 };
1572
1573 partial<T1, T2, T3, T4, T5, T6, T7>(
1574 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1575 p1: T1,
1576 p2: T2,
1577 stub3: UnderscoreStatic,
1578 p4: T4,
1579 ): { (p3: T3, p5: T5, p6: T6): T7 };
1580
1581 partial<T1, T2, T3, T4, T5, T6, T7>(
1582 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1583 stub1: UnderscoreStatic,
1584 p2: T2,
1585 stub3: UnderscoreStatic,
1586 p4: T4,
1587 ): { (p1: T1, p3: T3, p5: T5, p6: T6): T7 };
1588
1589 partial<T1, T2, T3, T4, T5, T6, T7>(
1590 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1591 p1: T1,
1592 stub2: UnderscoreStatic,
1593 stub3: UnderscoreStatic,
1594 p4: T4,
1595 ): { (p2: T2, p3: T3, p5: T5, p6: T6): T7 };
1596
1597 partial<T1, T2, T3, T4, T5, T6, T7>(
1598 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1599 stub1: UnderscoreStatic,
1600 stub2: UnderscoreStatic,
1601 stub3: UnderscoreStatic,
1602 p4: T4,
1603 ): { (p1: T1, p2: T2, p3: T3, p5: T5, p6: T6): T7 };
1604
1605 partial<T1, T2, T3, T4, T5, T6, T7>(
1606 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1607 p1: T1,
1608 p2: T2,
1609 p3: T3,
1610 p4: T4,
1611 p5: T5,
1612 ): { (p6: T6): T7 };
1613
1614 partial<T1, T2, T3, T4, T5, T6, T7>(
1615 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1616 stub1: UnderscoreStatic,
1617 p2: T2,
1618 p3: T3,
1619 p4: T4,
1620 p5: T5,
1621 ): { (p1: T1, p6: T6): T7 };
1622
1623 partial<T1, T2, T3, T4, T5, T6, T7>(
1624 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1625 p1: T1,
1626 stub2: UnderscoreStatic,
1627 p3: T3,
1628 p4: T4,
1629 p5: T5,
1630 ): { (p2: T2, p6: T6): T7 };
1631
1632 partial<T1, T2, T3, T4, T5, T6, T7>(
1633 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1634 stub1: UnderscoreStatic,
1635 stub2: UnderscoreStatic,
1636 p3: T3,
1637 p4: T4,
1638 p5: T5,
1639 ): { (p1: T1, p2: T2, p6: T6): T7 };
1640
1641 partial<T1, T2, T3, T4, T5, T6, T7>(
1642 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1643 p1: T1,
1644 p2: T2,
1645 stub3: UnderscoreStatic,
1646 p4: T4,
1647 p5: T5,
1648 ): { (p3: T3, p6: T6): T7 };
1649
1650 partial<T1, T2, T3, T4, T5, T6, T7>(
1651 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1652 stub1: UnderscoreStatic,
1653 p2: T2,
1654 stub3: UnderscoreStatic,
1655 p4: T4,
1656 p5: T5,
1657 ): { (p1: T1, p3: T3, p6: T6): T7 };
1658
1659 partial<T1, T2, T3, T4, T5, T6, T7>(
1660 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1661 p1: T1,
1662 stub2: UnderscoreStatic,
1663 stub3: UnderscoreStatic,
1664 p4: T4,
1665 p5: T5,
1666 ): { (p2: T2, p3: T3, p6: T6): T7 };
1667
1668 partial<T1, T2, T3, T4, T5, T6, T7>(
1669 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1670 stub1: UnderscoreStatic,
1671 stub2: UnderscoreStatic,
1672 stub3: UnderscoreStatic,
1673 p4: T4,
1674 p5: T5,
1675 ): { (p1: T1, p2: T2, p3: T3, p6: T6): T7 };
1676
1677 partial<T1, T2, T3, T4, T5, T6, T7>(
1678 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1679 p1: T1,
1680 p2: T2,
1681 p3: T3,
1682 stub4: UnderscoreStatic,
1683 p5: T5,
1684 ): { (p4: T4, p6: T6): T7 };
1685
1686 partial<T1, T2, T3, T4, T5, T6, T7>(
1687 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1688 stub1: UnderscoreStatic,
1689 p2: T2,
1690 p3: T3,
1691 stub4: UnderscoreStatic,
1692 p5: T5,
1693 ): { (p1: T1, p4: T4, p6: T6): T7 };
1694
1695 partial<T1, T2, T3, T4, T5, T6, T7>(
1696 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1697 p1: T1,
1698 stub2: UnderscoreStatic,
1699 p3: T3,
1700 stub4: UnderscoreStatic,
1701 p5: T5,
1702 ): { (p2: T2, p4: T4, p6: T6): T7 };
1703
1704 partial<T1, T2, T3, T4, T5, T6, T7>(
1705 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1706 stub1: UnderscoreStatic,
1707 stub2: UnderscoreStatic,
1708 p3: T3,
1709 stub4: UnderscoreStatic,
1710 p5: T5,
1711 ): { (p1: T1, p2: T2, p4: T4, p6: T6): T7 };
1712
1713 partial<T1, T2, T3, T4, T5, T6, T7>(
1714 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1715 p1: T1,
1716 p2: T2,
1717 stub3: UnderscoreStatic,
1718 stub4: UnderscoreStatic,
1719 p5: T5,
1720 ): { (p3: T3, p4: T4, p6: T6): T7 };
1721
1722 partial<T1, T2, T3, T4, T5, T6, T7>(
1723 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1724 stub1: UnderscoreStatic,
1725 p2: T2,
1726 stub3: UnderscoreStatic,
1727 stub4: UnderscoreStatic,
1728 p5: T5,
1729 ): { (p1: T1, p3: T3, p4: T4, p6: T6): T7 };
1730
1731 partial<T1, T2, T3, T4, T5, T6, T7>(
1732 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1733 p1: T1,
1734 stub2: UnderscoreStatic,
1735 stub3: UnderscoreStatic,
1736 stub4: UnderscoreStatic,
1737 p5: T5,
1738 ): { (p2: T2, p3: T3, p4: T4, p6: T6): T7 };
1739
1740 partial<T1, T2, T3, T4, T5, T6, T7>(
1741 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1742 stub1: UnderscoreStatic,
1743 stub2: UnderscoreStatic,
1744 stub3: UnderscoreStatic,
1745 stub4: UnderscoreStatic,
1746 p5: T5,
1747 ): { (p1: T1, p2: T2, p3: T3, p4: T4, p6: T6): T7 };
1748
1749 partial<T1, T2, T3, T4, T5, T6, T7>(
1750 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1751 p1: T1,
1752 p2: T2,
1753 p3: T3,
1754 p4: T4,
1755 p5: T5,
1756 p6: T6,
1757 ): { (): T7 };
1758
1759 partial<T1, T2, T3, T4, T5, T6, T7>(
1760 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1761 stub1: UnderscoreStatic,
1762 p2: T2,
1763 p3: T3,
1764 p4: T4,
1765 p5: T5,
1766 p6: T6,
1767 ): { (p1: T1): T7 };
1768
1769 partial<T1, T2, T3, T4, T5, T6, T7>(
1770 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1771 p1: T1,
1772 stub2: UnderscoreStatic,
1773 p3: T3,
1774 p4: T4,
1775 p5: T5,
1776 p6: T6,
1777 ): { (p2: T2): T7 };
1778
1779 partial<T1, T2, T3, T4, T5, T6, T7>(
1780 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1781 stub1: UnderscoreStatic,
1782 stub2: UnderscoreStatic,
1783 p3: T3,
1784 p4: T4,
1785 p5: T5,
1786 p6: T6,
1787 ): { (p1: T1, p2: T2): T7 };
1788
1789 partial<T1, T2, T3, T4, T5, T6, T7>(
1790 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1791 p1: T1,
1792 p2: T2,
1793 stub3: UnderscoreStatic,
1794 p4: T4,
1795 p5: T5,
1796 p6: T6,
1797 ): { (p3: T3): T7 };
1798
1799 partial<T1, T2, T3, T4, T5, T6, T7>(
1800 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1801 stub1: UnderscoreStatic,
1802 p2: T2,
1803 stub3: UnderscoreStatic,
1804 p4: T4,
1805 p5: T5,
1806 p6: T6,
1807 ): { (p1: T1, p3: T3): T7 };
1808
1809 partial<T1, T2, T3, T4, T5, T6, T7>(
1810 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1811 p1: T1,
1812 stub2: UnderscoreStatic,
1813 stub3: UnderscoreStatic,
1814 p4: T4,
1815 p5: T5,
1816 p6: T6,
1817 ): { (p2: T2, p3: T3): T7 };
1818
1819 partial<T1, T2, T3, T4, T5, T6, T7>(
1820 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1821 stub1: UnderscoreStatic,
1822 stub2: UnderscoreStatic,
1823 stub3: UnderscoreStatic,
1824 p4: T4,
1825 p5: T5,
1826 p6: T6,
1827 ): { (p1: T1, p2: T2, p3: T3): T7 };
1828
1829 partial<T1, T2, T3, T4, T5, T6, T7>(
1830 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1831 p1: T1,
1832 p2: T2,
1833 p3: T3,
1834 stub4: UnderscoreStatic,
1835 p5: T5,
1836 p6: T6,
1837 ): { (p4: T4): T7 };
1838
1839 partial<T1, T2, T3, T4, T5, T6, T7>(
1840 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1841 stub1: UnderscoreStatic,
1842 p2: T2,
1843 p3: T3,
1844 stub4: UnderscoreStatic,
1845 p5: T5,
1846 p6: T6,
1847 ): { (p1: T1, p4: T4): T7 };
1848
1849 partial<T1, T2, T3, T4, T5, T6, T7>(
1850 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1851 p1: T1,
1852 stub2: UnderscoreStatic,
1853 p3: T3,
1854 stub4: UnderscoreStatic,
1855 p5: T5,
1856 p6: T6,
1857 ): { (p2: T2, p4: T4): T7 };
1858
1859 partial<T1, T2, T3, T4, T5, T6, T7>(
1860 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1861 stub1: UnderscoreStatic,
1862 stub2: UnderscoreStatic,
1863 p3: T3,
1864 stub4: UnderscoreStatic,
1865 p5: T5,
1866 p6: T6,
1867 ): { (p1: T1, p2: T2, p4: T4): T7 };
1868
1869 partial<T1, T2, T3, T4, T5, T6, T7>(
1870 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1871 p1: T1,
1872 p2: T2,
1873 stub3: UnderscoreStatic,
1874 stub4: UnderscoreStatic,
1875 p5: T5,
1876 p6: T6,
1877 ): { (p3: T3, p4: T4): T7 };
1878
1879 partial<T1, T2, T3, T4, T5, T6, T7>(
1880 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1881 stub1: UnderscoreStatic,
1882 p2: T2,
1883 stub3: UnderscoreStatic,
1884 stub4: UnderscoreStatic,
1885 p5: T5,
1886 p6: T6,
1887 ): { (p1: T1, p3: T3, p4: T4): T7 };
1888
1889 partial<T1, T2, T3, T4, T5, T6, T7>(
1890 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1891 p1: T1,
1892 stub2: UnderscoreStatic,
1893 stub3: UnderscoreStatic,
1894 stub4: UnderscoreStatic,
1895 p5: T5,
1896 p6: T6,
1897 ): { (p2: T2, p3: T3, p4: T4): T7 };
1898
1899 partial<T1, T2, T3, T4, T5, T6, T7>(
1900 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1901 stub1: UnderscoreStatic,
1902 stub2: UnderscoreStatic,
1903 stub3: UnderscoreStatic,
1904 stub4: UnderscoreStatic,
1905 p5: T5,
1906 p6: T6,
1907 ): { (p1: T1, p2: T2, p3: T3, p4: T4): T7 };
1908
1909 partial<T1, T2, T3, T4, T5, T6, T7>(
1910 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1911 p1: T1,
1912 p2: T2,
1913 p3: T3,
1914 p4: T4,
1915 stub5: UnderscoreStatic,
1916 p6: T6,
1917 ): { (p5: T5): T7 };
1918
1919 partial<T1, T2, T3, T4, T5, T6, T7>(
1920 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1921 stub1: UnderscoreStatic,
1922 p2: T2,
1923 p3: T3,
1924 p4: T4,
1925 stub5: UnderscoreStatic,
1926 p6: T6,
1927 ): { (p1: T1, p5: T5): T7 };
1928
1929 partial<T1, T2, T3, T4, T5, T6, T7>(
1930 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1931 p1: T1,
1932 stub2: UnderscoreStatic,
1933 p3: T3,
1934 p4: T4,
1935 stub5: UnderscoreStatic,
1936 p6: T6,
1937 ): { (p2: T2, p5: T5): T7 };
1938
1939 partial<T1, T2, T3, T4, T5, T6, T7>(
1940 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1941 stub1: UnderscoreStatic,
1942 stub2: UnderscoreStatic,
1943 p3: T3,
1944 p4: T4,
1945 stub5: UnderscoreStatic,
1946 p6: T6,
1947 ): { (p1: T1, p2: T2, p5: T5): T7 };
1948
1949 partial<T1, T2, T3, T4, T5, T6, T7>(
1950 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1951 p1: T1,
1952 p2: T2,
1953 stub3: UnderscoreStatic,
1954 p4: T4,
1955 stub5: UnderscoreStatic,
1956 p6: T6,
1957 ): { (p3: T3, p5: T5): T7 };
1958
1959 partial<T1, T2, T3, T4, T5, T6, T7>(
1960 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1961 stub1: UnderscoreStatic,
1962 p2: T2,
1963 stub3: UnderscoreStatic,
1964 p4: T4,
1965 stub5: UnderscoreStatic,
1966 p6: T6,
1967 ): { (p1: T1, p3: T3, p5: T5): T7 };
1968
1969 partial<T1, T2, T3, T4, T5, T6, T7>(
1970 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1971 p1: T1,
1972 stub2: UnderscoreStatic,
1973 stub3: UnderscoreStatic,
1974 p4: T4,
1975 stub5: UnderscoreStatic,
1976 p6: T6,
1977 ): { (p2: T2, p3: T3, p5: T5): T7 };
1978
1979 partial<T1, T2, T3, T4, T5, T6, T7>(
1980 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1981 stub1: UnderscoreStatic,
1982 stub2: UnderscoreStatic,
1983 stub3: UnderscoreStatic,
1984 p4: T4,
1985 stub5: UnderscoreStatic,
1986 p6: T6,
1987 ): { (p1: T1, p2: T2, p3: T3, p5: T5): T7 };
1988
1989 partial<T1, T2, T3, T4, T5, T6, T7>(
1990 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
1991 p1: T1,
1992 p2: T2,
1993 p3: T3,
1994 stub4: UnderscoreStatic,
1995 stub5: UnderscoreStatic,
1996 p6: T6,
1997 ): { (p4: T4, p5: T5): T7 };
1998
1999 partial<T1, T2, T3, T4, T5, T6, T7>(
2000 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
2001 stub1: UnderscoreStatic,
2002 p2: T2,
2003 p3: T3,
2004 stub4: UnderscoreStatic,
2005 stub5: UnderscoreStatic,
2006 p6: T6,
2007 ): { (p1: T1, p4: T4, p5: T5): T7 };
2008
2009 partial<T1, T2, T3, T4, T5, T6, T7>(
2010 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
2011 p1: T1,
2012 stub2: UnderscoreStatic,
2013 p3: T3,
2014 stub4: UnderscoreStatic,
2015 stub5: UnderscoreStatic,
2016 p6: T6,
2017 ): { (p2: T2, p4: T4, p5: T5): T7 };
2018
2019 partial<T1, T2, T3, T4, T5, T6, T7>(
2020 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
2021 stub1: UnderscoreStatic,
2022 stub2: UnderscoreStatic,
2023 p3: T3,
2024 stub4: UnderscoreStatic,
2025 stub5: UnderscoreStatic,
2026 p6: T6,
2027 ): { (p1: T1, p2: T2, p4: T4, p5: T5): T7 };
2028
2029 partial<T1, T2, T3, T4, T5, T6, T7>(
2030 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
2031 p1: T1,
2032 p2: T2,
2033 stub3: UnderscoreStatic,
2034 stub4: UnderscoreStatic,
2035 stub5: UnderscoreStatic,
2036 p6: T6,
2037 ): { (p3: T3, p4: T4, p5: T5): T7 };
2038
2039 partial<T1, T2, T3, T4, T5, T6, T7>(
2040 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
2041 stub1: UnderscoreStatic,
2042 p2: T2,
2043 stub3: UnderscoreStatic,
2044 stub4: UnderscoreStatic,
2045 stub5: UnderscoreStatic,
2046 p6: T6,
2047 ): { (p1: T1, p3: T3, p4: T4, p5: T5): T7 };
2048
2049 partial<T1, T2, T3, T4, T5, T6, T7>(
2050 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
2051 p1: T1,
2052 stub2: UnderscoreStatic,
2053 stub3: UnderscoreStatic,
2054 stub4: UnderscoreStatic,
2055 stub5: UnderscoreStatic,
2056 p6: T6,
2057 ): { (p2: T2, p3: T3, p4: T4, p5: T5): T7 };
2058
2059 partial<T1, T2, T3, T4, T5, T6, T7>(
2060 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 },
2061 stub1: UnderscoreStatic,
2062 stub2: UnderscoreStatic,
2063 stub3: UnderscoreStatic,
2064 stub4: UnderscoreStatic,
2065 stub5: UnderscoreStatic,
2066 p6: T6,
2067 ): { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T7 };
2068
2069 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2070 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2071 p1: T1,
2072 ): { (p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 };
2073
2074 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2075 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2076 p1: T1,
2077 p2: T2,
2078 ): { (p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 };
2079
2080 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2081 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2082 stub1: UnderscoreStatic,
2083 p2: T2,
2084 ): { (p1: T1, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 };
2085
2086 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2087 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2088 p1: T1,
2089 p2: T2,
2090 p3: T3,
2091 ): { (p4: T4, p5: T5, p6: T6, p7: T7): T8 };
2092
2093 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2094 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2095 stub1: UnderscoreStatic,
2096 p2: T2,
2097 p3: T3,
2098 ): { (p1: T1, p4: T4, p5: T5, p6: T6, p7: T7): T8 };
2099
2100 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2101 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2102 p1: T1,
2103 stub2: UnderscoreStatic,
2104 p3: T3,
2105 ): { (p2: T2, p4: T4, p5: T5, p6: T6, p7: T7): T8 };
2106
2107 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2108 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2109 stub1: UnderscoreStatic,
2110 stub2: UnderscoreStatic,
2111 p3: T3,
2112 ): { (p1: T1, p2: T2, p4: T4, p5: T5, p6: T6, p7: T7): T8 };
2113
2114 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2115 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2116 p1: T1,
2117 p2: T2,
2118 p3: T3,
2119 p4: T4,
2120 ): { (p5: T5, p6: T6, p7: T7): T8 };
2121
2122 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2123 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2124 stub1: UnderscoreStatic,
2125 p2: T2,
2126 p3: T3,
2127 p4: T4,
2128 ): { (p1: T1, p5: T5, p6: T6, p7: T7): T8 };
2129
2130 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2131 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2132 p1: T1,
2133 stub2: UnderscoreStatic,
2134 p3: T3,
2135 p4: T4,
2136 ): { (p2: T2, p5: T5, p6: T6, p7: T7): T8 };
2137
2138 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2139 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2140 stub1: UnderscoreStatic,
2141 stub2: UnderscoreStatic,
2142 p3: T3,
2143 p4: T4,
2144 ): { (p1: T1, p2: T2, p5: T5, p6: T6, p7: T7): T8 };
2145
2146 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2147 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2148 p1: T1,
2149 p2: T2,
2150 stub3: UnderscoreStatic,
2151 p4: T4,
2152 ): { (p3: T3, p5: T5, p6: T6, p7: T7): T8 };
2153
2154 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2155 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2156 stub1: UnderscoreStatic,
2157 p2: T2,
2158 stub3: UnderscoreStatic,
2159 p4: T4,
2160 ): { (p1: T1, p3: T3, p5: T5, p6: T6, p7: T7): T8 };
2161
2162 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2163 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2164 p1: T1,
2165 stub2: UnderscoreStatic,
2166 stub3: UnderscoreStatic,
2167 p4: T4,
2168 ): { (p2: T2, p3: T3, p5: T5, p6: T6, p7: T7): T8 };
2169
2170 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2171 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2172 stub1: UnderscoreStatic,
2173 stub2: UnderscoreStatic,
2174 stub3: UnderscoreStatic,
2175 p4: T4,
2176 ): { (p1: T1, p2: T2, p3: T3, p5: T5, p6: T6, p7: T7): T8 };
2177
2178 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2179 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2180 p1: T1,
2181 p2: T2,
2182 p3: T3,
2183 p4: T4,
2184 p5: T5,
2185 ): { (p6: T6, p7: T7): T8 };
2186
2187 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2188 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2189 stub1: UnderscoreStatic,
2190 p2: T2,
2191 p3: T3,
2192 p4: T4,
2193 p5: T5,
2194 ): { (p1: T1, p6: T6, p7: T7): T8 };
2195
2196 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2197 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2198 p1: T1,
2199 stub2: UnderscoreStatic,
2200 p3: T3,
2201 p4: T4,
2202 p5: T5,
2203 ): { (p2: T2, p6: T6, p7: T7): T8 };
2204
2205 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2206 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2207 stub1: UnderscoreStatic,
2208 stub2: UnderscoreStatic,
2209 p3: T3,
2210 p4: T4,
2211 p5: T5,
2212 ): { (p1: T1, p2: T2, p6: T6, p7: T7): T8 };
2213
2214 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2215 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2216 p1: T1,
2217 p2: T2,
2218 stub3: UnderscoreStatic,
2219 p4: T4,
2220 p5: T5,
2221 ): { (p3: T3, p6: T6, p7: T7): T8 };
2222
2223 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2224 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2225 stub1: UnderscoreStatic,
2226 p2: T2,
2227 stub3: UnderscoreStatic,
2228 p4: T4,
2229 p5: T5,
2230 ): { (p1: T1, p3: T3, p6: T6, p7: T7): T8 };
2231
2232 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2233 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2234 p1: T1,
2235 stub2: UnderscoreStatic,
2236 stub3: UnderscoreStatic,
2237 p4: T4,
2238 p5: T5,
2239 ): { (p2: T2, p3: T3, p6: T6, p7: T7): T8 };
2240
2241 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2242 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2243 stub1: UnderscoreStatic,
2244 stub2: UnderscoreStatic,
2245 stub3: UnderscoreStatic,
2246 p4: T4,
2247 p5: T5,
2248 ): { (p1: T1, p2: T2, p3: T3, p6: T6, p7: T7): T8 };
2249
2250 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2251 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2252 p1: T1,
2253 p2: T2,
2254 p3: T3,
2255 stub4: UnderscoreStatic,
2256 p5: T5,
2257 ): { (p4: T4, p6: T6, p7: T7): T8 };
2258
2259 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2260 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2261 stub1: UnderscoreStatic,
2262 p2: T2,
2263 p3: T3,
2264 stub4: UnderscoreStatic,
2265 p5: T5,
2266 ): { (p1: T1, p4: T4, p6: T6, p7: T7): T8 };
2267
2268 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2269 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2270 p1: T1,
2271 stub2: UnderscoreStatic,
2272 p3: T3,
2273 stub4: UnderscoreStatic,
2274 p5: T5,
2275 ): { (p2: T2, p4: T4, p6: T6, p7: T7): T8 };
2276
2277 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2278 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2279 stub1: UnderscoreStatic,
2280 stub2: UnderscoreStatic,
2281 p3: T3,
2282 stub4: UnderscoreStatic,
2283 p5: T5,
2284 ): { (p1: T1, p2: T2, p4: T4, p6: T6, p7: T7): T8 };
2285
2286 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2287 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2288 p1: T1,
2289 p2: T2,
2290 stub3: UnderscoreStatic,
2291 stub4: UnderscoreStatic,
2292 p5: T5,
2293 ): { (p3: T3, p4: T4, p6: T6, p7: T7): T8 };
2294
2295 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2296 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2297 stub1: UnderscoreStatic,
2298 p2: T2,
2299 stub3: UnderscoreStatic,
2300 stub4: UnderscoreStatic,
2301 p5: T5,
2302 ): { (p1: T1, p3: T3, p4: T4, p6: T6, p7: T7): T8 };
2303
2304 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2305 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2306 p1: T1,
2307 stub2: UnderscoreStatic,
2308 stub3: UnderscoreStatic,
2309 stub4: UnderscoreStatic,
2310 p5: T5,
2311 ): { (p2: T2, p3: T3, p4: T4, p6: T6, p7: T7): T8 };
2312
2313 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2314 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2315 stub1: UnderscoreStatic,
2316 stub2: UnderscoreStatic,
2317 stub3: UnderscoreStatic,
2318 stub4: UnderscoreStatic,
2319 p5: T5,
2320 ): { (p1: T1, p2: T2, p3: T3, p4: T4, p6: T6, p7: T7): T8 };
2321
2322 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2323 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2324 p1: T1,
2325 p2: T2,
2326 p3: T3,
2327 p4: T4,
2328 p5: T5,
2329 p6: T6,
2330 ): { (p7: T7): T8 };
2331
2332 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2333 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2334 stub1: UnderscoreStatic,
2335 p2: T2,
2336 p3: T3,
2337 p4: T4,
2338 p5: T5,
2339 p6: T6,
2340 ): { (p1: T1, p7: T7): T8 };
2341
2342 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2343 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2344 p1: T1,
2345 stub2: UnderscoreStatic,
2346 p3: T3,
2347 p4: T4,
2348 p5: T5,
2349 p6: T6,
2350 ): { (p2: T2, p7: T7): T8 };
2351
2352 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2353 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2354 stub1: UnderscoreStatic,
2355 stub2: UnderscoreStatic,
2356 p3: T3,
2357 p4: T4,
2358 p5: T5,
2359 p6: T6,
2360 ): { (p1: T1, p2: T2, p7: T7): T8 };
2361
2362 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2363 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2364 p1: T1,
2365 p2: T2,
2366 stub3: UnderscoreStatic,
2367 p4: T4,
2368 p5: T5,
2369 p6: T6,
2370 ): { (p3: T3, p7: T7): T8 };
2371
2372 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2373 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2374 stub1: UnderscoreStatic,
2375 p2: T2,
2376 stub3: UnderscoreStatic,
2377 p4: T4,
2378 p5: T5,
2379 p6: T6,
2380 ): { (p1: T1, p3: T3, p7: T7): T8 };
2381
2382 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2383 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2384 p1: T1,
2385 stub2: UnderscoreStatic,
2386 stub3: UnderscoreStatic,
2387 p4: T4,
2388 p5: T5,
2389 p6: T6,
2390 ): { (p2: T2, p3: T3, p7: T7): T8 };
2391
2392 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2393 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2394 stub1: UnderscoreStatic,
2395 stub2: UnderscoreStatic,
2396 stub3: UnderscoreStatic,
2397 p4: T4,
2398 p5: T5,
2399 p6: T6,
2400 ): { (p1: T1, p2: T2, p3: T3, p7: T7): T8 };
2401
2402 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2403 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2404 p1: T1,
2405 p2: T2,
2406 p3: T3,
2407 stub4: UnderscoreStatic,
2408 p5: T5,
2409 p6: T6,
2410 ): { (p4: T4, p7: T7): T8 };
2411
2412 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2413 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2414 stub1: UnderscoreStatic,
2415 p2: T2,
2416 p3: T3,
2417 stub4: UnderscoreStatic,
2418 p5: T5,
2419 p6: T6,
2420 ): { (p1: T1, p4: T4, p7: T7): T8 };
2421
2422 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2423 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2424 p1: T1,
2425 stub2: UnderscoreStatic,
2426 p3: T3,
2427 stub4: UnderscoreStatic,
2428 p5: T5,
2429 p6: T6,
2430 ): { (p2: T2, p4: T4, p7: T7): T8 };
2431
2432 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2433 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2434 stub1: UnderscoreStatic,
2435 stub2: UnderscoreStatic,
2436 p3: T3,
2437 stub4: UnderscoreStatic,
2438 p5: T5,
2439 p6: T6,
2440 ): { (p1: T1, p2: T2, p4: T4, p7: T7): T8 };
2441
2442 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2443 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2444 p1: T1,
2445 p2: T2,
2446 stub3: UnderscoreStatic,
2447 stub4: UnderscoreStatic,
2448 p5: T5,
2449 p6: T6,
2450 ): { (p3: T3, p4: T4, p7: T7): T8 };
2451
2452 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2453 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2454 stub1: UnderscoreStatic,
2455 p2: T2,
2456 stub3: UnderscoreStatic,
2457 stub4: UnderscoreStatic,
2458 p5: T5,
2459 p6: T6,
2460 ): { (p1: T1, p3: T3, p4: T4, p7: T7): T8 };
2461
2462 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2463 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2464 p1: T1,
2465 stub2: UnderscoreStatic,
2466 stub3: UnderscoreStatic,
2467 stub4: UnderscoreStatic,
2468 p5: T5,
2469 p6: T6,
2470 ): { (p2: T2, p3: T3, p4: T4, p7: T7): T8 };
2471
2472 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2473 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2474 stub1: UnderscoreStatic,
2475 stub2: UnderscoreStatic,
2476 stub3: UnderscoreStatic,
2477 stub4: UnderscoreStatic,
2478 p5: T5,
2479 p6: T6,
2480 ): { (p1: T1, p2: T2, p3: T3, p4: T4, p7: T7): T8 };
2481
2482 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2483 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2484 p1: T1,
2485 p2: T2,
2486 p3: T3,
2487 p4: T4,
2488 stub5: UnderscoreStatic,
2489 p6: T6,
2490 ): { (p5: T5, p7: T7): T8 };
2491
2492 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2493 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2494 stub1: UnderscoreStatic,
2495 p2: T2,
2496 p3: T3,
2497 p4: T4,
2498 stub5: UnderscoreStatic,
2499 p6: T6,
2500 ): { (p1: T1, p5: T5, p7: T7): T8 };
2501
2502 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2503 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2504 p1: T1,
2505 stub2: UnderscoreStatic,
2506 p3: T3,
2507 p4: T4,
2508 stub5: UnderscoreStatic,
2509 p6: T6,
2510 ): { (p2: T2, p5: T5, p7: T7): T8 };
2511
2512 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2513 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2514 stub1: UnderscoreStatic,
2515 stub2: UnderscoreStatic,
2516 p3: T3,
2517 p4: T4,
2518 stub5: UnderscoreStatic,
2519 p6: T6,
2520 ): { (p1: T1, p2: T2, p5: T5, p7: T7): T8 };
2521
2522 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2523 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2524 p1: T1,
2525 p2: T2,
2526 stub3: UnderscoreStatic,
2527 p4: T4,
2528 stub5: UnderscoreStatic,
2529 p6: T6,
2530 ): { (p3: T3, p5: T5, p7: T7): T8 };
2531
2532 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2533 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2534 stub1: UnderscoreStatic,
2535 p2: T2,
2536 stub3: UnderscoreStatic,
2537 p4: T4,
2538 stub5: UnderscoreStatic,
2539 p6: T6,
2540 ): { (p1: T1, p3: T3, p5: T5, p7: T7): T8 };
2541
2542 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2543 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2544 p1: T1,
2545 stub2: UnderscoreStatic,
2546 stub3: UnderscoreStatic,
2547 p4: T4,
2548 stub5: UnderscoreStatic,
2549 p6: T6,
2550 ): { (p2: T2, p3: T3, p5: T5, p7: T7): T8 };
2551
2552 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2553 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2554 stub1: UnderscoreStatic,
2555 stub2: UnderscoreStatic,
2556 stub3: UnderscoreStatic,
2557 p4: T4,
2558 stub5: UnderscoreStatic,
2559 p6: T6,
2560 ): { (p1: T1, p2: T2, p3: T3, p5: T5, p7: T7): T8 };
2561
2562 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2563 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2564 p1: T1,
2565 p2: T2,
2566 p3: T3,
2567 stub4: UnderscoreStatic,
2568 stub5: UnderscoreStatic,
2569 p6: T6,
2570 ): { (p4: T4, p5: T5, p7: T7): T8 };
2571
2572 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2573 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2574 stub1: UnderscoreStatic,
2575 p2: T2,
2576 p3: T3,
2577 stub4: UnderscoreStatic,
2578 stub5: UnderscoreStatic,
2579 p6: T6,
2580 ): { (p1: T1, p4: T4, p5: T5, p7: T7): T8 };
2581
2582 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2583 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2584 p1: T1,
2585 stub2: UnderscoreStatic,
2586 p3: T3,
2587 stub4: UnderscoreStatic,
2588 stub5: UnderscoreStatic,
2589 p6: T6,
2590 ): { (p2: T2, p4: T4, p5: T5, p7: T7): T8 };
2591
2592 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2593 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2594 stub1: UnderscoreStatic,
2595 stub2: UnderscoreStatic,
2596 p3: T3,
2597 stub4: UnderscoreStatic,
2598 stub5: UnderscoreStatic,
2599 p6: T6,
2600 ): { (p1: T1, p2: T2, p4: T4, p5: T5, p7: T7): T8 };
2601
2602 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2603 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2604 p1: T1,
2605 p2: T2,
2606 stub3: UnderscoreStatic,
2607 stub4: UnderscoreStatic,
2608 stub5: UnderscoreStatic,
2609 p6: T6,
2610 ): { (p3: T3, p4: T4, p5: T5, p7: T7): T8 };
2611
2612 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2613 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2614 stub1: UnderscoreStatic,
2615 p2: T2,
2616 stub3: UnderscoreStatic,
2617 stub4: UnderscoreStatic,
2618 stub5: UnderscoreStatic,
2619 p6: T6,
2620 ): { (p1: T1, p3: T3, p4: T4, p5: T5, p7: T7): T8 };
2621
2622 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2623 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2624 p1: T1,
2625 stub2: UnderscoreStatic,
2626 stub3: UnderscoreStatic,
2627 stub4: UnderscoreStatic,
2628 stub5: UnderscoreStatic,
2629 p6: T6,
2630 ): { (p2: T2, p3: T3, p4: T4, p5: T5, p7: T7): T8 };
2631
2632 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2633 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2634 stub1: UnderscoreStatic,
2635 stub2: UnderscoreStatic,
2636 stub3: UnderscoreStatic,
2637 stub4: UnderscoreStatic,
2638 stub5: UnderscoreStatic,
2639 p6: T6,
2640 ): { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p7: T7): T8 };
2641
2642 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2643 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2644 p1: T1,
2645 p2: T2,
2646 p3: T3,
2647 p4: T4,
2648 p5: T5,
2649 p6: T6,
2650 p7: T7,
2651 ): { (): T8 };
2652
2653 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2654 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2655 stub1: UnderscoreStatic,
2656 p2: T2,
2657 p3: T3,
2658 p4: T4,
2659 p5: T5,
2660 p6: T6,
2661 p7: T7,
2662 ): { (p1: T1): T8 };
2663
2664 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2665 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2666 p1: T1,
2667 stub2: UnderscoreStatic,
2668 p3: T3,
2669 p4: T4,
2670 p5: T5,
2671 p6: T6,
2672 p7: T7,
2673 ): { (p2: T2): T8 };
2674
2675 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2676 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2677 stub1: UnderscoreStatic,
2678 stub2: UnderscoreStatic,
2679 p3: T3,
2680 p4: T4,
2681 p5: T5,
2682 p6: T6,
2683 p7: T7,
2684 ): { (p1: T1, p2: T2): T8 };
2685
2686 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2687 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2688 p1: T1,
2689 p2: T2,
2690 stub3: UnderscoreStatic,
2691 p4: T4,
2692 p5: T5,
2693 p6: T6,
2694 p7: T7,
2695 ): { (p3: T3): T8 };
2696
2697 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2698 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2699 stub1: UnderscoreStatic,
2700 p2: T2,
2701 stub3: UnderscoreStatic,
2702 p4: T4,
2703 p5: T5,
2704 p6: T6,
2705 p7: T7,
2706 ): { (p1: T1, p3: T3): T8 };
2707
2708 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2709 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2710 p1: T1,
2711 stub2: UnderscoreStatic,
2712 stub3: UnderscoreStatic,
2713 p4: T4,
2714 p5: T5,
2715 p6: T6,
2716 p7: T7,
2717 ): { (p2: T2, p3: T3): T8 };
2718
2719 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2720 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2721 stub1: UnderscoreStatic,
2722 stub2: UnderscoreStatic,
2723 stub3: UnderscoreStatic,
2724 p4: T4,
2725 p5: T5,
2726 p6: T6,
2727 p7: T7,
2728 ): { (p1: T1, p2: T2, p3: T3): T8 };
2729
2730 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2731 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2732 p1: T1,
2733 p2: T2,
2734 p3: T3,
2735 stub4: UnderscoreStatic,
2736 p5: T5,
2737 p6: T6,
2738 p7: T7,
2739 ): { (p4: T4): T8 };
2740
2741 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2742 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2743 stub1: UnderscoreStatic,
2744 p2: T2,
2745 p3: T3,
2746 stub4: UnderscoreStatic,
2747 p5: T5,
2748 p6: T6,
2749 p7: T7,
2750 ): { (p1: T1, p4: T4): T8 };
2751
2752 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2753 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2754 p1: T1,
2755 stub2: UnderscoreStatic,
2756 p3: T3,
2757 stub4: UnderscoreStatic,
2758 p5: T5,
2759 p6: T6,
2760 p7: T7,
2761 ): { (p2: T2, p4: T4): T8 };
2762
2763 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2764 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2765 stub1: UnderscoreStatic,
2766 stub2: UnderscoreStatic,
2767 p3: T3,
2768 stub4: UnderscoreStatic,
2769 p5: T5,
2770 p6: T6,
2771 p7: T7,
2772 ): { (p1: T1, p2: T2, p4: T4): T8 };
2773
2774 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2775 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2776 p1: T1,
2777 p2: T2,
2778 stub3: UnderscoreStatic,
2779 stub4: UnderscoreStatic,
2780 p5: T5,
2781 p6: T6,
2782 p7: T7,
2783 ): { (p3: T3, p4: T4): T8 };
2784
2785 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2786 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2787 stub1: UnderscoreStatic,
2788 p2: T2,
2789 stub3: UnderscoreStatic,
2790 stub4: UnderscoreStatic,
2791 p5: T5,
2792 p6: T6,
2793 p7: T7,
2794 ): { (p1: T1, p3: T3, p4: T4): T8 };
2795
2796 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2797 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2798 p1: T1,
2799 stub2: UnderscoreStatic,
2800 stub3: UnderscoreStatic,
2801 stub4: UnderscoreStatic,
2802 p5: T5,
2803 p6: T6,
2804 p7: T7,
2805 ): { (p2: T2, p3: T3, p4: T4): T8 };
2806
2807 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2808 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2809 stub1: UnderscoreStatic,
2810 stub2: UnderscoreStatic,
2811 stub3: UnderscoreStatic,
2812 stub4: UnderscoreStatic,
2813 p5: T5,
2814 p6: T6,
2815 p7: T7,
2816 ): { (p1: T1, p2: T2, p3: T3, p4: T4): T8 };
2817
2818 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2819 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2820 p1: T1,
2821 p2: T2,
2822 p3: T3,
2823 p4: T4,
2824 stub5: UnderscoreStatic,
2825 p6: T6,
2826 p7: T7,
2827 ): { (p5: T5): T8 };
2828
2829 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2830 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2831 stub1: UnderscoreStatic,
2832 p2: T2,
2833 p3: T3,
2834 p4: T4,
2835 stub5: UnderscoreStatic,
2836 p6: T6,
2837 p7: T7,
2838 ): { (p1: T1, p5: T5): T8 };
2839
2840 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2841 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2842 p1: T1,
2843 stub2: UnderscoreStatic,
2844 p3: T3,
2845 p4: T4,
2846 stub5: UnderscoreStatic,
2847 p6: T6,
2848 p7: T7,
2849 ): { (p2: T2, p5: T5): T8 };
2850
2851 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2852 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2853 stub1: UnderscoreStatic,
2854 stub2: UnderscoreStatic,
2855 p3: T3,
2856 p4: T4,
2857 stub5: UnderscoreStatic,
2858 p6: T6,
2859 p7: T7,
2860 ): { (p1: T1, p2: T2, p5: T5): T8 };
2861
2862 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2863 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2864 p1: T1,
2865 p2: T2,
2866 stub3: UnderscoreStatic,
2867 p4: T4,
2868 stub5: UnderscoreStatic,
2869 p6: T6,
2870 p7: T7,
2871 ): { (p3: T3, p5: T5): T8 };
2872
2873 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2874 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2875 stub1: UnderscoreStatic,
2876 p2: T2,
2877 stub3: UnderscoreStatic,
2878 p4: T4,
2879 stub5: UnderscoreStatic,
2880 p6: T6,
2881 p7: T7,
2882 ): { (p1: T1, p3: T3, p5: T5): T8 };
2883
2884 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2885 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2886 p1: T1,
2887 stub2: UnderscoreStatic,
2888 stub3: UnderscoreStatic,
2889 p4: T4,
2890 stub5: UnderscoreStatic,
2891 p6: T6,
2892 p7: T7,
2893 ): { (p2: T2, p3: T3, p5: T5): T8 };
2894
2895 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2896 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2897 stub1: UnderscoreStatic,
2898 stub2: UnderscoreStatic,
2899 stub3: UnderscoreStatic,
2900 p4: T4,
2901 stub5: UnderscoreStatic,
2902 p6: T6,
2903 p7: T7,
2904 ): { (p1: T1, p2: T2, p3: T3, p5: T5): T8 };
2905
2906 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2907 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2908 p1: T1,
2909 p2: T2,
2910 p3: T3,
2911 stub4: UnderscoreStatic,
2912 stub5: UnderscoreStatic,
2913 p6: T6,
2914 p7: T7,
2915 ): { (p4: T4, p5: T5): T8 };
2916
2917 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2918 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2919 stub1: UnderscoreStatic,
2920 p2: T2,
2921 p3: T3,
2922 stub4: UnderscoreStatic,
2923 stub5: UnderscoreStatic,
2924 p6: T6,
2925 p7: T7,
2926 ): { (p1: T1, p4: T4, p5: T5): T8 };
2927
2928 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2929 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2930 p1: T1,
2931 stub2: UnderscoreStatic,
2932 p3: T3,
2933 stub4: UnderscoreStatic,
2934 stub5: UnderscoreStatic,
2935 p6: T6,
2936 p7: T7,
2937 ): { (p2: T2, p4: T4, p5: T5): T8 };
2938
2939 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2940 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2941 stub1: UnderscoreStatic,
2942 stub2: UnderscoreStatic,
2943 p3: T3,
2944 stub4: UnderscoreStatic,
2945 stub5: UnderscoreStatic,
2946 p6: T6,
2947 p7: T7,
2948 ): { (p1: T1, p2: T2, p4: T4, p5: T5): T8 };
2949
2950 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2951 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2952 p1: T1,
2953 p2: T2,
2954 stub3: UnderscoreStatic,
2955 stub4: UnderscoreStatic,
2956 stub5: UnderscoreStatic,
2957 p6: T6,
2958 p7: T7,
2959 ): { (p3: T3, p4: T4, p5: T5): T8 };
2960
2961 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2962 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2963 stub1: UnderscoreStatic,
2964 p2: T2,
2965 stub3: UnderscoreStatic,
2966 stub4: UnderscoreStatic,
2967 stub5: UnderscoreStatic,
2968 p6: T6,
2969 p7: T7,
2970 ): { (p1: T1, p3: T3, p4: T4, p5: T5): T8 };
2971
2972 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2973 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2974 p1: T1,
2975 stub2: UnderscoreStatic,
2976 stub3: UnderscoreStatic,
2977 stub4: UnderscoreStatic,
2978 stub5: UnderscoreStatic,
2979 p6: T6,
2980 p7: T7,
2981 ): { (p2: T2, p3: T3, p4: T4, p5: T5): T8 };
2982
2983 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2984 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2985 stub1: UnderscoreStatic,
2986 stub2: UnderscoreStatic,
2987 stub3: UnderscoreStatic,
2988 stub4: UnderscoreStatic,
2989 stub5: UnderscoreStatic,
2990 p6: T6,
2991 p7: T7,
2992 ): { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): T8 };
2993
2994 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
2995 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
2996 p1: T1,
2997 p2: T2,
2998 p3: T3,
2999 p4: T4,
3000 p5: T5,
3001 stub6: UnderscoreStatic,
3002 p7: T7,
3003 ): { (p6: T6): T8 };
3004
3005 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3006 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3007 stub1: UnderscoreStatic,
3008 p2: T2,
3009 p3: T3,
3010 p4: T4,
3011 p5: T5,
3012 stub6: UnderscoreStatic,
3013 p7: T7,
3014 ): { (p1: T1, p6: T6): T8 };
3015
3016 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3017 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3018 p1: T1,
3019 stub2: UnderscoreStatic,
3020 p3: T3,
3021 p4: T4,
3022 p5: T5,
3023 stub6: UnderscoreStatic,
3024 p7: T7,
3025 ): { (p2: T2, p6: T6): T8 };
3026
3027 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3028 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3029 stub1: UnderscoreStatic,
3030 stub2: UnderscoreStatic,
3031 p3: T3,
3032 p4: T4,
3033 p5: T5,
3034 stub6: UnderscoreStatic,
3035 p7: T7,
3036 ): { (p1: T1, p2: T2, p6: T6): T8 };
3037
3038 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3039 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3040 p1: T1,
3041 p2: T2,
3042 stub3: UnderscoreStatic,
3043 p4: T4,
3044 p5: T5,
3045 stub6: UnderscoreStatic,
3046 p7: T7,
3047 ): { (p3: T3, p6: T6): T8 };
3048
3049 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3050 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3051 stub1: UnderscoreStatic,
3052 p2: T2,
3053 stub3: UnderscoreStatic,
3054 p4: T4,
3055 p5: T5,
3056 stub6: UnderscoreStatic,
3057 p7: T7,
3058 ): { (p1: T1, p3: T3, p6: T6): T8 };
3059
3060 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3061 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3062 p1: T1,
3063 stub2: UnderscoreStatic,
3064 stub3: UnderscoreStatic,
3065 p4: T4,
3066 p5: T5,
3067 stub6: UnderscoreStatic,
3068 p7: T7,
3069 ): { (p2: T2, p3: T3, p6: T6): T8 };
3070
3071 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3072 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3073 stub1: UnderscoreStatic,
3074 stub2: UnderscoreStatic,
3075 stub3: UnderscoreStatic,
3076 p4: T4,
3077 p5: T5,
3078 stub6: UnderscoreStatic,
3079 p7: T7,
3080 ): { (p1: T1, p2: T2, p3: T3, p6: T6): T8 };
3081
3082 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3083 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3084 p1: T1,
3085 p2: T2,
3086 p3: T3,
3087 stub4: UnderscoreStatic,
3088 p5: T5,
3089 stub6: UnderscoreStatic,
3090 p7: T7,
3091 ): { (p4: T4, p6: T6): T8 };
3092
3093 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3094 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3095 stub1: UnderscoreStatic,
3096 p2: T2,
3097 p3: T3,
3098 stub4: UnderscoreStatic,
3099 p5: T5,
3100 stub6: UnderscoreStatic,
3101 p7: T7,
3102 ): { (p1: T1, p4: T4, p6: T6): T8 };
3103
3104 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3105 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3106 p1: T1,
3107 stub2: UnderscoreStatic,
3108 p3: T3,
3109 stub4: UnderscoreStatic,
3110 p5: T5,
3111 stub6: UnderscoreStatic,
3112 p7: T7,
3113 ): { (p2: T2, p4: T4, p6: T6): T8 };
3114
3115 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3116 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3117 stub1: UnderscoreStatic,
3118 stub2: UnderscoreStatic,
3119 p3: T3,
3120 stub4: UnderscoreStatic,
3121 p5: T5,
3122 stub6: UnderscoreStatic,
3123 p7: T7,
3124 ): { (p1: T1, p2: T2, p4: T4, p6: T6): T8 };
3125
3126 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3127 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3128 p1: T1,
3129 p2: T2,
3130 stub3: UnderscoreStatic,
3131 stub4: UnderscoreStatic,
3132 p5: T5,
3133 stub6: UnderscoreStatic,
3134 p7: T7,
3135 ): { (p3: T3, p4: T4, p6: T6): T8 };
3136
3137 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3138 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3139 stub1: UnderscoreStatic,
3140 p2: T2,
3141 stub3: UnderscoreStatic,
3142 stub4: UnderscoreStatic,
3143 p5: T5,
3144 stub6: UnderscoreStatic,
3145 p7: T7,
3146 ): { (p1: T1, p3: T3, p4: T4, p6: T6): T8 };
3147
3148 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3149 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3150 p1: T1,
3151 stub2: UnderscoreStatic,
3152 stub3: UnderscoreStatic,
3153 stub4: UnderscoreStatic,
3154 p5: T5,
3155 stub6: UnderscoreStatic,
3156 p7: T7,
3157 ): { (p2: T2, p3: T3, p4: T4, p6: T6): T8 };
3158
3159 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3160 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3161 stub1: UnderscoreStatic,
3162 stub2: UnderscoreStatic,
3163 stub3: UnderscoreStatic,
3164 stub4: UnderscoreStatic,
3165 p5: T5,
3166 stub6: UnderscoreStatic,
3167 p7: T7,
3168 ): { (p1: T1, p2: T2, p3: T3, p4: T4, p6: T6): T8 };
3169
3170 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3171 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3172 p1: T1,
3173 p2: T2,
3174 p3: T3,
3175 p4: T4,
3176 stub5: UnderscoreStatic,
3177 stub6: UnderscoreStatic,
3178 p7: T7,
3179 ): { (p5: T5, p6: T6): T8 };
3180
3181 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3182 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3183 stub1: UnderscoreStatic,
3184 p2: T2,
3185 p3: T3,
3186 p4: T4,
3187 stub5: UnderscoreStatic,
3188 stub6: UnderscoreStatic,
3189 p7: T7,
3190 ): { (p1: T1, p5: T5, p6: T6): T8 };
3191
3192 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3193 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3194 p1: T1,
3195 stub2: UnderscoreStatic,
3196 p3: T3,
3197 p4: T4,
3198 stub5: UnderscoreStatic,
3199 stub6: UnderscoreStatic,
3200 p7: T7,
3201 ): { (p2: T2, p5: T5, p6: T6): T8 };
3202
3203 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3204 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3205 stub1: UnderscoreStatic,
3206 stub2: UnderscoreStatic,
3207 p3: T3,
3208 p4: T4,
3209 stub5: UnderscoreStatic,
3210 stub6: UnderscoreStatic,
3211 p7: T7,
3212 ): { (p1: T1, p2: T2, p5: T5, p6: T6): T8 };
3213
3214 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3215 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3216 p1: T1,
3217 p2: T2,
3218 stub3: UnderscoreStatic,
3219 p4: T4,
3220 stub5: UnderscoreStatic,
3221 stub6: UnderscoreStatic,
3222 p7: T7,
3223 ): { (p3: T3, p5: T5, p6: T6): T8 };
3224
3225 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3226 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3227 stub1: UnderscoreStatic,
3228 p2: T2,
3229 stub3: UnderscoreStatic,
3230 p4: T4,
3231 stub5: UnderscoreStatic,
3232 stub6: UnderscoreStatic,
3233 p7: T7,
3234 ): { (p1: T1, p3: T3, p5: T5, p6: T6): T8 };
3235
3236 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3237 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3238 p1: T1,
3239 stub2: UnderscoreStatic,
3240 stub3: UnderscoreStatic,
3241 p4: T4,
3242 stub5: UnderscoreStatic,
3243 stub6: UnderscoreStatic,
3244 p7: T7,
3245 ): { (p2: T2, p3: T3, p5: T5, p6: T6): T8 };
3246
3247 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3248 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3249 stub1: UnderscoreStatic,
3250 stub2: UnderscoreStatic,
3251 stub3: UnderscoreStatic,
3252 p4: T4,
3253 stub5: UnderscoreStatic,
3254 stub6: UnderscoreStatic,
3255 p7: T7,
3256 ): { (p1: T1, p2: T2, p3: T3, p5: T5, p6: T6): T8 };
3257
3258 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3259 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3260 p1: T1,
3261 p2: T2,
3262 p3: T3,
3263 stub4: UnderscoreStatic,
3264 stub5: UnderscoreStatic,
3265 stub6: UnderscoreStatic,
3266 p7: T7,
3267 ): { (p4: T4, p5: T5, p6: T6): T8 };
3268
3269 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3270 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3271 stub1: UnderscoreStatic,
3272 p2: T2,
3273 p3: T3,
3274 stub4: UnderscoreStatic,
3275 stub5: UnderscoreStatic,
3276 stub6: UnderscoreStatic,
3277 p7: T7,
3278 ): { (p1: T1, p4: T4, p5: T5, p6: T6): T8 };
3279
3280 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3281 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3282 p1: T1,
3283 stub2: UnderscoreStatic,
3284 p3: T3,
3285 stub4: UnderscoreStatic,
3286 stub5: UnderscoreStatic,
3287 stub6: UnderscoreStatic,
3288 p7: T7,
3289 ): { (p2: T2, p4: T4, p5: T5, p6: T6): T8 };
3290
3291 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3292 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3293 stub1: UnderscoreStatic,
3294 stub2: UnderscoreStatic,
3295 p3: T3,
3296 stub4: UnderscoreStatic,
3297 stub5: UnderscoreStatic,
3298 stub6: UnderscoreStatic,
3299 p7: T7,
3300 ): { (p1: T1, p2: T2, p4: T4, p5: T5, p6: T6): T8 };
3301
3302 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3303 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3304 p1: T1,
3305 p2: T2,
3306 stub3: UnderscoreStatic,
3307 stub4: UnderscoreStatic,
3308 stub5: UnderscoreStatic,
3309 stub6: UnderscoreStatic,
3310 p7: T7,
3311 ): { (p3: T3, p4: T4, p5: T5, p6: T6): T8 };
3312
3313 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3314 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3315 stub1: UnderscoreStatic,
3316 p2: T2,
3317 stub3: UnderscoreStatic,
3318 stub4: UnderscoreStatic,
3319 stub5: UnderscoreStatic,
3320 stub6: UnderscoreStatic,
3321 p7: T7,
3322 ): { (p1: T1, p3: T3, p4: T4, p5: T5, p6: T6): T8 };
3323
3324 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3325 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3326 p1: T1,
3327 stub2: UnderscoreStatic,
3328 stub3: UnderscoreStatic,
3329 stub4: UnderscoreStatic,
3330 stub5: UnderscoreStatic,
3331 stub6: UnderscoreStatic,
3332 p7: T7,
3333 ): { (p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T8 };
3334
3335 partial<T1, T2, T3, T4, T5, T6, T7, T8>(
3336 fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6, p7: T7): T8 },
3337 stub1: UnderscoreStatic,
3338 stub2: UnderscoreStatic,
3339 stub3: UnderscoreStatic,
3340 stub4: UnderscoreStatic,
3341 stub5: UnderscoreStatic,
3342 stub6: UnderscoreStatic,
3343 p7: T7,
3344 ): { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T8 };
3345
3346 /**
3347 * Memoizes a given function by caching the computed result. Useful for speeding up slow-running computations.
3348 * If passed an optional hashFunction, it will be used to compute the hash key for storing the result, based
3349 * on the arguments to the original function. The default hashFunction just uses the first argument to the
3350 * memoized function as the key.
3351 * @param fn Computationally expensive function that will now memoized results.
3352 * @param hashFn Hash function for storing the result of `fn`.
3353 * @return Memoized version of `fn`.
3354 */
3355 memoize<T = Function>(
3356 fn: T,
3357 hashFn?: (...args: any[]) => string,
3358 ): T;
3359
3360 /**
3361 * Much like setTimeout, invokes function after wait milliseconds. If you pass the optional arguments,
3362 * they will be forwarded on to the function when it is invoked.
3363 * @param func Function to delay `waitMS` amount of ms.
3364 * @param wait The amount of milliseconds to delay `fn`.
3365 * @param args Additional arguments to pass to `fn`.
3366 */
3367 delay(
3368 func: Function,
3369 wait: number,
3370 ...args: any[]
3371 ): any;
3372
3373 /**
3374 * @see _delay
3375 */
3376 delay(
3377 func: Function,
3378 ...args: any[]
3379 ): any;
3380
3381 /**
3382 * Defers invoking the function until the current call stack has cleared, similar to using setTimeout
3383 * with a delay of 0. Useful for performing expensive computations or HTML rendering in chunks without
3384 * blocking the UI thread from updating. If you pass the optional arguments, they will be forwarded on
3385 * to the function when it is invoked.
3386 * @param fn The function to defer.
3387 * @param arguments Additional arguments to pass to `fn`.
3388 */
3389 defer(
3390 fn: Function,
3391 ...args: any[]
3392 ): void;
3393
3394 /**
3395 * Creates and returns a new, throttled version of the passed function, that, when invoked repeatedly,
3396 * will only actually call the original function at most once per every wait milliseconds. Useful for
3397 * rate-limiting events that occur faster than you can keep up with.
3398 * By default, throttle will execute the function as soon as you call it for the first time, and,
3399 * if you call it again any number of times during the wait period, as soon as that period is over.
3400 * If you'd like to disable the leading-edge call, pass {leading: false}, and if you'd like to disable
3401 * the execution on the trailing-edge, pass {trailing: false}.
3402 * @param func Function to throttle `waitMS` ms.
3403 * @param wait The number of milliseconds to wait before `fn` can be invoked again.
3404 * @param options Allows for disabling execution of the throttled function on either the leading or trailing edge.
3405 * @return `fn` with a throttle of `wait`.
3406 */
3407 throttle<T extends Function>(
3408 func: T,
3409 wait: number,
3410 options?: _.ThrottleSettings,
3411 ): T & _.Cancelable;
3412
3413 /**
3414 * Creates and returns a new debounced version of the passed function that will postpone its execution
3415 * until after wait milliseconds have elapsed since the last time it was invoked. Useful for implementing
3416 * behavior that should only happen after the input has stopped arriving. For example: rendering a preview
3417 * of a Markdown comment, recalculating a layout after the window has stopped being resized, and so on.
3418 *
3419 * Pass true for the immediate parameter to cause debounce to trigger the function on the leading instead
3420 * of the trailing edge of the wait interval. Useful in circumstances like preventing accidental double
3421 * -clicks on a "submit" button from firing a second time.
3422 * @param fn Function to debounce `waitMS` ms.
3423 * @param wait The number of milliseconds to wait before `fn` can be invoked again.
3424 * @param immediate True if `fn` should be invoked on the leading edge of `waitMS` instead of the trailing edge.
3425 * @return Debounced version of `fn` that waits `wait` ms when invoked.
3426 */
3427 debounce<T extends Function>(
3428 fn: T,
3429 wait: number,
3430 immediate?: boolean,
3431 ): T & _.Cancelable;
3432
3433 /**
3434 * Creates a version of the function that can only be called one time. Repeated calls to the modified
3435 * function will have no effect, returning the value from the original call. Useful for initialization
3436 * functions, instead of having to set a boolean flag and then check it later.
3437 * @param fn Function to only execute once.
3438 * @return Copy of `fn` that can only be invoked once.
3439 */
3440 once<T extends Function>(fn: T): T;
3441
3442 /**
3443 * Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
3444 * This accumulates the arguments passed into an array, after a given index.
3445 */
3446 restArgs(func: Function, starIndex?: number): Function;
3447
3448 /**
3449 * Creates a version of the function that will only be run after first being called count times. Useful
3450 * for grouping asynchronous responses, where you want to be sure that all the async calls have finished,
3451 * before proceeding.
3452 * @param number count Number of times to be called before actually executing.
3453 * @param Function fn The function to defer execution `count` times.
3454 * @return Copy of `fn` that will not execute until it is invoked `count` times.
3455 */
3456 after(
3457 count: number,
3458 fn: Function,
3459 ): Function;
3460
3461 /**
3462 * Creates a version of the function that can be called no more than count times. The result of
3463 * the last function call is memoized and returned when count has been reached.
3464 * @param number count The maxmimum number of times the function can be called.
3465 * @param Function fn The function to limit the number of times it can be called.
3466 * @return Copy of `fn` that can only be called `count` times.
3467 */
3468 before(
3469 count: number,
3470 fn: Function,
3471 ): Function;
3472
3473 /**
3474 * Wraps the first function inside of the wrapper function, passing it as the first argument. This allows
3475 * the wrapper to execute code before and after the function runs, adjust the arguments, and execute it
3476 * conditionally.
3477 * @param fn Function to wrap.
3478 * @param wrapper The function that will wrap `fn`.
3479 * @return Wrapped version of `fn.
3480 */
3481 wrap(
3482 fn: Function,
3483 wrapper: (fn: Function, ...args: any[]) => any,
3484 ): Function;
3485
3486 /**
3487 * Returns a negated version of the pass-in predicate.
3488 * @param (...args: any[]) => boolean predicate
3489 * @return (...args: any[]) => boolean
3490 */
3491 negate(predicate: (...args: any[]) => boolean): (...args: any[]) => boolean;
3492
3493 /**
3494 * Returns the composition of a list of functions, where each function consumes the return value of the
3495 * function that follows. In math terms, composing the functions f(), g(), and h() produces f(g(h())).
3496 * @param functions List of functions to compose.
3497 * @return Composition of `functions`.
3498 */
3499 compose(...functions: Function[]): Function;
3500
3501 /***********
3502 * Objects *
3503 ***********/
3504
3505 /**
3506 * Retrieve all the names of the object's properties.
3507 * @param object Retrieve the key or property names from this object.
3508 * @return List of all the property names on `object`.
3509 */
3510 keys(object: any): string[];
3511
3512 /**
3513 * Retrieve all the names of object's own and inherited properties.
3514 * @param object Retrieve the key or property names from this object.
3515 * @return List of all the property names on `object`.
3516 */
3517 allKeys(object: any): string[];
3518
3519 /**
3520 * Return all of the values of the object's properties.
3521 * @param object Retrieve the values of all the properties on this object.
3522 * @return List of all the values on `object`.
3523 */
3524 values<T>(object: _.Dictionary<T>): T[];
3525
3526 /**
3527 * Return all of the values of the object's properties.
3528 * @param object Retrieve the values of all the properties on this object.
3529 * @return List of all the values on `object`.
3530 */
3531 values(object: any): any[];
3532
3533 /**
3534 * Like map, but for objects. Transform the value of each property in
3535 * turn.
3536 * @param object The object to transform.
3537 * @param iteratee The iteratee to use to transform property values.
3538 * @param context `this` object in `iteratee`, optional.
3539 * @returns A new object with all of `object`'s property values
3540 * transformed through `iteratee`.
3541 */
3542 mapObject<V extends object, I extends Iteratee<V, any, TypeOfCollection<V, any>>>(
3543 object: V,
3544 iteratee: I,
3545 context?: any,
3546 ): { [K in keyof V]: IterateeResult<I, V[K]> };
3547
3548 /**
3549 * Converts `object` into a list of [key, value] pairs. The opposite
3550 * of the single-argument signature of `_.object`.
3551 * @param object The object to convert.
3552 * @returns The list of [key, value] pairs from `object`.
3553 */
3554 pairs<V extends object>(
3555 object: V,
3556 ): Array<[Extract<keyof V, string>, TypeOfCollection<V, any>]>;
3557
3558 /**
3559 * Returns a copy of the object where the keys have become the values and the values the keys.
3560 * For this to work, all of your object's values should be unique and string serializable.
3561 * @param object Object to invert key/value pairs.
3562 * @return An inverted key/value paired version of `object`.
3563 */
3564 invert(object: any): any;
3565
3566 /**
3567 * Returns a sorted list of the names of every method in an object - that is to say,
3568 * the name of every function property of the object.
3569 * @param object Object to pluck all function property names from.
3570 * @return List of all the function names on `object`.
3571 */
3572 functions(object: any): string[];
3573
3574 /**
3575 * @see _functions
3576 */
3577 methods(object: any): string[];
3578
3579 /**
3580 * Copy all of the properties in the source objects over to the destination object, and return
3581 * the destination object. It's in-order, so the last source will override properties of the
3582 * same name in previous arguments.
3583 * @param destination Object to extend all the properties from `sources`.
3584 * @param sources Extends `destination` with all properties from these source objects.
3585 * @return `destination` extended with all the properties from the `sources` objects.
3586 */
3587 extend(
3588 destination: any,
3589 ...sources: any[]
3590 ): any;
3591
3592 /**
3593 * Like extend, but only copies own properties over to the destination object. (alias: assign)
3594 */
3595 extendOwn(
3596 destination: any,
3597 ...source: any[]
3598 ): any;
3599
3600 /**
3601 * Like extend, but only copies own properties over to the destination object. (alias: extendOwn)
3602 */
3603 assign(
3604 destination: any,
3605 ...source: any[]
3606 ): any;
3607
3608 /**
3609 * Similar to `findIndex` but for keys in objects. Returns the key
3610 * where the `iteratee` truth test passes or undefined.
3611 * @param object The object to search.
3612 * @param iteratee The truth test to apply.
3613 * @param context `this` object in `iteratee`, optional.
3614 * @returns The first element in `object` that passes the truth test or
3615 * undefined if no elements pass.
3616 */
3617 findKey<V extends object>(
3618 object: V,
3619 iteratee?: Iteratee<V, boolean, TypeOfCollection<V, any>>,
3620 context?: any,
3621 ): Extract<keyof V, string> | undefined;
3622
3623 /**
3624 * Return a copy of `object` that is filtered to only have values for
3625 * the allowed keys (or array of keys).
3626 * @param object The object to pick specific keys in.
3627 * @param keys The keys to keep on `object`.
3628 * @returns A copy of `object` with only the `keys` properties.
3629 */
3630 pick<V, K extends string>(
3631 object: V,
3632 ...keys: Array<K | K[]>
3633 ): _Pick<V, K>;
3634
3635 /**
3636 * Return a copy of `object` that is filtered to only have values for
3637 * the keys selected by a truth test.
3638 * @param object The object to pick specific keys in.
3639 * @param iterator A truth test that selects the keys to keep on
3640 * `object`.
3641 * @returns A copy of `object` with only the keys selected by
3642 * `iterator`.
3643 */
3644 pick<V>(
3645 object: V,
3646 iterator: ObjectIterator<TypeOfDictionary<V, any>, boolean, V>,
3647 ): Partial<V>;
3648
3649 /**
3650 * Return a copy of `object` that is filtered to omit the disallowed
3651 * keys (or array of keys).
3652 * @param object The object to omit specific keys from.
3653 * @param keys The keys to omit from `object`.
3654 * @returns A copy of `object` without the `keys` properties.
3655 */
3656 omit<V, K extends string>(
3657 object: V,
3658 ...keys: Array<K | K[]>
3659 ): _Omit<V, K>;
3660
3661 /**
3662 * Return a copy of `object` that is filtered to not have values for
3663 * the keys selected by a truth test.
3664 * @param object The object to omit specific keys from.
3665 * @param iterator A truth test that selects the keys to omit from
3666 * `object`.
3667 * @returns A copy of `object` without the keys selected by
3668 * `iterator`.
3669 */
3670 omit<V>(
3671 object: V,
3672 iterator: ObjectIterator<TypeOfDictionary<V, any>, boolean, V>,
3673 ): Partial<V>;
3674
3675 /**
3676 * Fill in null and undefined properties in object with values from the defaults objects,
3677 * and return the object. As soon as the property is filled, further defaults will have no effect.
3678 * @param object Fill this object with default values.
3679 * @param defaults The default values to add to `object`.
3680 * @return `object` with added `defaults` values.
3681 */
3682 defaults(
3683 object: any,
3684 ...defaults: any[]
3685 ): any;
3686
3687 /**
3688 * Creates an object that inherits from the given prototype object.
3689 * If additional properties are provided then they will be added to the
3690 * created object.
3691 * @param prototype The prototype that the returned object will inherit from.
3692 * @param props Additional props added to the returned object.
3693 */
3694 create(prototype: any, props?: object): any;
3695
3696 /**
3697 * Create a shallow-copied clone of the object.
3698 * Any nested objects or arrays will be copied by reference, not duplicated.
3699 * @param object Object to clone.
3700 * @return Copy of `object`.
3701 */
3702 clone<T>(object: T): T;
3703
3704 /**
3705 * Invokes interceptor with the object, and then returns object. The primary purpose of this method
3706 * is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
3707 * @param object Argument to `interceptor`.
3708 * @param intercepter The function to modify `object` before continuing the method chain.
3709 * @return Modified `object`.
3710 */
3711 tap<T>(object: T, intercepter: Function): T;
3712
3713 /**
3714 * Does the object contain the given key? Identical to object.hasOwnProperty(key), but uses a safe
3715 * reference to the hasOwnProperty function, in case it's been overridden accidentally.
3716 * @param object Object to check for `key`.
3717 * @param key The key to check for on `object`.
3718 * @return True if `key` is a property on `object`, otherwise false.
3719 */
3720 has(object: any, key: string): boolean;
3721
3722 /**
3723 * Returns a predicate function that will tell you if a passed in object contains all of the key/value properties present in attrs.
3724 * @param attrs Object with key values pair
3725 * @return Predicate function
3726 */
3727 matches<T>(attrs: T): _.Predicate<T>;
3728
3729 /**
3730 * Returns a predicate function that will tell you if a passed in object contains all of the key/value properties present in attrs.
3731 * @see _.matches
3732 * @param attrs Object with key values pair
3733 * @return Predicate function
3734 */
3735 matcher<T>(attrs: T): _.Predicate<T>;
3736
3737 /**
3738 * Returns the specified property of `object`. `path` may be specified
3739 * as a simple key, or as an array of object keys or array indexes,
3740 * for deep property fetching. If the property does not exist or is `undefined`,
3741 * the optional default is returned.
3742 * @param object The object that maybe contains the property.
3743 * @param path The path to the property on `object`.
3744 * @param defaultValue Default if not found.
3745 * @returns The item on the `object` or the `defaultValue`
3746 */
3747 get(
3748 object: null | undefined,
3749 path: string | string[],
3750 ): undefined;
3751 get<U>(
3752 object: null | undefined,
3753 path: string | string[],
3754 defaultValue?: U,
3755 ): U;
3756 get<V extends Collection<any>>(
3757 object: V,
3758 path: string,
3759 ): TypeOfCollection<V> | undefined;
3760 get<V extends Collection<any>, U>(
3761 object: V,
3762 path: string,
3763 defaultValue?: U,
3764 ): TypeOfCollection<V> | U;
3765 get<V extends Collection<any>, P extends Array<string | number>, U = undefined>(
3766 object: V,
3767 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
3768 path: readonly [...P],
3769 defaultValue?: U,
3770 ): DeepTypeOfCollection<V, P> | U;
3771
3772 /**
3773 * Returns a function that will itself return the key property of any passed-in object.
3774 * @param key Property of the object.
3775 * @return Function which accept an object an returns the value of key in that object.
3776 */
3777 property(key: string | number | Array<string | number>): (object: any) => any;
3778
3779 /**
3780 * Returns a function that will itself return the value of a object key property.
3781 * @param key The object to get the property value from.
3782 * @return Function which accept a key property in `object` and returns its value.
3783 */
3784 propertyOf(object: object): (key: string | number | Array<string | number>) => any;
3785
3786 /**
3787 * Performs an optimized deep comparison between `object` and `other`
3788 * to determine if they should be considered equal.
3789 * @param object Compare to `other`.
3790 * @param other Compare to `object`.
3791 * @returns True if `object` should be considered equal to `other`.
3792 */
3793 isEqual(object: any, other: any): boolean;
3794
3795 /**
3796 * Returns true if `collection` contains no values.
3797 * For strings and array-like objects checks if the length property is
3798 * 0.
3799 * @param collection The collection to check.
3800 * @returns True if `collection` has no elements.
3801 */
3802 isEmpty(collection: any): boolean;
3803
3804 /**
3805 * Returns true if the keys and values in `properties` are contained in
3806 * `object`.
3807 * @param object The object to check.
3808 * @param properties The properties to check for in `object`.
3809 * @returns True if all keys and values in `properties` are also in
3810 * `object`.
3811 */
3812 isMatch(object: any, properties: any): boolean;
3813
3814 /**
3815 * Returns true if `object` is a DOM element.
3816 * @param object The object to check.
3817 * @returns True if `object` is a DOM element, otherwise false.
3818 */
3819 isElement(object: any): object is Element;
3820
3821 /**
3822 * Returns true if `object` is an Array.
3823 * @param object The object to check.
3824 * @returns True if `object` is an Array, otherwise false.
3825 */
3826 isArray(object: any): object is any[];
3827
3828 /**
3829 * Returns true if `object` is an ArrayBuffer.
3830 * @param object The object to check.
3831 * @returns True if `object` is an ArrayBuffer, otherwise false.
3832 */
3833 isArrayBuffer(object: any): object is ArrayBuffer;
3834
3835 /**
3836 * Returns true if `object` is a DataView.
3837 * @param object The object to check.
3838 * @returns True if `object` is a DataView, otherwise false.
3839 */
3840 isDataView(object: any): object is DataView;
3841
3842 /**
3843 * Returns true if `object` is a TypedArray.
3844 * @param object The object to check.
3845 * @returns True if `object` is a TypedArray, otherwise false.
3846 */
3847 isTypedArray(object: any): object is TypedArray;
3848
3849 /**
3850 * Returns true if `object` is a Symbol.
3851 * @param object The object to check.
3852 * @returns True if `object` is a Symbol, otherwise false.
3853 */
3854 isSymbol(object: any): object is symbol;
3855
3856 /**
3857 * Returns true if `object` is an Object. Note that JavaScript arrays
3858 * and functions are objects,
3859 * while (normal) strings and numbers are not.
3860 * @param object The object to check.
3861 * @returns True if `object` is an Object, otherwise false.
3862 */
3863 isObject(object: any): object is Dictionary<any> & object;
3864
3865 /**
3866 * Returns true if `object` is an Arguments object.
3867 * @param object The object to check.
3868 * @returns True if `object` is an Arguments object, otherwise false.
3869 */
3870 isArguments(object: any): object is IArguments;
3871
3872 /**
3873 * Returns true if `object` is a Function.
3874 * @param object The object to check.
3875 * @returns True if `object` is a Function, otherwise false.
3876 */
3877 isFunction(object: any): object is Function;
3878
3879 /**
3880 * Returns true if `object` is an Error.
3881 * @param object The object to check.
3882 * @returns True if `object` is a Error, otherwise false.
3883 */
3884 isError(object: any): object is Error;
3885
3886 /**
3887 * Returns true if `object` is a String.
3888 * @param object The object to check.
3889 * @returns True if `object` is a String, otherwise false.
3890 */
3891 isString(object: any): object is string;
3892
3893 /**
3894 * Returns true if `object` is a Number (including NaN).
3895 * @param object The object to check.
3896 * @returns True if `object` is a Number, otherwise false.
3897 */
3898 isNumber(object: any): object is number;
3899
3900 /**
3901 * Returns true if `object` is a finite Number.
3902 * @param object The object to check.
3903 * @returns True if `object` is a finite Number.
3904 */
3905 isFinite(object: any): boolean;
3906
3907 /**
3908 * Returns true if `object` is a Boolean.
3909 * @param object The object to check.
3910 * @returns True if `object` is a Boolean, otherwise false.
3911 */
3912 isBoolean(object: any): object is boolean;
3913
3914 /**
3915 * Returns true if `object` is a Date.
3916 * @param object The object to check.
3917 * @returns True if `object` is a Date, otherwise false.
3918 */
3919 isDate(object: any): object is Date;
3920
3921 /**
3922 * Returns true if `object` is a RegExp.
3923 * @param object The object to check.
3924 * @returns True if `object` is a RegExp, otherwise false.
3925 */
3926 isRegExp(object: any): object is RegExp;
3927
3928 /**
3929 * Returns true if `object` is NaN.
3930 * Note: this is not the same as the native isNaN function,
3931 * which will also return true if the variable is undefined.
3932 * @param object The object to check.
3933 * @returns True if `object` is NaN, otherwise false.
3934 */
3935 isNaN(object: any): boolean;
3936
3937 /**
3938 * Returns true if `object` is null.
3939 * @param object The object to check.
3940 * @returns True if `object` is null, otherwise false.
3941 */
3942 isNull(object: any): object is null;
3943
3944 /**
3945 * Returns true if `object` is undefined.
3946 * @param object The object to check.
3947 * @returns True if `object` is undefined, otherwise false.
3948 */
3949 isUndefined(object: any): object is undefined;
3950
3951 /***********
3952 * Utility *
3953 ***********/
3954
3955 /**
3956 * Give control of the "_" variable back to its previous owner.
3957 * Returns a reference to the Underscore object.
3958 * @return Underscore object reference.
3959 */
3960 noConflict(): any;
3961
3962 /**
3963 * Returns the same value that is used as the argument. In math: f(x) = x
3964 * This function looks useless, but is used throughout Underscore as a default iterator.
3965 * @param value Identity of this object.
3966 * @return `value`.
3967 */
3968 identity<T>(value: T): T;
3969
3970 /**
3971 * Creates a function that returns the same value that is used as the argument of _.constant
3972 * @param value Identity of this object.
3973 * @return Function that return value.
3974 */
3975 constant<T>(value: T): () => T;
3976
3977 /**
3978 * Returns undefined irrespective of the arguments passed to it. Useful as the default
3979 * for optional callback arguments.
3980 * Note there is no way to indicate a 'undefined' return, so it is currently typed as void.
3981 * @return undefined
3982 */
3983 noop(): void;
3984
3985 /**
3986 * Invokes the given iterator function n times.
3987 * Each invocation of iterator is called with an index argument
3988 * @param n Number of times to invoke `iterator`.
3989 * @param iterator Function iterator to invoke `n` times.
3990 * @param context `this` object in `iterator`, optional.
3991 */
3992 times<TResult>(n: number, iterator: (n: number) => TResult, context?: any): TResult[];
3993
3994 /**
3995 * Returns a random integer between min and max, inclusive. If you only pass one argument,
3996 * it will return a number between 0 and that number.
3997 * @param max The maximum random number.
3998 * @return A random number between 0 and `max`.
3999 */
4000 random(max: number): number;
4001
4002 /**
4003 * @see _.random
4004 * @param min The minimum random number.
4005 * @return A random number between `min` and `max`.
4006 */
4007 random(min: number, max: number): number;
4008
4009 /**
4010 * Allows you to extend Underscore with your own utility functions. Pass a hash of
4011 * {name: function} definitions to have your functions added to the Underscore object,
4012 * as well as the OOP wrapper.
4013 * @param object Mixin object containing key/function pairs to add to the Underscore object.
4014 */
4015 mixin(object: any): void;
4016
4017 /**
4018 * A mostly-internal function to generate callbacks that can be applied to each element
4019 * in a collection, returning the desired result -- either identity, an arbitrary callback,
4020 * a property matcher, or a propetery accessor.
4021 * @param string|Function|Object value The value to iterate over, usually the key.
4022 * @param any context
4023 * @return Callback that can be applied to each element in a collection.
4024 */
4025 iteratee(value: string): Function;
4026 iteratee(value: Function, context?: any): Function;
4027 iteratee(value: object): Function;
4028
4029 /**
4030 * Generate a globally-unique id for client-side models or DOM elements that need one.
4031 * If prefix is passed, the id will be appended to it. Without prefix, returns an integer.
4032 * @param prefix A prefix string to start the unique ID with.
4033 * @return Unique string ID beginning with `prefix`.
4034 */
4035 uniqueId(prefix?: string): string;
4036
4037 /**
4038 * Escapes a string for insertion into HTML, replacing &, <, >, ", ', and / characters.
4039 * @param str Raw string to escape.
4040 * @return `str` HTML escaped.
4041 */
4042 escape(str: string): string;
4043
4044 /**
4045 * The opposite of escape, replaces &amp;, &lt;, &gt;, &quot;, and &#x27; with their unescaped counterparts.
4046 * @param str HTML escaped string.
4047 * @return `str` Raw string.
4048 */
4049 unescape(str: string): string;
4050
4051 /**
4052 * If the value of the named property is a function then invoke it; otherwise, return it.
4053 * @param object Object to maybe invoke function `property` on.
4054 * @param property The function by name to invoke on `object`.
4055 * @param defaultValue The value to be returned in case `property` doesn't exist or is undefined.
4056 * @return The result of invoking the function `property` on `object.
4057 */
4058 result(object: any, property: string, defaultValue?: any): any;
4059
4060 /**
4061 * Compiles JavaScript templates into functions that can be evaluated for rendering. Useful
4062 * for rendering complicated bits of HTML from JSON data sources. Template functions can both
4063 * interpolate variables, using <%= ... %>, as well as execute arbitrary JavaScript code, with
4064 * <% ... %>. If you wish to interpolate a value, and have it be HTML-escaped, use <%- ... %> When
4065 * you evaluate a template function, pass in a data object that has properties corresponding to
4066 * the template's free variables. If you're writing a one-off, you can pass the data object as
4067 * the second parameter to template in order to render immediately instead of returning a template
4068 * function. The settings argument should be a hash containing any _.templateSettings that should
4069 * be overridden.
4070 * @param templateString Underscore HTML template.
4071 * @param data Data to use when compiling `templateString`.
4072 * @param settings Settings to use while compiling.
4073 * @return Returns the compiled Underscore HTML template.
4074 */
4075 template(templateString: string, settings?: _.TemplateSettings): CompiledTemplate;
4076
4077 /**
4078 * By default, Underscore uses ERB-style template delimiters, change the
4079 * following template settings to use alternative delimiters.
4080 */
4081 templateSettings: _.TemplateSettings;
4082
4083 /**
4084 * Returns an integer timestamp for the current time, using the fastest method available in the runtime. Useful for implementing timing/animation functions.
4085 */
4086 now(): number;
4087
4088 /************
4089 * Chaining *
4090 ************/
4091
4092 /**
4093 * Returns a wrapped object. Calling methods on this object will
4094 * continue to return wrapped objects until value() is used.
4095 * @param value The object to chain.
4096 * @returns An underscore chain wrapper around the supplied value.
4097 */
4098 chain<V>(value: V): _Chain<TypeOfCollection<V>, V>;
4099
4100 /**
4101 * Current version
4102 */
4103 readonly VERSION: string;
4104 }
4105
4106 interface Underscore<T, V = T[]> {
4107 /***************
4108 * Collections *
4109 ***************/
4110
4111 /**
4112 * Iterates over the wrapped collection of elements, yielding each in
4113 * turn to an `iteratee`. The `iteratee` is bound to the context object,
4114 * if one is passed.
4115 * @param iteratee The iteratee to call for each element in the wrapped
4116 * collection.
4117 * @param context 'this' object in `iteratee`, optional.
4118 * @returns The originally wrapped collection.
4119 */
4120 each(
4121 iteratee: CollectionIterator<TypeOfCollection<V>, void, V>,
4122 context?: any,
4123 ): V;
4124
4125 /**
4126 * @see each
4127 */
4128 forEach: Underscore<T, V>["each"];
4129
4130 /**
4131 * Produces a new array of values by mapping each value in the wrapped
4132 * collection through a transformation `iteratee`.
4133 * @param iteratee The iteratee to use to transform each item in the
4134 * wrapped collection.
4135 * @param context `this` object in `iteratee`, optional.
4136 * @returns The mapped result.
4137 */
4138 map<I extends Iteratee<V, any>>(
4139 iteratee: I,
4140 context?: any,
4141 ): Array<IterateeResult<I, T>>;
4142
4143 /**
4144 * @see map
4145 */
4146 collect: Underscore<T, V>["map"];
4147
4148 /**
4149 * Also known as inject and foldl, reduce boils down the wrapped
4150 * collection of values into a single value. `memo` is the initial
4151 * state of the reduction, and each successive step of it should be
4152 * returned by `iteratee`.
4153 *
4154 * If no memo is passed to the initial invocation of reduce, `iteratee`
4155 * is not invoked on the first element of the wrapped collection. The
4156 * first element is instead passed as the memo in the invocation of
4157 * `iteratee` on the next element in the wrapped collection.
4158 * @param iteratee The function to call on each iteration to reduce the
4159 * collection.
4160 * @param memo The initial reduce state or undefined to use the first
4161 * item in `collection` as initial state.
4162 * @param context `this` object in `iteratee`, optional.
4163 * @returns The reduced result.
4164 */
4165 reduce<TResult>(
4166 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult, V>,
4167 memo: TResult,
4168 context?: any,
4169 ): TResult;
4170 reduce<TResult = TypeOfCollection<V>>(
4171 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult | TypeOfCollection<V>, V>,
4172 ): TResult | TypeOfCollection<V> | undefined;
4173
4174 /**
4175 * @see reduce
4176 */
4177 inject: Underscore<T, V>["reduce"];
4178
4179 /**
4180 * @see reduce
4181 */
4182 foldl: Underscore<T, V>["reduce"];
4183
4184 /**
4185 * The right-associative version of reduce.
4186 *
4187 * This is not as useful in JavaScript as it would be in a language
4188 * with lazy evaluation.
4189 * @param iteratee The function to call on each iteration to reduce the
4190 * collection.
4191 * @param memo The initial reduce state or undefined to use the first
4192 * item in `collection` as the initial state.
4193 * @param context `this` object in `iteratee`, optional.
4194 * @returns The reduced result.
4195 */
4196 reduceRight<TResult>(
4197 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult, V>,
4198 memo: TResult,
4199 context?: any,
4200 ): TResult;
4201 reduceRight<TResult = TypeOfCollection<V>>(
4202 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult | TypeOfCollection<V>, V>,
4203 ): TResult | TypeOfCollection<V> | undefined;
4204
4205 /**
4206 * @see reduceRight
4207 */
4208 foldr: Underscore<T, V>["reduceRight"];
4209
4210 /**
4211 * Looks through each value in the wrapped collection, returning the
4212 * first one that passes a truth test (`iteratee`), or undefined if no
4213 * value passes the test. The function returns as soon as it finds an
4214 * acceptable element, and doesn't traverse the entire collection.
4215 * @param iteratee The truth test to apply.
4216 * @param context `this` object in `iteratee`, optional.
4217 * @returns The first element in the wrapped collection that passes the
4218 * truth test or undefined if no elements pass.
4219 */
4220 find(iteratee?: Iteratee<V, boolean>, context?: any): T | undefined;
4221
4222 /**
4223 * @see find
4224 */
4225 detect: Underscore<T, V>["find"];
4226
4227 /**
4228 * Looks through each value in the wrapped collection, returning an
4229 * array of all the values that pass a truth test (`iteratee`).
4230 * @param iteratee The truth test to apply.
4231 * @param context `this` object in `iteratee`, optional.
4232 * @returns The set of values that pass the truth test.
4233 */
4234 filter(iteratee?: Iteratee<V, boolean>, context?: any): T[];
4235
4236 /**
4237 * @see filter
4238 */
4239 select: Underscore<T, V>["filter"];
4240
4241 /**
4242 * Looks through each value in the wrapped collection, returning an
4243 * array of all the elements that match the key-value pairs listed in
4244 * `properties`.
4245 * @param properties The properties to check for on the elements within
4246 * the wrapped collection.
4247 * @returns The elements in the wrapped collection that match
4248 * `properties`.
4249 */
4250 where(properties: Partial<T>): T[];
4251
4252 /**
4253 * Looks through the wrapped collection and returns the first value
4254 * that matches all of the key-value pairs listed in `properties`. If
4255 * no match is found, or if list is empty, undefined will be returned.
4256 * @param properties The properties to check for on the elements within
4257 * the wrapped collection.
4258 * @returns The first element in the wrapped collection that matches
4259 * `properties` or undefined if no match is found.
4260 */
4261 findWhere(properties: Partial<T>): T | undefined;
4262
4263 /**
4264 * Returns the values in the wrapped collection without the elements
4265 * that pass a truth test (`iteratee`).
4266 * The opposite of filter.
4267 * @param iteratee The truth test to apply.
4268 * @param context `this` object in `iteratee`, optional.
4269 * @returns The set of values that fail the truth test.
4270 */
4271 reject(iteratee?: Iteratee<V, boolean>, context?: any): T[];
4272
4273 /**
4274 * Returns true if all of the values in the wrapped collection pass the
4275 * `iteratee` truth test. Short-circuits and stops traversing the
4276 * wrapped collection if a false element is found.
4277 * @param iteratee The truth test to apply.
4278 * @param context `this` object in `iteratee`, optional.
4279 * @returns True if all elements pass the truth test, otherwise false.
4280 */
4281 every(iteratee?: Iteratee<V, boolean>, context?: any): boolean;
4282
4283 /**
4284 * @see every
4285 */
4286 all: Underscore<T, V>["every"];
4287
4288 /**
4289 * Returns true if any of the values in the wrapped collection pass the
4290 * `iteratee` truth test. Short-circuits and stops traversing the
4291 * wrapped collection if a true element is found.
4292 * @param iteratee The truth test to apply.
4293 * @param context `this` object in `iteratee`, optional.
4294 * @returns True if any element passed the truth test, otherwise false.
4295 */
4296 some(iteratee?: Iteratee<V, boolean>, context?: any): boolean;
4297
4298 /**
4299 * @see some
4300 */
4301 any: Underscore<T, V>["some"];
4302
4303 /**
4304 * Returns true if the value is present in the wrapped collection. Uses
4305 * indexOf internally, if the wrapped collection is a List. Use
4306 * `fromIndex` to start your search at a given index.
4307 * @param value The value to check the wrapped collection for.
4308 * @param fromIndex The index to start searching from, optional,
4309 * default = 0, only used when the wrapped collection is a List.
4310 * @returns True if `value` is present in the wrapped collection after
4311 * `fromIndex`, otherwise false.
4312 */
4313 contains(value: any, fromIndex?: number): boolean;
4314
4315 /**
4316 * @see contains
4317 */
4318 include: Underscore<T, V>["contains"];
4319
4320 /**
4321 * @see contains
4322 */
4323 includes: Underscore<T, V>["contains"];
4324
4325 /**
4326 * Calls the method named by `methodName` on each value in the wrapped
4327 * collection. Any extra arguments passed to invoke will be forwarded
4328 * on to the method invocation.
4329 * @param methodName The name of the method to call on each element in
4330 * the wrapped collection.
4331 * @param args Additional arguments to pass to method `methodName`.
4332 * @returns An array containing the result of the method call for each
4333 * item in the wrapped collection.
4334 */
4335 invoke(methodName: string, ...args: any[]): any[];
4336
4337 /**
4338 * A convenient version of what is perhaps the most common use-case for
4339 * map: extracting a list of property values.
4340 * @param propertyName The name of a specific property to retrieve from
4341 * all items in the wrapped collection.
4342 * @returns The set of values for the specified `propertyName` for each
4343 * item in the wrapped collection.
4344 */
4345 pluck<K extends string | number>(
4346 propertyName: K,
4347 ): Array<PropertyTypeOrAny<T, K>>;
4348
4349 /**
4350 * Returns the maximum value in the wrapped collection. If an
4351 * `iteratee` is provided, it will be used on each element to generate
4352 * the criterion by which the element is ranked. -Infinity is returned
4353 * if list is empty. Non-numerical values returned by `iteratee` will
4354 * be ignored.
4355 * @param iteratee The iteratee that provides the criterion by which
4356 * each element is ranked, optional if evaluating a collection of
4357 * numbers.
4358 * @param context `this` object in `iteratee`, optional.
4359 * @returns The maximum element within the wrapped collection or
4360 * -Infinity if the wrapped collection is empty.
4361 */
4362 max(iteratee?: Iteratee<V, any>, context?: any): T | number;
4363
4364 /**
4365 * Returns the minimum value in the wrapped collection. If an
4366 * `iteratee` is provided, it will be used on each element to generate
4367 * the criterion by which the element is ranked. Infinity is returned
4368 * if list is empty. Non-numerical values returned by `iteratee` will
4369 * be ignored.
4370 * @param iteratee The iteratee that provides the criterion by which
4371 * each element is ranked, optional if evaluating a collection of
4372 * numbers.
4373 * @param context `this` object in `iteratee`, optional.
4374 * @returns The minimum element within the wrapped collection or
4375 * Infinity if the wrapped collection is empty.
4376 */
4377 min(iteratee?: Iteratee<V, any>, context?: any): T | number;
4378
4379 /**
4380 * Returns a (stably) sorted copy of the wrapped collection, ranked in
4381 * ascending order by the results of running each value through
4382 * `iteratee`.
4383 * @param iteratee An iteratee that provides the value to sort by for
4384 * each item in the wrapped collection.
4385 * @param context `this` object in `iteratee`, optional.
4386 * @returns A sorted copy of the wrapped collection.
4387 */
4388 sortBy(iteratee?: Iteratee<V, any>, context?: any): T[];
4389
4390 /**
4391 * Splits the warpped collection into sets that are grouped by the
4392 * result of running each value through `iteratee`.
4393 * @param iteratee An iteratee that provides the value to group by for
4394 * each item in the wrapped collection.
4395 * @param context `this` object in `iteratee`, optional.
4396 * @returns A dictionary with the group names provided by `iteratee` as
4397 * properties where each property contains the grouped elements from
4398 * the wrapped collection.
4399 */
4400 groupBy(
4401 iteratee?: Iteratee<V, string | number>,
4402 context?: any,
4403 ): Dictionary<T[]>;
4404
4405 /**
4406 * Given the warpped collection and an `iteratee` function that returns
4407 * a key for each element in the wrapped collection, returns an object
4408 * that acts as an index of each item. Just like `groupBy`, but for when you
4409 * know your keys are unique.
4410 * @param iteratee An iteratee that provides the value to index by for
4411 * each item in the wrapped collection.
4412 * @param context `this` object in `iteratee`, optional.
4413 * @returns A dictionary where each item in the wrapped collection is
4414 * assigned to the property designated by `iteratee`.
4415 */
4416 indexBy(iteratee?: Iteratee<V, string | number>, context?: any): Dictionary<T>;
4417
4418 /**
4419 * Sorts the wrapped collection into groups and returns a count for the
4420 * number of objects in each group. Similar to `groupBy`, but instead
4421 * of returning a list of values, returns a count for the number of
4422 * values in that group.
4423 * @param iteratee An iteratee that provides the value to count by for
4424 * each item in the wrapped collection.
4425 * @param context `this` object in `iteratee`, optional.
4426 * @returns A dictionary with the group names provided by `iteratee` as
4427 * properties where each property contains the count of the grouped
4428 * elements from the wrapped collection.
4429 */
4430 countBy(
4431 iteratee?: Iteratee<V, string | number>,
4432 context?: any,
4433 ): Dictionary<number>;
4434
4435 /**
4436 * Returns a shuffled copy of the wrapped collection, using a version
4437 * of the Fisher-Yates shuffle.
4438 * @returns A shuffled copy of the wrapped collection.
4439 */
4440 shuffle(): T[];
4441
4442 /**
4443 * Produce a random sample from the wrapped collection. Pass a number
4444 * to return `n` random elements from the wrapped collection. Otherwise
4445 * a single random item will be returned.
4446 * @param n The number of elements to sample from the wrapped
4447 * collection.
4448 * @returns A random sample of `n` elements from the wrapped collection
4449 * or a single element if `n` is not specified.
4450 */
4451 sample(n: number): T[];
4452 sample(): T | undefined;
4453
4454 /**
4455 * Creates a real Array from the wrapped collection (anything that can
4456 * be iterated over). Useful for transmuting the arguments object.
4457 * @returns An array containing the elements of the wrapped collection.
4458 */
4459 toArray(): T[];
4460
4461 /**
4462 * Determines the number of values in the wrapped collection.
4463 * @returns The number of values in the wrapped collection.
4464 */
4465 size(): number;
4466
4467 /**
4468 * Splits the wrapped collection into two arrays: one whose elements
4469 * all satisfy `iteratee` and one whose elements all do not satisfy
4470 * `iteratee`.
4471 * @param iteratee The iteratee that defines the partitioning scheme
4472 * for each element in the wrapped collection.
4473 * @param context `this` object in `iteratee`, optional.
4474 * @returns An array composed of two elements, where the first element
4475 * contains the elements in the wrapped collection that satisfied the
4476 * predicate and the second element contains the elements that did not.
4477 */
4478 partition(iteratee?: Iteratee<V, boolean>, context?: any): [T[], T[]];
4479
4480 /**********
4481 * Arrays *
4482 **********/
4483
4484 /**
4485 * Returns the first element of the wrapped list. Passing `n` will
4486 * return the first `n` elements of the wrapped list.
4487 * @param n The number of elements to retrieve, optional.
4488 * @returns The first `n` elements of the wrapped list or the first
4489 * element if `n` is omitted.
4490 */
4491 first(): T | undefined;
4492 first(n: number): T[];
4493
4494 /**
4495 * @see first
4496 */
4497 head: Underscore<T, V>["first"];
4498
4499 /**
4500 * @see first
4501 */
4502 take: Underscore<T, V>["first"];
4503
4504 /**
4505 * Returns everything but the last entry of the wrapped list.
4506 * Especially useful on the arguments object. Pass `n` to exclude the
4507 * last `n` elements from the result.
4508 * @param n The number of elements from the end of the wrapped list to
4509 * omit, optional, default = 1.
4510 * @returns The elements of the wrapped list with the last `n` items
4511 * omitted.
4512 */
4513 initial(n?: number): T[];
4514
4515 /**
4516 * Returns the last element of the wrapped list. Passing `n` will
4517 * return the last `n` elements of the wrapped list.
4518 * @param n The number of elements to retrieve, optional.
4519 * @returns The last `n` elements of the wrapped list or the last
4520 * element if `n` is omitted.
4521 */
4522 last(): T | undefined;
4523 last(n: number): T[];
4524
4525 /**
4526 * Returns the rest of the elements in the wrapped list. Pass an
4527 * `index` to return the values of the list from that index onward.
4528 * @param index The index to start retrieving elements from, optional,
4529 * default = 1.
4530 * @returns The elements of the wrapped list from `index` to the end
4531 * of the list.
4532 */
4533 rest(n?: number): T[];
4534
4535 /**
4536 * @see rest
4537 */
4538 tail: Underscore<T, V>["rest"];
4539
4540 /**
4541 * @see rest
4542 */
4543 drop: Underscore<T, V>["rest"];
4544
4545 /**
4546 * Returns a copy of the wrapped list with all falsy values removed. In
4547 * JavaScript, false, null, 0, "", undefined and NaN are all falsy.
4548 * @returns An array containing the elements of the wrapped list without
4549 * falsy values.
4550 */
4551 compact(): Array<Truthy<T>>;
4552
4553 /**
4554 * Flattens a nested list (the nesting can be to any depth). If you
4555 * pass depth, the wrapped list will only be flattened a single
4556 * level.
4557 * @param depth True to only flatten one level, optional,
4558 * default = false.
4559 * @returns The flattened list.
4560 */
4561 flatten(depth: 1 | true): Array<ListItemOrSelf<T>>;
4562 flatten(depth?: number | false): Array<DeepestListItemOrSelf<T>>;
4563
4564 /**
4565 * Returns a copy of the wrapped list with all instances of `values`
4566 * removed.
4567 * @param values The values to exclude from the wrapped list.
4568 * @returns An array that contains all elements of the wrapped list
4569 * except for `values`.
4570 */
4571 without(...values: T[]): T[];
4572
4573 /**
4574 * Computes the union of the wrapped list and the passed-in `lists`:
4575 * the list of unique items, examined in order from first list to last
4576 * list, that are present in one or more of the lists.
4577 * @param lists The lists (along with the wrapped list) to compute
4578 * the union of.
4579 * @returns The union of elements within the wrapped list and `lists`.
4580 */
4581 union(...lists: Array<List<T>>): T[];
4582
4583 /**
4584 * Computes the list of values that are the intersection of the wrapped
4585 * list and the passed-in `lists`. Each value in the result is present
4586 * in each of the lists.
4587 * @param lists The lists (along with the wrapped list) to compute the
4588 * intersection of.
4589 * @returns The intersection of elements within the the wrapped list
4590 * and `lists`.
4591 */
4592 intersection(...lists: Array<List<T>>): T[];
4593
4594 /**
4595 * Similar to without, but returns the values from the wrapped list
4596 * that are not present in `others`.
4597 * @param list The starting list.
4598 * @param others The lists of values to exclude from the wrapped list.
4599 * @returns The contents of the wrapped list without the values in
4600 * `others`.
4601 */
4602 difference(...others: Array<List<T>>): T[];
4603
4604 /**
4605 * Produces a duplicate-free version of the wrapped list, using === to
4606 * test object equality. If you know in advance that the wrapped list
4607 * is sorted, passing true for isSorted will run a much faster
4608 * algorithm. If you want to compute unique items based on a
4609 * transformation, pass an iteratee function.
4610 * @param isSorted True if the wrapped list is already sorted,
4611 * optional, default = false.
4612 * @param iteratee Transform the elements of the wrapped list before
4613 * comparisons for uniqueness.
4614 * @param context 'this' object in `iteratee`, optional.
4615 * @returns An array containing only the unique elements in the wrapped
4616 * list.
4617 */
4618 uniq(
4619 isSorted?: boolean,
4620 iteratee?: Iteratee<V, any>,
4621 cotext?: any,
4622 ): T[];
4623 uniq(
4624 iteratee?: Iteratee<V, any>,
4625 context?: any,
4626 ): T[];
4627
4628 /**
4629 * @see uniq
4630 */
4631 unique: Underscore<T, V>["uniq"];
4632
4633 /**
4634 * Merges together the values of each of the `lists` (including the
4635 * wrapped list) with the values at the corresponding position. Useful
4636 * when you have separate data sources that are coordinated through
4637 * matching list indexes.
4638 * @returns The zipped version of the wrapped list and `lists`.
4639 */
4640 zip(): V extends List<infer A> ? Array<[A]> : []; // eslint-disable-line @definitelytyped/no-single-element-tuple-type
4641 zip<A, B>(...lists: [List<A>, List<B>]): Array<[T, A, B]>;
4642 zip<A>(list: List<A>): Array<[T, A]>;
4643 zip(...lists: Array<List<T>>): T[][];
4644 zip(...lists: Array<List<any>>): any[][];
4645
4646 /**
4647 * The opposite of zip. Given the wrapped list of lists, returns a
4648 * series of new arrays, the first of which contains all of the first
4649 * elements in the wrapped lists, the second of which contains all of
4650 * the second elements, and so on. (alias: transpose)
4651 * @returns The unzipped version of the wrapped lists.
4652 */
4653 unzip(): T extends [infer A, infer B, infer C] ? [A[], B[], C[]]
4654 : T extends [infer A, infer B] ? [A[], B[]]
4655 : T extends [infer A] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
4656 ? [A[]] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
4657 : T extends List<infer A> ? A[][]
4658 : [];
4659 transpose(): T extends [infer A, infer B, infer C] ? [A[], B[], C[]]
4660 : T extends [infer A, infer B] ? [A[], B[]]
4661 : T extends [infer A] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
4662 ? [A[]] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
4663 : T extends List<infer A> ? A[][]
4664 : [];
4665
4666 /**
4667 * Converts lists into objects. Call on either a wrapped list of
4668 * [key, value] pairs, or a wrapped list of keys and a list of
4669 * `values`. Passing by pairs is the reverse of pairs. If duplicate
4670 * keys exist, the last value wins.
4671 * @param values If the wrapped list is a list of keys, a list of
4672 * values corresponding to those keys.
4673 * @returns An object comprised of the provided keys and values.
4674 */
4675 object<TValue>(
4676 values: List<TValue>,
4677 ): Dictionary<TValue | undefined>;
4678 object(): Dictionary<PairValue<T>>;
4679
4680 /**
4681 * Returns the index at which `value` can be found in the wrapped list,
4682 * or -1 if `value` is not present. If you're working with a large list
4683 * and you know that the list is already sorted, pass true for
4684 * `isSortedOrFromIndex` to use a faster binary search...or, pass a
4685 * number in order to look for the first matching value in the list
4686 * after the given index.
4687 * @param value The value to search for within the wrapped list.
4688 * @param isSortedOrFromIndex True if the wrapped list is already
4689 * sorted OR the starting index for the search, optional.
4690 * @returns The index of the first occurrence of `value` within the
4691 * wrapped list or -1 if `value` is not found.
4692 */
4693 indexOf(
4694 value: T,
4695 isSortedOrFromIndex?: boolean | number,
4696 ): number;
4697
4698 /**
4699 * Returns the index of the last occurrence of `value` in the wrapped
4700 * list, or -1 if `value` is not present. Pass `fromIndex` to start
4701 * your search at a given index.
4702 * @param value The value to search for within the wrapped list.
4703 * @param fromIndex The starting index for the search, optional.
4704 * @returns The index of the last occurrence of `value` within the
4705 * wrapped list or -1 if `value` is not found.
4706 */
4707 lastIndexOf(
4708 value: T,
4709 fromIndex?: number,
4710 ): number;
4711
4712 /**
4713 * Returns the first index of an element in the wrapped list where the
4714 * `iteratee` truth test passes, otherwise returns -1.
4715 * @param iteratee The truth test to apply.
4716 * @param context `this` object in `iteratee`, optional.
4717 * @returns The index of the first element in the wrapped list where
4718 * the truth test passes or -1 if no elements pass.
4719 */
4720 findIndex(
4721 iteratee?: Iteratee<V, boolean>,
4722 context?: any,
4723 ): number;
4724
4725 /**
4726 * Returns the last index of an element in the wrapped list where the
4727 * `iteratee` truth test passes, otherwise returns -1.
4728 * @param iteratee The truth test to apply.
4729 * @param context `this` object in `iteratee`, optional.
4730 * @returns The index of the last element in the wrapped list where the
4731 * truth test passes or -1 if no elements pass.
4732 */
4733 findLastIndex(
4734 iteratee?: Iteratee<V, boolean>,
4735 context?: any,
4736 ): number;
4737
4738 /**
4739 * Uses a binary search to determine the lowest index at which the
4740 * value should be inserted into the wrapped list in order to maintain
4741 * the wrapped list's sorted order. If an iteratee is provided, it will
4742 * be used to compute the sort ranking of each value, including the
4743 * value you pass.
4744 * @param value The value to determine an insert index for to mainain
4745 * the sorting in the wrapped list.
4746 * @param iteratee Iteratee to compute the sort ranking of each
4747 * element including `value`, optional.
4748 * @param context `this` object in `iteratee`, optional.
4749 * @returns The index where `value` should be inserted into the wrapped
4750 * list.
4751 */
4752 sortedIndex(
4753 value: T,
4754 iteratee?: Iteratee<V | undefined, any>,
4755 context?: any,
4756 ): number;
4757
4758 /**
4759 * A function to create flexibly-numbered lists of integers, handy for
4760 * `each` and `map` loops. Returns a list of integers from
4761 * the wrapped value (inclusive) to `stop` (exclusive), incremented
4762 * (or decremented) by `step`. Note that ranges that `stop` before they
4763 * `start` are considered to be zero-length instead of negative - if
4764 * you'd like a negative range, use a negative `step`.
4765 *
4766 * If `stop` is not specified, the wrapped value will be the number to
4767 * stop at and the default start of 0 will be used.
4768 * @param stop The number to stop at.
4769 * @param step The number to count up by each iteration, optional,
4770 * default = 1.
4771 * @returns An array of numbers from start to `stop` with increments
4772 * of `step`.
4773 */
4774 range(stop?: number, step?: number): number[];
4775
4776 /**
4777 * Chunks the wrapped list into multiple arrays, each containing
4778 * `length` or fewer items.
4779 * @param length The maximum size of the chunks.
4780 * @returns The contents of the wrapped list in chunks no greater than
4781 * `length` in size.
4782 */
4783 chunk(length: number): T[][];
4784
4785 /*************
4786 * Functions *
4787 *************/
4788
4789 /**
4790 * Wrapped type `Function`.
4791 * @see _.bind
4792 */
4793 bind(object: any, ...args: any[]): Function;
4794
4795 /**
4796 * Wrapped type `object`.
4797 * @see _.bindAll
4798 */
4799 bindAll(...methodNames: string[]): any;
4800
4801 /**
4802 * Wrapped type `Function`.
4803 * @see _.partial
4804 */
4805 partial(...args: any[]): Function;
4806
4807 /**
4808 * Wrapped type `Function`.
4809 * @see _.memoize
4810 */
4811 memoize(hashFn?: (n: any) => string): Function;
4812
4813 /**
4814 * Wrapped type `Function`.
4815 * @see _.defer
4816 */
4817 defer(...args: any[]): void;
4818
4819 /**
4820 * Wrapped type `Function`.
4821 * @see _.delay
4822 */
4823 delay(wait: number, ...args: any[]): any;
4824
4825 /**
4826 * @see _.delay
4827 */
4828 delay(...args: any[]): any;
4829
4830 /**
4831 * Wrapped type `Function`.
4832 * @see _.throttle
4833 */
4834 throttle(wait: number, options?: _.ThrottleSettings): Function & _.Cancelable;
4835
4836 /**
4837 * Wrapped type `Function`.
4838 * @see _.debounce
4839 */
4840 debounce(wait: number, immediate?: boolean): Function & _.Cancelable;
4841
4842 /**
4843 * Wrapped type `Function`.
4844 * @see _.once
4845 */
4846 once(): Function;
4847
4848 /**
4849 * Wrapped type `Function`.
4850 * @see _.once
4851 */
4852 restArgs(starIndex?: number): Function;
4853
4854 /**
4855 * Wrapped type `number`.
4856 * @see _.after
4857 */
4858 after(fn: Function): Function;
4859
4860 /**
4861 * Wrapped type `number`.
4862 * @see _.before
4863 */
4864 before(fn: Function): Function;
4865
4866 /**
4867 * Wrapped type `Function`.
4868 * @see _.wrap
4869 */
4870 wrap(wrapper: Function): () => Function;
4871
4872 /**
4873 * Wrapped type `Function`.
4874 * @see _.negate
4875 */
4876 negate(): (...args: any[]) => boolean;
4877
4878 /**
4879 * Wrapped type `Function[]`.
4880 * @see _.compose
4881 */
4882 compose(...functions: Function[]): Function;
4883
4884 /***********
4885 * Objects *
4886 ***********/
4887
4888 /**
4889 * Wrapped type `object`.
4890 * @see _.keys
4891 */
4892 keys(): string[];
4893
4894 /**
4895 * Wrapped type `object`.
4896 * @see _.allKeys
4897 */
4898 allKeys(): string[];
4899
4900 /**
4901 * Wrapped type `object`.
4902 * @see _.values
4903 */
4904 values(): T[];
4905
4906 /**
4907 * Like map, but for objects. Transform the value of each property in
4908 * turn.
4909 * @param iteratee The iteratee to use to transform property values.
4910 * @param context `this` object in `iteratee`, optional.
4911 * @returns A new object with all of the wrapped object's property
4912 * values transformed through `iteratee`.
4913 */
4914 mapObject<I extends Iteratee<V, any, TypeOfCollection<V, any>>>(
4915 iteratee: I,
4916 context?: any,
4917 ): { [K in keyof V]: IterateeResult<I, V[K]> };
4918
4919 /**
4920 * Convert the wrapped object into a list of [key, value] pairs. The
4921 * opposite of the single-argument signature of `_.object`.
4922 * @returns The list of [key, value] pairs from the wrapped object.
4923 */
4924 pairs(): Array<[Extract<keyof V, string>, TypeOfCollection<V, any>]>;
4925
4926 /**
4927 * Wrapped type `object`.
4928 * @see _.invert
4929 */
4930 invert(): any;
4931
4932 /**
4933 * Wrapped type `object`.
4934 * @see _.functions
4935 */
4936 functions(): string[];
4937
4938 /**
4939 * @see _.functions
4940 */
4941 methods(): string[];
4942
4943 /**
4944 * Wrapped type `object`.
4945 * @see _.extend
4946 */
4947 extend(...sources: any[]): any;
4948
4949 /**
4950 * Similar to `findIndex` but for keys in objects. Returns the key
4951 * where the `iteratee` truth test passes or undefined.
4952 * @param iteratee The truth test to apply.
4953 * @param context `this` object in `iteratee`, optional.
4954 * @returns The first element in the wrapped object that passes the
4955 * truth test or undefined if no elements pass.
4956 */
4957 findKey(
4958 iteratee?: Iteratee<V, boolean, TypeOfCollection<V, any>>,
4959 context?: any,
4960 ): Extract<keyof V, string> | undefined;
4961
4962 /**
4963 * Return a copy of the wrapped object that is filtered to only have
4964 * values for the allowed keys (or array of keys).
4965 * @param keys The keys to keep on the wrapped object.
4966 * @returns A copy of the wrapped object with only the `keys`
4967 * properties.
4968 */
4969 pick<K extends string>(...keys: Array<K | K[]>): _Pick<V, K>;
4970
4971 /**
4972 * Return a copy of the wrapped object that is filtered to only have
4973 * values for the keys selected by a truth test.
4974 * @param iterator A truth test that selects the keys to keep on the
4975 * wrapped object.
4976 * @returns A copy of the wrapped object with only the keys selected by
4977 * `iterator`.
4978 */
4979 pick(
4980 iterator: ObjectIterator<TypeOfDictionary<V, any>, boolean, V>,
4981 ): Partial<V>;
4982
4983 /**
4984 * Return a copy of the wrapped object that is filtered to omit the
4985 * disallowed keys (or array of keys).
4986 * @param keys The keys to omit from the wrapped object.
4987 * @returns A copy of the wrapped object without the `keys` properties.
4988 */
4989 omit<K extends string>(...keys: Array<K | K[]>): _Omit<V, K>;
4990
4991 /**
4992 * Return a copy of the wrapped object that is filtered to not have
4993 * values for the keys selected by a truth test.
4994 * @param iterator A truth test that selects the keys to omit from the
4995 * wrapped object.
4996 * @returns A copy of the wrapped object without the keys selected by
4997 * `iterator`.
4998 */
4999 omit(
5000 iterator: ObjectIterator<TypeOfDictionary<V, any>, boolean, V>,
5001 ): Partial<V>;
5002
5003 /**
5004 * Wrapped type `object`.
5005 * @see _.defaults
5006 */
5007 defaults(...defaults: any[]): any;
5008
5009 /**
5010 * Wrapped type `any`.
5011 * @see _.create
5012 */
5013 create(props?: object): any;
5014
5015 /**
5016 * Wrapped type `any[]`.
5017 * @see _.clone
5018 */
5019 clone(): T;
5020
5021 /**
5022 * Wrapped type `object`.
5023 * @see _.tap
5024 */
5025 tap(interceptor: (...as: any[]) => any): any;
5026
5027 /**
5028 * Wrapped type `object`.
5029 * @see _.has
5030 */
5031 has(key: string): boolean;
5032
5033 /**
5034 * Wrapped type `any[]`.
5035 * @see _.matches
5036 */
5037 matches(): _.ListIterator<T, boolean>;
5038
5039 /**
5040 * Wrapped type `any[]`.
5041 * @see _.matcher
5042 */
5043 matcher(): _.ListIterator<T, boolean>;
5044
5045 /**
5046 * Wrapped type `any`.
5047 * @see _.get
5048 */
5049 get(
5050 path: string,
5051 ): TypeOfCollection<V> | undefined;
5052 get<U>(
5053 path: string,
5054 defaultValue?: U,
5055 ): TypeOfCollection<V> | U;
5056 get<P extends Array<string | number>, U = undefined>(
5057 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
5058 path: [...P],
5059 defaultValue?: U,
5060 ): DeepTypeOfCollection<V, P> | U;
5061
5062 /**
5063 * Wrapped type `string`.
5064 * @see _.property
5065 */
5066 property(): (object: any) => any;
5067
5068 /**
5069 * Wrapped type `object`.
5070 * @see _.propertyOf
5071 */
5072 propertyOf(): (key: string) => any;
5073
5074 /**
5075 * Performs an optimized deep comparison between the wrapped object
5076 * and `other` to determine if they should be considered equal.
5077 * @param other Compare to the wrapped object.
5078 * @returns True if the wrapped object should be considered equal to
5079 * `other`.
5080 */
5081 isEqual(other: any): boolean;
5082
5083 /**
5084 * Returns true if the wrapped collection contains no values.
5085 * For strings and array-like objects checks if the length property is
5086 * 0.
5087 * @returns True if the wrapped collection has no elements.
5088 */
5089 isEmpty(): boolean;
5090
5091 /**
5092 * Returns true if the keys and values in `properties` are contained in
5093 * the wrapped object.
5094 * @param properties The properties to check for in the wrapped object.
5095 * @returns True if all keys and values in `properties` are also in the
5096 * wrapped object.
5097 */
5098 isMatch(properties: any): boolean;
5099
5100 /**
5101 * Returns true if the wrapped object is a DOM element.
5102 * @returns True if the wrapped object is a DOM element, otherwise
5103 * false.
5104 */
5105 isElement(): boolean;
5106
5107 /**
5108 * Returns true if the wrapped object is an Array.
5109 * @returns True if the wrapped object is an Array, otherwise false.
5110 */
5111 isArray(): boolean;
5112
5113 /**
5114 * Returns true if the wrapped object is an ArrayBuffer.
5115 * @returns True if the wrapped object is an ArrayBuffer, otherwise false.
5116 */
5117 isArrayBuffer(): boolean;
5118
5119 /**
5120 * Returns true if the wrapped object is a DataView.
5121 * @returns True if the wrapped object is a DataView, otherwise false.
5122 */
5123 isDataView(): boolean;
5124
5125 /**
5126 * Returns true if the wrapped object is a TypedArray.
5127 * @returns True if the wrapped object is a TypedArray, otherwise false.
5128 */
5129 isTypedArray(): boolean;
5130
5131 /**
5132 * Returns true if the wrapped object is a Symbol.
5133 * @returns True if the wrapped object is a Symbol, otherwise false.
5134 */
5135 isSymbol(): boolean;
5136
5137 /**
5138 * Returns true if the wrapped object is an Object. Note that
5139 * JavaScript arrays and functions are objects, while (normal) strings
5140 * and numbers are not.
5141 * @returns True if the wrapped object is an Object, otherwise false.
5142 */
5143 isObject(): boolean;
5144
5145 /**
5146 * Returns true if the wrapped object is an Arguments object.
5147 * @returns True if the wrapped object is an Arguments object,
5148 * otherwise false.
5149 */
5150 isArguments(): boolean;
5151
5152 /**
5153 * Returns true if the wrapped object is a Function.
5154 * @returns True if the wrapped object is a Function, otherwise false.
5155 */
5156 isFunction(): boolean;
5157
5158 /**
5159 * Returns true if the wrapped object is a Error.
5160 * @returns True if the wrapped object is a Error, otherwise false.
5161 */
5162 isError(): boolean;
5163
5164 /**
5165 * Returns true if the wrapped object is a String.
5166 * @returns True if the wrapped object is a String, otherwise false.
5167 */
5168 isString(): boolean;
5169
5170 /**
5171 * Returns true if the wrapped object is a Number (including NaN).
5172 * @returns True if the wrapped object is a Number, otherwise false.
5173 */
5174 isNumber(): boolean;
5175
5176 /**
5177 * Returns true if the wrapped object is a finite Number.
5178 * @returns True if the wrapped object is a finite Number.
5179 */
5180 isFinite(): boolean;
5181
5182 /**
5183 * Returns true if the wrapped object is a Boolean.
5184 * @returns True if the wrapped object is a Boolean, otherwise false.
5185 */
5186 isBoolean(): boolean;
5187
5188 /**
5189 * Returns true if the wrapped object is a Date.
5190 * @returns True if the wrapped object is a Date, otherwise false.
5191 */
5192 isDate(): boolean;
5193
5194 /**
5195 * Returns true if the wrapped object is a RegExp.
5196 * @returns True if the wrapped object is a RegExp, otherwise false.
5197 */
5198 isRegExp(): boolean;
5199
5200 /**
5201 * Returns true if the wrapped object is NaN.
5202 * Note: this is not the same as the native isNaN function,
5203 * which will also return true if the variable is undefined.
5204 * @returns True if the wrapped object is NaN, otherwise false.
5205 */
5206 isNaN(): boolean;
5207
5208 /**
5209 * Returns true if the wrapped object is null.
5210 * @returns True if the wrapped object is null, otherwise false.
5211 */
5212 isNull(): boolean;
5213
5214 /**
5215 * Returns true if the wrapped object is undefined.
5216 * @returns True if the wrapped object is undefined, otherwise false.
5217 */
5218 isUndefined(): boolean;
5219
5220 /***********
5221 * Utility *
5222 ***********/
5223
5224 /**
5225 * Wrapped type `any`.
5226 * @see _.identity
5227 */
5228 identity(): any;
5229
5230 /**
5231 * Wrapped type `any`.
5232 * @see _.constant
5233 */
5234 constant(): () => T;
5235
5236 /**
5237 * Wrapped type `any`.
5238 * @see _.noop
5239 */
5240 noop(): void;
5241
5242 /**
5243 * Wrapped type `number`.
5244 * @see _.times
5245 */
5246 times<TResult>(iterator: (n: number) => TResult, context?: any): TResult[];
5247
5248 /**
5249 * Wrapped type `number`.
5250 * @see _.random
5251 */
5252 random(): number;
5253 /**
5254 * Wrapped type `number`.
5255 * @see _.random
5256 */
5257 random(max: number): number;
5258
5259 /**
5260 * Wrapped type `object`.
5261 * @see _.mixin
5262 */
5263 mixin(): void;
5264
5265 /**
5266 * Wrapped type `string|Function|Object`.
5267 * @see _.iteratee
5268 */
5269 iteratee(context?: any): Function;
5270
5271 /**
5272 * Wrapped type `string`.
5273 * @see _.uniqueId
5274 */
5275 uniqueId(): string;
5276
5277 /**
5278 * Wrapped type `string`.
5279 * @see _.escape
5280 */
5281 escape(): string;
5282
5283 /**
5284 * Wrapped type `string`.
5285 * @see _.unescape
5286 */
5287 unescape(): string;
5288
5289 /**
5290 * Wrapped type `object`.
5291 * @see _.result
5292 */
5293 result(property: string, defaultValue?: any): any;
5294
5295 /**
5296 * Wrapped type `string`.
5297 * @see _.template
5298 */
5299 template(settings?: _.TemplateSettings): CompiledTemplate;
5300
5301 /************
5302 * Chaining *
5303 ************/
5304
5305 /**
5306 * Returns a wrapped object. Calling methods on this object will
5307 * continue to return wrapped objects until value() is used.
5308 * @returns An underscore chain wrapper around the wrapped value.
5309 */
5310 chain(): _Chain<T, V>;
5311
5312 /**
5313 * Extracts the value of the wrapped object.
5314 * @returns The value of the wrapped object.
5315 */
5316 value(): V;
5317 }
5318
5319 interface _Chain<T, V = T[]> {
5320 /***************
5321 * Collections *
5322 ***************/
5323
5324 /**
5325 * Iterates over the wrapped collection of elements, yielding each in
5326 * turn to an `iteratee`. The `iteratee` is bound to the context
5327 * object, if one is passed.
5328 * @param iteratee The iteratee to call for each element in the wrapped
5329 * collection.
5330 * @param context 'this' object in `iteratee`, optional.
5331 * @returns A chain wrapper around the originally wrapped collection.
5332 */
5333 each(
5334 iteratee: CollectionIterator<TypeOfCollection<V>, void, V>,
5335 context?: any,
5336 ): _Chain<T, V>;
5337
5338 /**
5339 * @see each
5340 */
5341 forEach: _Chain<T, V>["each"];
5342
5343 /**
5344 * Produces a new array of values by mapping each value in the wrapped
5345 * collection through a transformation `iteratee`.
5346 * @param iteratee The iteratee to use to transform each item in the
5347 * wrapped collection.
5348 * @param context `this` object in `iteratee`, optional.
5349 * @returns A chain wrapper around the mapped result.
5350 */
5351 map<I extends Iteratee<V, any>>(
5352 iteratee: I,
5353 context?: any,
5354 ): _Chain<IterateeResult<I, T>>;
5355
5356 /**
5357 * @see map
5358 */
5359 collect: _Chain<T, V>["map"];
5360
5361 /**
5362 * Also known as inject and foldl, reduce boils down the wrapped
5363 * collection of values into a single value. `memo` is the initial
5364 * state of the reduction, and each successive step of it should be
5365 * returned by `iteratee`.
5366 *
5367 * If no memo is passed to the initial invocation of reduce, `iteratee`
5368 * is not invoked on the first element of the wrapped collection. The
5369 * first element is instead passed as the memo in the invocation of
5370 * `iteratee` on the next element in the wrapped collection.
5371 * @param iteratee The function to call on each iteration to reduce the
5372 * collection.
5373 * @param memo The initial reduce state or undefined to use the first
5374 * item in `collection` as initial state.
5375 * @param context `this` object in `iteratee`, optional.
5376 * @returns A chain wrapper around the reduced result.
5377 */
5378 reduce<TResult>(
5379 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult, V>,
5380 memo: TResult,
5381 context?: any,
5382 ): _ChainSingle<TResult>;
5383 reduce<TResult = TypeOfCollection<V>>(
5384 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult | TypeOfCollection<V>, V>,
5385 ): _ChainSingle<TResult | TypeOfCollection<V> | undefined>;
5386
5387 /**
5388 * @see reduce
5389 */
5390 inject: _Chain<T, V>["reduce"];
5391
5392 /**
5393 * @see reduce
5394 */
5395 foldl: _Chain<T, V>["reduce"];
5396
5397 /**
5398 * The right-associative version of reduce.
5399 *
5400 * This is not as useful in JavaScript as it would be in a language
5401 * with lazy evaluation.
5402 * @param iteratee The function to call on each iteration to reduce the
5403 * collection.
5404 * @param memo The initial reduce state or undefined to use the first
5405 * item in `collection` as the initial state.
5406 * @param context `this` object in `iteratee`, optional.
5407 * @returns A chain wrapper around the reduced result.
5408 */
5409 reduceRight<TResult>(
5410 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult, V>,
5411 memo: TResult,
5412 context?: any,
5413 ): _ChainSingle<TResult>;
5414 reduceRight<TResult = TypeOfCollection<V>>(
5415 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult | TypeOfCollection<V>, V>,
5416 ): _ChainSingle<TResult | TypeOfCollection<V> | undefined>;
5417
5418 /**
5419 * @see reduceRight
5420 */
5421 foldr: _Chain<T, V>["reduceRight"];
5422
5423 /**
5424 * Looks through each value in the wrapped collection, returning the
5425 * first one that passes a truth test (`iteratee`), or undefined if no
5426 * value passes the test. The function returns as soon as it finds an
5427 * acceptable element, and doesn't traverse the entire collection.
5428 * @param iteratee The truth test to apply.
5429 * @param context `this` object in `iteratee`, optional.
5430 * @returns A chain wrapper around the first element in the wrapped
5431 * collection that passes the truth test or undefined if no elements
5432 * pass.
5433 */
5434 find(
5435 iteratee?: Iteratee<V, boolean>,
5436 context?: any,
5437 ): _ChainSingle<T | undefined>;
5438
5439 /**
5440 * @see find
5441 */
5442 detect: _Chain<T, V>["find"];
5443
5444 /**
5445 * Looks through each value in the wrapped collection, returning an
5446 * array of all the values that pass a truth test (`iteratee`).
5447 * @param iteratee The truth test to apply.
5448 * @param context `this` object in `iteratee`, optional.
5449 * @returns A chain wrapper around the set of values that pass the
5450 * truth test.
5451 */
5452 filter(iteratee?: Iteratee<V, any>, context?: any): _Chain<T>;
5453
5454 /**
5455 * @see filter
5456 */
5457 select: _Chain<T, V>["filter"];
5458
5459 /**
5460 * Looks through each value in the wrapped collection, returning an
5461 * array of all the elements that match the key-value pairs listed in
5462 * `properties`.
5463 * @param properties The properties to check for on the elements within
5464 * the wrapped collection.
5465 * @returns A chain wrapper around the elements in the wrapped
5466 * collection that match `properties`.
5467 */
5468 where(properties: Partial<T>): _Chain<T>;
5469
5470 /**
5471 * Looks through the wrapped collection and returns the first value
5472 * that matches all of the key-value pairs listed in `properties`. If
5473 * no match is found, or if list is empty, undefined will be returned.
5474 * @param properties The properties to check for on the elements within
5475 * the wrapped collection.
5476 * @returns A chain wrapper around the first element in the wrapped
5477 * collection that matches `properties` or undefined if no match is
5478 * found.
5479 */
5480 findWhere(properties: Partial<T>): _ChainSingle<T | undefined>;
5481
5482 /**
5483 * Returns the values in the wrapped collection without the elements
5484 * that pass a truth test (`iteratee`).
5485 * The opposite of filter.
5486 * @param iteratee The truth test to apply.
5487 * @param context `this` object in `iteratee`, optional.
5488 * @returns A chain wrapper around the set of values that fail the
5489 * truth test.
5490 */
5491 reject(iteratee?: Iteratee<V, boolean>, context?: any): _Chain<T>;
5492
5493 /**
5494 * Returns true if all of the values in the wrapped collection pass the
5495 * `iteratee` truth test. Short-circuits and stops traversing the
5496 * wrapped collection if a false element is found.
5497 * @param iteratee The truth test to apply.
5498 * @param context `this` object in `iteratee`, optional.
5499 * @returns A chain wrapper around true if all elements pass the truth
5500 * test, otherwise around false.
5501 */
5502 every(
5503 iterator?: Iteratee<V, boolean>,
5504 context?: any,
5505 ): _ChainSingle<boolean>;
5506
5507 /**
5508 * @see every
5509 */
5510 all: _Chain<T, V>["every"];
5511
5512 /**
5513 * Returns true if any of the values in the wrapped collection pass the
5514 * `iteratee` truth test. Short-circuits and stops traversing the
5515 * wrapped collection if a true element is found.
5516 * @param iteratee The truth test to apply.
5517 * @param context `this` object in `iteratee`, optional.
5518 * @returns A chain wrapper around true if any element passed the truth
5519 * test, otherwise around false.
5520 */
5521 some(
5522 iterator?: Iteratee<V, boolean>,
5523 context?: any,
5524 ): _ChainSingle<boolean>;
5525
5526 /**
5527 * @see some
5528 */
5529 any: _Chain<T, V>["some"];
5530
5531 /**
5532 * Returns true if the value is present in the wrapped collection. Uses
5533 * indexOf internally, if the wrapped collection is a List. Use
5534 * `fromIndex` to start your search at a given index.
5535 * @param value The value to check the wrapped collection for.
5536 * @param fromIndex The index to start searching from, optional,
5537 * default = 0, only used when the wrapped collection is a List.
5538 * @returns A chain wrapper around true if `value` is present in the
5539 * wrapped collection after `fromIndex`, otherwise around false.
5540 */
5541 contains(value: any, fromIndex?: number): _ChainSingle<boolean>;
5542
5543 /**
5544 * @see contains
5545 */
5546 include: _Chain<T, V>["contains"];
5547
5548 /**
5549 * @see contains
5550 */
5551 includes: _Chain<T, V>["contains"];
5552
5553 /**
5554 * Calls the method named by `methodName` on each value in the wrapped
5555 * collection. Any extra arguments passed to invoke will be forwarded
5556 * on to the method invocation.
5557 * @param methodName The name of the method to call on each element in
5558 * the wrapped collection.
5559 * @param args Additional arguments to pass to method `methodName`.
5560 * @returns A chain wrapper around an array containing the result of
5561 * the method call for each item in the wrapped collection.
5562 */
5563 invoke(methodName: string, ...args: any[]): _Chain<any>;
5564
5565 /**
5566 * A convenient version of what is perhaps the most common use-case for
5567 * map: extracting a list of property values.
5568 * @param propertyName The name of a specific property to retrieve from
5569 * all items in the wrapped collection.
5570 * @returns A chain wrapper around The set of values for the specified
5571 * `propertyName` for each item in the wrapped collection.
5572 */
5573 pluck<K extends string | number>(
5574 propertyName: K,
5575 ): _Chain<PropertyTypeOrAny<T, K>>;
5576
5577 /**
5578 * Returns the maximum value in the wrapped collection. If an
5579 * `iteratee` is provided, it will be used on each element to generate
5580 * the criterion by which the element is ranked. -Infinity is returned
5581 * if list is empty. Non-numerical values returned by `iteratee` will
5582 * be ignored.
5583 * @param iteratee The iteratee that provides the criterion by which
5584 * each element is ranked, optional if evaluating a collection of
5585 * numbers.
5586 * @param context `this` object in `iteratee`, optional.
5587 * @returns A chain wrapper around the maximum element within the
5588 * wrapped collection or around -Infinity if the wrapped collection is
5589 * empty.
5590 */
5591 max(
5592 iteratee?: Iteratee<V, any>,
5593 context?: any,
5594 ): _ChainSingle<T | number>;
5595
5596 /**
5597 * Returns the minimum value in the wrapped collection. If an
5598 * `iteratee` is provided, it will be used on each element to generate
5599 * the criterion by which the element is ranked. Infinity is returned
5600 * if list is empty. Non-numerical values returned by `iteratee` will
5601 * be ignored.
5602 * @param iteratee The iteratee that provides the criterion by which
5603 * each element is ranked, optional if evaluating a collection of
5604 * numbers.
5605 * @param context `this` object in `iteratee`, optional.
5606 * @returns A chain wrapper around the minimum element within the
5607 * wrapped collection or around Infinity if the wrapped collection is
5608 * empty.
5609 */
5610 min(
5611 iteratee?: Iteratee<V, any>,
5612 context?: any,
5613 ): _ChainSingle<T | number>;
5614
5615 /**
5616 * Returns a (stably) sorted copy of the wrapped collection, ranked in
5617 * ascending order by the results of running each value through
5618 * `iteratee`.
5619 * @param iteratee An iteratee that provides the value to sort by for
5620 * each item in the wrapped collection.
5621 * @param context `this` object in `iteratee`, optional.
5622 * @returns A chain wrapper around a sorted copy of the wrapped
5623 * collection.
5624 */
5625 sortBy(iteratee?: Iteratee<V, any>, context?: any): _Chain<T>;
5626
5627 /**
5628 * Splits the warpped collection into sets that are grouped by the
5629 * result of running each value through `iteratee`.
5630 * @param iteratee An iteratee that provides the value to group by for
5631 * each item in the wrapped collection.
5632 * @param context `this` object in `iteratee`, optional.
5633 * @returns A chain wrapper around a dictionary with the group names
5634 * provided by `iteratee` as properties where each property contains
5635 * the grouped elements from the wrapped collection.
5636 */
5637 groupBy(
5638 iteratee?: Iteratee<V, string | number>,
5639 context?: any,
5640 ): _Chain<T[], Dictionary<T[]>>;
5641
5642 /**
5643 * Given the warpped collection and an `iteratee` function that returns
5644 * a key for each element in `collection`, returns an object that acts
5645 * as an index of each item. Just like `groupBy`, but for when you
5646 * know your keys are unique.
5647 * @param iteratee An iteratee that provides the value to index by for
5648 * each item in the wrapped collection.
5649 * @param context `this` object in `iteratee`, optional.
5650 * @returns A chain wrapper around a dictionary where each item in the
5651 * wrapped collection is assigned to the property designated by
5652 * `iteratee`.
5653 */
5654 indexBy(
5655 iteratee?: Iteratee<V, string | number>,
5656 context?: any,
5657 ): _Chain<T, Dictionary<T>>;
5658
5659 /**
5660 * Sorts the wrapped collection into groups and returns a count for the
5661 * number of objects in each group. Similar to `groupBy`, but instead
5662 * of returning a list of values, returns a count for the number of
5663 * values in that group.
5664 * @param iteratee An iteratee that provides the value to count by for
5665 * each item in the wrapped collection.
5666 * @param context `this` object in `iteratee`, optional.
5667 * @returns A chain wrapper around a dictionary with the group names
5668 * provided by `iteratee` as properties where each property contains
5669 * the count of the grouped elements from the wrapped collection.
5670 */
5671 countBy(
5672 iterator?: Iteratee<V, string | number>,
5673 context?: any,
5674 ): _Chain<number, Dictionary<number>>;
5675
5676 /**
5677 * Returns a shuffled copy of the wrapped collection, using a version
5678 * of the Fisher-Yates shuffle.
5679 * @returns A chain wrapper around a shuffled copy of the wrapped
5680 * collection.
5681 */
5682 shuffle(): _Chain<T>;
5683
5684 /**
5685 * Produce a random sample from the wrapped collection. Pass a number
5686 * to return `n` random elements from the wrapped collection. Otherwise
5687 * a single random item will be returned.
5688 * @param n The number of elements to sample from the wrapped
5689 * collection.
5690 * @returns A chain wrapper around a random sample of `n` elements from
5691 * the wrapped collection or a single element if `n` is not specified.
5692 */
5693 sample(n: number): _Chain<T>;
5694 sample(): _ChainSingle<T | undefined>;
5695
5696 /**
5697 * Creates a real Array from the wrapped collection (anything that can
5698 * be iterated over). Useful for transmuting the arguments object.
5699 * @returns A chain wrapper around an array containing the elements
5700 * of the wrapped collection.
5701 */
5702 toArray(): _Chain<T>;
5703
5704 /**
5705 * Determines the number of values in the wrapped collection.
5706 * @returns A chain wrapper around the number of values in the wrapped
5707 * collection.
5708 */
5709 size(): _ChainSingle<number>;
5710
5711 /**
5712 * Splits the wrapped collection into two arrays: one whose elements
5713 * all satisfy `iteratee` and one whose elements all do not satisfy
5714 * `iteratee`.
5715 * @param iteratee The iteratee that defines the partitioning scheme
5716 * for each element in the wrapped collection.
5717 * @param context `this` object in `iteratee`, optional.
5718 * @returns A chain wrapper around an array composed of two elements,
5719 * where the first element contains the elements in the wrapped
5720 * collection that satisfied the predicate and the second element
5721 * contains the elements that did not.
5722 */
5723 partition(
5724 iteratee?: Iteratee<V, boolean>,
5725 context?: any,
5726 ): _Chain<T[], [T[], T[]]>;
5727
5728 /**********
5729 * Arrays *
5730 **********/
5731
5732 /**
5733 * Returns the first element of the wrapped list. Passing `n` will
5734 * return the first `n` elements of the wrapped list.
5735 * @param n The number of elements to retrieve, optional.
5736 * @returns A chain wrapper around the first `n` elements of the
5737 * wrapped list or around the first element if `n` is omitted.
5738 */
5739 first(): _ChainSingle<T | undefined>;
5740 first(n: number): _Chain<T>;
5741
5742 /**
5743 * @see first
5744 */
5745 head: _Chain<T, V>["first"];
5746
5747 /**
5748 * @see first
5749 */
5750 take: _Chain<T, V>["first"];
5751
5752 /**
5753 * Returns everything but the last entry of the wrapped list.
5754 * Especially useful on the arguments object. Pass `n` to exclude the
5755 * last `n` elements from the result.
5756 * @param n The number of elements from the end of the wrapped list to
5757 * omit, optional, default = 1.
5758 * @returns A chain wrapper around the elements of the wrapped list
5759 * with the last `n` items omitted.
5760 */
5761 initial(n?: number): _Chain<T>;
5762
5763 /**
5764 * Returns the last element of the wrapped list. Passing `n` will
5765 * return the last `n` elements of the wrapped list.
5766 * @param n The number of elements to retrieve, optional.
5767 * @returns A chain wrapper around the last `n` elements of the wrapped
5768 * list or around the last element if `n` is omitted.
5769 */
5770 last(): _ChainSingle<T | undefined>;
5771 last(n: number): _Chain<T>;
5772
5773 /**
5774 * Returns the rest of the elements in the wrapped list. Pass an
5775 * `index` to return the values of the list from that index onward.
5776 * @param index The index to start retrieving elements from, optional,
5777 * default = 1.
5778 * @returns A chain wrapper around the elements of the wrapped list
5779 * from `index` to the end of the list.
5780 */
5781 rest(n?: number): _Chain<T>;
5782
5783 /**
5784 * @see rest
5785 */
5786 tail: _Chain<T, V>["rest"];
5787
5788 /**
5789 * @see rest
5790 */
5791 drop: _Chain<T, V>["rest"];
5792
5793 /**
5794 * Returns a copy of the wrapped list with all falsy values removed. In
5795 * JavaScript, false, null, 0, "", undefined and NaN are all falsy.
5796 * @returns A chain wrapper around an array containing the elements of
5797 * the wrapped list without falsy values.
5798 */
5799 compact(): _Chain<Truthy<T>>;
5800
5801 /**
5802 * Flattens a nested list (the nesting can be to any depth). If you
5803 * pass true or 1 as the depth, the list will only be flattened a single
5804 * level. Passing a greater number will cause the flattening to descend
5805 * deeper into the nesting hierarchy. Omitting the depth argument, or
5806 * passing false or Infinity, flattens the list all the way to the
5807 * deepest nesting level.
5808 * @param depth True to only flatten one level, optional,
5809 * default = false.
5810 * @returns A chain wrapper around the flattened list.
5811 */
5812 flatten(depth: 1 | true): _Chain<ListItemOrSelf<T>>;
5813 flatten(depth?: number | false): _Chain<DeepestListItemOrSelf<T>>;
5814
5815 /**
5816 * Returns a copy of the wrapped list with all instances of `values`
5817 * removed.
5818 * @param values The values to exclude from the wrapped list.
5819 * @returns A chain wrapper around an array that contains all elements
5820 * of the wrapped list except for `values`.
5821 */
5822 without(...values: T[]): _Chain<T>;
5823
5824 /**
5825 * Computes the union of the wrapped list and the passed-in `lists`:
5826 * the list of unique items, examined in order from first list to last
5827 * list, that are present in one or more of the lists.
5828 * @param lists The lists (along with the wrapped list) to compute
5829 * the union of.
5830 * @returns A chain wrapper around the union of elements within the
5831 * wrapped list and `lists`.
5832 */
5833 union(...lists: Array<List<T>>): _Chain<T>;
5834
5835 /**
5836 * Computes the list of values that are the intersection of the wrapped
5837 * list and the passed-in `lists`. Each value in the result is present
5838 * in each of the lists.
5839 * @param lists The lists (along with the wrapped list) to compute the
5840 * intersection of.
5841 * @returns A chain wrapper around the intersection of elements within
5842 * the the wrapped list and `lists`.
5843 */
5844 intersection(...lists: Array<List<T>>): _Chain<T>;
5845
5846 /**
5847 * Similar to without, but returns the values from the wrapped list
5848 * that are not present in `others`.
5849 * @param list The starting list.
5850 * @param others The lists of values to exclude from the wrapped list.
5851 * @returns A chain wrapper around the contents of the wrapped list
5852 * without the values in `others`.
5853 */
5854 difference(...others: Array<List<T>>): _Chain<T>;
5855
5856 /**
5857 * Produces a duplicate-free version of the wrapped list, using === to
5858 * test object equality. If you know in advance that the wrapped list
5859 * is sorted, passing true for isSorted will run a much faster
5860 * algorithm. If you want to compute unique items based on a
5861 * transformation, pass an iteratee function.
5862 * @param isSorted True if the wrapped list is already sorted,
5863 * optional, default = false.
5864 * @param iteratee Transform the elements of the wrapped list before
5865 * comparisons for uniqueness.
5866 * @param context 'this' object in `iteratee`, optional.
5867 * @returns A chain wrapper around an array containing only the unique
5868 * elements in the wrapped list.
5869 */
5870 uniq(
5871 isSorted?: boolean,
5872 iteratee?: Iteratee<V, any>,
5873 context?: any,
5874 ): _Chain<T>;
5875 uniq(
5876 iteratee?: Iteratee<V, any>,
5877 context?: any,
5878 ): _Chain<T>;
5879
5880 /**
5881 * Wrapped type List<T>.
5882 * @see uniq
5883 */
5884 unique: _Chain<T, V>["uniq"];
5885
5886 /**
5887 * Merges together the values of each of the `lists` (including the
5888 * wrapped list) with the values at the corresponding position. Useful
5889 * when you have separate data sources that are coordinated through
5890 * matching list indexes.
5891 * @returns A chain wrapper around the zipped version of the wrapped
5892 * list and `lists`.
5893 */
5894 zip(): V extends List<infer A> ? _Chain<[A]> : _Chain<never, []>; // eslint-disable-line @definitelytyped/no-single-element-tuple-type
5895 zip<A, B>(...arrays: [List<A>, List<B>]): _Chain<[T, A, B]>;
5896 zip<A>(array: List<A>): _Chain<[T, A]>;
5897 zip(...arrays: Array<List<T>>): _Chain<T[]>;
5898 zip(...arrays: Array<List<any>>): _Chain<any[]>;
5899
5900 /**
5901 * The opposite of zip. Given the wrapped list of lists, returns a
5902 * series of new arrays, the first of which contains all of the first
5903 * elements in the wrapped lists, the second of which contains all of
5904 * the second elements, and so on. (alias: transpose)
5905 * @returns A chain wrapper around the unzipped version of the wrapped
5906 * lists.
5907 */
5908 unzip(): T extends [infer A, infer B, infer C] ? _Chain<A[] | B[] | C[], [A[], B[], C[]]>
5909 : T extends [infer A, infer B] ? _Chain<A[] | B[], [A[], B[]]>
5910 : T extends [infer A] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
5911 ? _Chain<A[], [A[]]> // eslint-disable-line @definitelytyped/no-single-element-tuple-type
5912 : T extends List<infer A> ? _Chain<A[]>
5913 : _Chain<never, []>;
5914 transpose(): T extends [infer A, infer B, infer C] ? _Chain<A[] | B[] | C[], [A[], B[], C[]]>
5915 : T extends [infer A, infer B] ? _Chain<A[] | B[], [A[], B[]]>
5916 : T extends [infer A] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
5917 ? _Chain<A[], [A[]]> // eslint-disable-line @definitelytyped/no-single-element-tuple-type
5918 : T extends List<infer A> ? _Chain<A[]>
5919 : _Chain<never, []>;
5920
5921 /**
5922 * Converts lists into objects. Call on either a wrapped list of
5923 * [key, value] pairs, or a wrapped list of keys and a list of
5924 * `values`. Passing by pairs is the reverse of pairs. If duplicate
5925 * keys exist, the last value wins.
5926 * @param values If the wrapped list is a list of keys, a list of
5927 * values corresponding to those keys.
5928 * @returns A chain wrapper around an object comprised of the provided
5929 * keys and values.
5930 */
5931 object<TValue>(
5932 values: List<TValue>,
5933 ): _Chain<TValue | undefined, Dictionary<TValue | undefined>>;
5934 object(): _Chain<PairValue<T>, Dictionary<PairValue<T>>>;
5935
5936 /**
5937 * Returns the index at which `value` can be found in the wrapped list,
5938 * or -1 if `value` is not present. If you're working with a large list
5939 * and you know that the list is already sorted, pass true for
5940 * `isSortedOrFromIndex` to use a faster binary search...or, pass a
5941 * number in order to look for the first matching value in the list
5942 * after the given index.
5943 * @param value The value to search for within the wrapped list.
5944 * @param isSortedOrFromIndex True if the wrapped list is already
5945 * sorted OR the starting index for the search, optional.
5946 * @returns A chain wrapper around the index of the first occurrence of
5947 * `value` within the wrapped list or -1 if `value` is not found.
5948 */
5949 indexOf(
5950 value: T,
5951 isSortedOrFromIndex?: boolean | number,
5952 ): _ChainSingle<number>;
5953
5954 /**
5955 * Returns the index of the last occurrence of `value` in the wrapped
5956 * list, or -1 if `value` is not present. Pass `fromIndex` to start
5957 * your search at a given index.
5958 * @param value The value to search for within the wrapped list.
5959 * @param fromIndex The starting index for the search, optional.
5960 * @returns A chain wrapper around the index of the last occurrence of
5961 * `value` within the wrapped list or -1 if `value` is not found.
5962 */
5963 lastIndexOf(
5964 value: T,
5965 fromIndex?: number,
5966 ): _ChainSingle<number>;
5967
5968 /**
5969 * Returns the first index of an element in the wrapped list where the
5970 * `iteratee` truth test passes, otherwise returns -1.
5971 * @param iteratee The truth test to apply.
5972 * @param context `this` object in `iteratee`, optional.
5973 * @returns A chain wrapper around the index of the first element in
5974 * the wrapped list where the truth test passes or -1 if no elements
5975 * pass.
5976 */
5977 findIndex(
5978 iteratee?: Iteratee<V, boolean>,
5979 context?: any,
5980 ): _ChainSingle<number>;
5981
5982 /**
5983 * Returns the last index of an element in the wrapped list where the
5984 * `iteratee` truth test passes, otherwise returns -1.
5985 * @param iteratee The truth test to apply.
5986 * @param context `this` object in `iteratee`, optional.
5987 * @returns A chain wrapper around the index of the last element in the
5988 * wrapped list where the truth test passes or -1 if no elements pass.
5989 */
5990 findLastIndex(
5991 iteratee?: Iteratee<V, boolean>,
5992 context?: any,
5993 ): _ChainSingle<number>;
5994
5995 /**
5996 * Uses a binary search to determine the lowest index at which the
5997 * value should be inserted into the wrapped list in order to maintain
5998 * the wrapped list's sorted order. If an iteratee is provided, it
5999 * will be used to compute the sort ranking of each value, including
6000 * the value you pass.
6001 * @param value The value to determine an insert index for to mainain
6002 * the sorting in the wrapped list.
6003 * @param iteratee Iteratee to compute the sort ranking of each element
6004 * including `value`, optional.
6005 * @param context `this` object in `iteratee`, optional.
6006 * @returns A chain wrapper around the index where `value` should be
6007 * inserted into the wrapped list.
6008 */
6009 sortedIndex(
6010 value: T,
6011 iteratee?: Iteratee<V | undefined, any>,
6012 context?: any,
6013 ): _ChainSingle<number>;
6014
6015 /**
6016 * A function to create flexibly-numbered lists of integers, handy for
6017 * `each` and `map` loops. Returns a list of integers from
6018 * the wrapped value (inclusive) to `stop` (exclusive), incremented
6019 * (or decremented) by `step`. Note that ranges that `stop` before they
6020 * `start` are considered to be zero-length instead of negative - if
6021 * you'd like a negative range, use a negative `step`.
6022 *
6023 * If `stop` is not specified, the wrapped value will be the number to
6024 * stop at and the default start of 0 will be used.
6025 * @param stop The number to stop at.
6026 * @param step The number to count up by each iteration, optional,
6027 * default = 1.
6028 * @returns A chain wrapper around an array of numbers from start to
6029 * `stop` with increments of `step`.
6030 */
6031 range(stop?: number, step?: number): _Chain<number>;
6032
6033 /**
6034 * Chunks the wrapped list into multiple arrays, each containing
6035 * `length` or fewer items.
6036 * @param length The maximum size of the chunks.
6037 * @returns A chain wrapper around the contents of the wrapped list in
6038 * chunks no greater than `length` in size.
6039 */
6040 chunk(length: number): _Chain<T[]>;
6041
6042 /*************
6043 * Functions *
6044 *************/
6045
6046 /**
6047 * Wrapped type `Function`.
6048 * @see _.bind
6049 */
6050 bind(object: any, ...args: any[]): _Chain<T>;
6051
6052 /**
6053 * Wrapped type `object`.
6054 * @see _.bindAll
6055 */
6056 bindAll(...methodNames: string[]): _Chain<T>;
6057
6058 /**
6059 * Wrapped type `Function`.
6060 * @see _.partial
6061 */
6062 partial(...args: any[]): _Chain<T>;
6063
6064 /**
6065 * Wrapped type `Function`.
6066 * @see _.memoize
6067 */
6068 memoize(hashFn?: (n: any) => string): _Chain<T>;
6069
6070 /**
6071 * Wrapped type `Function`.
6072 * @see _.defer
6073 */
6074 defer(...args: any[]): _Chain<T>;
6075
6076 /**
6077 * Wrapped type `Function`.
6078 * @see _.delay
6079 */
6080 delay(wait: number, ...args: any[]): _Chain<T>;
6081
6082 /**
6083 * @see _.delay
6084 */
6085 delay(...args: any[]): _Chain<T>;
6086
6087 /**
6088 * Wrapped type `Function`.
6089 * @see _.throttle
6090 */
6091 throttle(wait: number, options?: _.ThrottleSettings): _Chain<T>;
6092
6093 /**
6094 * Wrapped type `Function`.
6095 * @see _.debounce
6096 */
6097 debounce(wait: number, immediate?: boolean): _Chain<T>;
6098
6099 /**
6100 * Wrapped type `Function`.
6101 * @see _.once
6102 */
6103 once(): _Chain<T>;
6104
6105 /**
6106 * Wrapped type `Function`.
6107 * @see _.once
6108 */
6109 restArgs(startIndex?: number): _Chain<T>;
6110
6111 /**
6112 * Wrapped type `number`.
6113 * @see _.after
6114 */
6115 after(func: Function): _Chain<T>;
6116
6117 /**
6118 * Wrapped type `number`.
6119 * @see _.before
6120 */
6121 before(fn: Function): _Chain<T>;
6122
6123 /**
6124 * Wrapped type `Function`.
6125 * @see _.wrap
6126 */
6127 wrap(wrapper: Function): () => _Chain<T>;
6128
6129 /**
6130 * Wrapped type `Function`.
6131 * @see _.negate
6132 */
6133 negate(): _Chain<T>;
6134
6135 /**
6136 * Wrapped type `Function[]`.
6137 * @see _.compose
6138 */
6139 compose(...functions: Function[]): _Chain<T>;
6140
6141 /***********
6142 * Objects *
6143 ***********/
6144
6145 /**
6146 * Wrapped type `object`.
6147 * @see _.keys
6148 */
6149 keys(): _Chain<string>;
6150
6151 /**
6152 * Wrapped type `object`.
6153 * @see _.allKeys
6154 */
6155 allKeys(): _Chain<string>;
6156
6157 /**
6158 * Wrapped type `object`.
6159 * @see _.values
6160 */
6161 values(): _Chain<any>;
6162
6163 /**
6164 * Like map, but for objects. Transform the value of each property in
6165 * turn.
6166 * @param iteratee The iteratee to use to transform property values.
6167 * @param context `this` object in `iteratee`, optional.
6168 * @returns A chain wrapper around a new object with all of the wrapped
6169 * object's property values transformed through `iteratee`.
6170 */
6171 mapObject<I extends Iteratee<V, any, TypeOfCollection<V, any>>>(
6172 iteratee: I,
6173 context?: any,
6174 ): _Chain<IterateeResult<I, TypeOfCollection<V, any>>, { [K in keyof V]: IterateeResult<I, V[K]> }>;
6175
6176 /**
6177 * Convert the wrapped object into a list of [key, value] pairs. The
6178 * opposite of the single-argument signature of `_.object`.
6179 * @returns A chain wrapper around the list of [key, value] pairs from
6180 * the wrapped object.
6181 */
6182 pairs(): _Chain<[Extract<keyof V, string>, TypeOfCollection<V, any>]>;
6183
6184 /**
6185 * Wrapped type `object`.
6186 * @see _.invert
6187 */
6188 invert(): _Chain<T>;
6189
6190 /**
6191 * Wrapped type `object`.
6192 * @see _.functions
6193 */
6194 functions(): _Chain<T>;
6195
6196 /**
6197 * @see _.functions
6198 */
6199 methods(): _Chain<T>;
6200
6201 /**
6202 * Wrapped type `object`.
6203 * @see _.extend
6204 */
6205 extend(...sources: any[]): _Chain<T>;
6206
6207 /**
6208 * Similar to `findIndex` but for keys in objects. Returns the key
6209 * where the `iteratee` truth test passes or undefined.
6210 * @param iteratee The truth test to apply.
6211 * @param context `this` object in `iteratee`, optional.
6212 * @returns The first element in the wrapped object that passes the
6213 * truth test or undefined if no elements pass.
6214 */
6215 findKey(
6216 iteratee?: Iteratee<V, boolean, TypeOfCollection<V, any>>,
6217 context?: any,
6218 ): _ChainSingle<Extract<keyof V, string> | undefined>;
6219
6220 /**
6221 * Return a copy of the wrapped object that is filtered to only have
6222 * values for the allowed keys (or array of keys).
6223 * @param keys The keys to keep on the wrapped object.
6224 * @returns A chain wrapper around a copy of the wrapped object with
6225 * only the `keys` properties.
6226 */
6227 pick<K extends string>(...keys: Array<K | K[]>): _ChainSingle<_Pick<V, K>>;
6228
6229 /**
6230 * Return a copy of the wrapped object that is filtered to only have
6231 * values for the keys selected by a truth test.
6232 * @param iterator A truth test that selects the keys to keep on the
6233 * wrapped object.
6234 * @returns A chain wrapper around a copy of the wrapped object with
6235 * only the keys selected by `iterator`.
6236 */
6237 pick(
6238 iterator: ObjectIterator<TypeOfDictionary<V, any>, boolean, V>,
6239 ): _ChainSingle<Partial<V>>;
6240
6241 /**
6242 * Return a copy of the wrapped object that is filtered to omit the
6243 * disallowed keys (or array of keys).
6244 * @param keys The keys to omit from the wrapped object.
6245 * @returns A chain wrapper around a copy of the wrapped object without
6246 * the `keys` properties.
6247 */
6248 omit<K extends string>(...keys: Array<K | K[]>): _ChainSingle<_Omit<V, K>>;
6249
6250 /**
6251 * Return a copy of the wrapped object that is filtered to not have
6252 * values for the keys selected by a truth test.
6253 * @param iterator A truth test that selects the keys to omit from the
6254 * wrapped object.
6255 * @returns A chain wrapper around a copy of the wrapped object without
6256 * the keys selected by `iterator`.
6257 */
6258 omit(
6259 iterator: ObjectIterator<TypeOfDictionary<V, any>, boolean, V>,
6260 ): _ChainSingle<Partial<V>>;
6261
6262 /**
6263 * Wrapped type `object`.
6264 * @see _.defaults
6265 */
6266 defaults(...defaults: any[]): _Chain<T>;
6267
6268 /**
6269 * Wrapped type `any`.
6270 * @see _.create
6271 */
6272 create(props?: object): _Chain<T>;
6273
6274 /**
6275 * Wrapped type `any[]`.
6276 * @see _.clone
6277 */
6278 clone(): _Chain<T>;
6279
6280 /**
6281 * Wrapped type `object`.
6282 * @see _.tap
6283 */
6284 tap(interceptor: (...as: any[]) => any): _Chain<T, V>;
6285
6286 /**
6287 * Wrapped type `object`.
6288 * @see _.has
6289 */
6290 has(key: string): _Chain<T>;
6291
6292 /**
6293 * Wrapped type `any[]`.
6294 * @see _.matches
6295 */
6296 matches(): _Chain<T>;
6297
6298 /**
6299 * Wrapped type `any[]`.
6300 * @see _.matcher
6301 */
6302 matcher(): _Chain<T>;
6303
6304 /**
6305 * Wrapped type `any`.
6306 * @see _.get
6307 */
6308 get(
6309 path: string,
6310 ): _Chain<TypeOfCollection<V> | undefined, T | undefined>;
6311 get<U>(
6312 path: string,
6313 defaultValue?: U,
6314 ): _Chain<TypeOfCollection<V> | U, T | U>;
6315 get<P extends Array<string | number>, W = DeepTypeOfCollection<Exclude<V, undefined>, P>, U = undefined>(
6316 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
6317 path: [...P],
6318 defaultValue?: U,
6319 ): _Chain<TypeOfCollection<W> | U, W | U>;
6320
6321 /**
6322 * Wrapped type `string`.
6323 * @see _.property
6324 */
6325 property(): _Chain<T>;
6326
6327 /**
6328 * Wrapped type `object`.
6329 * @see _.propertyOf
6330 */
6331 propertyOf(): _Chain<T>;
6332
6333 /**
6334 * Performs an optimized deep comparison between the wrapped object
6335 * and `other` to determine if they should be considered equal.
6336 * @param other Compare to the wrapped object.
6337 * @returns True if the wrapped object should be considered equal to
6338 * `other`.
6339 * The result will be wrapped in a chain wrapper.
6340 */
6341 isEqual(other: any): _ChainSingle<boolean>;
6342
6343 /**
6344 * Returns true if the wrapped collection contains no values.
6345 * For strings and array-like objects checks if the length property is
6346 * 0.
6347 * @returns True if the wrapped collection has no elements.
6348 * The result will be wrapped in a chain wrapper.
6349 */
6350 isEmpty(): _ChainSingle<boolean>;
6351
6352 /**
6353 * Returns true if the keys and values in `properties` are contained in
6354 * the wrapped object.
6355 * @param properties The properties to check for in the wrapped object.
6356 * @returns True if all keys and values in `properties` are also in the
6357 * wrapped object.
6358 * The result will be wrapped in a chain wrapper.
6359 */
6360 isMatch(properties: any): _ChainSingle<boolean>;
6361
6362 /**
6363 * Returns true if the wrapped object is a DOM element.
6364 * @returns True if the wrapped object is a DOM element, otherwise
6365 * false.
6366 * The result will be wrapped in a chain wrapper.
6367 */
6368 isElement(): _ChainSingle<boolean>;
6369
6370 /**
6371 * Returns true if the wrapped object is an Array.
6372 * @returns True if the wrapped object is an Array, otherwise false.
6373 * The result will be wrapped in a chain wrapper.
6374 */
6375 isArray(): _ChainSingle<boolean>;
6376
6377 /**
6378 * Returns true if the wrapped object is an ArrayBuffer.
6379 * @returns True if the wrapped object is an ArrayBuffer, otherwise false.
6380 * The result will be wrapped in a chain wrapper.
6381 */
6382 isArrayBuffer(): _ChainSingle<boolean>;
6383
6384 /**
6385 * Returns true if the wrapped object is a DataView.
6386 * @returns True if the wrapped object is a DataView, otherwise false.
6387 * The result will be wrapped in a chain wrapper.
6388 */
6389 isDataView(): _ChainSingle<boolean>;
6390
6391 /**
6392 * Returns true if the wrapped object is a TypedArray.
6393 * @returns True if the wrapped object is a TypedArray, otherwise false.
6394 * The result will be wrapped in a chain wrapper.
6395 */
6396 isTypedArray(): _ChainSingle<boolean>;
6397
6398 /**
6399 * Returns true if the wrapped object is a Symbol.
6400 * @returns True if the wrapped object is a Symbol, otherwise false.
6401 * The result will be wrapped in a chain wrapper.
6402 */
6403 isSymbol(): _ChainSingle<boolean>;
6404
6405 /**
6406 * Returns true if the wrapped object is an Object. Note that
6407 * JavaScript arrays and functions are objects, while (normal) strings
6408 * and numbers are not.
6409 * @returns True if the wrapped object is an Object, otherwise false.
6410 * The result will be wrapped in a chain wrapper.
6411 */
6412 isObject(): _ChainSingle<boolean>;
6413
6414 /**
6415 * Returns true if the wrapped object is an Arguments object.
6416 * @returns True if the wrapped object is an Arguments object,
6417 * otherwise false.
6418 * The result will be wrapped in a chain wrapper.
6419 */
6420 isArguments(): _ChainSingle<boolean>;
6421
6422 /**
6423 * Returns true if the wrapped object is a Function.
6424 * @returns True if the wrapped object is a Function, otherwise false.
6425 * The result will be wrapped in a chain wrapper.
6426 */
6427 isFunction(): _ChainSingle<boolean>;
6428
6429 /**
6430 * Returns true if the wrapped object is a Error.
6431 * @returns True if the wrapped object is a Error, otherwise false.
6432 * The result will be wrapped in a chain wrapper.
6433 */
6434 isError(): _ChainSingle<boolean>;
6435
6436 /**
6437 * Returns true if the wrapped object is a String.
6438 * @returns True if the wrapped object is a String, otherwise false.
6439 * The result will be wrapped in a chain wrapper.
6440 */
6441 isString(): _ChainSingle<boolean>;
6442
6443 /**
6444 * Returns true if the wrapped object is a Number (including NaN).
6445 * @returns True if the wrapped object is a Number, otherwise false.
6446 * The result will be wrapped in a chain wrapper.
6447 */
6448 isNumber(): _ChainSingle<boolean>;
6449
6450 /**
6451 * Returns true if the wrapped object is a finite Number.
6452 * @returns True if the wrapped object is a finite Number.
6453 * The result will be wrapped in a chain wrapper.
6454 */
6455 isFinite(): _ChainSingle<boolean>;
6456
6457 /**
6458 * Returns true if the wrapped object is a Boolean.
6459 * @returns True if the wrapped object is a Boolean, otherwise false.
6460 * The result will be wrapped in a chain wrapper.
6461 */
6462 isBoolean(): _ChainSingle<boolean>;
6463
6464 /**
6465 * Returns true if the wrapped object is a Date.
6466 * @returns True if the wrapped object is a Date, otherwise false.
6467 * The result will be wrapped in a chain wrapper.
6468 */
6469 isDate(): _ChainSingle<boolean>;
6470
6471 /**
6472 * Returns true if the wrapped object is a RegExp.
6473 * @returns True if the wrapped object is a RegExp, otherwise false.
6474 * The result will be wrapped in a chain wrapper.
6475 */
6476 isRegExp(): _ChainSingle<boolean>;
6477
6478 /**
6479 * Returns true if the wrapped object is NaN.
6480 * Note: this is not the same as the native isNaN function,
6481 * which will also return true if the variable is undefined.
6482 * @returns True if the wrapped object is NaN, otherwise false.
6483 * The result will be wrapped in a chain wrapper.
6484 */
6485 isNaN(): _ChainSingle<boolean>;
6486
6487 /**
6488 * Returns true if the wrapped object is null.
6489 * @returns True if the wrapped object is null, otherwise false.
6490 * The result will be wrapped in a chain wrapper.
6491 */
6492 isNull(): _ChainSingle<boolean>;
6493
6494 /**
6495 * Returns true if the wrapped object is undefined.
6496 * @returns True if the wrapped object is undefined, otherwise false.
6497 * The result will be wrapped in a chain wrapper.
6498 */
6499 isUndefined(): _ChainSingle<boolean>;
6500
6501 /***********
6502 * Utility *
6503 ***********/
6504
6505 /**
6506 * Wrapped type `any`.
6507 * @see _.identity
6508 */
6509 identity(): _Chain<T>;
6510
6511 /**
6512 * Wrapped type `any`.
6513 * @see _.constant
6514 */
6515 constant(): _Chain<T>;
6516
6517 /**
6518 * Wrapped type `any`.
6519 * @see _.noop
6520 */
6521 noop(): _Chain<T>;
6522
6523 /**
6524 * Wrapped type `number`.
6525 * @see _.times
6526 */
6527 times<TResult>(iterator: (n: number) => TResult, context?: any): _Chain<T>;
6528
6529 /**
6530 * Wrapped type `number`.
6531 * @see _.random
6532 */
6533 random(): _Chain<T>;
6534 /**
6535 * Wrapped type `number`.
6536 * @see _.random
6537 */
6538 random(max: number): _Chain<T>;
6539
6540 /**
6541 * Wrapped type `object`.
6542 * @see _.mixin
6543 */
6544 mixin(): _Chain<T>;
6545
6546 /**
6547 * Wrapped type `string|Function|Object`.
6548 * @see _.iteratee
6549 */
6550 iteratee(context?: any): _Chain<T>;
6551
6552 /**
6553 * Wrapped type `string`.
6554 * @see _.uniqueId
6555 */
6556 uniqueId(): _Chain<T>;
6557
6558 /**
6559 * Wrapped type `string`.
6560 * @see _.escape
6561 */
6562 escape(): _Chain<T>;
6563
6564 /**
6565 * Wrapped type `string`.
6566 * @see _.unescape
6567 */
6568 unescape(): _Chain<T>;
6569
6570 /**
6571 * Wrapped type `object`.
6572 * @see _.result
6573 */
6574 result(property: string, defaultValue?: any): _Chain<T>;
6575
6576 /**
6577 * Wrapped type `string`.
6578 * @see _.template
6579 */
6580 template(settings?: _.TemplateSettings): _Chain<CompiledTemplate>;
6581
6582 /***************
6583 * Array proxy *
6584 ***************/
6585
6586 /**
6587 * Returns a new array comprised of the array on which it is called
6588 * joined with the array(s) and/or value(s) provided as arguments.
6589 * @param arr Arrays and/or values to concatenate into a new array. See the discussion below for details.
6590 * @return A new array comprised of the array on which it is called
6591 */
6592 concat(...arr: T[][]): _Chain<T>;
6593
6594 /**
6595 * Join all elements of an array into a string.
6596 * @param separator Optional. Specifies a string to separate each element of the array. The separator is converted to a string if necessary. If omitted, the array elements are separated with a comma.
6597 * @return The string conversions of all array elements joined into one string.
6598 */
6599 join(separator?: any): _ChainSingle<T>;
6600
6601 /**
6602 * Removes the last element from an array and returns that element.
6603 * @return Returns the popped element.
6604 */
6605 pop(): _ChainSingle<T>;
6606
6607 /**
6608 * Adds one or more elements to the end of an array and returns the new length of the array.
6609 * @param item The elements to add to the end of the array.
6610 * @return The array with the element added to the end.
6611 */
6612 push(...item: T[]): _Chain<T>;
6613
6614 /**
6615 * Reverses an array in place. The first array element becomes the last and the last becomes the first.
6616 * @return The reversed array.
6617 */
6618 reverse(): _Chain<T>;
6619
6620 /**
6621 * Removes the first element from an array and returns that element. This method changes the length of the array.
6622 * @return The shifted element.
6623 */
6624 shift(): _ChainSingle<T>;
6625
6626 /**
6627 * Returns a shallow copy of a portion of an array into a new array object.
6628 * @param start Zero-based index at which to begin extraction.
6629 * @param end Optional. Zero-based index at which to end extraction. slice extracts up to but not including end.
6630 * @return A shallow copy of a portion of an array into a new array object.
6631 */
6632 slice(start: number, end?: number): _Chain<T>;
6633
6634 /**
6635 * Sorts the elements of an array in place and returns the array. The sort is not necessarily stable. The default sort order is according to string Unicode code points.
6636 * @param compareFn Optional. Specifies a function that defines the sort order. If omitted, the array is sorted according to each character's Unicode code point value, according to the string conversion of each element.
6637 * @return The sorted array.
6638 */
6639 sort(compareFn?: (a: T, b: T) => boolean): _Chain<T>;
6640
6641 /**
6642 * Changes the content of an array by removing existing elements and/or adding new elements.
6643 * @param index Index at which to start changing the array. If greater than the length of the array, actual starting index will be set to the length of the array. If negative, will begin that many elements from the end.
6644 * @param quantity An integer indicating the number of old array elements to remove. If deleteCount is 0, no elements are removed. In this case, you should specify at least one new element. If deleteCount is greater than the number of elements left in the array starting at index, then all of the elements through the end of the array will be deleted.
6645 * @param items The element to add to the array. If you don't specify any elements, splice will only remove elements from the array.
6646 * @return An array containing the deleted elements. If only one element is removed, an array of one element is returned. If no elements are removed, an empty array is returned.
6647 */
6648 splice(index: number, quantity: number, ...items: T[]): _Chain<T>;
6649
6650 /**
6651 * A string representing the specified array and its elements.
6652 * @return A string representing the specified array and its elements.
6653 */
6654 toString(): _ChainSingle<T>;
6655
6656 /**
6657 * Adds one or more elements to the beginning of an array and returns the new length of the array.
6658 * @param items The elements to add to the front of the array.
6659 * @return The array with the element added to the beginning.
6660 */
6661 unshift(...items: T[]): _Chain<T>;
6662
6663 /************
6664 * Chaining *
6665 ************/
6666
6667 /**
6668 * Returns a wrapped object. Calling methods on this object will
6669 * continue to return wrapped objects until value() is used.
6670 * @returns An underscore chain wrapper around the wrapped value.
6671 */
6672 chain(): _Chain<T, V>;
6673
6674 /**
6675 * Extracts the value of the wrapped object.
6676 * @returns The value of the wrapped object.
6677 */
6678 value(): V;
6679 }
6680}
6681
\No newline at end of file