UNPKG

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