PageRenderTime 59ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/typings/globals/underscore/index.d.ts

https://gitlab.com/no15/komnit
TypeScript Typings | 1850 lines | 1038 code | 220 blank | 592 comment | 3 complexity | 01f3314beeb091c69eef10809aaead46 MD5 | raw file
  1. // Generated by typings
  2. // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7aaede33ba523d3c29d6702682b1fbe066a38111/underscore/underscore.d.ts
  3. declare module _ {
  4. /**
  5. * underscore.js _.throttle options.
  6. **/
  7. interface ThrottleSettings {
  8. /**
  9. * If you'd like to disable the leading-edge call, pass this as false.
  10. **/
  11. leading?: boolean;
  12. /**
  13. * If you'd like to disable the execution on the trailing-edge, pass false.
  14. **/
  15. trailing?: boolean;
  16. }
  17. /**
  18. * underscore.js template settings, set templateSettings or pass as an argument
  19. * to 'template()' to override defaults.
  20. **/
  21. interface TemplateSettings {
  22. /**
  23. * Default value is '/<%([\s\S]+?)%>/g'.
  24. **/
  25. evaluate?: RegExp;
  26. /**
  27. * Default value is '/<%=([\s\S]+?)%>/g'.
  28. **/
  29. interpolate?: RegExp;
  30. /**
  31. * Default value is '/<%-([\s\S]+?)%>/g'.
  32. **/
  33. escape?: RegExp;
  34. /**
  35. * By default, 'template()' places the values from your data in the local scope via the 'with' statement.
  36. * However, you can specify a single variable name with this setting.
  37. **/
  38. variable?: string;
  39. }
  40. interface Collection<T> { }
  41. // Common interface between Arrays and jQuery objects
  42. interface List<T> extends Collection<T> {
  43. [index: number]: T;
  44. length: number;
  45. }
  46. interface Dictionary<T> extends Collection<T> {
  47. [index: string]: T;
  48. }
  49. interface ListIterator<T, TResult> {
  50. (value: T, index: number, list: List<T>): TResult;
  51. }
  52. interface ObjectIterator<T, TResult> {
  53. (element: T, key: string, list: Dictionary<T>): TResult;
  54. }
  55. interface MemoIterator<T, TResult> {
  56. (prev: TResult, curr: T, index: number, list: List<T>): TResult;
  57. }
  58. interface MemoObjectIterator<T, TResult> {
  59. (prev: TResult, curr: T, key: string, list: Dictionary<T>): TResult;
  60. }
  61. }
  62. interface UnderscoreStatic {
  63. /**
  64. * Underscore OOP Wrapper, all Underscore functions that take an object
  65. * as the first parameter can be invoked through this function.
  66. * @param key First argument to Underscore object functions.
  67. **/
  68. <T>(value: _.Dictionary<T>): Underscore<T>;
  69. <T>(value: Array<T>): Underscore<T>;
  70. <T>(value: T): Underscore<T>;
  71. /* *************
  72. * Collections *
  73. ************* */
  74. /**
  75. * Iterates over a list of elements, yielding each in turn to an iterator function. The iterator is
  76. * bound to the context object, if one is passed. Each invocation of iterator is called with three
  77. * arguments: (element, index, list). If list is a JavaScript object, iterator's arguments will be
  78. * (value, key, object). Delegates to the native forEach function if it exists.
  79. * @param list Iterates over this list of elements.
  80. * @param iterator Iterator function for each element `list`.
  81. * @param context 'this' object in `iterator`, optional.
  82. **/
  83. each<T>(
  84. list: _.List<T>,
  85. iterator: _.ListIterator<T, void>,
  86. context?: any): _.List<T>;
  87. /**
  88. * @see _.each
  89. * @param object Iterates over properties of this object.
  90. * @param iterator Iterator function for each property on `object`.
  91. * @param context 'this' object in `iterator`, optional.
  92. **/
  93. each<T>(
  94. object: _.Dictionary<T>,
  95. iterator: _.ObjectIterator<T, void>,
  96. context?: any): _.Dictionary<T>;
  97. /**
  98. * @see _.each
  99. **/
  100. forEach<T>(
  101. list: _.List<T>,
  102. iterator: _.ListIterator<T, void>,
  103. context?: any): _.List<T>;
  104. /**
  105. * @see _.each
  106. **/
  107. forEach<T>(
  108. object: _.Dictionary<T>,
  109. iterator: _.ObjectIterator<T, void>,
  110. context?: any): _.Dictionary<T>;
  111. /**
  112. * Produces a new array of values by mapping each value in list through a transformation function
  113. * (iterator). If the native map method exists, it will be used instead. If list is a JavaScript
  114. * object, iterator's arguments will be (value, key, object).
  115. * @param list Maps the elements of this array.
  116. * @param iterator Map iterator function for each element in `list`.
  117. * @param context `this` object in `iterator`, optional.
  118. * @return The mapped array result.
  119. **/
  120. map<T, TResult>(
  121. list: _.List<T>,
  122. iterator: _.ListIterator<T, TResult>,
  123. context?: any): TResult[];
  124. /**
  125. * @see _.map
  126. * @param object Maps the properties of this object.
  127. * @param iterator Map iterator function for each property on `object`.
  128. * @param context `this` object in `iterator`, optional.
  129. * @return The mapped object result.
  130. **/
  131. map<T, TResult>(
  132. object: _.Dictionary<T>,
  133. iterator: _.ObjectIterator<T, TResult>,
  134. context?: any): TResult[];
  135. /**
  136. * @see _.map
  137. **/
  138. collect<T, TResult>(
  139. list: _.List<T>,
  140. iterator: _.ListIterator<T, TResult>,
  141. context?: any): TResult[];
  142. /**
  143. * @see _.map
  144. **/
  145. collect<T, TResult>(
  146. object: _.Dictionary<T>,
  147. iterator: _.ObjectIterator<T, TResult>,
  148. context?: any): TResult[];
  149. /**
  150. * Also known as inject and foldl, reduce boils down a list of values into a single value.
  151. * Memo is the initial state of the reduction, and each successive step of it should be
  152. * returned by iterator. The iterator is passed four arguments: the memo, then the value
  153. * and index (or key) of the iteration, and finally a reference to the entire list.
  154. * @param list Reduces the elements of this array.
  155. * @param iterator Reduce iterator function for each element in `list`.
  156. * @param memo Initial reduce state.
  157. * @param context `this` object in `iterator`, optional.
  158. * @return Reduced object result.
  159. **/
  160. reduce<T, TResult>(
  161. list: _.Collection<T>,
  162. iterator: _.MemoIterator<T, TResult>,
  163. memo?: TResult,
  164. context?: any): TResult;
  165. reduce<T, TResult>(
  166. list: _.Dictionary<T>,
  167. iterator: _.MemoObjectIterator<T, TResult>,
  168. memo?: TResult,
  169. context?: any): TResult;
  170. /**
  171. * @see _.reduce
  172. **/
  173. inject<T, TResult>(
  174. list: _.Collection<T>,
  175. iterator: _.MemoIterator<T, TResult>,
  176. memo?: TResult,
  177. context?: any): TResult;
  178. /**
  179. * @see _.reduce
  180. **/
  181. foldl<T, TResult>(
  182. list: _.Collection<T>,
  183. iterator: _.MemoIterator<T, TResult>,
  184. memo?: TResult,
  185. context?: any): TResult;
  186. /**
  187. * The right-associative version of reduce. Delegates to the JavaScript 1.8 version of
  188. * reduceRight, if it exists. `foldr` is not as useful in JavaScript as it would be in a
  189. * language with lazy evaluation.
  190. * @param list Reduces the elements of this array.
  191. * @param iterator Reduce iterator function for each element in `list`.
  192. * @param memo Initial reduce state.
  193. * @param context `this` object in `iterator`, optional.
  194. * @return Reduced object result.
  195. **/
  196. reduceRight<T, TResult>(
  197. list: _.Collection<T>,
  198. iterator: _.MemoIterator<T, TResult>,
  199. memo?: TResult,
  200. context?: any): TResult;
  201. /**
  202. * @see _.reduceRight
  203. **/
  204. foldr<T, TResult>(
  205. list: _.Collection<T>,
  206. iterator: _.MemoIterator<T, TResult>,
  207. memo?: TResult,
  208. context?: any): TResult;
  209. /**
  210. * Looks through each value in the list, returning the first one that passes a truth
  211. * test (iterator). The function returns as soon as it finds an acceptable element,
  212. * and doesn't traverse the entire list.
  213. * @param list Searches for a value in this list.
  214. * @param iterator Search iterator function for each element in `list`.
  215. * @param context `this` object in `iterator`, optional.
  216. * @return The first acceptable found element in `list`, if nothing is found undefined/null is returned.
  217. **/
  218. find<T>(
  219. list: _.List<T>,
  220. iterator: _.ListIterator<T, boolean>,
  221. context?: any): T;
  222. /**
  223. * @see _.find
  224. **/
  225. find<T>(
  226. object: _.Dictionary<T>,
  227. iterator: _.ObjectIterator<T, boolean>,
  228. context?: any): T;
  229. /**
  230. * @see _.find
  231. **/
  232. find<T, U extends {}>(
  233. object: _.List<T>|_.Dictionary<T>,
  234. iterator: U): T;
  235. /**
  236. * @see _.find
  237. **/
  238. find<T>(
  239. object: _.List<T>|_.Dictionary<T>,
  240. iterator: string): T;
  241. /**
  242. * @see _.find
  243. **/
  244. detect<T>(
  245. list: _.List<T>,
  246. iterator: _.ListIterator<T, boolean>,
  247. context?: any): T;
  248. /**
  249. * @see _.find
  250. **/
  251. detect<T>(
  252. object: _.Dictionary<T>,
  253. iterator: _.ObjectIterator<T, boolean>,
  254. context?: any): T;
  255. /**
  256. * @see _.find
  257. **/
  258. detect<T, U extends {}>(
  259. object: _.List<T>|_.Dictionary<T>,
  260. iterator: U): T;
  261. /**
  262. * @see _.find
  263. **/
  264. detect<T>(
  265. object: _.List<T>|_.Dictionary<T>,
  266. iterator: string): T;
  267. /**
  268. * Looks through each value in the list, returning an array of all the values that pass a truth
  269. * test (iterator). Delegates to the native filter method, if it exists.
  270. * @param list Filter elements out of this list.
  271. * @param iterator Filter iterator function for each element in `list`.
  272. * @param context `this` object in `iterator`, optional.
  273. * @return The filtered list of elements.
  274. **/
  275. filter<T>(
  276. list: _.List<T>,
  277. iterator: _.ListIterator<T, boolean>,
  278. context?: any): T[];
  279. /**
  280. * @see _.filter
  281. **/
  282. filter<T>(
  283. object: _.Dictionary<T>,
  284. iterator: _.ObjectIterator<T, boolean>,
  285. context?: any): T[];
  286. /**
  287. * @see _.filter
  288. **/
  289. select<T>(
  290. list: _.List<T>,
  291. iterator: _.ListIterator<T, boolean>,
  292. context?: any): T[];
  293. /**
  294. * @see _.filter
  295. **/
  296. select<T>(
  297. object: _.Dictionary<T>,
  298. iterator: _.ObjectIterator<T, boolean>,
  299. context?: any): T[];
  300. /**
  301. * Looks through each value in the list, returning an array of all the values that contain all
  302. * of the key-value pairs listed in properties.
  303. * @param list List to match elements again `properties`.
  304. * @param properties The properties to check for on each element within `list`.
  305. * @return The elements within `list` that contain the required `properties`.
  306. **/
  307. where<T, U extends {}>(
  308. list: _.List<T>,
  309. properties: U): T[];
  310. /**
  311. * Looks through the list and returns the first value that matches all of the key-value pairs listed in properties.
  312. * @param list Search through this list's elements for the first object with all `properties`.
  313. * @param properties Properties to look for on the elements within `list`.
  314. * @return The first element in `list` that has all `properties`.
  315. **/
  316. findWhere<T, U extends {}>(
  317. list: _.List<T>,
  318. properties: U): T;
  319. /**
  320. * Returns the values in list without the elements that the truth test (iterator) passes.
  321. * The opposite of filter.
  322. * Return all the elements for which a truth test fails.
  323. * @param list Reject elements within this list.
  324. * @param iterator Reject iterator function for each element in `list`.
  325. * @param context `this` object in `iterator`, optional.
  326. * @return The rejected list of elements.
  327. **/
  328. reject<T>(
  329. list: _.List<T>,
  330. iterator: _.ListIterator<T, boolean>,
  331. context?: any): T[];
  332. /**
  333. * @see _.reject
  334. **/
  335. reject<T>(
  336. object: _.Dictionary<T>,
  337. iterator: _.ObjectIterator<T, boolean>,
  338. context?: any): T[];
  339. /**
  340. * Returns true if all of the values in the list pass the iterator truth test. Delegates to the
  341. * native method every, if present.
  342. * @param list Truth test against all elements within this list.
  343. * @param iterator Trust test iterator function for each element in `list`.
  344. * @param context `this` object in `iterator`, optional.
  345. * @return True if all elements passed the truth test, otherwise false.
  346. **/
  347. every<T>(
  348. list: _.List<T>,
  349. iterator?: _.ListIterator<T, boolean>,
  350. context?: any): boolean;
  351. /**
  352. * @see _.every
  353. **/
  354. every<T>(
  355. list: _.Dictionary<T>,
  356. iterator?: _.ObjectIterator<T, boolean>,
  357. context?: any): boolean;
  358. /**
  359. * @see _.every
  360. **/
  361. all<T>(
  362. list: _.List<T>,
  363. iterator?: _.ListIterator<T, boolean>,
  364. context?: any): boolean;
  365. /**
  366. * @see _.every
  367. **/
  368. all<T>(
  369. list: _.Dictionary<T>,
  370. iterator?: _.ObjectIterator<T, boolean>,
  371. context?: any): boolean;
  372. /**
  373. * Returns true if any of the values in the list pass the iterator truth test. Short-circuits and
  374. * stops traversing the list if a true element is found. Delegates to the native method some, if present.
  375. * @param list Truth test against all elements within this list.
  376. * @param iterator Trust test iterator function for each element in `list`.
  377. * @param context `this` object in `iterator`, optional.
  378. * @return True if any elements passed the truth test, otherwise false.
  379. **/
  380. some<T>(
  381. list: _.List<T>,
  382. iterator?: _.ListIterator<T, boolean>,
  383. context?: any): boolean;
  384. /**
  385. * @see _.some
  386. **/
  387. some<T>(
  388. object: _.Dictionary<T>,
  389. iterator?: _.ObjectIterator<T, boolean>,
  390. context?: any): boolean;
  391. /**
  392. * @see _.some
  393. **/
  394. any<T>(
  395. list: _.List<T>,
  396. iterator?: _.ListIterator<T, boolean>,
  397. context?: any): boolean;
  398. /**
  399. * @see _.some
  400. **/
  401. any<T>(
  402. object: _.Dictionary<T>,
  403. iterator?: _.ObjectIterator<T, boolean>,
  404. context?: any): boolean;
  405. /**
  406. * Returns true if the value is present in the list. Uses indexOf internally,
  407. * if list is an Array.
  408. * @param list Checks each element to see if `value` is present.
  409. * @param value The value to check for within `list`.
  410. * @return True if `value` is present in `list`, otherwise false.
  411. **/
  412. contains<T>(
  413. list: _.List<T>,
  414. value: T): boolean;
  415. /**
  416. * @see _.contains
  417. **/
  418. contains<T>(
  419. object: _.Dictionary<T>,
  420. value: T): boolean;
  421. /**
  422. * @see _.contains
  423. **/
  424. include<T>(
  425. list: _.Collection<T>,
  426. value: T): boolean;
  427. /**
  428. * @see _.contains
  429. **/
  430. include<T>(
  431. object: _.Dictionary<T>,
  432. value: T): boolean;
  433. /**
  434. * Calls the method named by methodName on each value in the list. Any extra arguments passed to
  435. * invoke will be forwarded on to the method invocation.
  436. * @param list The element's in this list will each have the method `methodName` invoked.
  437. * @param methodName The method's name to call on each element within `list`.
  438. * @param arguments Additional arguments to pass to the method `methodName`.
  439. **/
  440. invoke<T extends {}>(
  441. list: _.List<T>,
  442. methodName: string,
  443. ...arguments: any[]): any;
  444. /**
  445. * A convenient version of what is perhaps the most common use-case for map: extracting a list of
  446. * property values.
  447. * @param list The list to pluck elements out of that have the property `propertyName`.
  448. * @param propertyName The property to look for on each element within `list`.
  449. * @return The list of elements within `list` that have the property `propertyName`.
  450. **/
  451. pluck<T extends {}>(
  452. list: _.List<T>,
  453. propertyName: string): any[];
  454. /**
  455. * Returns the maximum value in list.
  456. * @param list Finds the maximum value in this list.
  457. * @return Maximum value in `list`.
  458. **/
  459. max(list: _.List<number>): number;
  460. /**
  461. * @see _.max
  462. */
  463. max(object: _.Dictionary<number>): number;
  464. /**
  465. * Returns the maximum value in list. If iterator is passed, it will be used on each value to generate
  466. * the criterion by which the value is ranked.
  467. * @param list Finds the maximum value in this list.
  468. * @param iterator Compares each element in `list` to find the maximum value.
  469. * @param context `this` object in `iterator`, optional.
  470. * @return The maximum element within `list`.
  471. **/
  472. max<T>(
  473. list: _.List<T>,
  474. iterator?: _.ListIterator<T, any>,
  475. context?: any): T;
  476. /**
  477. * @see _.max
  478. */
  479. max<T>(
  480. list: _.Dictionary<T>,
  481. iterator?: _.ObjectIterator<T, any>,
  482. context?: any): T;
  483. /**
  484. * Returns the minimum value in list.
  485. * @param list Finds the minimum value in this list.
  486. * @return Minimum value in `list`.
  487. **/
  488. min(list: _.List<number>): number;
  489. /**
  490. * @see _.min
  491. */
  492. min(o: _.Dictionary<number>): number;
  493. /**
  494. * Returns the minimum value in list. If iterator is passed, it will be used on each value to generate
  495. * the criterion by which the value is ranked.
  496. * @param list Finds the minimum value in this list.
  497. * @param iterator Compares each element in `list` to find the minimum value.
  498. * @param context `this` object in `iterator`, optional.
  499. * @return The minimum element within `list`.
  500. **/
  501. min<T>(
  502. list: _.List<T>,
  503. iterator?: _.ListIterator<T, any>,
  504. context?: any): T;
  505. /**
  506. * @see _.min
  507. */
  508. min<T>(
  509. list: _.Dictionary<T>,
  510. iterator?: _.ObjectIterator<T, any>,
  511. context?: any): T;
  512. /**
  513. * Returns a sorted copy of list, ranked in ascending order by the results of running each value
  514. * through iterator. Iterator may also be the string name of the property to sort by (eg. length).
  515. * @param list Sorts this list.
  516. * @param iterator Sort iterator for each element within `list`.
  517. * @param context `this` object in `iterator`, optional.
  518. * @return A sorted copy of `list`.
  519. **/
  520. sortBy<T, TSort>(
  521. list: _.List<T>,
  522. iterator?: _.ListIterator<T, TSort>,
  523. context?: any): T[];
  524. /**
  525. * @see _.sortBy
  526. * @param iterator Sort iterator for each element within `list`.
  527. **/
  528. sortBy<T>(
  529. list: _.List<T>,
  530. iterator: string,
  531. context?: any): T[];
  532. /**
  533. * Splits a collection into sets, grouped by the result of running each value through iterator.
  534. * If iterator is a string instead of a function, groups by the property named by iterator on
  535. * each of the values.
  536. * @param list Groups this list.
  537. * @param iterator Group iterator for each element within `list`, return the key to group the element by.
  538. * @param context `this` object in `iterator`, optional.
  539. * @return An object with the group names as properties where each property contains the grouped elements from `list`.
  540. **/
  541. groupBy<T>(
  542. list: _.List<T>,
  543. iterator?: _.ListIterator<T, any>,
  544. context?: any): _.Dictionary<T[]>;
  545. /**
  546. * @see _.groupBy
  547. * @param iterator Property on each object to group them by.
  548. **/
  549. groupBy<T>(
  550. list: _.List<T>,
  551. iterator: string,
  552. context?: any): _.Dictionary<T[]>;
  553. /**
  554. * Given a `list`, and an `iterator` function that returns a key for each element in the list (or a property name),
  555. * returns an object with an index of each item. Just like _.groupBy, but for when you know your keys are unique.
  556. **/
  557. indexBy<T>(
  558. list: _.List<T>,
  559. iterator: _.ListIterator<T, any>,
  560. context?: any): _.Dictionary<T>;
  561. /**
  562. * @see _.indexBy
  563. * @param iterator Property on each object to index them by.
  564. **/
  565. indexBy<T>(
  566. list: _.List<T>,
  567. iterator: string,
  568. context?: any): _.Dictionary<T>;
  569. /**
  570. * Sorts a list into groups and returns a count for the number of objects in each group. Similar
  571. * to groupBy, but instead of returning a list of values, returns a count for the number of values
  572. * in that group.
  573. * @param list Group elements in this list and then count the number of elements in each group.
  574. * @param iterator Group iterator for each element within `list`, return the key to group the element by.
  575. * @param context `this` object in `iterator`, optional.
  576. * @return An object with the group names as properties where each property contains the number of elements in that group.
  577. **/
  578. countBy<T>(
  579. list: _.List<T>,
  580. iterator?: _.ListIterator<T, any>,
  581. context?: any): _.Dictionary<number>;
  582. /**
  583. * @see _.countBy
  584. * @param iterator Function name
  585. **/
  586. countBy<T>(
  587. list: _.List<T>,
  588. iterator: string,
  589. context?: any): _.Dictionary<number>;
  590. /**
  591. * Returns a shuffled copy of the list, using a version of the Fisher-Yates shuffle.
  592. * @param list List to shuffle.
  593. * @return Shuffled copy of `list`.
  594. **/
  595. shuffle<T>(list: _.Collection<T>): T[];
  596. /**
  597. * Produce a random sample from the `list`. Pass a number to return `n` random elements from the list. Otherwise a single random item will be returned.
  598. * @param list List to sample.
  599. * @return Random sample of `n` elements in `list`.
  600. **/
  601. sample<T>(list: _.Collection<T>, n: number): T[];
  602. /**
  603. * @see _.sample
  604. **/
  605. sample<T>(list: _.Collection<T>): T;
  606. /**
  607. * Converts the list (anything that can be iterated over), into a real Array. Useful for transmuting
  608. * the arguments object.
  609. * @param list object to transform into an array.
  610. * @return `list` as an array.
  611. **/
  612. toArray<T>(list: _.Collection<T>): T[];
  613. /**
  614. * Return the number of values in the list.
  615. * @param list Count the number of values/elements in this list.
  616. * @return Number of values in `list`.
  617. **/
  618. size<T>(list: _.Collection<T>): number;
  619. /**
  620. * Split array into two arrays:
  621. * one whose elements all satisfy predicate and one whose elements all do not satisfy predicate.
  622. * @param array Array to split in two.
  623. * @param iterator Filter iterator function for each element in `array`.
  624. * @param context `this` object in `iterator`, optional.
  625. * @return Array where Array[0] are the elements in `array` that satisfies the predicate, and Array[1] the elements that did not.
  626. **/
  627. partition<T>(
  628. array: Array<T>,
  629. iterator: _.ListIterator<T, boolean>,
  630. context?: any): T[][];
  631. /*********
  632. * Arrays *
  633. **********/
  634. /**
  635. * Returns the first element of an array. Passing n will return the first n elements of the array.
  636. * @param array Retrieves the first element of this array.
  637. * @return Returns the first element of `array`.
  638. **/
  639. first<T>(array: _.List<T>): T;
  640. /**
  641. * @see _.first
  642. * @param n Return more than one element from `array`.
  643. **/
  644. first<T>(
  645. array: _.List<T>,
  646. n: number): T[];
  647. /**
  648. * @see _.first
  649. **/
  650. head<T>(array: _.List<T>): T;
  651. /**
  652. * @see _.first
  653. **/
  654. head<T>(
  655. array: _.List<T>,
  656. n: number): T[];
  657. /**
  658. * @see _.first
  659. **/
  660. take<T>(array: _.List<T>): T;
  661. /**
  662. * @see _.first
  663. **/
  664. take<T>(
  665. array: _.List<T>,
  666. n: number): T[];
  667. /**
  668. * Returns everything but the last entry of the array. Especially useful on the arguments object.
  669. * Pass n to exclude the last n elements from the result.
  670. * @param array Retrieve all elements except the last `n`.
  671. * @param n Leaves this many elements behind, optional.
  672. * @return Returns everything but the last `n` elements of `array`.
  673. **/
  674. initial<T>(
  675. array: _.List<T>,
  676. n?: number): T[];
  677. /**
  678. * Returns the last element of an array. Passing n will return the last n elements of the array.
  679. * @param array Retrieves the last element of this array.
  680. * @return Returns the last element of `array`.
  681. **/
  682. last<T>(array: _.List<T>): T;
  683. /**
  684. * @see _.last
  685. * @param n Return more than one element from `array`.
  686. **/
  687. last<T>(
  688. array: _.List<T>,
  689. n: number): T[];
  690. /**
  691. * Returns the rest of the elements in an array. Pass an index to return the values of the array
  692. * from that index onward.
  693. * @param array The array to retrieve all but the first `index` elements.
  694. * @param n The index to start retrieving elements forward from, optional, default = 1.
  695. * @return Returns the elements of `array` from `index` to the end of `array`.
  696. **/
  697. rest<T>(
  698. array: _.List<T>,
  699. n?: number): T[];
  700. /**
  701. * @see _.rest
  702. **/
  703. tail<T>(
  704. array: _.List<T>,
  705. n?: number): T[];
  706. /**
  707. * @see _.rest
  708. **/
  709. drop<T>(
  710. array: _.List<T>,
  711. n?: number): T[];
  712. /**
  713. * Returns a copy of the array with all falsy values removed. In JavaScript, false, null, 0, "",
  714. * undefined and NaN are all falsy.
  715. * @param array Array to compact.
  716. * @return Copy of `array` without false values.
  717. **/
  718. compact<T>(array: _.List<T>): T[];
  719. /**
  720. * Flattens a nested array (the nesting can be to any depth). If you pass shallow, the array will
  721. * only be flattened a single level.
  722. * @param array The array to flatten.
  723. * @param shallow If true then only flatten one level, optional, default = false.
  724. * @return `array` flattened.
  725. **/
  726. flatten(
  727. array: _.List<any>,
  728. shallow?: boolean): any[];
  729. /**
  730. * Returns a copy of the array with all instances of the values removed.
  731. * @param array The array to remove `values` from.
  732. * @param values The values to remove from `array`.
  733. * @return Copy of `array` without `values`.
  734. **/
  735. without<T>(
  736. array: _.List<T>,
  737. ...values: T[]): T[];
  738. /**
  739. * Computes the union of the passed-in arrays: the list of unique items, in order, that are
  740. * present in one or more of the arrays.
  741. * @param arrays Array of arrays to compute the union of.
  742. * @return The union of elements within `arrays`.
  743. **/
  744. union<T>(...arrays: _.List<T>[]): T[];
  745. /**
  746. * Computes the list of values that are the intersection of all the arrays. Each value in the result
  747. * is present in each of the arrays.
  748. * @param arrays Array of arrays to compute the intersection of.
  749. * @return The intersection of elements within `arrays`.
  750. **/
  751. intersection<T>(...arrays: _.List<T>[]): T[];
  752. /**
  753. * Similar to without, but returns the values from array that are not present in the other arrays.
  754. * @param array Keeps values that are within `others`.
  755. * @param others The values to keep within `array`.
  756. * @return Copy of `array` with only `others` values.
  757. **/
  758. difference<T>(
  759. array: _.List<T>,
  760. ...others: _.List<T>[]): T[];
  761. /**
  762. * Produces a duplicate-free version of the array, using === to test object equality. If you know in
  763. * advance that the array is sorted, passing true for isSorted will run a much faster algorithm. If
  764. * you want to compute unique items based on a transformation, pass an iterator function.
  765. * @param array Array to remove duplicates from.
  766. * @param isSorted True if `array` is already sorted, optional, default = false.
  767. * @param iterator Transform the elements of `array` before comparisons for uniqueness.
  768. * @param context 'this' object in `iterator`, optional.
  769. * @return Copy of `array` where all elements are unique.
  770. **/
  771. uniq<T, TSort>(
  772. array: _.List<T>,
  773. isSorted?: boolean,
  774. iterator?: _.ListIterator<T, TSort>,
  775. context?: any): T[];
  776. /**
  777. * @see _.uniq
  778. **/
  779. uniq<T, TSort>(
  780. array: _.List<T>,
  781. iterator?: _.ListIterator<T, TSort>,
  782. context?: any): T[];
  783. /**
  784. * @see _.uniq
  785. **/
  786. unique<T, TSort>(
  787. array: _.List<T>,
  788. iterator?: _.ListIterator<T, TSort>,
  789. context?: any): T[];
  790. /**
  791. * @see _.uniq
  792. **/
  793. unique<T, TSort>(
  794. array: _.List<T>,
  795. isSorted?: boolean,
  796. iterator?: _.ListIterator<T, TSort>,
  797. context?: any): T[];
  798. /**
  799. * Merges together the values of each of the arrays with the values at the corresponding position.
  800. * Useful when you have separate data sources that are coordinated through matching array indexes.
  801. * If you're working with a matrix of nested arrays, zip.apply can transpose the matrix in a similar fashion.
  802. * @param arrays The arrays to merge/zip.
  803. * @return Zipped version of `arrays`.
  804. **/
  805. zip(...arrays: any[][]): any[][];
  806. /**
  807. * @see _.zip
  808. **/
  809. zip(...arrays: any[]): any[];
  810. /**
  811. * The opposite of zip. Given a number of arrays, returns a series of new arrays, the first
  812. * of which contains all of the first elements in the input arrays, the second of which
  813. * contains all of the second elements, and so on. Use with apply to pass in an array
  814. * of arrays
  815. * @param arrays The arrays to unzip.
  816. * @return Unzipped version of `arrays`.
  817. **/
  818. unzip(...arrays: any[][]): any[][];
  819. /**
  820. * Converts arrays into objects. Pass either a single list of [key, value] pairs, or a
  821. * list of keys, and a list of values.
  822. * @param keys Key array.
  823. * @param values Value array.
  824. * @return An object containing the `keys` as properties and `values` as the property values.
  825. **/
  826. object<TResult extends {}>(
  827. keys: _.List<string>,
  828. values: _.List<any>): TResult;
  829. /**
  830. * Converts arrays into objects. Pass either a single list of [key, value] pairs, or a
  831. * list of keys, and a list of values.
  832. * @param keyValuePairs Array of [key, value] pairs.
  833. * @return An object containing the `keys` as properties and `values` as the property values.
  834. **/
  835. object<TResult extends {}>(...keyValuePairs: any[][]): TResult;
  836. /**
  837. * @see _.object
  838. **/
  839. object<TResult extends {}>(
  840. list: _.List<any>,
  841. values?: any): TResult;
  842. /**
  843. * Returns the index at which value can be found in the array, or -1 if value is not present in the array.
  844. * Uses the native indexOf function unless it's missing. If you're working with a large array, and you know
  845. * that the array is already sorted, pass true for isSorted to use a faster binary search ... or, pass a number
  846. * as the third argument in order to look for the first matching value in the array after the given index.
  847. * @param array The array to search for the index of `value`.
  848. * @param value The value to search for within `array`.
  849. * @param isSorted True if the array is already sorted, optional, default = false.
  850. * @return The index of `value` within `array`.
  851. **/
  852. indexOf<T>(
  853. array: _.List<T>,
  854. value: T,
  855. isSorted?: boolean): number;
  856. /**
  857. * @see _indexof
  858. **/
  859. indexOf<T>(
  860. array: _.List<T>,
  861. value: T,
  862. startFrom: number): number;
  863. /**
  864. * Returns the index of the last occurrence of value in the array, or -1 if value is not present. Uses the
  865. * native lastIndexOf function if possible. Pass fromIndex to start your search at a given index.
  866. * @param array The array to search for the last index of `value`.
  867. * @param value The value to search for within `array`.
  868. * @param from The starting index for the search, optional.
  869. * @return The index of the last occurrence of `value` within `array`.
  870. **/
  871. lastIndexOf<T>(
  872. array: _.List<T>,
  873. value: T,
  874. from?: number): number;
  875. /**
  876. * Returns the first index of an element in `array` where the predicate truth test passes
  877. * @param array The array to search for the index of the first element where the predicate truth test passes.
  878. * @param predicate Predicate function.
  879. * @param context `this` object in `predicate`, optional.
  880. * @return Returns the index of an element in `array` where the predicate truth test passes or -1.`
  881. **/
  882. findIndex<T>(
  883. array: _.List<T>,
  884. predicate: _.ListIterator<T, boolean> | {},
  885. context?: any): number;
  886. /**
  887. * Returns the last index of an element in `array` where the predicate truth test passes
  888. * @param array The array to search for the index of the last element where the predicate truth test passes.
  889. * @param predicate Predicate function.
  890. * @param context `this` object in `predicate`, optional.
  891. * @return Returns the index of an element in `array` where the predicate truth test passes or -1.`
  892. **/
  893. findLastIndex<T>(
  894. array: _.List<T>,
  895. predicate: _.ListIterator<T, boolean> | {},
  896. context?: any): number;
  897. /**
  898. * Uses a binary search to determine the index at which the value should be inserted into the list in order
  899. * to maintain the list's sorted order. If an iterator is passed, it will be used to compute the sort ranking
  900. * of each value, including the value you pass.
  901. * @param list The sorted list.
  902. * @param value The value to determine its index within `list`.
  903. * @param iterator Iterator to compute the sort ranking of each value, optional.
  904. * @return The index where `value` should be inserted into `list`.
  905. **/
  906. sortedIndex<T, TSort>(
  907. list: _.List<T>,
  908. value: T,
  909. iterator?: (x: T) => TSort, context?: any): number;
  910. /**
  911. * A function to create flexibly-numbered lists of integers, handy for each and map loops. start, if omitted,
  912. * defaults to 0; step defaults to 1. Returns a list of integers from start to stop, incremented (or decremented)
  913. * by step, exclusive.
  914. * @param start Start here.
  915. * @param stop Stop here.
  916. * @param step The number to count up by each iteration, optional, default = 1.
  917. * @return Array of numbers from `start` to `stop` with increments of `step`.
  918. **/
  919. range(
  920. start: number,
  921. stop: number,
  922. step?: number): number[];
  923. /**
  924. * @see _.range
  925. * @param stop Stop here.
  926. * @return Array of numbers from 0 to `stop` with increments of 1.
  927. * @note If start is not specified the implementation will never pull the step (step = arguments[2] || 0)
  928. **/
  929. range(stop: number): number[];
  930. /*************
  931. * Functions *
  932. *************/
  933. /**
  934. * Bind a function to an object, meaning that whenever the function is called, the value of this will
  935. * be the object. Optionally, bind arguments to the function to pre-fill them, also known as partial application.
  936. * @param func The function to bind `this` to `object`.
  937. * @param context The `this` pointer whenever `fn` is called.
  938. * @param arguments Additional arguments to pass to `fn` when called.
  939. * @return `fn` with `this` bound to `object`.
  940. **/
  941. bind(
  942. func: Function,
  943. context: any,
  944. ...arguments: any[]): () => any;
  945. /**
  946. * Binds a number of methods on the object, specified by methodNames, to be run in the context of that object
  947. * whenever they are invoked. Very handy for binding functions that are going to be used as event handlers,
  948. * which would otherwise be invoked with a fairly useless this. If no methodNames are provided, all of the
  949. * object's function properties will be bound to it.
  950. * @param object The object to bind the methods `methodName` to.
  951. * @param methodNames The methods to bind to `object`, optional and if not provided all of `object`'s
  952. * methods are bound.
  953. **/
  954. bindAll(
  955. object: any,
  956. ...methodNames: string[]): any;
  957. /**
  958. * Partially apply a function by filling in any number of its arguments, without changing its dynamic this value.
  959. * A close cousin of bind. You may pass _ in your list of arguments to specify an argument that should not be
  960. * pre-filled, but left open to supply at call-time.
  961. * @param fn Function to partially fill in arguments.
  962. * @param arguments The partial arguments.
  963. * @return `fn` with partially filled in arguments.
  964. **/
  965. partial<T1, T2>(
  966. fn: { (p1: T1):T2 },
  967. p1: T1
  968. ): { (): T2 };
  969. partial<T1, T2, T3>(
  970. fn: { (p1: T1, p2: T2):T3 },
  971. p1: T1
  972. ): { (p2: T2): T3 };
  973. partial<T1, T2, T3>(
  974. fn: { (p1: T1, p2: T2):T3 },
  975. p1: T1,
  976. p2: T2
  977. ): { (): T3 };
  978. partial<T1, T2, T3>(
  979. fn: { (p1: T1, p2: T2):T3 },
  980. stub1: UnderscoreStatic,
  981. p2: T2
  982. ): { (p1: T1): T3 };
  983. partial<T1, T2, T3, T4>(
  984. fn: { (p1: T1, p2: T2, p3: T3):T4 },
  985. p1: T1
  986. ): { (p2: T2, p3: T3): T4 };
  987. partial<T1, T2, T3, T4>(
  988. fn: { (p1: T1, p2: T2, p3: T3):T4 },
  989. p1: T1,
  990. p2: T2
  991. ): { (p3: T3): T4 };
  992. partial<T1, T2, T3, T4>(
  993. fn: { (p1: T1, p2: T2, p3: T3):T4 },
  994. stub1: UnderscoreStatic,
  995. p2: T2
  996. ): { (p1: T1, p3: T3): T4 };
  997. partial<T1, T2, T3, T4>(
  998. fn: { (p1: T1, p2: T2, p3: T3):T4 },
  999. p1: T1,
  1000. p2: T2,
  1001. p3: T3
  1002. ): { (): T4 };
  1003. partial<T1, T2, T3, T4>(
  1004. fn: { (p1: T1, p2: T2, p3: T3):T4 },
  1005. stub1: UnderscoreStatic,
  1006. p2: T2,
  1007. p3: T3
  1008. ): { (p1: T1): T4 };
  1009. partial<T1, T2, T3, T4>(
  1010. fn: { (p1: T1, p2: T2, p3: T3):T4 },
  1011. p1: T1,
  1012. stub2: UnderscoreStatic,
  1013. p3: T3
  1014. ): { (p2: T2): T4 };
  1015. partial<T1, T2, T3, T4>(
  1016. fn: { (p1: T1, p2: T2, p3: T3):T4 },
  1017. stub1: UnderscoreStatic,
  1018. stub2: UnderscoreStatic,
  1019. p3: T3
  1020. ): { (p1: T1, p2: T2): T4 };
  1021. partial<T1, T2, T3, T4, T5>(
  1022. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1023. p1: T1
  1024. ): { (p2: T2, p3: T3, p4: T4): T5 };
  1025. partial<T1, T2, T3, T4, T5>(
  1026. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1027. p1: T1,
  1028. p2: T2
  1029. ): { (p3: T3, p4: T4): T5 };
  1030. partial<T1, T2, T3, T4, T5>(
  1031. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1032. stub1: UnderscoreStatic,
  1033. p2: T2
  1034. ): { (p1: T1, p3: T3, p4: T4): T5 };
  1035. partial<T1, T2, T3, T4, T5>(
  1036. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1037. p1: T1,
  1038. p2: T2,
  1039. p3: T3
  1040. ): { (p4: T4): T5 };
  1041. partial<T1, T2, T3, T4, T5>(
  1042. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1043. stub1: UnderscoreStatic,
  1044. p2: T2,
  1045. p3: T3
  1046. ): { (p1: T1, p4: T4): T5 };
  1047. partial<T1, T2, T3, T4, T5>(
  1048. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1049. p1: T1,
  1050. stub2: UnderscoreStatic,
  1051. p3: T3
  1052. ): { (p2: T2, p4: T4): T5 };
  1053. partial<T1, T2, T3, T4, T5>(
  1054. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1055. stub1: UnderscoreStatic,
  1056. stub2: UnderscoreStatic,
  1057. p3: T3
  1058. ): { (p1: T1, p2: T2, p4: T4): T5 };
  1059. partial<T1, T2, T3, T4, T5>(
  1060. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1061. p1: T1,
  1062. p2: T2,
  1063. p3: T3,
  1064. p4: T4
  1065. ): { (): T5 };
  1066. partial<T1, T2, T3, T4, T5>(
  1067. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1068. stub1: UnderscoreStatic,
  1069. p2: T2,
  1070. p3: T3,
  1071. p4: T4
  1072. ): { (p1: T1): T5 };
  1073. partial<T1, T2, T3, T4, T5>(
  1074. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1075. p1: T1,
  1076. stub2: UnderscoreStatic,
  1077. p3: T3,
  1078. p4: T4
  1079. ): { (p2: T2): T5 };
  1080. partial<T1, T2, T3, T4, T5>(
  1081. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1082. stub1: UnderscoreStatic,
  1083. stub2: UnderscoreStatic,
  1084. p3: T3,
  1085. p4: T4
  1086. ): { (p1: T1, p2: T2): T5 };
  1087. partial<T1, T2, T3, T4, T5>(
  1088. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1089. p1: T1,
  1090. p2: T2,
  1091. stub3: UnderscoreStatic,
  1092. p4: T4
  1093. ): { (p3: T3): T5 };
  1094. partial<T1, T2, T3, T4, T5>(
  1095. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1096. stub1: UnderscoreStatic,
  1097. p2: T2,
  1098. stub3: UnderscoreStatic,
  1099. p4: T4
  1100. ): { (p1: T1, p3: T3): T5 };
  1101. partial<T1, T2, T3, T4, T5>(
  1102. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1103. p1: T1,
  1104. stub2: UnderscoreStatic,
  1105. stub3: UnderscoreStatic,
  1106. p4: T4
  1107. ): { (p2: T2, p3: T3): T5 };
  1108. partial<T1, T2, T3, T4, T5>(
  1109. fn: { (p1: T1, p2: T2, p3: T3, p4: T4):T5 },
  1110. stub1: UnderscoreStatic,
  1111. stub2: UnderscoreStatic,
  1112. stub3: UnderscoreStatic,
  1113. p4: T4
  1114. ): { (p1: T1, p2: T2, p3: T3): T5 };
  1115. partial<T1, T2, T3, T4, T5, T6>(
  1116. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1117. p1: T1
  1118. ): { (p2: T2, p3: T3, p4: T4, p5: T5): T6 };
  1119. partial<T1, T2, T3, T4, T5, T6>(
  1120. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1121. p1: T1,
  1122. p2: T2
  1123. ): { (p3: T3, p4: T4, p5: T5): T6 };
  1124. partial<T1, T2, T3, T4, T5, T6>(
  1125. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1126. stub1: UnderscoreStatic,
  1127. p2: T2
  1128. ): { (p1: T1, p3: T3, p4: T4, p5: T5): T6 };
  1129. partial<T1, T2, T3, T4, T5, T6>(
  1130. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1131. p1: T1,
  1132. p2: T2,
  1133. p3: T3
  1134. ): { (p4: T4, p5: T5): T6 };
  1135. partial<T1, T2, T3, T4, T5, T6>(
  1136. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1137. stub1: UnderscoreStatic,
  1138. p2: T2,
  1139. p3: T3
  1140. ): { (p1: T1, p4: T4, p5: T5): T6 };
  1141. partial<T1, T2, T3, T4, T5, T6>(
  1142. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1143. p1: T1,
  1144. stub2: UnderscoreStatic,
  1145. p3: T3
  1146. ): { (p2: T2, p4: T4, p5: T5): T6 };
  1147. partial<T1, T2, T3, T4, T5, T6>(
  1148. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1149. stub1: UnderscoreStatic,
  1150. stub2: UnderscoreStatic,
  1151. p3: T3
  1152. ): { (p1: T1, p2: T2, p4: T4, p5: T5): T6 };
  1153. partial<T1, T2, T3, T4, T5, T6>(
  1154. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1155. p1: T1,
  1156. p2: T2,
  1157. p3: T3,
  1158. p4: T4
  1159. ): { (p5: T5): T6 };
  1160. partial<T1, T2, T3, T4, T5, T6>(
  1161. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1162. stub1: UnderscoreStatic,
  1163. p2: T2,
  1164. p3: T3,
  1165. p4: T4
  1166. ): { (p1: T1, p5: T5): T6 };
  1167. partial<T1, T2, T3, T4, T5, T6>(
  1168. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1169. p1: T1,
  1170. stub2: UnderscoreStatic,
  1171. p3: T3,
  1172. p4: T4
  1173. ): { (p2: T2, p5: T5): T6 };
  1174. partial<T1, T2, T3, T4, T5, T6>(
  1175. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1176. stub1: UnderscoreStatic,
  1177. stub2: UnderscoreStatic,
  1178. p3: T3,
  1179. p4: T4
  1180. ): { (p1: T1, p2: T2, p5: T5): T6 };
  1181. partial<T1, T2, T3, T4, T5, T6>(
  1182. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1183. p1: T1,
  1184. p2: T2,
  1185. stub3: UnderscoreStatic,
  1186. p4: T4
  1187. ): { (p3: T3, p5: T5): T6 };
  1188. partial<T1, T2, T3, T4, T5, T6>(
  1189. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1190. stub1: UnderscoreStatic,
  1191. p2: T2,
  1192. stub3: UnderscoreStatic,
  1193. p4: T4
  1194. ): { (p1: T1, p3: T3, p5: T5): T6 };
  1195. partial<T1, T2, T3, T4, T5, T6>(
  1196. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1197. p1: T1,
  1198. stub2: UnderscoreStatic,
  1199. stub3: UnderscoreStatic,
  1200. p4: T4
  1201. ): { (p2: T2, p3: T3, p5: T5): T6 };
  1202. partial<T1, T2, T3, T4, T5, T6>(
  1203. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1204. stub1: UnderscoreStatic,
  1205. stub2: UnderscoreStatic,
  1206. stub3: UnderscoreStatic,
  1207. p4: T4
  1208. ): { (p1: T1, p2: T2, p3: T3, p5: T5): T6 };
  1209. partial<T1, T2, T3, T4, T5, T6>(
  1210. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1211. p1: T1,
  1212. p2: T2,
  1213. p3: T3,
  1214. p4: T4,
  1215. p5: T5
  1216. ): { (): T6 };
  1217. partial<T1, T2, T3, T4, T5, T6>(
  1218. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1219. stub1: UnderscoreStatic,
  1220. p2: T2,
  1221. p3: T3,
  1222. p4: T4,
  1223. p5: T5
  1224. ): { (p1: T1): T6 };
  1225. partial<T1, T2, T3, T4, T5, T6>(
  1226. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1227. p1: T1,
  1228. stub2: UnderscoreStatic,
  1229. p3: T3,
  1230. p4: T4,
  1231. p5: T5
  1232. ): { (p2: T2): T6 };
  1233. partial<T1, T2, T3, T4, T5, T6>(
  1234. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1235. stub1: UnderscoreStatic,
  1236. stub2: UnderscoreStatic,
  1237. p3: T3,
  1238. p4: T4,
  1239. p5: T5
  1240. ): { (p1: T1, p2: T2): T6 };
  1241. partial<T1, T2, T3, T4, T5, T6>(
  1242. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1243. p1: T1,
  1244. p2: T2,
  1245. stub3: UnderscoreStatic,
  1246. p4: T4,
  1247. p5: T5
  1248. ): { (p3: T3): T6 };
  1249. partial<T1, T2, T3, T4, T5, T6>(
  1250. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1251. stub1: UnderscoreStatic,
  1252. p2: T2,
  1253. stub3: UnderscoreStatic,
  1254. p4: T4,
  1255. p5: T5
  1256. ): { (p1: T1, p3: T3): T6 };
  1257. partial<T1, T2, T3, T4, T5, T6>(
  1258. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1259. p1: T1,
  1260. stub2: UnderscoreStatic,
  1261. stub3: UnderscoreStatic,
  1262. p4: T4,
  1263. p5: T5
  1264. ): { (p2: T2, p3: T3): T6 };
  1265. partial<T1, T2, T3, T4, T5, T6>(
  1266. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1267. stub1: UnderscoreStatic,
  1268. stub2: UnderscoreStatic,
  1269. stub3: UnderscoreStatic,
  1270. p4: T4,
  1271. p5: T5
  1272. ): { (p1: T1, p2: T2, p3: T3): T6 };
  1273. partial<T1, T2, T3, T4, T5, T6>(
  1274. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1275. p1: T1,
  1276. p2: T2,
  1277. p3: T3,
  1278. stub4: UnderscoreStatic,
  1279. p5: T5
  1280. ): { (p4: T4): T6 };
  1281. partial<T1, T2, T3, T4, T5, T6>(
  1282. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1283. stub1: UnderscoreStatic,
  1284. p2: T2,
  1285. p3: T3,
  1286. stub4: UnderscoreStatic,
  1287. p5: T5
  1288. ): { (p1: T1, p4: T4): T6 };
  1289. partial<T1, T2, T3, T4, T5, T6>(
  1290. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1291. p1: T1,
  1292. stub2: UnderscoreStatic,
  1293. p3: T3,
  1294. stub4: UnderscoreStatic,
  1295. p5: T5
  1296. ): { (p2: T2, p4: T4): T6 };
  1297. partial<T1, T2, T3, T4, T5, T6>(
  1298. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1299. stub1: UnderscoreStatic,
  1300. stub2: UnderscoreStatic,
  1301. p3: T3,
  1302. stub4: UnderscoreStatic,
  1303. p5: T5
  1304. ): { (p1: T1, p2: T2, p4: T4): T6 };
  1305. partial<T1, T2, T3, T4, T5, T6>(
  1306. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1307. p1: T1,
  1308. p2: T2,
  1309. stub3: UnderscoreStatic,
  1310. stub4: UnderscoreStatic,
  1311. p5: T5
  1312. ): { (p3: T3, p4: T4): T6 };
  1313. partial<T1, T2, T3, T4, T5, T6>(
  1314. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1315. stub1: UnderscoreStatic,
  1316. p2: T2,
  1317. stub3: UnderscoreStatic,
  1318. stub4: UnderscoreStatic,
  1319. p5: T5
  1320. ): { (p1: T1, p3: T3, p4: T4): T6 };
  1321. partial<T1, T2, T3, T4, T5, T6>(
  1322. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1323. p1: T1,
  1324. stub2: UnderscoreStatic,
  1325. stub3: UnderscoreStatic,
  1326. stub4: UnderscoreStatic,
  1327. p5: T5
  1328. ): { (p2: T2, p3: T3, p4: T4): T6 };
  1329. partial<T1, T2, T3, T4, T5, T6>(
  1330. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5):T6 },
  1331. stub1: UnderscoreStatic,
  1332. stub2: UnderscoreStatic,
  1333. stub3: UnderscoreStatic,
  1334. stub4: UnderscoreStatic,
  1335. p5: T5
  1336. ): { (p1: T1, p2: T2, p3: T3, p4: T4): T6 };
  1337. partial<T1, T2, T3, T4, T5, T6, T7>(
  1338. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1339. p1: T1
  1340. ): { (p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): T7 };
  1341. partial<T1, T2, T3, T4, T5, T6, T7>(
  1342. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1343. p1: T1,
  1344. p2: T2
  1345. ): { (p3: T3, p4: T4, p5: T5, p6: T6): T7 };
  1346. partial<T1, T2, T3, T4, T5, T6, T7>(
  1347. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1348. stub1: UnderscoreStatic,
  1349. p2: T2
  1350. ): { (p1: T1, p3: T3, p4: T4, p5: T5, p6: T6): T7 };
  1351. partial<T1, T2, T3, T4, T5, T6, T7>(
  1352. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1353. p1: T1,
  1354. p2: T2,
  1355. p3: T3
  1356. ): { (p4: T4, p5: T5, p6: T6): T7 };
  1357. partial<T1, T2, T3, T4, T5, T6, T7>(
  1358. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1359. stub1: UnderscoreStatic,
  1360. p2: T2,
  1361. p3: T3
  1362. ): { (p1: T1, p4: T4, p5: T5, p6: T6): T7 };
  1363. partial<T1, T2, T3, T4, T5, T6, T7>(
  1364. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1365. p1: T1,
  1366. stub2: UnderscoreStatic,
  1367. p3: T3
  1368. ): { (p2: T2, p4: T4, p5: T5, p6: T6): T7 };
  1369. partial<T1, T2, T3, T4, T5, T6, T7>(
  1370. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1371. stub1: UnderscoreStatic,
  1372. stub2: UnderscoreStatic,
  1373. p3: T3
  1374. ): { (p1: T1, p2: T2, p4: T4, p5: T5, p6: T6): T7 };
  1375. partial<T1, T2, T3, T4, T5, T6, T7>(
  1376. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1377. p1: T1,
  1378. p2: T2,
  1379. p3: T3,
  1380. p4: T4
  1381. ): { (p5: T5, p6: T6): T7 };
  1382. partial<T1, T2, T3, T4, T5, T6, T7>(
  1383. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1384. stub1: UnderscoreStatic,
  1385. p2: T2,
  1386. p3: T3,
  1387. p4: T4
  1388. ): { (p1: T1, p5: T5, p6: T6): T7 };
  1389. partial<T1, T2, T3, T4, T5, T6, T7>(
  1390. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1391. p1: T1,
  1392. stub2: UnderscoreStatic,
  1393. p3: T3,
  1394. p4: T4
  1395. ): { (p2: T2, p5: T5, p6: T6): T7 };
  1396. partial<T1, T2, T3, T4, T5, T6, T7>(
  1397. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1398. stub1: UnderscoreStatic,
  1399. stub2: UnderscoreStatic,
  1400. p3: T3,
  1401. p4: T4
  1402. ): { (p1: T1, p2: T2, p5: T5, p6: T6): T7 };
  1403. partial<T1, T2, T3, T4, T5, T6, T7>(
  1404. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1405. p1: T1,
  1406. p2: T2,
  1407. stub3: UnderscoreStatic,
  1408. p4: T4
  1409. ): { (p3: T3, p5: T5, p6: T6): T7 };
  1410. partial<T1, T2, T3, T4, T5, T6, T7>(
  1411. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1412. stub1: UnderscoreStatic,
  1413. p2: T2,
  1414. stub3: UnderscoreStatic,
  1415. p4: T4
  1416. ): { (p1: T1, p3: T3, p5: T5, p6: T6): T7 };
  1417. partial<T1, T2, T3, T4, T5, T6, T7>(
  1418. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1419. p1: T1,
  1420. stub2: UnderscoreStatic,
  1421. stub3: UnderscoreStatic,
  1422. p4: T4
  1423. ): { (p2: T2, p3: T3, p5: T5, p6: T6): T7 };
  1424. partial<T1, T2, T3, T4, T5, T6, T7>(
  1425. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1426. stub1: UnderscoreStatic,
  1427. stub2: UnderscoreStatic,
  1428. stub3: UnderscoreStatic,
  1429. p4: T4
  1430. ): { (p1: T1, p2: T2, p3: T3, p5: T5, p6: T6): T7 };
  1431. partial<T1, T2, T3, T4, T5, T6, T7>(
  1432. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1433. p1: T1,
  1434. p2: T2,
  1435. p3: T3,
  1436. p4: T4,
  1437. p5: T5
  1438. ): { (p6: T6): T7 };
  1439. partial<T1, T2, T3, T4, T5, T6, T7>(
  1440. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1441. stub1: UnderscoreStatic,
  1442. p2: T2,
  1443. p3: T3,
  1444. p4: T4,
  1445. p5: T5
  1446. ): { (p1: T1, p6: T6): T7 };
  1447. partial<T1, T2, T3, T4, T5, T6, T7>(
  1448. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1449. p1: T1,
  1450. stub2: UnderscoreStatic,
  1451. p3: T3,
  1452. p4: T4,
  1453. p5: T5
  1454. ): { (p2: T2, p6: T6): T7 };
  1455. partial<T1, T2, T3, T4, T5, T6, T7>(
  1456. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1457. stub1: UnderscoreStatic,
  1458. stub2: UnderscoreStatic,
  1459. p3: T3,
  1460. p4: T4,
  1461. p5: T5
  1462. ): { (p1: T1, p2: T2, p6: T6): T7 };
  1463. partial<T1, T2, T3, T4, T5, T6, T7>(
  1464. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1465. p1: T1,
  1466. p2: T2,
  1467. stub3: UnderscoreStatic,
  1468. p4: T4,
  1469. p5: T5
  1470. ): { (p3: T3, p6: T6): T7 };
  1471. partial<T1, T2, T3, T4, T5, T6, T7>(
  1472. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1473. stub1: UnderscoreStatic,
  1474. p2: T2,
  1475. stub3: UnderscoreStatic,
  1476. p4: T4,
  1477. p5: T5
  1478. ): { (p1: T1, p3: T3, p6: T6): T7 };
  1479. partial<T1, T2, T3, T4, T5, T6, T7>(
  1480. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1481. p1: T1,
  1482. stub2: UnderscoreStatic,
  1483. stub3: UnderscoreStatic,
  1484. p4: T4,
  1485. p5: T5
  1486. ): { (p2: T2, p3: T3, p6: T6): T7 };
  1487. partial<T1, T2, T3, T4, T5, T6, T7>(
  1488. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1489. stub1: UnderscoreStatic,
  1490. stub2: UnderscoreStatic,
  1491. stub3: UnderscoreStatic,
  1492. p4: T4,
  1493. p5: T5
  1494. ): { (p1: T1, p2: T2, p3: T3, p6: T6): T7 };
  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. p1: T1,
  1498. p2: T2,
  1499. p3: T3,
  1500. stub4: UnderscoreStatic,
  1501. p5: T5
  1502. ): { (p4: T4, p6: T6): T7 };
  1503. partial<T1, T2, T3, T4, T5, T6, T7>(
  1504. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1505. stub1: UnderscoreStatic,
  1506. p2: T2,
  1507. p3: T3,
  1508. stub4: UnderscoreStatic,
  1509. p5: T5
  1510. ): { (p1: T1, p4: T4, p6: T6): T7 };
  1511. partial<T1, T2, T3, T4, T5, T6, T7>(
  1512. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1513. p1: T1,
  1514. stub2: UnderscoreStatic,
  1515. p3: T3,
  1516. stub4: UnderscoreStatic,
  1517. p5: T5
  1518. ): { (p2: T2, p4: T4, p6: T6): T7 };
  1519. partial<T1, T2, T3, T4, T5, T6, T7>(
  1520. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1521. stub1: UnderscoreStatic,
  1522. stub2: UnderscoreStatic,
  1523. p3: T3,
  1524. stub4: UnderscoreStatic,
  1525. p5: T5
  1526. ): { (p1: T1, p2: T2, p4: T4, p6: T6): T7 };
  1527. partial<T1, T2, T3, T4, T5, T6, T7>(
  1528. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1529. p1: T1,
  1530. p2: T2,
  1531. stub3: UnderscoreStatic,
  1532. stub4: UnderscoreStatic,
  1533. p5: T5
  1534. ): { (p3: T3, p4: T4, p6: T6): T7 };
  1535. partial<T1, T2, T3, T4, T5, T6, T7>(
  1536. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1537. stub1: UnderscoreStatic,
  1538. p2: T2,
  1539. stub3: UnderscoreStatic,
  1540. stub4: UnderscoreStatic,
  1541. p5: T5
  1542. ): { (p1: T1, p3: T3, p4: T4, p6: T6): T7 };
  1543. partial<T1, T2, T3, T4, T5, T6, T7>(
  1544. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1545. p1: T1,
  1546. stub2: UnderscoreStatic,
  1547. stub3: UnderscoreStatic,
  1548. stub4: UnderscoreStatic,
  1549. p5: T5
  1550. ): { (p2: T2, p3: T3, p4: T4, p6: T6): T7 };
  1551. partial<T1, T2, T3, T4, T5, T6, T7>(
  1552. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1553. stub1: UnderscoreStatic,
  1554. stub2: UnderscoreStatic,
  1555. stub3: UnderscoreStatic,
  1556. stub4: UnderscoreStatic,
  1557. p5: T5
  1558. ): { (p1: T1, p2: T2, p3: T3, p4: T4, p6: T6): T7 };
  1559. partial<T1, T2, T3, T4, T5, T6, T7>(
  1560. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1561. p1: T1,
  1562. p2: T2,
  1563. p3: T3,
  1564. p4: T4,
  1565. p5: T5,
  1566. p6: T6
  1567. ): { (): T7 };
  1568. partial<T1, T2, T3, T4, T5, T6, T7>(
  1569. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1570. stub1: UnderscoreStatic,
  1571. p2: T2,
  1572. p3: T3,
  1573. p4: T4,
  1574. p5: T5,
  1575. p6: T6
  1576. ): { (p1: T1): T7 };
  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. p3: T3,
  1582. p4: T4,
  1583. p5: T5,
  1584. p6: T6
  1585. ): { (p2: T2): T7 };
  1586. partial<T1, T2, T3, T4, T5, T6, T7>(
  1587. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1588. stub1: UnderscoreStatic,
  1589. stub2: UnderscoreStatic,
  1590. p3: T3,
  1591. p4: T4,
  1592. p5: T5,
  1593. p6: T6
  1594. ): { (p1: T1, p2: T2): T7 };
  1595. partial<T1, T2, T3, T4, T5, T6, T7>(
  1596. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1597. p1: T1,
  1598. p2: T2,
  1599. stub3: UnderscoreStatic,
  1600. p4: T4,
  1601. p5: T5,
  1602. p6: T6
  1603. ): { (p3: T3): T7 };
  1604. partial<T1, T2, T3, T4, T5, T6, T7>(
  1605. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1606. stub1: UnderscoreStatic,
  1607. p2: T2,
  1608. stub3: UnderscoreStatic,
  1609. p4: T4,
  1610. p5: T5,
  1611. p6: T6
  1612. ): { (p1: T1, p3: T3): T7 };
  1613. partial<T1, T2, T3, T4, T5, T6, T7>(
  1614. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1615. p1: T1,
  1616. stub2: UnderscoreStatic,
  1617. stub3: UnderscoreStatic,
  1618. p4: T4,
  1619. p5: T5,
  1620. p6: T6
  1621. ): { (p2: T2, p3: T3): T7 };
  1622. partial<T1, T2, T3, T4, T5, T6, T7>(
  1623. fn: { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6):T7 },
  1624. stub1: UnderscoreStatic,
  1625. stub2: UnderscoreStatic,
  1626. stub3: UnderscoreStatic,
  1627. p4: T4,
  1628. p5: T5,
  1629. p6: T6
  1630. ): { (