UNPKG

251 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 * Returns true if `object` is a Set.
3953 * @param object The object to check.
3954 * @returns True if `object` is a Set, otherwise false.
3955 */
3956 isSet(object: any): object is Set<any>;
3957
3958 /**
3959 * Returns true if `object` is a WeakSet.
3960 * @param object The object to check.
3961 * @returns True if `object` is a WeakSet, otherwise false.
3962 */
3963 isWeakSet(object: any): object is WeakSet<any>;
3964
3965 /**
3966 * Returns true if `object` is a Map.
3967 * @param object The object to check.
3968 * @returns True if `object` is a Map, otherwise false.
3969 */
3970 isMap(object: any): object is Map<any, any>;
3971
3972 /**
3973 * Returns true if `object` is a WeakMap.
3974 * @param object The object to check.
3975 * @returns True if `object` is a WeakMap, otherwise false.
3976 */
3977 isWeakMap(object: any): object is WeakMap<any, any>;
3978
3979 /**
3980 * Ensures that path is an array.
3981 * @param path
3982 * 1. If path is a string, it is wrapped in a single-element array;
3983 * 2. if it is an array already, it is returned unmodified.
3984 */
3985 toPath<P>(path: P): (
3986 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
3987 P extends ReadonlyArray<string | number> ? P
3988 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
3989 : P extends string | number ? [P]
3990 : never
3991 );
3992
3993 /***********
3994 * Utility *
3995 ***********/
3996
3997 /**
3998 * Give control of the "_" variable back to its previous owner.
3999 * Returns a reference to the Underscore object.
4000 * @return Underscore object reference.
4001 */
4002 noConflict(): any;
4003
4004 /**
4005 * Returns the same value that is used as the argument. In math: f(x) = x
4006 * This function looks useless, but is used throughout Underscore as a default iterator.
4007 * @param value Identity of this object.
4008 * @return `value`.
4009 */
4010 identity<T>(value: T): T;
4011
4012 /**
4013 * Creates a function that returns the same value that is used as the argument of _.constant
4014 * @param value Identity of this object.
4015 * @return Function that return value.
4016 */
4017 constant<T>(value: T): () => T;
4018
4019 /**
4020 * Returns undefined irrespective of the arguments passed to it. Useful as the default
4021 * for optional callback arguments.
4022 * Note there is no way to indicate a 'undefined' return, so it is currently typed as void.
4023 * @return undefined
4024 */
4025 noop(): void;
4026
4027 /**
4028 * Invokes the given iterator function n times.
4029 * Each invocation of iterator is called with an index argument
4030 * @param n Number of times to invoke `iterator`.
4031 * @param iterator Function iterator to invoke `n` times.
4032 * @param context `this` object in `iterator`, optional.
4033 */
4034 times<TResult>(n: number, iterator: (n: number) => TResult, context?: any): TResult[];
4035
4036 /**
4037 * Returns a random integer between min and max, inclusive. If you only pass one argument,
4038 * it will return a number between 0 and that number.
4039 * @param max The maximum random number.
4040 * @return A random number between 0 and `max`.
4041 */
4042 random(max: number): number;
4043
4044 /**
4045 * @see _.random
4046 * @param min The minimum random number.
4047 * @return A random number between `min` and `max`.
4048 */
4049 random(min: number, max: number): number;
4050
4051 /**
4052 * Allows you to extend Underscore with your own utility functions. Pass a hash of
4053 * {name: function} definitions to have your functions added to the Underscore object,
4054 * as well as the OOP wrapper.
4055 * @param object Mixin object containing key/function pairs to add to the Underscore object.
4056 */
4057 mixin(object: any): void;
4058
4059 /**
4060 * A mostly-internal function to generate callbacks that can be applied to each element
4061 * in a collection, returning the desired result -- either identity, an arbitrary callback,
4062 * a property matcher, or a propetery accessor.
4063 * @param string|Function|Object value The value to iterate over, usually the key.
4064 * @param any context
4065 * @return Callback that can be applied to each element in a collection.
4066 */
4067 iteratee(value: string): Function;
4068 iteratee(value: Function, context?: any): Function;
4069 iteratee(value: object): Function;
4070
4071 /**
4072 * Generate a globally-unique id for client-side models or DOM elements that need one.
4073 * If prefix is passed, the id will be appended to it. Without prefix, returns an integer.
4074 * @param prefix A prefix string to start the unique ID with.
4075 * @return Unique string ID beginning with `prefix`.
4076 */
4077 uniqueId(prefix?: string): string;
4078
4079 /**
4080 * Escapes a string for insertion into HTML, replacing &, <, >, ", ', and / characters.
4081 * @param str Raw string to escape.
4082 * @return `str` HTML escaped.
4083 */
4084 escape(str: string): string;
4085
4086 /**
4087 * The opposite of escape, replaces &amp;, &lt;, &gt;, &quot;, and &#x27; with their unescaped counterparts.
4088 * @param str HTML escaped string.
4089 * @return `str` Raw string.
4090 */
4091 unescape(str: string): string;
4092
4093 /**
4094 * If the value of the named property is a function then invoke it; otherwise, return it.
4095 * @param object Object to maybe invoke function `property` on.
4096 * @param property The function by name to invoke on `object`.
4097 * @param defaultValue The value to be returned in case `property` doesn't exist or is undefined.
4098 * @return The result of invoking the function `property` on `object.
4099 */
4100 result(object: any, property: string, defaultValue?: any): any;
4101
4102 /**
4103 * Compiles JavaScript templates into functions that can be evaluated for rendering. Useful
4104 * for rendering complicated bits of HTML from JSON data sources. Template functions can both
4105 * interpolate variables, using <%= ... %>, as well as execute arbitrary JavaScript code, with
4106 * <% ... %>. If you wish to interpolate a value, and have it be HTML-escaped, use <%- ... %> When
4107 * you evaluate a template function, pass in a data object that has properties corresponding to
4108 * the template's free variables. If you're writing a one-off, you can pass the data object as
4109 * the second parameter to template in order to render immediately instead of returning a template
4110 * function. The settings argument should be a hash containing any _.templateSettings that should
4111 * be overridden.
4112 * @param templateString Underscore HTML template.
4113 * @param data Data to use when compiling `templateString`.
4114 * @param settings Settings to use while compiling.
4115 * @return Returns the compiled Underscore HTML template.
4116 */
4117 template(templateString: string, settings?: _.TemplateSettings): CompiledTemplate;
4118
4119 /**
4120 * By default, Underscore uses ERB-style template delimiters, change the
4121 * following template settings to use alternative delimiters.
4122 */
4123 templateSettings: _.TemplateSettings;
4124
4125 /**
4126 * Returns an integer timestamp for the current time, using the fastest method available in the runtime. Useful for implementing timing/animation functions.
4127 */
4128 now(): number;
4129
4130 /************
4131 * Chaining *
4132 ************/
4133
4134 /**
4135 * Returns a wrapped object. Calling methods on this object will
4136 * continue to return wrapped objects until value() is used.
4137 * @param value The object to chain.
4138 * @returns An underscore chain wrapper around the supplied value.
4139 */
4140 chain<V>(value: V): _Chain<TypeOfCollection<V>, V>;
4141
4142 /**
4143 * Current version
4144 */
4145 readonly VERSION: string;
4146 }
4147
4148 interface Underscore<T, V = T[]> {
4149 /***************
4150 * Collections *
4151 ***************/
4152
4153 /**
4154 * Iterates over the wrapped collection of elements, yielding each in
4155 * turn to an `iteratee`. The `iteratee` is bound to the context object,
4156 * if one is passed.
4157 * @param iteratee The iteratee to call for each element in the wrapped
4158 * collection.
4159 * @param context 'this' object in `iteratee`, optional.
4160 * @returns The originally wrapped collection.
4161 */
4162 each(
4163 iteratee: CollectionIterator<TypeOfCollection<V>, void, V>,
4164 context?: any,
4165 ): V;
4166
4167 /**
4168 * @see each
4169 */
4170 forEach: Underscore<T, V>["each"];
4171
4172 /**
4173 * Produces a new array of values by mapping each value in the wrapped
4174 * collection through a transformation `iteratee`.
4175 * @param iteratee The iteratee to use to transform each item in the
4176 * wrapped collection.
4177 * @param context `this` object in `iteratee`, optional.
4178 * @returns The mapped result.
4179 */
4180 map<I extends Iteratee<V, any>>(
4181 iteratee: I,
4182 context?: any,
4183 ): Array<IterateeResult<I, T>>;
4184
4185 /**
4186 * @see map
4187 */
4188 collect: Underscore<T, V>["map"];
4189
4190 /**
4191 * Also known as inject and foldl, reduce boils down the wrapped
4192 * collection of values into a single value. `memo` is the initial
4193 * state of the reduction, and each successive step of it should be
4194 * returned by `iteratee`.
4195 *
4196 * If no memo is passed to the initial invocation of reduce, `iteratee`
4197 * is not invoked on the first element of the wrapped collection. The
4198 * first element is instead passed as the memo in the invocation of
4199 * `iteratee` on the next element in the wrapped collection.
4200 * @param iteratee The function to call on each iteration to reduce the
4201 * collection.
4202 * @param memo The initial reduce state or undefined to use the first
4203 * item in `collection` as initial state.
4204 * @param context `this` object in `iteratee`, optional.
4205 * @returns The reduced result.
4206 */
4207 reduce<TResult>(
4208 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult, V>,
4209 memo: TResult,
4210 context?: any,
4211 ): TResult;
4212 reduce<TResult = TypeOfCollection<V>>(
4213 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult | TypeOfCollection<V>, V>,
4214 ): TResult | TypeOfCollection<V> | undefined;
4215
4216 /**
4217 * @see reduce
4218 */
4219 inject: Underscore<T, V>["reduce"];
4220
4221 /**
4222 * @see reduce
4223 */
4224 foldl: Underscore<T, V>["reduce"];
4225
4226 /**
4227 * The right-associative version of reduce.
4228 *
4229 * This is not as useful in JavaScript as it would be in a language
4230 * with lazy evaluation.
4231 * @param iteratee The function to call on each iteration to reduce the
4232 * collection.
4233 * @param memo The initial reduce state or undefined to use the first
4234 * item in `collection` as the initial state.
4235 * @param context `this` object in `iteratee`, optional.
4236 * @returns The reduced result.
4237 */
4238 reduceRight<TResult>(
4239 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult, V>,
4240 memo: TResult,
4241 context?: any,
4242 ): TResult;
4243 reduceRight<TResult = TypeOfCollection<V>>(
4244 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult | TypeOfCollection<V>, V>,
4245 ): TResult | TypeOfCollection<V> | undefined;
4246
4247 /**
4248 * @see reduceRight
4249 */
4250 foldr: Underscore<T, V>["reduceRight"];
4251
4252 /**
4253 * Looks through each value in the wrapped collection, returning the
4254 * first one that passes a truth test (`iteratee`), or undefined if no
4255 * value passes the test. The function returns as soon as it finds an
4256 * acceptable element, and doesn't traverse the entire collection.
4257 * @param iteratee The truth test to apply.
4258 * @param context `this` object in `iteratee`, optional.
4259 * @returns The first element in the wrapped collection that passes the
4260 * truth test or undefined if no elements pass.
4261 */
4262 find(iteratee?: Iteratee<V, boolean>, context?: any): T | undefined;
4263
4264 /**
4265 * @see find
4266 */
4267 detect: Underscore<T, V>["find"];
4268
4269 /**
4270 * Looks through each value in the wrapped collection, returning an
4271 * array of all the values that pass a truth test (`iteratee`).
4272 * @param iteratee The truth test to apply.
4273 * @param context `this` object in `iteratee`, optional.
4274 * @returns The set of values that pass the truth test.
4275 */
4276 filter(iteratee?: Iteratee<V, boolean>, context?: any): T[];
4277
4278 /**
4279 * @see filter
4280 */
4281 select: Underscore<T, V>["filter"];
4282
4283 /**
4284 * Looks through each value in the wrapped collection, returning an
4285 * array of all the elements that match the key-value pairs listed in
4286 * `properties`.
4287 * @param properties The properties to check for on the elements within
4288 * the wrapped collection.
4289 * @returns The elements in the wrapped collection that match
4290 * `properties`.
4291 */
4292 where(properties: Partial<T>): T[];
4293
4294 /**
4295 * Looks through the wrapped collection and returns the first value
4296 * that matches all of the key-value pairs listed in `properties`. If
4297 * no match is found, or if list is empty, undefined will be returned.
4298 * @param properties The properties to check for on the elements within
4299 * the wrapped collection.
4300 * @returns The first element in the wrapped collection that matches
4301 * `properties` or undefined if no match is found.
4302 */
4303 findWhere(properties: Partial<T>): T | undefined;
4304
4305 /**
4306 * Returns the values in the wrapped collection without the elements
4307 * that pass a truth test (`iteratee`).
4308 * The opposite of filter.
4309 * @param iteratee The truth test to apply.
4310 * @param context `this` object in `iteratee`, optional.
4311 * @returns The set of values that fail the truth test.
4312 */
4313 reject(iteratee?: Iteratee<V, boolean>, context?: any): T[];
4314
4315 /**
4316 * Returns true if all of the values in the wrapped collection pass the
4317 * `iteratee` truth test. Short-circuits and stops traversing the
4318 * wrapped collection if a false element is found.
4319 * @param iteratee The truth test to apply.
4320 * @param context `this` object in `iteratee`, optional.
4321 * @returns True if all elements pass the truth test, otherwise false.
4322 */
4323 every(iteratee?: Iteratee<V, boolean>, context?: any): boolean;
4324
4325 /**
4326 * @see every
4327 */
4328 all: Underscore<T, V>["every"];
4329
4330 /**
4331 * Returns true if any of the values in the wrapped collection pass the
4332 * `iteratee` truth test. Short-circuits and stops traversing the
4333 * wrapped collection if a true element is found.
4334 * @param iteratee The truth test to apply.
4335 * @param context `this` object in `iteratee`, optional.
4336 * @returns True if any element passed the truth test, otherwise false.
4337 */
4338 some(iteratee?: Iteratee<V, boolean>, context?: any): boolean;
4339
4340 /**
4341 * @see some
4342 */
4343 any: Underscore<T, V>["some"];
4344
4345 /**
4346 * Returns true if the value is present in the wrapped collection. Uses
4347 * indexOf internally, if the wrapped collection is a List. Use
4348 * `fromIndex` to start your search at a given index.
4349 * @param value The value to check the wrapped collection for.
4350 * @param fromIndex The index to start searching from, optional,
4351 * default = 0, only used when the wrapped collection is a List.
4352 * @returns True if `value` is present in the wrapped collection after
4353 * `fromIndex`, otherwise false.
4354 */
4355 contains(value: any, fromIndex?: number): boolean;
4356
4357 /**
4358 * @see contains
4359 */
4360 include: Underscore<T, V>["contains"];
4361
4362 /**
4363 * @see contains
4364 */
4365 includes: Underscore<T, V>["contains"];
4366
4367 /**
4368 * Calls the method named by `methodName` on each value in the wrapped
4369 * collection. Any extra arguments passed to invoke will be forwarded
4370 * on to the method invocation.
4371 * @param methodName The name of the method to call on each element in
4372 * the wrapped collection.
4373 * @param args Additional arguments to pass to method `methodName`.
4374 * @returns An array containing the result of the method call for each
4375 * item in the wrapped collection.
4376 */
4377 invoke(methodName: string, ...args: any[]): any[];
4378
4379 /**
4380 * A convenient version of what is perhaps the most common use-case for
4381 * map: extracting a list of property values.
4382 * @param propertyName The name of a specific property to retrieve from
4383 * all items in the wrapped collection.
4384 * @returns The set of values for the specified `propertyName` for each
4385 * item in the wrapped collection.
4386 */
4387 pluck<K extends string | number>(
4388 propertyName: K,
4389 ): Array<PropertyTypeOrAny<T, K>>;
4390
4391 /**
4392 * Returns the maximum value in the wrapped collection. If an
4393 * `iteratee` is provided, it will be used on each element to generate
4394 * the criterion by which the element is ranked. -Infinity is returned
4395 * if list is empty. Non-numerical values returned by `iteratee` will
4396 * be ignored.
4397 * @param iteratee The iteratee that provides the criterion by which
4398 * each element is ranked, optional if evaluating a collection of
4399 * numbers.
4400 * @param context `this` object in `iteratee`, optional.
4401 * @returns The maximum element within the wrapped collection or
4402 * -Infinity if the wrapped collection is empty.
4403 */
4404 max(iteratee?: Iteratee<V, any>, context?: any): T | number;
4405
4406 /**
4407 * Returns the minimum value in the wrapped collection. If an
4408 * `iteratee` is provided, it will be used on each element to generate
4409 * the criterion by which the element is ranked. Infinity is returned
4410 * if list is empty. Non-numerical values returned by `iteratee` will
4411 * be ignored.
4412 * @param iteratee The iteratee that provides the criterion by which
4413 * each element is ranked, optional if evaluating a collection of
4414 * numbers.
4415 * @param context `this` object in `iteratee`, optional.
4416 * @returns The minimum element within the wrapped collection or
4417 * Infinity if the wrapped collection is empty.
4418 */
4419 min(iteratee?: Iteratee<V, any>, context?: any): T | number;
4420
4421 /**
4422 * Returns a (stably) sorted copy of the wrapped collection, ranked in
4423 * ascending order by the results of running each value through
4424 * `iteratee`.
4425 * @param iteratee An iteratee that provides the value to sort by for
4426 * each item in the wrapped collection.
4427 * @param context `this` object in `iteratee`, optional.
4428 * @returns A sorted copy of the wrapped collection.
4429 */
4430 sortBy(iteratee?: Iteratee<V, any>, context?: any): T[];
4431
4432 /**
4433 * Splits the warpped collection into sets that are grouped by the
4434 * result of running each value through `iteratee`.
4435 * @param iteratee An iteratee that provides the value to group by for
4436 * each item in the wrapped collection.
4437 * @param context `this` object in `iteratee`, optional.
4438 * @returns A dictionary with the group names provided by `iteratee` as
4439 * properties where each property contains the grouped elements from
4440 * the wrapped collection.
4441 */
4442 groupBy(
4443 iteratee?: Iteratee<V, string | number>,
4444 context?: any,
4445 ): Dictionary<T[]>;
4446
4447 /**
4448 * Given the warpped collection and an `iteratee` function that returns
4449 * a key for each element in the wrapped collection, returns an object
4450 * that acts as an index of each item. Just like `groupBy`, but for when you
4451 * know your keys are unique.
4452 * @param iteratee An iteratee that provides the value to index by for
4453 * each item in the wrapped collection.
4454 * @param context `this` object in `iteratee`, optional.
4455 * @returns A dictionary where each item in the wrapped collection is
4456 * assigned to the property designated by `iteratee`.
4457 */
4458 indexBy(iteratee?: Iteratee<V, string | number>, context?: any): Dictionary<T>;
4459
4460 /**
4461 * Sorts the wrapped collection into groups and returns a count for the
4462 * number of objects in each group. Similar to `groupBy`, but instead
4463 * of returning a list of values, returns a count for the number of
4464 * values in that group.
4465 * @param iteratee An iteratee that provides the value to count by for
4466 * each item in the wrapped collection.
4467 * @param context `this` object in `iteratee`, optional.
4468 * @returns A dictionary with the group names provided by `iteratee` as
4469 * properties where each property contains the count of the grouped
4470 * elements from the wrapped collection.
4471 */
4472 countBy(
4473 iteratee?: Iteratee<V, string | number>,
4474 context?: any,
4475 ): Dictionary<number>;
4476
4477 /**
4478 * Returns a shuffled copy of the wrapped collection, using a version
4479 * of the Fisher-Yates shuffle.
4480 * @returns A shuffled copy of the wrapped collection.
4481 */
4482 shuffle(): T[];
4483
4484 /**
4485 * Produce a random sample from the wrapped collection. Pass a number
4486 * to return `n` random elements from the wrapped collection. Otherwise
4487 * a single random item will be returned.
4488 * @param n The number of elements to sample from the wrapped
4489 * collection.
4490 * @returns A random sample of `n` elements from the wrapped collection
4491 * or a single element if `n` is not specified.
4492 */
4493 sample(n: number): T[];
4494 sample(): T | undefined;
4495
4496 /**
4497 * Creates a real Array from the wrapped collection (anything that can
4498 * be iterated over). Useful for transmuting the arguments object.
4499 * @returns An array containing the elements of the wrapped collection.
4500 */
4501 toArray(): T[];
4502
4503 /**
4504 * Determines the number of values in the wrapped collection.
4505 * @returns The number of values in the wrapped collection.
4506 */
4507 size(): number;
4508
4509 /**
4510 * Splits the wrapped collection into two arrays: one whose elements
4511 * all satisfy `iteratee` and one whose elements all do not satisfy
4512 * `iteratee`.
4513 * @param iteratee The iteratee that defines the partitioning scheme
4514 * for each element in the wrapped collection.
4515 * @param context `this` object in `iteratee`, optional.
4516 * @returns An array composed of two elements, where the first element
4517 * contains the elements in the wrapped collection that satisfied the
4518 * predicate and the second element contains the elements that did not.
4519 */
4520 partition(iteratee?: Iteratee<V, boolean>, context?: any): [T[], T[]];
4521
4522 /**********
4523 * Arrays *
4524 **********/
4525
4526 /**
4527 * Returns the first element of the wrapped list. Passing `n` will
4528 * return the first `n` elements of the wrapped list.
4529 * @param n The number of elements to retrieve, optional.
4530 * @returns The first `n` elements of the wrapped list or the first
4531 * element if `n` is omitted.
4532 */
4533 first(): T | undefined;
4534 first(n: number): T[];
4535
4536 /**
4537 * @see first
4538 */
4539 head: Underscore<T, V>["first"];
4540
4541 /**
4542 * @see first
4543 */
4544 take: Underscore<T, V>["first"];
4545
4546 /**
4547 * Returns everything but the last entry of the wrapped list.
4548 * Especially useful on the arguments object. Pass `n` to exclude the
4549 * last `n` elements from the result.
4550 * @param n The number of elements from the end of the wrapped list to
4551 * omit, optional, default = 1.
4552 * @returns The elements of the wrapped list with the last `n` items
4553 * omitted.
4554 */
4555 initial(n?: number): T[];
4556
4557 /**
4558 * Returns the last element of the wrapped list. Passing `n` will
4559 * return the last `n` elements of the wrapped list.
4560 * @param n The number of elements to retrieve, optional.
4561 * @returns The last `n` elements of the wrapped list or the last
4562 * element if `n` is omitted.
4563 */
4564 last(): T | undefined;
4565 last(n: number): T[];
4566
4567 /**
4568 * Returns the rest of the elements in the wrapped list. Pass an
4569 * `index` to return the values of the list from that index onward.
4570 * @param index The index to start retrieving elements from, optional,
4571 * default = 1.
4572 * @returns The elements of the wrapped list from `index` to the end
4573 * of the list.
4574 */
4575 rest(n?: number): T[];
4576
4577 /**
4578 * @see rest
4579 */
4580 tail: Underscore<T, V>["rest"];
4581
4582 /**
4583 * @see rest
4584 */
4585 drop: Underscore<T, V>["rest"];
4586
4587 /**
4588 * Returns a copy of the wrapped list with all falsy values removed. In
4589 * JavaScript, false, null, 0, "", undefined and NaN are all falsy.
4590 * @returns An array containing the elements of the wrapped list without
4591 * falsy values.
4592 */
4593 compact(): Array<Truthy<T>>;
4594
4595 /**
4596 * Flattens a nested list (the nesting can be to any depth). If you
4597 * pass depth, the wrapped list will only be flattened a single
4598 * level.
4599 * @param depth True to only flatten one level, optional,
4600 * default = false.
4601 * @returns The flattened list.
4602 */
4603 flatten(depth: 1 | true): Array<ListItemOrSelf<T>>;
4604 flatten(depth?: number | false): Array<DeepestListItemOrSelf<T>>;
4605
4606 /**
4607 * Returns a copy of the wrapped list with all instances of `values`
4608 * removed.
4609 * @param values The values to exclude from the wrapped list.
4610 * @returns An array that contains all elements of the wrapped list
4611 * except for `values`.
4612 */
4613 without(...values: T[]): T[];
4614
4615 /**
4616 * Computes the union of the wrapped list and the passed-in `lists`:
4617 * the list of unique items, examined in order from first list to last
4618 * list, that are present in one or more of the lists.
4619 * @param lists The lists (along with the wrapped list) to compute
4620 * the union of.
4621 * @returns The union of elements within the wrapped list and `lists`.
4622 */
4623 union(...lists: Array<List<T>>): T[];
4624
4625 /**
4626 * Computes the list of values that are the intersection of the wrapped
4627 * list and the passed-in `lists`. Each value in the result is present
4628 * in each of the lists.
4629 * @param lists The lists (along with the wrapped list) to compute the
4630 * intersection of.
4631 * @returns The intersection of elements within the the wrapped list
4632 * and `lists`.
4633 */
4634 intersection(...lists: Array<List<T>>): T[];
4635
4636 /**
4637 * Similar to without, but returns the values from the wrapped list
4638 * that are not present in `others`.
4639 * @param list The starting list.
4640 * @param others The lists of values to exclude from the wrapped list.
4641 * @returns The contents of the wrapped list without the values in
4642 * `others`.
4643 */
4644 difference(...others: Array<List<T>>): T[];
4645
4646 /**
4647 * Produces a duplicate-free version of the wrapped list, using === to
4648 * test object equality. If you know in advance that the wrapped list
4649 * is sorted, passing true for isSorted will run a much faster
4650 * algorithm. If you want to compute unique items based on a
4651 * transformation, pass an iteratee function.
4652 * @param isSorted True if the wrapped list is already sorted,
4653 * optional, default = false.
4654 * @param iteratee Transform the elements of the wrapped list before
4655 * comparisons for uniqueness.
4656 * @param context 'this' object in `iteratee`, optional.
4657 * @returns An array containing only the unique elements in the wrapped
4658 * list.
4659 */
4660 uniq(
4661 isSorted?: boolean,
4662 iteratee?: Iteratee<V, any>,
4663 cotext?: any,
4664 ): T[];
4665 uniq(
4666 iteratee?: Iteratee<V, any>,
4667 context?: any,
4668 ): T[];
4669
4670 /**
4671 * @see uniq
4672 */
4673 unique: Underscore<T, V>["uniq"];
4674
4675 /**
4676 * Merges together the values of each of the `lists` (including the
4677 * wrapped list) with the values at the corresponding position. Useful
4678 * when you have separate data sources that are coordinated through
4679 * matching list indexes.
4680 * @returns The zipped version of the wrapped list and `lists`.
4681 */
4682 zip(): V extends List<infer A> ? Array<[A]> : []; // eslint-disable-line @definitelytyped/no-single-element-tuple-type
4683 zip<A, B>(...lists: [List<A>, List<B>]): Array<[T, A, B]>;
4684 zip<A>(list: List<A>): Array<[T, A]>;
4685 zip(...lists: Array<List<T>>): T[][];
4686 zip(...lists: Array<List<any>>): any[][];
4687
4688 /**
4689 * The opposite of zip. Given the wrapped list of lists, returns a
4690 * series of new arrays, the first of which contains all of the first
4691 * elements in the wrapped lists, the second of which contains all of
4692 * the second elements, and so on. (alias: transpose)
4693 * @returns The unzipped version of the wrapped lists.
4694 */
4695 unzip(): T extends [infer A, infer B, infer C] ? [A[], B[], C[]]
4696 : T extends [infer A, infer B] ? [A[], B[]]
4697 : T extends [infer A] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
4698 ? [A[]] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
4699 : T extends List<infer A> ? A[][]
4700 : [];
4701 transpose(): T extends [infer A, infer B, infer C] ? [A[], B[], C[]]
4702 : T extends [infer A, infer B] ? [A[], B[]]
4703 : T extends [infer A] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
4704 ? [A[]] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
4705 : T extends List<infer A> ? A[][]
4706 : [];
4707
4708 /**
4709 * Converts lists into objects. Call on either a wrapped list of
4710 * [key, value] pairs, or a wrapped list of keys and a list of
4711 * `values`. Passing by pairs is the reverse of pairs. If duplicate
4712 * keys exist, the last value wins.
4713 * @param values If the wrapped list is a list of keys, a list of
4714 * values corresponding to those keys.
4715 * @returns An object comprised of the provided keys and values.
4716 */
4717 object<TValue>(
4718 values: List<TValue>,
4719 ): Dictionary<TValue | undefined>;
4720 object(): Dictionary<PairValue<T>>;
4721
4722 /**
4723 * Returns the index at which `value` can be found in the wrapped list,
4724 * or -1 if `value` is not present. If you're working with a large list
4725 * and you know that the list is already sorted, pass true for
4726 * `isSortedOrFromIndex` to use a faster binary search...or, pass a
4727 * number in order to look for the first matching value in the list
4728 * after the given index.
4729 * @param value The value to search for within the wrapped list.
4730 * @param isSortedOrFromIndex True if the wrapped list is already
4731 * sorted OR the starting index for the search, optional.
4732 * @returns The index of the first occurrence of `value` within the
4733 * wrapped list or -1 if `value` is not found.
4734 */
4735 indexOf(
4736 value: T,
4737 isSortedOrFromIndex?: boolean | number,
4738 ): number;
4739
4740 /**
4741 * Returns the index of the last occurrence of `value` in the wrapped
4742 * list, or -1 if `value` is not present. Pass `fromIndex` to start
4743 * your search at a given index.
4744 * @param value The value to search for within the wrapped list.
4745 * @param fromIndex The starting index for the search, optional.
4746 * @returns The index of the last occurrence of `value` within the
4747 * wrapped list or -1 if `value` is not found.
4748 */
4749 lastIndexOf(
4750 value: T,
4751 fromIndex?: number,
4752 ): number;
4753
4754 /**
4755 * Returns the first index of an element in the wrapped list where the
4756 * `iteratee` truth test passes, otherwise returns -1.
4757 * @param iteratee The truth test to apply.
4758 * @param context `this` object in `iteratee`, optional.
4759 * @returns The index of the first element in the wrapped list where
4760 * the truth test passes or -1 if no elements pass.
4761 */
4762 findIndex(
4763 iteratee?: Iteratee<V, boolean>,
4764 context?: any,
4765 ): number;
4766
4767 /**
4768 * Returns the last index of an element in the wrapped list where the
4769 * `iteratee` truth test passes, otherwise returns -1.
4770 * @param iteratee The truth test to apply.
4771 * @param context `this` object in `iteratee`, optional.
4772 * @returns The index of the last element in the wrapped list where the
4773 * truth test passes or -1 if no elements pass.
4774 */
4775 findLastIndex(
4776 iteratee?: Iteratee<V, boolean>,
4777 context?: any,
4778 ): number;
4779
4780 /**
4781 * Uses a binary search to determine the lowest index at which the
4782 * value should be inserted into the wrapped list in order to maintain
4783 * the wrapped list's sorted order. If an iteratee is provided, it will
4784 * be used to compute the sort ranking of each value, including the
4785 * value you pass.
4786 * @param value The value to determine an insert index for to mainain
4787 * the sorting in the wrapped list.
4788 * @param iteratee Iteratee to compute the sort ranking of each
4789 * element including `value`, optional.
4790 * @param context `this` object in `iteratee`, optional.
4791 * @returns The index where `value` should be inserted into the wrapped
4792 * list.
4793 */
4794 sortedIndex(
4795 value: T,
4796 iteratee?: Iteratee<V | undefined, any>,
4797 context?: any,
4798 ): number;
4799
4800 /**
4801 * A function to create flexibly-numbered lists of integers, handy for
4802 * `each` and `map` loops. Returns a list of integers from
4803 * the wrapped value (inclusive) to `stop` (exclusive), incremented
4804 * (or decremented) by `step`. Note that ranges that `stop` before they
4805 * `start` are considered to be zero-length instead of negative - if
4806 * you'd like a negative range, use a negative `step`.
4807 *
4808 * If `stop` is not specified, the wrapped value will be the number to
4809 * stop at and the default start of 0 will be used.
4810 * @param stop The number to stop at.
4811 * @param step The number to count up by each iteration, optional,
4812 * default = 1.
4813 * @returns An array of numbers from start to `stop` with increments
4814 * of `step`.
4815 */
4816 range(stop?: number, step?: number): number[];
4817
4818 /**
4819 * Chunks the wrapped list into multiple arrays, each containing
4820 * `length` or fewer items.
4821 * @param length The maximum size of the chunks.
4822 * @returns The contents of the wrapped list in chunks no greater than
4823 * `length` in size.
4824 */
4825 chunk(length: number): T[][];
4826
4827 /*************
4828 * Functions *
4829 *************/
4830
4831 /**
4832 * Wrapped type `Function`.
4833 * @see _.bind
4834 */
4835 bind(object: any, ...args: any[]): Function;
4836
4837 /**
4838 * Wrapped type `object`.
4839 * @see _.bindAll
4840 */
4841 bindAll(...methodNames: string[]): any;
4842
4843 /**
4844 * Wrapped type `Function`.
4845 * @see _.partial
4846 */
4847 partial(...args: any[]): Function;
4848
4849 /**
4850 * Wrapped type `Function`.
4851 * @see _.memoize
4852 */
4853 memoize(hashFn?: (n: any) => string): Function;
4854
4855 /**
4856 * Wrapped type `Function`.
4857 * @see _.defer
4858 */
4859 defer(...args: any[]): void;
4860
4861 /**
4862 * Wrapped type `Function`.
4863 * @see _.delay
4864 */
4865 delay(wait: number, ...args: any[]): any;
4866
4867 /**
4868 * @see _.delay
4869 */
4870 delay(...args: any[]): any;
4871
4872 /**
4873 * Wrapped type `Function`.
4874 * @see _.throttle
4875 */
4876 throttle(wait: number, options?: _.ThrottleSettings): Function & _.Cancelable;
4877
4878 /**
4879 * Wrapped type `Function`.
4880 * @see _.debounce
4881 */
4882 debounce(wait: number, immediate?: boolean): Function & _.Cancelable;
4883
4884 /**
4885 * Wrapped type `Function`.
4886 * @see _.once
4887 */
4888 once(): Function;
4889
4890 /**
4891 * Wrapped type `Function`.
4892 * @see _.once
4893 */
4894 restArgs(starIndex?: number): Function;
4895
4896 /**
4897 * Wrapped type `number`.
4898 * @see _.after
4899 */
4900 after(fn: Function): Function;
4901
4902 /**
4903 * Wrapped type `number`.
4904 * @see _.before
4905 */
4906 before(fn: Function): Function;
4907
4908 /**
4909 * Wrapped type `Function`.
4910 * @see _.wrap
4911 */
4912 wrap(wrapper: Function): () => Function;
4913
4914 /**
4915 * Wrapped type `Function`.
4916 * @see _.negate
4917 */
4918 negate(): (...args: any[]) => boolean;
4919
4920 /**
4921 * Wrapped type `Function[]`.
4922 * @see _.compose
4923 */
4924 compose(...functions: Function[]): Function;
4925
4926 /***********
4927 * Objects *
4928 ***********/
4929
4930 /**
4931 * Wrapped type `object`.
4932 * @see _.keys
4933 */
4934 keys(): string[];
4935
4936 /**
4937 * Wrapped type `object`.
4938 * @see _.allKeys
4939 */
4940 allKeys(): string[];
4941
4942 /**
4943 * Wrapped type `object`.
4944 * @see _.values
4945 */
4946 values(): T[];
4947
4948 /**
4949 * Like map, but for objects. Transform the value of each property in
4950 * turn.
4951 * @param iteratee The iteratee to use to transform property values.
4952 * @param context `this` object in `iteratee`, optional.
4953 * @returns A new object with all of the wrapped object's property
4954 * values transformed through `iteratee`.
4955 */
4956 mapObject<I extends Iteratee<V, any, TypeOfCollection<V, any>>>(
4957 iteratee: I,
4958 context?: any,
4959 ): { [K in keyof V]: IterateeResult<I, V[K]> };
4960
4961 /**
4962 * Convert the wrapped object into a list of [key, value] pairs. The
4963 * opposite of the single-argument signature of `_.object`.
4964 * @returns The list of [key, value] pairs from the wrapped object.
4965 */
4966 pairs(): Array<[Extract<keyof V, string>, TypeOfCollection<V, any>]>;
4967
4968 /**
4969 * Wrapped type `object`.
4970 * @see _.invert
4971 */
4972 invert(): any;
4973
4974 /**
4975 * Wrapped type `object`.
4976 * @see _.functions
4977 */
4978 functions(): string[];
4979
4980 /**
4981 * @see _.functions
4982 */
4983 methods(): string[];
4984
4985 /**
4986 * Wrapped type `object`.
4987 * @see _.extend
4988 */
4989 extend(...sources: any[]): any;
4990
4991 /**
4992 * Similar to `findIndex` but for keys in objects. Returns the key
4993 * where the `iteratee` truth test passes or undefined.
4994 * @param iteratee The truth test to apply.
4995 * @param context `this` object in `iteratee`, optional.
4996 * @returns The first element in the wrapped object that passes the
4997 * truth test or undefined if no elements pass.
4998 */
4999 findKey(
5000 iteratee?: Iteratee<V, boolean, TypeOfCollection<V, any>>,
5001 context?: any,
5002 ): Extract<keyof V, string> | undefined;
5003
5004 /**
5005 * Return a copy of the wrapped object that is filtered to only have
5006 * values for the allowed keys (or array of keys).
5007 * @param keys The keys to keep on the wrapped object.
5008 * @returns A copy of the wrapped object with only the `keys`
5009 * properties.
5010 */
5011 pick<K extends string>(...keys: Array<K | K[]>): _Pick<V, K>;
5012
5013 /**
5014 * Return a copy of the wrapped object that is filtered to only have
5015 * values for the keys selected by a truth test.
5016 * @param iterator A truth test that selects the keys to keep on the
5017 * wrapped object.
5018 * @returns A copy of the wrapped object with only the keys selected by
5019 * `iterator`.
5020 */
5021 pick(
5022 iterator: ObjectIterator<TypeOfDictionary<V, any>, boolean, V>,
5023 ): Partial<V>;
5024
5025 /**
5026 * Return a copy of the wrapped object that is filtered to omit the
5027 * disallowed keys (or array of keys).
5028 * @param keys The keys to omit from the wrapped object.
5029 * @returns A copy of the wrapped object without the `keys` properties.
5030 */
5031 omit<K extends string>(...keys: Array<K | K[]>): _Omit<V, K>;
5032
5033 /**
5034 * Return a copy of the wrapped object that is filtered to not have
5035 * values for the keys selected by a truth test.
5036 * @param iterator A truth test that selects the keys to omit from the
5037 * wrapped object.
5038 * @returns A copy of the wrapped object without the keys selected by
5039 * `iterator`.
5040 */
5041 omit(
5042 iterator: ObjectIterator<TypeOfDictionary<V, any>, boolean, V>,
5043 ): Partial<V>;
5044
5045 /**
5046 * Wrapped type `object`.
5047 * @see _.defaults
5048 */
5049 defaults(...defaults: any[]): any;
5050
5051 /**
5052 * Wrapped type `any`.
5053 * @see _.create
5054 */
5055 create(props?: object): any;
5056
5057 /**
5058 * Wrapped type `any[]`.
5059 * @see _.clone
5060 */
5061 clone(): T;
5062
5063 /**
5064 * Wrapped type `object`.
5065 * @see _.tap
5066 */
5067 tap(interceptor: (...as: any[]) => any): any;
5068
5069 /**
5070 * Wrapped type `object`.
5071 * @see _.has
5072 */
5073 has(key: string): boolean;
5074
5075 /**
5076 * Wrapped type `any[]`.
5077 * @see _.matches
5078 */
5079 matches(): _.ListIterator<T, boolean>;
5080
5081 /**
5082 * Wrapped type `any[]`.
5083 * @see _.matcher
5084 */
5085 matcher(): _.ListIterator<T, boolean>;
5086
5087 /**
5088 * Wrapped type `any`.
5089 * @see _.get
5090 */
5091 get(
5092 path: string,
5093 ): TypeOfCollection<V> | undefined;
5094 get<U>(
5095 path: string,
5096 defaultValue?: U,
5097 ): TypeOfCollection<V> | U;
5098 get<P extends Array<string | number>, U = undefined>(
5099 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
5100 path: [...P],
5101 defaultValue?: U,
5102 ): DeepTypeOfCollection<V, P> | U;
5103
5104 /**
5105 * Wrapped type `string`.
5106 * @see _.property
5107 */
5108 property(): (object: any) => any;
5109
5110 /**
5111 * Wrapped type `object`.
5112 * @see _.propertyOf
5113 */
5114 propertyOf(): (key: string) => any;
5115
5116 /**
5117 * Performs an optimized deep comparison between the wrapped object
5118 * and `other` to determine if they should be considered equal.
5119 * @param other Compare to the wrapped object.
5120 * @returns True if the wrapped object should be considered equal to
5121 * `other`.
5122 */
5123 isEqual(other: any): boolean;
5124
5125 /**
5126 * Returns true if the wrapped collection contains no values.
5127 * For strings and array-like objects checks if the length property is
5128 * 0.
5129 * @returns True if the wrapped collection has no elements.
5130 */
5131 isEmpty(): boolean;
5132
5133 /**
5134 * Returns true if the keys and values in `properties` are contained in
5135 * the wrapped object.
5136 * @param properties The properties to check for in the wrapped object.
5137 * @returns True if all keys and values in `properties` are also in the
5138 * wrapped object.
5139 */
5140 isMatch(properties: any): boolean;
5141
5142 /**
5143 * Returns true if the wrapped object is a DOM element.
5144 * @returns True if the wrapped object is a DOM element, otherwise
5145 * false.
5146 */
5147 isElement(): boolean;
5148
5149 /**
5150 * Returns true if the wrapped object is an Array.
5151 * @returns True if the wrapped object is an Array, otherwise false.
5152 */
5153 isArray(): boolean;
5154
5155 /**
5156 * Returns true if the wrapped object is an ArrayBuffer.
5157 * @returns True if the wrapped object is an ArrayBuffer, otherwise false.
5158 */
5159 isArrayBuffer(): boolean;
5160
5161 /**
5162 * Returns true if the wrapped object is a DataView.
5163 * @returns True if the wrapped object is a DataView, otherwise false.
5164 */
5165 isDataView(): boolean;
5166
5167 /**
5168 * Returns true if the wrapped object is a TypedArray.
5169 * @returns True if the wrapped object is a TypedArray, otherwise false.
5170 */
5171 isTypedArray(): boolean;
5172
5173 /**
5174 * Returns true if the wrapped object is a Symbol.
5175 * @returns True if the wrapped object is a Symbol, otherwise false.
5176 */
5177 isSymbol(): boolean;
5178
5179 /**
5180 * Returns true if the wrapped object is an Object. Note that
5181 * JavaScript arrays and functions are objects, while (normal) strings
5182 * and numbers are not.
5183 * @returns True if the wrapped object is an Object, otherwise false.
5184 */
5185 isObject(): boolean;
5186
5187 /**
5188 * Returns true if the wrapped object is an Arguments object.
5189 * @returns True if the wrapped object is an Arguments object,
5190 * otherwise false.
5191 */
5192 isArguments(): boolean;
5193
5194 /**
5195 * Returns true if the wrapped object is a Function.
5196 * @returns True if the wrapped object is a Function, otherwise false.
5197 */
5198 isFunction(): boolean;
5199
5200 /**
5201 * Returns true if the wrapped object is a Error.
5202 * @returns True if the wrapped object is a Error, otherwise false.
5203 */
5204 isError(): boolean;
5205
5206 /**
5207 * Returns true if the wrapped object is a String.
5208 * @returns True if the wrapped object is a String, otherwise false.
5209 */
5210 isString(): boolean;
5211
5212 /**
5213 * Returns true if the wrapped object is a Number (including NaN).
5214 * @returns True if the wrapped object is a Number, otherwise false.
5215 */
5216 isNumber(): boolean;
5217
5218 /**
5219 * Returns true if the wrapped object is a finite Number.
5220 * @returns True if the wrapped object is a finite Number.
5221 */
5222 isFinite(): boolean;
5223
5224 /**
5225 * Returns true if the wrapped object is a Boolean.
5226 * @returns True if the wrapped object is a Boolean, otherwise false.
5227 */
5228 isBoolean(): boolean;
5229
5230 /**
5231 * Returns true if the wrapped object is a Date.
5232 * @returns True if the wrapped object is a Date, otherwise false.
5233 */
5234 isDate(): boolean;
5235
5236 /**
5237 * Returns true if the wrapped object is a RegExp.
5238 * @returns True if the wrapped object is a RegExp, otherwise false.
5239 */
5240 isRegExp(): boolean;
5241
5242 /**
5243 * Returns true if the wrapped object is NaN.
5244 * Note: this is not the same as the native isNaN function,
5245 * which will also return true if the variable is undefined.
5246 * @returns True if the wrapped object is NaN, otherwise false.
5247 */
5248 isNaN(): boolean;
5249
5250 /**
5251 * Returns true if the wrapped object is null.
5252 * @returns True if the wrapped object is null, otherwise false.
5253 */
5254 isNull(): boolean;
5255
5256 /**
5257 * Returns true if the wrapped object is undefined.
5258 * @returns True if the wrapped object is undefined, otherwise false.
5259 */
5260 isUndefined(): boolean;
5261
5262 /**
5263 * Returns true if the wrapped object is a Set.
5264 * @returns True if the wrapped object is a Set, otherwise false.
5265 */
5266 isSet(): boolean;
5267
5268 /**
5269 * Returns true if the wrapped object is a WeakSet.
5270 * @returns True if the wrapped object is a WeakSet, otherwise false.
5271 */
5272 isWeakSet(): boolean;
5273
5274 /**
5275 * Returns true if the wrapped object is a Map.
5276 * @returns True if the wrapped object is a Map, otherwise false.
5277 */
5278 isMap(): boolean;
5279
5280 /**
5281 * Returns true if the wrapped object is a WeakMap.
5282 * @returns True if the wrapped object is a WeakMap, otherwise false.
5283 */
5284 isWeakMap(): boolean;
5285
5286 /**
5287 * Ensures that path is an array.
5288 * @param path
5289 * 1. If path is a string, it is wrapped in a single-element array;
5290 * 2. if it is an array already, it is returned unmodified.
5291 */
5292 toPath(): (
5293 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
5294 V extends ReadonlyArray<string | number> ? V
5295 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
5296 : V extends string | number ? [V]
5297 : never
5298 );
5299
5300 /***********
5301 * Utility *
5302 ***********/
5303
5304 /**
5305 * Wrapped type `any`.
5306 * @see _.identity
5307 */
5308 identity(): any;
5309
5310 /**
5311 * Wrapped type `any`.
5312 * @see _.constant
5313 */
5314 constant(): () => T;
5315
5316 /**
5317 * Wrapped type `any`.
5318 * @see _.noop
5319 */
5320 noop(): void;
5321
5322 /**
5323 * Wrapped type `number`.
5324 * @see _.times
5325 */
5326 times<TResult>(iterator: (n: number) => TResult, context?: any): TResult[];
5327
5328 /**
5329 * Wrapped type `number`.
5330 * @see _.random
5331 */
5332 random(): number;
5333 /**
5334 * Wrapped type `number`.
5335 * @see _.random
5336 */
5337 random(max: number): number;
5338
5339 /**
5340 * Wrapped type `object`.
5341 * @see _.mixin
5342 */
5343 mixin(): void;
5344
5345 /**
5346 * Wrapped type `string|Function|Object`.
5347 * @see _.iteratee
5348 */
5349 iteratee(context?: any): Function;
5350
5351 /**
5352 * Wrapped type `string`.
5353 * @see _.uniqueId
5354 */
5355 uniqueId(): string;
5356
5357 /**
5358 * Wrapped type `string`.
5359 * @see _.escape
5360 */
5361 escape(): string;
5362
5363 /**
5364 * Wrapped type `string`.
5365 * @see _.unescape
5366 */
5367 unescape(): string;
5368
5369 /**
5370 * Wrapped type `object`.
5371 * @see _.result
5372 */
5373 result(property: string, defaultValue?: any): any;
5374
5375 /**
5376 * Wrapped type `string`.
5377 * @see _.template
5378 */
5379 template(settings?: _.TemplateSettings): CompiledTemplate;
5380
5381 /************
5382 * Chaining *
5383 ************/
5384
5385 /**
5386 * Returns a wrapped object. Calling methods on this object will
5387 * continue to return wrapped objects until value() is used.
5388 * @returns An underscore chain wrapper around the wrapped value.
5389 */
5390 chain(): _Chain<T, V>;
5391
5392 /**
5393 * Extracts the value of the wrapped object.
5394 * @returns The value of the wrapped object.
5395 */
5396 value(): V;
5397 }
5398
5399 interface _Chain<T, V = T[]> {
5400 /***************
5401 * Collections *
5402 ***************/
5403
5404 /**
5405 * Iterates over the wrapped collection of elements, yielding each in
5406 * turn to an `iteratee`. The `iteratee` is bound to the context
5407 * object, if one is passed.
5408 * @param iteratee The iteratee to call for each element in the wrapped
5409 * collection.
5410 * @param context 'this' object in `iteratee`, optional.
5411 * @returns A chain wrapper around the originally wrapped collection.
5412 */
5413 each(
5414 iteratee: CollectionIterator<TypeOfCollection<V>, void, V>,
5415 context?: any,
5416 ): _Chain<T, V>;
5417
5418 /**
5419 * @see each
5420 */
5421 forEach: _Chain<T, V>["each"];
5422
5423 /**
5424 * Produces a new array of values by mapping each value in the wrapped
5425 * collection through a transformation `iteratee`.
5426 * @param iteratee The iteratee to use to transform each item in the
5427 * wrapped collection.
5428 * @param context `this` object in `iteratee`, optional.
5429 * @returns A chain wrapper around the mapped result.
5430 */
5431 map<I extends Iteratee<V, any>>(
5432 iteratee: I,
5433 context?: any,
5434 ): _Chain<IterateeResult<I, T>>;
5435
5436 /**
5437 * @see map
5438 */
5439 collect: _Chain<T, V>["map"];
5440
5441 /**
5442 * Also known as inject and foldl, reduce boils down the wrapped
5443 * collection of values into a single value. `memo` is the initial
5444 * state of the reduction, and each successive step of it should be
5445 * returned by `iteratee`.
5446 *
5447 * If no memo is passed to the initial invocation of reduce, `iteratee`
5448 * is not invoked on the first element of the wrapped collection. The
5449 * first element is instead passed as the memo in the invocation of
5450 * `iteratee` on the next element in the wrapped collection.
5451 * @param iteratee The function to call on each iteration to reduce the
5452 * collection.
5453 * @param memo The initial reduce state or undefined to use the first
5454 * item in `collection` as initial state.
5455 * @param context `this` object in `iteratee`, optional.
5456 * @returns A chain wrapper around the reduced result.
5457 */
5458 reduce<TResult>(
5459 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult, V>,
5460 memo: TResult,
5461 context?: any,
5462 ): _ChainSingle<TResult>;
5463 reduce<TResult = TypeOfCollection<V>>(
5464 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult | TypeOfCollection<V>, V>,
5465 ): _ChainSingle<TResult | TypeOfCollection<V> | undefined>;
5466
5467 /**
5468 * @see reduce
5469 */
5470 inject: _Chain<T, V>["reduce"];
5471
5472 /**
5473 * @see reduce
5474 */
5475 foldl: _Chain<T, V>["reduce"];
5476
5477 /**
5478 * The right-associative version of reduce.
5479 *
5480 * This is not as useful in JavaScript as it would be in a language
5481 * with lazy evaluation.
5482 * @param iteratee The function to call on each iteration to reduce the
5483 * collection.
5484 * @param memo The initial reduce state or undefined to use the first
5485 * item in `collection` as the initial state.
5486 * @param context `this` object in `iteratee`, optional.
5487 * @returns A chain wrapper around the reduced result.
5488 */
5489 reduceRight<TResult>(
5490 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult, V>,
5491 memo: TResult,
5492 context?: any,
5493 ): _ChainSingle<TResult>;
5494 reduceRight<TResult = TypeOfCollection<V>>(
5495 iteratee: MemoCollectionIterator<TypeOfCollection<V>, TResult | TypeOfCollection<V>, V>,
5496 ): _ChainSingle<TResult | TypeOfCollection<V> | undefined>;
5497
5498 /**
5499 * @see reduceRight
5500 */
5501 foldr: _Chain<T, V>["reduceRight"];
5502
5503 /**
5504 * Looks through each value in the wrapped collection, returning the
5505 * first one that passes a truth test (`iteratee`), or undefined if no
5506 * value passes the test. The function returns as soon as it finds an
5507 * acceptable element, and doesn't traverse the entire collection.
5508 * @param iteratee The truth test to apply.
5509 * @param context `this` object in `iteratee`, optional.
5510 * @returns A chain wrapper around the first element in the wrapped
5511 * collection that passes the truth test or undefined if no elements
5512 * pass.
5513 */
5514 find(
5515 iteratee?: Iteratee<V, boolean>,
5516 context?: any,
5517 ): _ChainSingle<T | undefined>;
5518
5519 /**
5520 * @see find
5521 */
5522 detect: _Chain<T, V>["find"];
5523
5524 /**
5525 * Looks through each value in the wrapped collection, returning an
5526 * array of all the values that pass a truth test (`iteratee`).
5527 * @param iteratee The truth test to apply.
5528 * @param context `this` object in `iteratee`, optional.
5529 * @returns A chain wrapper around the set of values that pass the
5530 * truth test.
5531 */
5532 filter(iteratee?: Iteratee<V, any>, context?: any): _Chain<T>;
5533
5534 /**
5535 * @see filter
5536 */
5537 select: _Chain<T, V>["filter"];
5538
5539 /**
5540 * Looks through each value in the wrapped collection, returning an
5541 * array of all the elements that match the key-value pairs listed in
5542 * `properties`.
5543 * @param properties The properties to check for on the elements within
5544 * the wrapped collection.
5545 * @returns A chain wrapper around the elements in the wrapped
5546 * collection that match `properties`.
5547 */
5548 where(properties: Partial<T>): _Chain<T>;
5549
5550 /**
5551 * Looks through the wrapped collection and returns the first value
5552 * that matches all of the key-value pairs listed in `properties`. If
5553 * no match is found, or if list is empty, undefined will be returned.
5554 * @param properties The properties to check for on the elements within
5555 * the wrapped collection.
5556 * @returns A chain wrapper around the first element in the wrapped
5557 * collection that matches `properties` or undefined if no match is
5558 * found.
5559 */
5560 findWhere(properties: Partial<T>): _ChainSingle<T | undefined>;
5561
5562 /**
5563 * Returns the values in the wrapped collection without the elements
5564 * that pass a truth test (`iteratee`).
5565 * The opposite of filter.
5566 * @param iteratee The truth test to apply.
5567 * @param context `this` object in `iteratee`, optional.
5568 * @returns A chain wrapper around the set of values that fail the
5569 * truth test.
5570 */
5571 reject(iteratee?: Iteratee<V, boolean>, context?: any): _Chain<T>;
5572
5573 /**
5574 * Returns true if all of the values in the wrapped collection pass the
5575 * `iteratee` truth test. Short-circuits and stops traversing the
5576 * wrapped collection if a false element is found.
5577 * @param iteratee The truth test to apply.
5578 * @param context `this` object in `iteratee`, optional.
5579 * @returns A chain wrapper around true if all elements pass the truth
5580 * test, otherwise around false.
5581 */
5582 every(
5583 iterator?: Iteratee<V, boolean>,
5584 context?: any,
5585 ): _ChainSingle<boolean>;
5586
5587 /**
5588 * @see every
5589 */
5590 all: _Chain<T, V>["every"];
5591
5592 /**
5593 * Returns true if any of the values in the wrapped collection pass the
5594 * `iteratee` truth test. Short-circuits and stops traversing the
5595 * wrapped collection if a true element is found.
5596 * @param iteratee The truth test to apply.
5597 * @param context `this` object in `iteratee`, optional.
5598 * @returns A chain wrapper around true if any element passed the truth
5599 * test, otherwise around false.
5600 */
5601 some(
5602 iterator?: Iteratee<V, boolean>,
5603 context?: any,
5604 ): _ChainSingle<boolean>;
5605
5606 /**
5607 * @see some
5608 */
5609 any: _Chain<T, V>["some"];
5610
5611 /**
5612 * Returns true if the value is present in the wrapped collection. Uses
5613 * indexOf internally, if the wrapped collection is a List. Use
5614 * `fromIndex` to start your search at a given index.
5615 * @param value The value to check the wrapped collection for.
5616 * @param fromIndex The index to start searching from, optional,
5617 * default = 0, only used when the wrapped collection is a List.
5618 * @returns A chain wrapper around true if `value` is present in the
5619 * wrapped collection after `fromIndex`, otherwise around false.
5620 */
5621 contains(value: any, fromIndex?: number): _ChainSingle<boolean>;
5622
5623 /**
5624 * @see contains
5625 */
5626 include: _Chain<T, V>["contains"];
5627
5628 /**
5629 * @see contains
5630 */
5631 includes: _Chain<T, V>["contains"];
5632
5633 /**
5634 * Calls the method named by `methodName` on each value in the wrapped
5635 * collection. Any extra arguments passed to invoke will be forwarded
5636 * on to the method invocation.
5637 * @param methodName The name of the method to call on each element in
5638 * the wrapped collection.
5639 * @param args Additional arguments to pass to method `methodName`.
5640 * @returns A chain wrapper around an array containing the result of
5641 * the method call for each item in the wrapped collection.
5642 */
5643 invoke(methodName: string, ...args: any[]): _Chain<any>;
5644
5645 /**
5646 * A convenient version of what is perhaps the most common use-case for
5647 * map: extracting a list of property values.
5648 * @param propertyName The name of a specific property to retrieve from
5649 * all items in the wrapped collection.
5650 * @returns A chain wrapper around The set of values for the specified
5651 * `propertyName` for each item in the wrapped collection.
5652 */
5653 pluck<K extends string | number>(
5654 propertyName: K,
5655 ): _Chain<PropertyTypeOrAny<T, K>>;
5656
5657 /**
5658 * Returns the maximum value in the wrapped collection. If an
5659 * `iteratee` is provided, it will be used on each element to generate
5660 * the criterion by which the element is ranked. -Infinity is returned
5661 * if list is empty. Non-numerical values returned by `iteratee` will
5662 * be ignored.
5663 * @param iteratee The iteratee that provides the criterion by which
5664 * each element is ranked, optional if evaluating a collection of
5665 * numbers.
5666 * @param context `this` object in `iteratee`, optional.
5667 * @returns A chain wrapper around the maximum element within the
5668 * wrapped collection or around -Infinity if the wrapped collection is
5669 * empty.
5670 */
5671 max(
5672 iteratee?: Iteratee<V, any>,
5673 context?: any,
5674 ): _ChainSingle<T | number>;
5675
5676 /**
5677 * Returns the minimum value in the wrapped collection. If an
5678 * `iteratee` is provided, it will be used on each element to generate
5679 * the criterion by which the element is ranked. Infinity is returned
5680 * if list is empty. Non-numerical values returned by `iteratee` will
5681 * be ignored.
5682 * @param iteratee The iteratee that provides the criterion by which
5683 * each element is ranked, optional if evaluating a collection of
5684 * numbers.
5685 * @param context `this` object in `iteratee`, optional.
5686 * @returns A chain wrapper around the minimum element within the
5687 * wrapped collection or around Infinity if the wrapped collection is
5688 * empty.
5689 */
5690 min(
5691 iteratee?: Iteratee<V, any>,
5692 context?: any,
5693 ): _ChainSingle<T | number>;
5694
5695 /**
5696 * Returns a (stably) sorted copy of the wrapped collection, ranked in
5697 * ascending order by the results of running each value through
5698 * `iteratee`.
5699 * @param iteratee An iteratee that provides the value to sort by for
5700 * each item in the wrapped collection.
5701 * @param context `this` object in `iteratee`, optional.
5702 * @returns A chain wrapper around a sorted copy of the wrapped
5703 * collection.
5704 */
5705 sortBy(iteratee?: Iteratee<V, any>, context?: any): _Chain<T>;
5706
5707 /**
5708 * Splits the warpped collection into sets that are grouped by the
5709 * result of running each value through `iteratee`.
5710 * @param iteratee An iteratee that provides the value to group by for
5711 * each item in the wrapped collection.
5712 * @param context `this` object in `iteratee`, optional.
5713 * @returns A chain wrapper around a dictionary with the group names
5714 * provided by `iteratee` as properties where each property contains
5715 * the grouped elements from the wrapped collection.
5716 */
5717 groupBy(
5718 iteratee?: Iteratee<V, string | number>,
5719 context?: any,
5720 ): _Chain<T[], Dictionary<T[]>>;
5721
5722 /**
5723 * Given the warpped collection and an `iteratee` function that returns
5724 * a key for each element in `collection`, returns an object that acts
5725 * as an index of each item. Just like `groupBy`, but for when you
5726 * know your keys are unique.
5727 * @param iteratee An iteratee that provides the value to index by for
5728 * each item in the wrapped collection.
5729 * @param context `this` object in `iteratee`, optional.
5730 * @returns A chain wrapper around a dictionary where each item in the
5731 * wrapped collection is assigned to the property designated by
5732 * `iteratee`.
5733 */
5734 indexBy(
5735 iteratee?: Iteratee<V, string | number>,
5736 context?: any,
5737 ): _Chain<T, Dictionary<T>>;
5738
5739 /**
5740 * Sorts the wrapped collection into groups and returns a count for the
5741 * number of objects in each group. Similar to `groupBy`, but instead
5742 * of returning a list of values, returns a count for the number of
5743 * values in that group.
5744 * @param iteratee An iteratee that provides the value to count by for
5745 * each item in the wrapped collection.
5746 * @param context `this` object in `iteratee`, optional.
5747 * @returns A chain wrapper around a dictionary with the group names
5748 * provided by `iteratee` as properties where each property contains
5749 * the count of the grouped elements from the wrapped collection.
5750 */
5751 countBy(
5752 iterator?: Iteratee<V, string | number>,
5753 context?: any,
5754 ): _Chain<number, Dictionary<number>>;
5755
5756 /**
5757 * Returns a shuffled copy of the wrapped collection, using a version
5758 * of the Fisher-Yates shuffle.
5759 * @returns A chain wrapper around a shuffled copy of the wrapped
5760 * collection.
5761 */
5762 shuffle(): _Chain<T>;
5763
5764 /**
5765 * Produce a random sample from the wrapped collection. Pass a number
5766 * to return `n` random elements from the wrapped collection. Otherwise
5767 * a single random item will be returned.
5768 * @param n The number of elements to sample from the wrapped
5769 * collection.
5770 * @returns A chain wrapper around a random sample of `n` elements from
5771 * the wrapped collection or a single element if `n` is not specified.
5772 */
5773 sample(n: number): _Chain<T>;
5774 sample(): _ChainSingle<T | undefined>;
5775
5776 /**
5777 * Creates a real Array from the wrapped collection (anything that can
5778 * be iterated over). Useful for transmuting the arguments object.
5779 * @returns A chain wrapper around an array containing the elements
5780 * of the wrapped collection.
5781 */
5782 toArray(): _Chain<T>;
5783
5784 /**
5785 * Determines the number of values in the wrapped collection.
5786 * @returns A chain wrapper around the number of values in the wrapped
5787 * collection.
5788 */
5789 size(): _ChainSingle<number>;
5790
5791 /**
5792 * Splits the wrapped collection into two arrays: one whose elements
5793 * all satisfy `iteratee` and one whose elements all do not satisfy
5794 * `iteratee`.
5795 * @param iteratee The iteratee that defines the partitioning scheme
5796 * for each element in the wrapped collection.
5797 * @param context `this` object in `iteratee`, optional.
5798 * @returns A chain wrapper around an array composed of two elements,
5799 * where the first element contains the elements in the wrapped
5800 * collection that satisfied the predicate and the second element
5801 * contains the elements that did not.
5802 */
5803 partition(
5804 iteratee?: Iteratee<V, boolean>,
5805 context?: any,
5806 ): _Chain<T[], [T[], T[]]>;
5807
5808 /**********
5809 * Arrays *
5810 **********/
5811
5812 /**
5813 * Returns the first element of the wrapped list. Passing `n` will
5814 * return the first `n` elements of the wrapped list.
5815 * @param n The number of elements to retrieve, optional.
5816 * @returns A chain wrapper around the first `n` elements of the
5817 * wrapped list or around the first element if `n` is omitted.
5818 */
5819 first(): _ChainSingle<T | undefined>;
5820 first(n: number): _Chain<T>;
5821
5822 /**
5823 * @see first
5824 */
5825 head: _Chain<T, V>["first"];
5826
5827 /**
5828 * @see first
5829 */
5830 take: _Chain<T, V>["first"];
5831
5832 /**
5833 * Returns everything but the last entry of the wrapped list.
5834 * Especially useful on the arguments object. Pass `n` to exclude the
5835 * last `n` elements from the result.
5836 * @param n The number of elements from the end of the wrapped list to
5837 * omit, optional, default = 1.
5838 * @returns A chain wrapper around the elements of the wrapped list
5839 * with the last `n` items omitted.
5840 */
5841 initial(n?: number): _Chain<T>;
5842
5843 /**
5844 * Returns the last element of the wrapped list. Passing `n` will
5845 * return the last `n` elements of the wrapped list.
5846 * @param n The number of elements to retrieve, optional.
5847 * @returns A chain wrapper around the last `n` elements of the wrapped
5848 * list or around the last element if `n` is omitted.
5849 */
5850 last(): _ChainSingle<T | undefined>;
5851 last(n: number): _Chain<T>;
5852
5853 /**
5854 * Returns the rest of the elements in the wrapped list. Pass an
5855 * `index` to return the values of the list from that index onward.
5856 * @param index The index to start retrieving elements from, optional,
5857 * default = 1.
5858 * @returns A chain wrapper around the elements of the wrapped list
5859 * from `index` to the end of the list.
5860 */
5861 rest(n?: number): _Chain<T>;
5862
5863 /**
5864 * @see rest
5865 */
5866 tail: _Chain<T, V>["rest"];
5867
5868 /**
5869 * @see rest
5870 */
5871 drop: _Chain<T, V>["rest"];
5872
5873 /**
5874 * Returns a copy of the wrapped list with all falsy values removed. In
5875 * JavaScript, false, null, 0, "", undefined and NaN are all falsy.
5876 * @returns A chain wrapper around an array containing the elements of
5877 * the wrapped list without falsy values.
5878 */
5879 compact(): _Chain<Truthy<T>>;
5880
5881 /**
5882 * Flattens a nested list (the nesting can be to any depth). If you
5883 * pass true or 1 as the depth, the list will only be flattened a single
5884 * level. Passing a greater number will cause the flattening to descend
5885 * deeper into the nesting hierarchy. Omitting the depth argument, or
5886 * passing false or Infinity, flattens the list all the way to the
5887 * deepest nesting level.
5888 * @param depth True to only flatten one level, optional,
5889 * default = false.
5890 * @returns A chain wrapper around the flattened list.
5891 */
5892 flatten(depth: 1 | true): _Chain<ListItemOrSelf<T>>;
5893 flatten(depth?: number | false): _Chain<DeepestListItemOrSelf<T>>;
5894
5895 /**
5896 * Returns a copy of the wrapped list with all instances of `values`
5897 * removed.
5898 * @param values The values to exclude from the wrapped list.
5899 * @returns A chain wrapper around an array that contains all elements
5900 * of the wrapped list except for `values`.
5901 */
5902 without(...values: T[]): _Chain<T>;
5903
5904 /**
5905 * Computes the union of the wrapped list and the passed-in `lists`:
5906 * the list of unique items, examined in order from first list to last
5907 * list, that are present in one or more of the lists.
5908 * @param lists The lists (along with the wrapped list) to compute
5909 * the union of.
5910 * @returns A chain wrapper around the union of elements within the
5911 * wrapped list and `lists`.
5912 */
5913 union(...lists: Array<List<T>>): _Chain<T>;
5914
5915 /**
5916 * Computes the list of values that are the intersection of the wrapped
5917 * list and the passed-in `lists`. Each value in the result is present
5918 * in each of the lists.
5919 * @param lists The lists (along with the wrapped list) to compute the
5920 * intersection of.
5921 * @returns A chain wrapper around the intersection of elements within
5922 * the the wrapped list and `lists`.
5923 */
5924 intersection(...lists: Array<List<T>>): _Chain<T>;
5925
5926 /**
5927 * Similar to without, but returns the values from the wrapped list
5928 * that are not present in `others`.
5929 * @param list The starting list.
5930 * @param others The lists of values to exclude from the wrapped list.
5931 * @returns A chain wrapper around the contents of the wrapped list
5932 * without the values in `others`.
5933 */
5934 difference(...others: Array<List<T>>): _Chain<T>;
5935
5936 /**
5937 * Produces a duplicate-free version of the wrapped list, using === to
5938 * test object equality. If you know in advance that the wrapped list
5939 * is sorted, passing true for isSorted will run a much faster
5940 * algorithm. If you want to compute unique items based on a
5941 * transformation, pass an iteratee function.
5942 * @param isSorted True if the wrapped list is already sorted,
5943 * optional, default = false.
5944 * @param iteratee Transform the elements of the wrapped list before
5945 * comparisons for uniqueness.
5946 * @param context 'this' object in `iteratee`, optional.
5947 * @returns A chain wrapper around an array containing only the unique
5948 * elements in the wrapped list.
5949 */
5950 uniq(
5951 isSorted?: boolean,
5952 iteratee?: Iteratee<V, any>,
5953 context?: any,
5954 ): _Chain<T>;
5955 uniq(
5956 iteratee?: Iteratee<V, any>,
5957 context?: any,
5958 ): _Chain<T>;
5959
5960 /**
5961 * Wrapped type List<T>.
5962 * @see uniq
5963 */
5964 unique: _Chain<T, V>["uniq"];
5965
5966 /**
5967 * Merges together the values of each of the `lists` (including the
5968 * wrapped list) with the values at the corresponding position. Useful
5969 * when you have separate data sources that are coordinated through
5970 * matching list indexes.
5971 * @returns A chain wrapper around the zipped version of the wrapped
5972 * list and `lists`.
5973 */
5974 zip(): V extends List<infer A> ? _Chain<[A]> : _Chain<never, []>; // eslint-disable-line @definitelytyped/no-single-element-tuple-type
5975 zip<A, B>(...arrays: [List<A>, List<B>]): _Chain<[T, A, B]>;
5976 zip<A>(array: List<A>): _Chain<[T, A]>;
5977 zip(...arrays: Array<List<T>>): _Chain<T[]>;
5978 zip(...arrays: Array<List<any>>): _Chain<any[]>;
5979
5980 /**
5981 * The opposite of zip. Given the wrapped list of lists, returns a
5982 * series of new arrays, the first of which contains all of the first
5983 * elements in the wrapped lists, the second of which contains all of
5984 * the second elements, and so on. (alias: transpose)
5985 * @returns A chain wrapper around the unzipped version of the wrapped
5986 * lists.
5987 */
5988 unzip(): T extends [infer A, infer B, infer C] ? _Chain<A[] | B[] | C[], [A[], B[], C[]]>
5989 : T extends [infer A, infer B] ? _Chain<A[] | B[], [A[], B[]]>
5990 : T extends [infer A] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
5991 ? _Chain<A[], [A[]]> // eslint-disable-line @definitelytyped/no-single-element-tuple-type
5992 : T extends List<infer A> ? _Chain<A[]>
5993 : _Chain<never, []>;
5994 transpose(): T extends [infer A, infer B, infer C] ? _Chain<A[] | B[] | C[], [A[], B[], C[]]>
5995 : T extends [infer A, infer B] ? _Chain<A[] | B[], [A[], B[]]>
5996 : T extends [infer A] // eslint-disable-line @definitelytyped/no-single-element-tuple-type
5997 ? _Chain<A[], [A[]]> // eslint-disable-line @definitelytyped/no-single-element-tuple-type
5998 : T extends List<infer A> ? _Chain<A[]>
5999 : _Chain<never, []>;
6000
6001 /**
6002 * Converts lists into objects. Call on either a wrapped list of
6003 * [key, value] pairs, or a wrapped list of keys and a list of
6004 * `values`. Passing by pairs is the reverse of pairs. If duplicate
6005 * keys exist, the last value wins.
6006 * @param values If the wrapped list is a list of keys, a list of
6007 * values corresponding to those keys.
6008 * @returns A chain wrapper around an object comprised of the provided
6009 * keys and values.
6010 */
6011 object<TValue>(
6012 values: List<TValue>,
6013 ): _Chain<TValue | undefined, Dictionary<TValue | undefined>>;
6014 object(): _Chain<PairValue<T>, Dictionary<PairValue<T>>>;
6015
6016 /**
6017 * Returns the index at which `value` can be found in the wrapped list,
6018 * or -1 if `value` is not present. If you're working with a large list
6019 * and you know that the list is already sorted, pass true for
6020 * `isSortedOrFromIndex` to use a faster binary search...or, pass a
6021 * number in order to look for the first matching value in the list
6022 * after the given index.
6023 * @param value The value to search for within the wrapped list.
6024 * @param isSortedOrFromIndex True if the wrapped list is already
6025 * sorted OR the starting index for the search, optional.
6026 * @returns A chain wrapper around the index of the first occurrence of
6027 * `value` within the wrapped list or -1 if `value` is not found.
6028 */
6029 indexOf(
6030 value: T,
6031 isSortedOrFromIndex?: boolean | number,
6032 ): _ChainSingle<number>;
6033
6034 /**
6035 * Returns the index of the last occurrence of `value` in the wrapped
6036 * list, or -1 if `value` is not present. Pass `fromIndex` to start
6037 * your search at a given index.
6038 * @param value The value to search for within the wrapped list.
6039 * @param fromIndex The starting index for the search, optional.
6040 * @returns A chain wrapper around the index of the last occurrence of
6041 * `value` within the wrapped list or -1 if `value` is not found.
6042 */
6043 lastIndexOf(
6044 value: T,
6045 fromIndex?: number,
6046 ): _ChainSingle<number>;
6047
6048 /**
6049 * Returns the first index of an element in the wrapped list where the
6050 * `iteratee` truth test passes, otherwise returns -1.
6051 * @param iteratee The truth test to apply.
6052 * @param context `this` object in `iteratee`, optional.
6053 * @returns A chain wrapper around the index of the first element in
6054 * the wrapped list where the truth test passes or -1 if no elements
6055 * pass.
6056 */
6057 findIndex(
6058 iteratee?: Iteratee<V, boolean>,
6059 context?: any,
6060 ): _ChainSingle<number>;
6061
6062 /**
6063 * Returns the last index of an element in the wrapped list where the
6064 * `iteratee` truth test passes, otherwise returns -1.
6065 * @param iteratee The truth test to apply.
6066 * @param context `this` object in `iteratee`, optional.
6067 * @returns A chain wrapper around the index of the last element in the
6068 * wrapped list where the truth test passes or -1 if no elements pass.
6069 */
6070 findLastIndex(
6071 iteratee?: Iteratee<V, boolean>,
6072 context?: any,
6073 ): _ChainSingle<number>;
6074
6075 /**
6076 * Uses a binary search to determine the lowest index at which the
6077 * value should be inserted into the wrapped list in order to maintain
6078 * the wrapped list's sorted order. If an iteratee is provided, it
6079 * will be used to compute the sort ranking of each value, including
6080 * the value you pass.
6081 * @param value The value to determine an insert index for to mainain
6082 * the sorting in the wrapped list.
6083 * @param iteratee Iteratee to compute the sort ranking of each element
6084 * including `value`, optional.
6085 * @param context `this` object in `iteratee`, optional.
6086 * @returns A chain wrapper around the index where `value` should be
6087 * inserted into the wrapped list.
6088 */
6089 sortedIndex(
6090 value: T,
6091 iteratee?: Iteratee<V | undefined, any>,
6092 context?: any,
6093 ): _ChainSingle<number>;
6094
6095 /**
6096 * A function to create flexibly-numbered lists of integers, handy for
6097 * `each` and `map` loops. Returns a list of integers from
6098 * the wrapped value (inclusive) to `stop` (exclusive), incremented
6099 * (or decremented) by `step`. Note that ranges that `stop` before they
6100 * `start` are considered to be zero-length instead of negative - if
6101 * you'd like a negative range, use a negative `step`.
6102 *
6103 * If `stop` is not specified, the wrapped value will be the number to
6104 * stop at and the default start of 0 will be used.
6105 * @param stop The number to stop at.
6106 * @param step The number to count up by each iteration, optional,
6107 * default = 1.
6108 * @returns A chain wrapper around an array of numbers from start to
6109 * `stop` with increments of `step`.
6110 */
6111 range(stop?: number, step?: number): _Chain<number>;
6112
6113 /**
6114 * Chunks the wrapped list into multiple arrays, each containing
6115 * `length` or fewer items.
6116 * @param length The maximum size of the chunks.
6117 * @returns A chain wrapper around the contents of the wrapped list in
6118 * chunks no greater than `length` in size.
6119 */
6120 chunk(length: number): _Chain<T[]>;
6121
6122 /*************
6123 * Functions *
6124 *************/
6125
6126 /**
6127 * Wrapped type `Function`.
6128 * @see _.bind
6129 */
6130 bind(object: any, ...args: any[]): _Chain<T>;
6131
6132 /**
6133 * Wrapped type `object`.
6134 * @see _.bindAll
6135 */
6136 bindAll(...methodNames: string[]): _Chain<T>;
6137
6138 /**
6139 * Wrapped type `Function`.
6140 * @see _.partial
6141 */
6142 partial(...args: any[]): _Chain<T>;
6143
6144 /**
6145 * Wrapped type `Function`.
6146 * @see _.memoize
6147 */
6148 memoize(hashFn?: (n: any) => string): _Chain<T>;
6149
6150 /**
6151 * Wrapped type `Function`.
6152 * @see _.defer
6153 */
6154 defer(...args: any[]): _Chain<T>;
6155
6156 /**
6157 * Wrapped type `Function`.
6158 * @see _.delay
6159 */
6160 delay(wait: number, ...args: any[]): _Chain<T>;
6161
6162 /**
6163 * @see _.delay
6164 */
6165 delay(...args: any[]): _Chain<T>;
6166
6167 /**
6168 * Wrapped type `Function`.
6169 * @see _.throttle
6170 */
6171 throttle(wait: number, options?: _.ThrottleSettings): _Chain<T>;
6172
6173 /**
6174 * Wrapped type `Function`.
6175 * @see _.debounce
6176 */
6177 debounce(wait: number, immediate?: boolean): _Chain<T>;
6178
6179 /**
6180 * Wrapped type `Function`.
6181 * @see _.once
6182 */
6183 once(): _Chain<T>;
6184
6185 /**
6186 * Wrapped type `Function`.
6187 * @see _.once
6188 */
6189 restArgs(startIndex?: number): _Chain<T>;
6190
6191 /**
6192 * Wrapped type `number`.
6193 * @see _.after
6194 */
6195 after(func: Function): _Chain<T>;
6196
6197 /**
6198 * Wrapped type `number`.
6199 * @see _.before
6200 */
6201 before(fn: Function): _Chain<T>;
6202
6203 /**
6204 * Wrapped type `Function`.
6205 * @see _.wrap
6206 */
6207 wrap(wrapper: Function): () => _Chain<T>;
6208
6209 /**
6210 * Wrapped type `Function`.
6211 * @see _.negate
6212 */
6213 negate(): _Chain<T>;
6214
6215 /**
6216 * Wrapped type `Function[]`.
6217 * @see _.compose
6218 */
6219 compose(...functions: Function[]): _Chain<T>;
6220
6221 /***********
6222 * Objects *
6223 ***********/
6224
6225 /**
6226 * Wrapped type `object`.
6227 * @see _.keys
6228 */
6229 keys(): _Chain<string>;
6230
6231 /**
6232 * Wrapped type `object`.
6233 * @see _.allKeys
6234 */
6235 allKeys(): _Chain<string>;
6236
6237 /**
6238 * Wrapped type `object`.
6239 * @see _.values
6240 */
6241 values(): _Chain<any>;
6242
6243 /**
6244 * Like map, but for objects. Transform the value of each property in
6245 * turn.
6246 * @param iteratee The iteratee to use to transform property values.
6247 * @param context `this` object in `iteratee`, optional.
6248 * @returns A chain wrapper around a new object with all of the wrapped
6249 * object's property values transformed through `iteratee`.
6250 */
6251 mapObject<I extends Iteratee<V, any, TypeOfCollection<V, any>>>(
6252 iteratee: I,
6253 context?: any,
6254 ): _Chain<IterateeResult<I, TypeOfCollection<V, any>>, { [K in keyof V]: IterateeResult<I, V[K]> }>;
6255
6256 /**
6257 * Convert the wrapped object into a list of [key, value] pairs. The
6258 * opposite of the single-argument signature of `_.object`.
6259 * @returns A chain wrapper around the list of [key, value] pairs from
6260 * the wrapped object.
6261 */
6262 pairs(): _Chain<[Extract<keyof V, string>, TypeOfCollection<V, any>]>;
6263
6264 /**
6265 * Wrapped type `object`.
6266 * @see _.invert
6267 */
6268 invert(): _Chain<T>;
6269
6270 /**
6271 * Wrapped type `object`.
6272 * @see _.functions
6273 */
6274 functions(): _Chain<T>;
6275
6276 /**
6277 * @see _.functions
6278 */
6279 methods(): _Chain<T>;
6280
6281 /**
6282 * Wrapped type `object`.
6283 * @see _.extend
6284 */
6285 extend(...sources: any[]): _Chain<T>;
6286
6287 /**
6288 * Similar to `findIndex` but for keys in objects. Returns the key
6289 * where the `iteratee` truth test passes or undefined.
6290 * @param iteratee The truth test to apply.
6291 * @param context `this` object in `iteratee`, optional.
6292 * @returns The first element in the wrapped object that passes the
6293 * truth test or undefined if no elements pass.
6294 */
6295 findKey(
6296 iteratee?: Iteratee<V, boolean, TypeOfCollection<V, any>>,
6297 context?: any,
6298 ): _ChainSingle<Extract<keyof V, string> | undefined>;
6299
6300 /**
6301 * Return a copy of the wrapped object that is filtered to only have
6302 * values for the allowed keys (or array of keys).
6303 * @param keys The keys to keep on the wrapped object.
6304 * @returns A chain wrapper around a copy of the wrapped object with
6305 * only the `keys` properties.
6306 */
6307 pick<K extends string>(...keys: Array<K | K[]>): _ChainSingle<_Pick<V, K>>;
6308
6309 /**
6310 * Return a copy of the wrapped object that is filtered to only have
6311 * values for the keys selected by a truth test.
6312 * @param iterator A truth test that selects the keys to keep on the
6313 * wrapped object.
6314 * @returns A chain wrapper around a copy of the wrapped object with
6315 * only the keys selected by `iterator`.
6316 */
6317 pick(
6318 iterator: ObjectIterator<TypeOfDictionary<V, any>, boolean, V>,
6319 ): _ChainSingle<Partial<V>>;
6320
6321 /**
6322 * Return a copy of the wrapped object that is filtered to omit the
6323 * disallowed keys (or array of keys).
6324 * @param keys The keys to omit from the wrapped object.
6325 * @returns A chain wrapper around a copy of the wrapped object without
6326 * the `keys` properties.
6327 */
6328 omit<K extends string>(...keys: Array<K | K[]>): _ChainSingle<_Omit<V, K>>;
6329
6330 /**
6331 * Return a copy of the wrapped object that is filtered to not have
6332 * values for the keys selected by a truth test.
6333 * @param iterator A truth test that selects the keys to omit from the
6334 * wrapped object.
6335 * @returns A chain wrapper around a copy of the wrapped object without
6336 * the keys selected by `iterator`.
6337 */
6338 omit(
6339 iterator: ObjectIterator<TypeOfDictionary<V, any>, boolean, V>,
6340 ): _ChainSingle<Partial<V>>;
6341
6342 /**
6343 * Wrapped type `object`.
6344 * @see _.defaults
6345 */
6346 defaults(...defaults: any[]): _Chain<T>;
6347
6348 /**
6349 * Wrapped type `any`.
6350 * @see _.create
6351 */
6352 create(props?: object): _Chain<T>;
6353
6354 /**
6355 * Wrapped type `any[]`.
6356 * @see _.clone
6357 */
6358 clone(): _Chain<T>;
6359
6360 /**
6361 * Wrapped type `object`.
6362 * @see _.tap
6363 */
6364 tap(interceptor: (...as: any[]) => any): _Chain<T, V>;
6365
6366 /**
6367 * Wrapped type `object`.
6368 * @see _.has
6369 */
6370 has(key: string): _Chain<T>;
6371
6372 /**
6373 * Wrapped type `any[]`.
6374 * @see _.matches
6375 */
6376 matches(): _Chain<T>;
6377
6378 /**
6379 * Wrapped type `any[]`.
6380 * @see _.matcher
6381 */
6382 matcher(): _Chain<T>;
6383
6384 /**
6385 * Wrapped type `any`.
6386 * @see _.get
6387 */
6388 get(
6389 path: string,
6390 ): _Chain<TypeOfCollection<V> | undefined, T | undefined>;
6391 get<U>(
6392 path: string,
6393 defaultValue?: U,
6394 ): _Chain<TypeOfCollection<V> | U, T | U>;
6395 get<P extends Array<string | number>, W = DeepTypeOfCollection<Exclude<V, undefined>, P>, U = undefined>(
6396 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
6397 path: [...P],
6398 defaultValue?: U,
6399 ): _Chain<TypeOfCollection<W> | U, W | U>;
6400
6401 /**
6402 * Wrapped type `string`.
6403 * @see _.property
6404 */
6405 property(): _Chain<T>;
6406
6407 /**
6408 * Wrapped type `object`.
6409 * @see _.propertyOf
6410 */
6411 propertyOf(): _Chain<T>;
6412
6413 /**
6414 * Performs an optimized deep comparison between the wrapped object
6415 * and `other` to determine if they should be considered equal.
6416 * @param other Compare to the wrapped object.
6417 * @returns True if the wrapped object should be considered equal to
6418 * `other`.
6419 * The result will be wrapped in a chain wrapper.
6420 */
6421 isEqual(other: any): _ChainSingle<boolean>;
6422
6423 /**
6424 * Returns true if the wrapped collection contains no values.
6425 * For strings and array-like objects checks if the length property is
6426 * 0.
6427 * @returns True if the wrapped collection has no elements.
6428 * The result will be wrapped in a chain wrapper.
6429 */
6430 isEmpty(): _ChainSingle<boolean>;
6431
6432 /**
6433 * Returns true if the keys and values in `properties` are contained in
6434 * the wrapped object.
6435 * @param properties The properties to check for in the wrapped object.
6436 * @returns True if all keys and values in `properties` are also in the
6437 * wrapped object.
6438 * The result will be wrapped in a chain wrapper.
6439 */
6440 isMatch(properties: any): _ChainSingle<boolean>;
6441
6442 /**
6443 * Returns true if the wrapped object is a DOM element.
6444 * @returns True if the wrapped object is a DOM element, otherwise
6445 * false.
6446 * The result will be wrapped in a chain wrapper.
6447 */
6448 isElement(): _ChainSingle<boolean>;
6449
6450 /**
6451 * Returns true if the wrapped object is an Array.
6452 * @returns True if the wrapped object is an Array, otherwise false.
6453 * The result will be wrapped in a chain wrapper.
6454 */
6455 isArray(): _ChainSingle<boolean>;
6456
6457 /**
6458 * Returns true if the wrapped object is an ArrayBuffer.
6459 * @returns True if the wrapped object is an ArrayBuffer, otherwise false.
6460 * The result will be wrapped in a chain wrapper.
6461 */
6462 isArrayBuffer(): _ChainSingle<boolean>;
6463
6464 /**
6465 * Returns true if the wrapped object is a DataView.
6466 * @returns True if the wrapped object is a DataView, otherwise false.
6467 * The result will be wrapped in a chain wrapper.
6468 */
6469 isDataView(): _ChainSingle<boolean>;
6470
6471 /**
6472 * Returns true if the wrapped object is a TypedArray.
6473 * @returns True if the wrapped object is a TypedArray, otherwise false.
6474 * The result will be wrapped in a chain wrapper.
6475 */
6476 isTypedArray(): _ChainSingle<boolean>;
6477
6478 /**
6479 * Returns true if the wrapped object is a Symbol.
6480 * @returns True if the wrapped object is a Symbol, otherwise false.
6481 * The result will be wrapped in a chain wrapper.
6482 */
6483 isSymbol(): _ChainSingle<boolean>;
6484
6485 /**
6486 * Returns true if the wrapped object is an Object. Note that
6487 * JavaScript arrays and functions are objects, while (normal) strings
6488 * and numbers are not.
6489 * @returns True if the wrapped object is an Object, otherwise false.
6490 * The result will be wrapped in a chain wrapper.
6491 */
6492 isObject(): _ChainSingle<boolean>;
6493
6494 /**
6495 * Returns true if the wrapped object is an Arguments object.
6496 * @returns True if the wrapped object is an Arguments object,
6497 * otherwise false.
6498 * The result will be wrapped in a chain wrapper.
6499 */
6500 isArguments(): _ChainSingle<boolean>;
6501
6502 /**
6503 * Returns true if the wrapped object is a Function.
6504 * @returns True if the wrapped object is a Function, otherwise false.
6505 * The result will be wrapped in a chain wrapper.
6506 */
6507 isFunction(): _ChainSingle<boolean>;
6508
6509 /**
6510 * Returns true if the wrapped object is a Error.
6511 * @returns True if the wrapped object is a Error, otherwise false.
6512 * The result will be wrapped in a chain wrapper.
6513 */
6514 isError(): _ChainSingle<boolean>;
6515
6516 /**
6517 * Returns true if the wrapped object is a String.
6518 * @returns True if the wrapped object is a String, otherwise false.
6519 * The result will be wrapped in a chain wrapper.
6520 */
6521 isString(): _ChainSingle<boolean>;
6522
6523 /**
6524 * Returns true if the wrapped object is a Number (including NaN).
6525 * @returns True if the wrapped object is a Number, otherwise false.
6526 * The result will be wrapped in a chain wrapper.
6527 */
6528 isNumber(): _ChainSingle<boolean>;
6529
6530 /**
6531 * Returns true if the wrapped object is a finite Number.
6532 * @returns True if the wrapped object is a finite Number.
6533 * The result will be wrapped in a chain wrapper.
6534 */
6535 isFinite(): _ChainSingle<boolean>;
6536
6537 /**
6538 * Returns true if the wrapped object is a Boolean.
6539 * @returns True if the wrapped object is a Boolean, otherwise false.
6540 * The result will be wrapped in a chain wrapper.
6541 */
6542 isBoolean(): _ChainSingle<boolean>;
6543
6544 /**
6545 * Returns true if the wrapped object is a Date.
6546 * @returns True if the wrapped object is a Date, otherwise false.
6547 * The result will be wrapped in a chain wrapper.
6548 */
6549 isDate(): _ChainSingle<boolean>;
6550
6551 /**
6552 * Returns true if the wrapped object is a RegExp.
6553 * @returns True if the wrapped object is a RegExp, otherwise false.
6554 * The result will be wrapped in a chain wrapper.
6555 */
6556 isRegExp(): _ChainSingle<boolean>;
6557
6558 /**
6559 * Returns true if the wrapped object is NaN.
6560 * Note: this is not the same as the native isNaN function,
6561 * which will also return true if the variable is undefined.
6562 * @returns True if the wrapped object is NaN, otherwise false.
6563 * The result will be wrapped in a chain wrapper.
6564 */
6565 isNaN(): _ChainSingle<boolean>;
6566
6567 /**
6568 * Returns true if the wrapped object is null.
6569 * @returns True if the wrapped object is null, otherwise false.
6570 * The result will be wrapped in a chain wrapper.
6571 */
6572 isNull(): _ChainSingle<boolean>;
6573
6574 /**
6575 * Returns true if the wrapped object is undefined.
6576 * @returns True if the wrapped object is undefined, otherwise false.
6577 * The result will be wrapped in a chain wrapper.
6578 */
6579 isUndefined(): _ChainSingle<boolean>;
6580
6581 /**
6582 * Returns true if the wrapped object is a Set.
6583 * @returns True if the wrapped object is a Set, otherwise false.
6584 * The result will be wrapped in a chain wrapper.
6585 */
6586 isSet(): _ChainSingle<boolean>;
6587
6588 /**
6589 * Returns true if the wrapped object is a WeakSet.
6590 * @returns True if the wrapped object is a WeakSet, otherwise false.
6591 * The result will be wrapped in a chain wrapper.
6592 */
6593 isWeakSet(): _ChainSingle<boolean>;
6594
6595 /**
6596 * Returns true if the wrapped object is a Map.
6597 * @returns True if the wrapped object is a Map, otherwise false.
6598 * The result will be wrapped in a chain wrapper.
6599 */
6600 isMap(): _ChainSingle<boolean>;
6601
6602 /**
6603 * Returns true if the wrapped object is a WeakMap.
6604 * @returns True if the wrapped object is a WeakMap, otherwise false.
6605 * The result will be wrapped in a chain wrapper.
6606 */
6607 isWeakMap(): _ChainSingle<boolean>;
6608
6609 /**
6610 * Ensures that path is an array.
6611 * @param path
6612 * 1. If path is a string, it is wrapped in a single-element array;
6613 * 2. if it is an array already, it is returned unmodified.
6614 */
6615 toPath(): _ChainSingle<
6616 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
6617 V extends ReadonlyArray<string | number> ? V
6618 // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
6619 : V extends string | number ? [V]
6620 : never
6621 >;
6622
6623 /***********
6624 * Utility *
6625 ***********/
6626
6627 /**
6628 * Wrapped type `any`.
6629 * @see _.identity
6630 */
6631 identity(): _Chain<T>;
6632
6633 /**
6634 * Wrapped type `any`.
6635 * @see _.constant
6636 */
6637 constant(): _Chain<T>;
6638
6639 /**
6640 * Wrapped type `any`.
6641 * @see _.noop
6642 */
6643 noop(): _Chain<T>;
6644
6645 /**
6646 * Wrapped type `number`.
6647 * @see _.times
6648 */
6649 times<TResult>(iterator: (n: number) => TResult, context?: any): _Chain<T>;
6650
6651 /**
6652 * Wrapped type `number`.
6653 * @see _.random
6654 */
6655 random(): _Chain<T>;
6656 /**
6657 * Wrapped type `number`.
6658 * @see _.random
6659 */
6660 random(max: number): _Chain<T>;
6661
6662 /**
6663 * Wrapped type `object`.
6664 * @see _.mixin
6665 */
6666 mixin(): _Chain<T>;
6667
6668 /**
6669 * Wrapped type `string|Function|Object`.
6670 * @see _.iteratee
6671 */
6672 iteratee(context?: any): _Chain<T>;
6673
6674 /**
6675 * Wrapped type `string`.
6676 * @see _.uniqueId
6677 */
6678 uniqueId(): _Chain<T>;
6679
6680 /**
6681 * Wrapped type `string`.
6682 * @see _.escape
6683 */
6684 escape(): _Chain<T>;
6685
6686 /**
6687 * Wrapped type `string`.
6688 * @see _.unescape
6689 */
6690 unescape(): _Chain<T>;
6691
6692 /**
6693 * Wrapped type `object`.
6694 * @see _.result
6695 */
6696 result(property: string, defaultValue?: any): _Chain<T>;
6697
6698 /**
6699 * Wrapped type `string`.
6700 * @see _.template
6701 */
6702 template(settings?: _.TemplateSettings): _Chain<CompiledTemplate>;
6703
6704 /***************
6705 * Array proxy *
6706 ***************/
6707
6708 /**
6709 * Returns a new array comprised of the array on which it is called
6710 * joined with the array(s) and/or value(s) provided as arguments.
6711 * @param arr Arrays and/or values to concatenate into a new array. See the discussion below for details.
6712 * @return A new array comprised of the array on which it is called
6713 */
6714 concat(...arr: T[][]): _Chain<T>;
6715
6716 /**
6717 * Join all elements of an array into a string.
6718 * @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.
6719 * @return The string conversions of all array elements joined into one string.
6720 */
6721 join(separator?: any): _ChainSingle<T>;
6722
6723 /**
6724 * Removes the last element from an array and returns that element.
6725 * @return Returns the popped element.
6726 */
6727 pop(): _ChainSingle<T>;
6728
6729 /**
6730 * Adds one or more elements to the end of an array and returns the new length of the array.
6731 * @param item The elements to add to the end of the array.
6732 * @return The array with the element added to the end.
6733 */
6734 push(...item: T[]): _Chain<T>;
6735
6736 /**
6737 * Reverses an array in place. The first array element becomes the last and the last becomes the first.
6738 * @return The reversed array.
6739 */
6740 reverse(): _Chain<T>;
6741
6742 /**
6743 * Removes the first element from an array and returns that element. This method changes the length of the array.
6744 * @return The shifted element.
6745 */
6746 shift(): _ChainSingle<T>;
6747
6748 /**
6749 * Returns a shallow copy of a portion of an array into a new array object.
6750 * @param start Zero-based index at which to begin extraction.
6751 * @param end Optional. Zero-based index at which to end extraction. slice extracts up to but not including end.
6752 * @return A shallow copy of a portion of an array into a new array object.
6753 */
6754 slice(start: number, end?: number): _Chain<T>;
6755
6756 /**
6757 * 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.
6758 * @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.
6759 * @return The sorted array.
6760 */
6761 sort(compareFn?: (a: T, b: T) => boolean): _Chain<T>;
6762
6763 /**
6764 * Changes the content of an array by removing existing elements and/or adding new elements.
6765 * @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.
6766 * @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.
6767 * @param items The element to add to the array. If you don't specify any elements, splice will only remove elements from the array.
6768 * @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.
6769 */
6770 splice(index: number, quantity: number, ...items: T[]): _Chain<T>;
6771
6772 /**
6773 * A string representing the specified array and its elements.
6774 * @return A string representing the specified array and its elements.
6775 */
6776 toString(): _ChainSingle<T>;
6777
6778 /**
6779 * Adds one or more elements to the beginning of an array and returns the new length of the array.
6780 * @param items The elements to add to the front of the array.
6781 * @return The array with the element added to the beginning.
6782 */
6783 unshift(...items: T[]): _Chain<T>;
6784
6785 /************
6786 * Chaining *
6787 ************/
6788
6789 /**
6790 * Returns a wrapped object. Calling methods on this object will
6791 * continue to return wrapped objects until value() is used.
6792 * @returns An underscore chain wrapper around the wrapped value.
6793 */
6794 chain(): _Chain<T, V>;
6795
6796 /**
6797 * Extracts the value of the wrapped object.
6798 * @returns The value of the wrapped object.
6799 */
6800 value(): V;
6801 }
6802}
6803
\No newline at end of file