From 60af25b105bdd2b1040366153a14d01502abea3a Mon Sep 17 00:00:00 2001 From: bobby77 Date: Tue, 26 Dec 2017 16:02:27 +0100 Subject: [PATCH 001/357] Update index.d.ts Changed error in "transform" and "inverseTransform" return type: Point instead of Matrix (L307) Changed error in clone parameters : object instead of boolean (L1358-1360) --- types/paper/index.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 64d961ed10..2c78fd6e6d 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -290,7 +290,7 @@ declare module paper { * Transforms a point and returns the result. * @param point - the point to be transformed */ - transform(point: Point): Matrix; + transform(point: Point): Point; /** * Transforms an array of coordinates by this matrix and stores the results into the destination array, which is also returned. @@ -304,7 +304,7 @@ declare module paper { * Inverse transforms a point and returns the result. * @param point - the point to be transformed */ - inverseTransform(point: Point): Matrix; + inverseTransform(point: Point): Point; /** * Attempts to decompose the affine transformation described by this matrix into scaling, rotation and shearing, and returns an object with these properties if it succeeded, null otherwise. @@ -1353,9 +1353,11 @@ declare module paper { /** * Clones the item within the same project and places the copy above the item. - * @param insert [optional] - specifies whether the copy should be inserted into the DOM. When set to true, it is inserted above the original. default: true + * @param options [optional] - object with 2 parameters + * insert: specifies whether the copy should be inserted into the DOM. When set to true, it is inserted above the original. default: true + * deep: specifies whether the item’s children should also be cloned — default: true */ - clone(insert?: boolean): Item; + clone(options?: any): Item; /** * When passed a project, copies the item to the project, or duplicates it within the same project. When passed an item, copies the item into the specified item. From 0868ebcbccd557c22955e6568c00c82fad15734a Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 10:39:36 -0500 Subject: [PATCH 002/357] Update type to include OnDragStart OnDragEnter OnDrop --- types/rc-tree/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 8091b2edd5..793a10bd6f 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -149,6 +149,12 @@ export interface TreeProps extends Props { * whether can drag treeNode. */ draggable?: boolean; + /* + * On Drag Start Called + */ + onDragStart?: Function; + onDragEnter?: Function; + onDrop?: Function; } export default class Tree extends Component { } From d3a97d4d25dc243a44f45d3f0356b83cca50df43 Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 12:00:58 -0500 Subject: [PATCH 003/357] Update onDrag types with Data Interfaces --- types/rc-tree/index.d.ts | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 793a10bd6f..4db24c2410 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -58,6 +58,24 @@ export interface SelectData { event: "select"; } +interface OnDragStartData { + event: Event, + node: TreeNode +} + +interface OnDragEnterData { + event: Event; + node: TreeNode; + expandedKeys: string[]; +} + +interface OnDropData { + event: Event; + node: TreeNode; + dragNode: TreeNode; + dragNodesKeys: string[]; +} + export interface TreeProps extends Props { /** * additional css class of root dom node @@ -149,12 +167,18 @@ export interface TreeProps extends Props { * whether can drag treeNode. */ draggable?: boolean; - /* - * On Drag Start Called + /** + * Event on Drag Start */ - onDragStart?: Function; - onDragEnter?: Function; - onDrop?: Function; + onDragStart?: (props: OnDragStartData) => void; + /** + * Event on Drag Enter + */ + onDragEnter?: (props: OnDragEnterData) => void; + /** + * Event on Drag Drop + */ + onDrop?: (props: OnDropData) => void; } export default class Tree extends Component { } From 82a4eba664eba92c8090deec3322399b9b8e246e Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 12:07:31 -0500 Subject: [PATCH 004/357] Fix comma interface to semicolon --- types/rc-tree/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 4db24c2410..df3db12c15 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -59,8 +59,8 @@ export interface SelectData { } interface OnDragStartData { - event: Event, - node: TreeNode + event: Event; + node: TreeNode; } interface OnDragEnterData { From 9a5a154ff88ff68bac20d27c19344a290fecd0ab Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 12:17:34 -0500 Subject: [PATCH 005/357] export onDrag interfaces --- types/rc-tree/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index df3db12c15..103bd60adf 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -58,18 +58,18 @@ export interface SelectData { event: "select"; } -interface OnDragStartData { +export interface OnDragStartData { event: Event; node: TreeNode; } -interface OnDragEnterData { +export interface OnDragEnterData { event: Event; node: TreeNode; expandedKeys: string[]; } -interface OnDropData { +export interface OnDropData { event: Event; node: TreeNode; dragNode: TreeNode; From 448e451dc1a188d80dea97e21184d4c4d90bea47 Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 12:26:02 -0500 Subject: [PATCH 006/357] align asteriks for onDrag properties --- types/rc-tree/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 103bd60adf..a8e5780b97 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -169,15 +169,15 @@ export interface TreeProps extends Props { draggable?: boolean; /** * Event on Drag Start - */ + */ onDragStart?: (props: OnDragStartData) => void; /** * Event on Drag Enter - */ + */ onDragEnter?: (props: OnDragEnterData) => void; /** * Event on Drag Drop - */ + */ onDrop?: (props: OnDropData) => void; } From e100608648cb0e61cee3b059c737076fe5a794e4 Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 12:34:21 -0500 Subject: [PATCH 007/357] lowercase letters --- types/rc-tree/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index a8e5780b97..4dc789824d 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -168,15 +168,15 @@ export interface TreeProps extends Props { */ draggable?: boolean; /** - * Event on Drag Start + * event on drag start */ onDragStart?: (props: OnDragStartData) => void; /** - * Event on Drag Enter + * event on drag enter */ onDragEnter?: (props: OnDragEnterData) => void; /** - * Event on Drag Drop + * event on drag drop */ onDrop?: (props: OnDropData) => void; } From c3dd0698c4e817274466f89f90e781b25db6a6d2 Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 15:45:17 -0500 Subject: [PATCH 008/357] add onDrag tests --- types/rc-tree/rc-tree-tests.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/types/rc-tree/rc-tree-tests.tsx b/types/rc-tree/rc-tree-tests.tsx index c57866284f..290e3658cc 100644 --- a/types/rc-tree/rc-tree-tests.tsx +++ b/types/rc-tree/rc-tree-tests.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import Tree, { TreeNode, SelectData, CheckData } from 'rc-tree'; +import { TreeNode as TreeNodeInterface } from './index.d.ts'; interface Props { keys: string[]; @@ -43,6 +44,18 @@ export class Demo extends React.Component { onCheck(checkedKeys: string[], info: CheckData) { console.log('onCheck', checkedKeys, info); } + + onDragStart(params: {event: Event, node: TreeNodeInterface}) { + console.log('onDragStart', params.event, params.node); + } + + OnDragEnterData(params: {event: Event, node: TreeNodeInterface, expandedKeys: string[]}) { + console.log('OnDragEnterData', params.event, params.node, params.expandedKeys); + } + + OnDropData(params: {event: Event, node: TreeNode, dragNode: TreeNode, dragNodesKeys: string[]}) { + console.log('OnDropData', params.event, params.node, params.dragNode, params.dragNodesKeys); + } onEdit() { setTimeout(() => { @@ -73,6 +86,8 @@ export class Demo extends React.Component { defaultSelectedKeys={this.state.defaultSelectedKeys} defaultCheckedKeys={this.state.defaultCheckedKeys} onSelect={this.onSelect} onCheck={this.onCheck} + onDragStart={this.onDragStart} OnDragEnterData={this.OnDragEnterData} + OnDragEnterData={this.OnDragEnterData} > From 311b5961e8076626358650a17168cd624fe101a0 Mon Sep 17 00:00:00 2001 From: tquinlan1992 Date: Sun, 31 Dec 2017 16:09:53 -0500 Subject: [PATCH 009/357] OnDropData in Tree Prop --- types/rc-tree/rc-tree-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/rc-tree/rc-tree-tests.tsx b/types/rc-tree/rc-tree-tests.tsx index 290e3658cc..ff73beda86 100644 --- a/types/rc-tree/rc-tree-tests.tsx +++ b/types/rc-tree/rc-tree-tests.tsx @@ -87,7 +87,7 @@ export class Demo extends React.Component { defaultCheckedKeys={this.state.defaultCheckedKeys} onSelect={this.onSelect} onCheck={this.onCheck} onDragStart={this.onDragStart} OnDragEnterData={this.OnDragEnterData} - OnDragEnterData={this.OnDragEnterData} + OnDropData={this.OnDropData} > From ac4424f5a3d88ec14293c7c94abb2b9c3491ac28 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 2 Jan 2018 23:28:50 -0800 Subject: [PATCH 010/357] Fix lint failures --- types/rc-tree/rc-tree-tests.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/rc-tree/rc-tree-tests.tsx b/types/rc-tree/rc-tree-tests.tsx index ff73beda86..2d5f0426ed 100644 --- a/types/rc-tree/rc-tree-tests.tsx +++ b/types/rc-tree/rc-tree-tests.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import Tree, { TreeNode, SelectData, CheckData } from 'rc-tree'; -import { TreeNode as TreeNodeInterface } from './index.d.ts'; +import { TreeNode as TreeNodeInterface } from './index'; interface Props { keys: string[]; @@ -44,15 +44,15 @@ export class Demo extends React.Component { onCheck(checkedKeys: string[], info: CheckData) { console.log('onCheck', checkedKeys, info); } - + onDragStart(params: {event: Event, node: TreeNodeInterface}) { console.log('onDragStart', params.event, params.node); } - + OnDragEnterData(params: {event: Event, node: TreeNodeInterface, expandedKeys: string[]}) { console.log('OnDragEnterData', params.event, params.node, params.expandedKeys); } - + OnDropData(params: {event: Event, node: TreeNode, dragNode: TreeNode, dragNodesKeys: string[]}) { console.log('OnDropData', params.event, params.node, params.dragNode, params.dragNodesKeys); } @@ -86,7 +86,7 @@ export class Demo extends React.Component { defaultSelectedKeys={this.state.defaultSelectedKeys} defaultCheckedKeys={this.state.defaultCheckedKeys} onSelect={this.onSelect} onCheck={this.onCheck} - onDragStart={this.onDragStart} OnDragEnterData={this.OnDragEnterData} + onDragStart={this.onDragStart} OnDragEnter={this.OnDragEnterData} OnDropData={this.OnDropData} > From 4e6d6e05532f82ea79e28e9c79ef0103b12866b8 Mon Sep 17 00:00:00 2001 From: Georg Kaspar Date: Wed, 3 Jan 2018 15:46:00 +0100 Subject: [PATCH 011/357] Added Control.Locate class Control.Locate class was added to type definitions in order to access functions in ts. --- types/leaflet.locatecontrol/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/leaflet.locatecontrol/index.d.ts b/types/leaflet.locatecontrol/index.d.ts index 35c88be5be..3ed9c7968a 100644 --- a/types/leaflet.locatecontrol/index.d.ts +++ b/types/leaflet.locatecontrol/index.d.ts @@ -8,6 +8,12 @@ import * as L from 'leaflet'; declare module 'leaflet' { namespace Control { + class Locate extends Control { + onAdd(map: Map): HTMLElement; + start(): void; + stop(): void; + setView():void; + } interface LocateOptions { position?: string; layer?: Layer; @@ -40,6 +46,6 @@ declare module 'leaflet' { /** * Creates a Leaflet.Locate control */ - function locate(options?: Control.LocateOptions): Control; + function locate(options?: Control.LocateOptions): Control.Locate; } } From 07c172e5f6dec507f25824c2821f1ad2a81fbfc8 Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Wed, 10 Jan 2018 11:51:11 +0100 Subject: [PATCH 012/357] fix style code error --- types/navigo/index.d.ts | 7 ++++--- types/navigo/navigo-tests.ts | 14 +++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 660e44dad7..73131a9d72 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -2,9 +2,10 @@ // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -type Keys = string -type State = {[k in Keys]: any} +type Keys = string; +type State = {[k in Keys]: any}; type Params = State; interface NavigoHooks { @@ -46,7 +47,7 @@ declare class Navigo { resolve(currentURL?: string): boolean; link(path: string): string; - + lastRouteResolved(): {url: string, query: string}; disableIfAPINotAvailable(): void; diff --git a/types/navigo/navigo-tests.ts b/types/navigo/navigo-tests.ts index a59bf3cfab..1aeb645ce8 100644 --- a/types/navigo/navigo-tests.ts +++ b/types/navigo/navigo-tests.ts @@ -1,14 +1,22 @@ import Navigo = require("navigo"); +type Keys = string; +type State = {[k in Keys]: any}; +type Params = State; + const root = null; const useHash = false; let router = new Navigo(root, useHash); +const before = (done: (suppress?: boolean) => void, params: Params) => done(); + +const after = (params: Params) => params; + router.hooks({ - before: function(done, params) { //do something }, - after: function(params) { //do something } - }); + before, + after +}); router .on('/products/list', () => { From 40bd25bd96834f880ebb43014555b5543ace9406 Mon Sep 17 00:00:00 2001 From: Carsten Schumann Date: Sat, 13 Jan 2018 14:59:44 +0100 Subject: [PATCH 013/357] Added missing parameter format Paper.path also accepts an array of commands instead of a path string. Example: paper.path([ ["M", 5, 10], ["l", 15, 2], ["h", 30], ["Z"] ]); --- types/snapsvg/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index ff0e9d09a9..539036b36c 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -279,6 +279,7 @@ declare namespace Snap { image(src:string,x:number,y:number,width:number,height:number):Snap.Element; line(x1:number,y1:number,x2:number,y2:number):Snap.Element; path(pathString?:string):Snap.Element; + path(pathSpec:(string | number)[][]):Snap.Element; polygon(varargs:any[]):Snap.Element; polyline(varargs:any[]):Snap.Element; rect(x:number,y:number,width:number,height:number,rx?:number,ry?:number):Snap.Element; From af1e2b71dc65036ef79b70f3bfc53a94c51a1dc1 Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Sun, 14 Jan 2018 18:35:25 +0100 Subject: [PATCH 014/357] add methods types to Navigo and update the version --- types/navigo/index.d.ts | 10 +++++++--- types/navigo/navigo-tests.ts | 9 +++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 73131a9d72..bb4681dd56 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for navigo 4.0 +// Type definitions for navigo 6.0 // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -20,7 +20,7 @@ interface GenericHooks { after?(params?: Params): void; } -type RouteHandler = ((parametersObj: any, query: string) => void) | { as: string; uses(parametersObj: any): void }; +type RouteHandler = ((params: Params, query: string) => void) | { as: string; uses(params: Params, query: string): void }; declare class Navigo { /** @@ -44,6 +44,8 @@ declare class Navigo { generate(path: string, params?: any): string; + getLinkPath(link: any): any; + resolve(currentURL?: string): boolean; link(path: string): string; @@ -52,9 +54,11 @@ declare class Navigo { disableIfAPINotAvailable(): void; + historyAPIUpdateMethod(method?: string): void; + hooks(hooks: GenericHooks): void; - pause(): void; + pause(change?: boolean): void; resume(): void; diff --git a/types/navigo/navigo-tests.ts b/types/navigo/navigo-tests.ts index 1aeb645ce8..b702df93c8 100644 --- a/types/navigo/navigo-tests.ts +++ b/types/navigo/navigo-tests.ts @@ -56,7 +56,7 @@ router .resolve(); router - .on('/user/:id/:action', (params: { id: string; action: string }) => { + .on('/user/:id/:action', (params: Params) => { // If we have http://site.com/user/42/save as a url then // params.id = 42 // params.action = save @@ -64,7 +64,7 @@ router .resolve(); router - .on('/user/:id/:action', (params: { id: string; action: string }, query: string) => { + .on('/user/:id/:action', (params: Params, query: string) => { // If we have http://site.com/user/42/save?answer=42 as a url then // params.id = 42 // params.action = save @@ -117,6 +117,11 @@ router.pause(); router.navigate('/en/products'); router.resume(); // or .pause(false) +router.pause(); +router.historyAPIUpdateMethod('replaceState'); +router.disableIfAPINotAvailable(); +router.resume(); + router.on( '/user/edit', () => { From d095efb7a653267e49cb0ed451d866b9226bc5cc Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Mon, 15 Jan 2018 02:22:11 +0100 Subject: [PATCH 015/357] add type for off method --- Abandonando | 0 Añadiendo | 0 Comprimiendo | 0 Generando | 0 types/navigo/index.d.ts | 2 ++ types/navigo/navigo-tests.ts | 5 +++++ 6 files changed, 7 insertions(+) create mode 100644 Abandonando create mode 100644 Añadiendo create mode 100644 Comprimiendo create mode 100644 Generando diff --git a/Abandonando b/Abandonando new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Añadiendo b/Añadiendo new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Comprimiendo b/Comprimiendo new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Generando b/Generando new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index bb4681dd56..053192b7ec 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -36,6 +36,8 @@ declare class Navigo { on(rootHandler: RouteHandler, hooks?: NavigoHooks): Navigo; + off(handler: { [key: string]: RouteHandler }): void; + notFound(handler: ((query: string) => void), hooks?: NavigoHooks): void; navigate(path: string, absolute?: boolean): void; diff --git a/types/navigo/navigo-tests.ts b/types/navigo/navigo-tests.ts index b702df93c8..d0c162702b 100644 --- a/types/navigo/navigo-tests.ts +++ b/types/navigo/navigo-tests.ts @@ -120,6 +120,11 @@ router.resume(); // or .pause(false) router.pause(); router.historyAPIUpdateMethod('replaceState'); router.disableIfAPINotAvailable(); +router.off({ + '/trip/:number': { + as: 'trip', uses: (params, query) => {} + } +}); router.resume(); router.on( From 23525e579310d8b6327f17320c7d6f4e278c8919 Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Mon, 15 Jan 2018 12:22:28 +0100 Subject: [PATCH 016/357] change the off method types --- types/navigo/index.d.ts | 2 +- types/navigo/navigo-tests.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 053192b7ec..58af71a564 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -36,7 +36,7 @@ declare class Navigo { on(rootHandler: RouteHandler, hooks?: NavigoHooks): Navigo; - off(handler: { [key: string]: RouteHandler }): void; + off(location: string, handler: RouteHandler): void; notFound(handler: ((query: string) => void), hooks?: NavigoHooks): void; diff --git a/types/navigo/navigo-tests.ts b/types/navigo/navigo-tests.ts index d0c162702b..b3094c053f 100644 --- a/types/navigo/navigo-tests.ts +++ b/types/navigo/navigo-tests.ts @@ -120,11 +120,7 @@ router.resume(); // or .pause(false) router.pause(); router.historyAPIUpdateMethod('replaceState'); router.disableIfAPINotAvailable(); -router.off({ - '/trip/:number': { - as: 'trip', uses: (params, query) => {} - } -}); +router.off('/trip/:number', { as: 'trip', uses: (params, query) => {}}); router.resume(); router.on( From 619403ecc7d3045921ebf50a5f296ef133ff24a2 Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Tue, 16 Jan 2018 23:55:33 +0100 Subject: [PATCH 017/357] change to the las navigo version 7.0.0 --- types/navigo/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 58af71a564..68d374449b 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for navigo 6.0 +// Type definitions for navigo 7.0 // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 0e5205c3aafd6e806a9e9a3f81716c8886394162 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 14 Jan 2018 23:18:42 -0800 Subject: [PATCH 018/357] fix: update types for p-queue --- types/p-queue/index.d.ts | 55 ++++++++++++++++++++++++++++++---- types/p-queue/p-queue-tests.ts | 11 +++++-- 2 files changed, 59 insertions(+), 7 deletions(-) diff --git a/types/p-queue/index.d.ts b/types/p-queue/index.d.ts index a3d4608bce..802a007e6e 100644 --- a/types/p-queue/index.d.ts +++ b/types/p-queue/index.d.ts @@ -8,25 +8,70 @@ export = PQueue; declare class PQueue { + /** + * Size of the queue. + */ size: number; + + /** + * Number of pending promises. + */ pending: number; + + /** + * Whether the queue is currently paused. + */ isPaused: boolean; constructor(opts?: PQueue.Options); + /** + * Returns the promise returned by calling fn. + * @param fn Promise-returning/async function. + * @param opts + */ add(fn: PQueue.Task, opts?: O): Promise; + /** + * Same as .add(), but accepts an array of async functions and + * returns a promise that resolves when all async functions are resolved. + * @param fn Array of Promise-returning/async functions. + * @param opts + */ addAll(fns: Array>, opts?: O): Promise; - pause(): void; + /** + * Returns a promise that settles when the queue becomes empty. + * Can be called multiple times. Useful if you for example add + * additional items at a later time. + */ + onEmpty(): Promise; + /** + * Returns a promise that settles when the queue becomes empty, and all + * promises have completed; queue.size === 0 && queue.pending === 0. + * The difference with .onEmpty is that .onIdle guarantees that all work + * from the queue has finished. .onEmpty merely signals that the queue is + * empty, but it could mean that some promises haven't completed yet. + */ + onIdle(): Promise; + + /** + * Start (or resume) executing enqueued tasks within concurrency limit. + * No need to call this if queue is not paused (via options.autoStart = false + * or by .pause() method.) + */ start(): void; - onEmpty(): Promise; - - onIdle(): Promise; - + /** + * Clear the queue. + */ clear(): void; + + /** + * Put queue execution on hold. + */ + pause(): void; } declare namespace PQueue { diff --git a/types/p-queue/p-queue-tests.ts b/types/p-queue/p-queue-tests.ts index 8c54953a73..e12723a7d4 100644 --- a/types/p-queue/p-queue-tests.ts +++ b/types/p-queue/p-queue-tests.ts @@ -6,19 +6,26 @@ queue.add(() => Promise.resolve('sindresorhus.com')).then((sindre) => { const str: string = sindre; }); +queue.addAll([() => Promise.resolve('oh'), () => Promise.resolve('hi')]).then(r => { + r.indexOf('h'); +}); + Promise.resolve((): Promise => Promise.resolve('unicorn')) .then(task => queue.add(task, {priority: 5})) .then(unicorn => { const str: string = unicorn; }); -queue.onEmpty().then(() => { -}); +queue.onEmpty().then(() => {}); +queue.onIdle().then(() => {}); +queue.start(); +queue.pause(); queue.clear(); let num: number; num = queue.size; num = queue.pending; +const paused = queue.isPaused; class QueueClass implements PQueue.QueueClass<{ any: string }> { private readonly queue: Array<() => void>; From bf05a96b10af764b11de75567c89799ba2369048 Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Wed, 17 Jan 2018 23:05:49 +0100 Subject: [PATCH 019/357] add to me how author too --- types/navigo/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 68d374449b..ebc0ecb8c5 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for navigo 7.0 // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam +// Dancespiele // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 From f5e3009d3af047890ba88b454199de65defd7961 Mon Sep 17 00:00:00 2001 From: CRIMX Date: Fri, 19 Jan 2018 14:04:36 +0800 Subject: [PATCH 020/357] Updated to v2.2.4 --- types/sinon-chrome/index.d.ts | 436 +++++++++++++++++----------------- 1 file changed, 221 insertions(+), 215 deletions(-) diff --git a/types/sinon-chrome/index.d.ts b/types/sinon-chrome/index.d.ts index bc33b04d17..f4834bc527 100644 --- a/types/sinon-chrome/index.d.ts +++ b/types/sinon-chrome/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Sinon-Chrome v0.2.1 +// Type definitions for Sinon-Chrome v2.2.4 // Project: https://github.com/vitalets/sinon-chrome // Definitions by: Tim Perry +// CRIMX // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -20,6 +21,10 @@ import * as Sinon from 'sinon'; export = SinonChrome; export as namespace SinonChrome; +interface SinonChromeStub extends Sinon.SinonStub { + flush(): void; +} + declare namespace SinonChrome { /** * Flush cache @@ -38,6 +43,7 @@ declare namespace SinonChrome { declare namespace SinonChrome.events { interface Event extends chrome.events.Event { + dispatch(...args: any[]): void; trigger(...args: any[]): void; triggerAsync(...args: any[]): void; @@ -52,36 +58,36 @@ declare namespace SinonChrome.events { } declare namespace SinonChrome.alarms { - export var clear: Sinon.SinonSpy; - export var clearAll: Sinon.SinonSpy; - export var create: Sinon.SinonSpy; - export var get: Sinon.SinonSpy; - export var getAll: Sinon.SinonSpy; + export var clear: SinonChromeStub; + export var clearAll: SinonChromeStub; + export var create: SinonChromeStub; + export var get: SinonChromeStub; + export var getAll: SinonChromeStub; export var onAlarm: SinonChrome.events.Event; } declare namespace SinonChrome.app { - export var getDetails: Sinon.SinonStub; - export var getDetailsForFrame: Sinon.SinonStub; - export var getDetails: Sinon.SinonStub; - export var getDetailsForFrame: Sinon.SinonStub; - export var getIsInstalled: Sinon.SinonStub; - export var installState: Sinon.SinonStub; - export var runningState: Sinon.SinonStub; + export var getDetails: SinonChromeStub; + export var getDetailsForFrame: SinonChromeStub; + export var getDetails: SinonChromeStub; + export var getDetailsForFrame: SinonChromeStub; + export var getIsInstalled: SinonChromeStub; + export var installState: SinonChromeStub; + export var runningState: SinonChromeStub; } declare namespace SinonChrome.bookmarks { - export var create: Sinon.SinonStub; - export var get: Sinon.SinonStub; - export var getChildren: Sinon.SinonStub; - export var getRecent: Sinon.SinonStub; - export var getSubTree: Sinon.SinonStub; - export var getTree: Sinon.SinonStub; - export var move: Sinon.SinonStub; - export var remove: Sinon.SinonStub; - export var removeTree: Sinon.SinonStub; - export var search: Sinon.SinonStub; - export var update: Sinon.SinonStub; + export var create: SinonChromeStub; + export var get: SinonChromeStub; + export var getChildren: SinonChromeStub; + export var getRecent: SinonChromeStub; + export var getSubTree: SinonChromeStub; + export var getTree: SinonChromeStub; + export var move: SinonChromeStub; + export var remove: SinonChromeStub; + export var removeTree: SinonChromeStub; + export var search: SinonChromeStub; + export var update: SinonChromeStub; export var onChanged: SinonChrome.events.Event; export var onChildrenReordered: SinonChrome.events.Event; @@ -93,44 +99,44 @@ declare namespace SinonChrome.bookmarks { } declare namespace SinonChrome.browserAction { - export var disable: Sinon.SinonStub; - export var enable: Sinon.SinonStub; - export var getBadgeBackgroundColor: Sinon.SinonStub; - export var getBadgeText: Sinon.SinonStub; - export var getPopup: Sinon.SinonStub; - export var getTitle: Sinon.SinonStub; - export var setBadgeBackgroundColor: Sinon.SinonStub; - export var setBadgeText: Sinon.SinonStub; - export var setIcon: Sinon.SinonStub; - export var setPopup: Sinon.SinonStub; - export var setTitle: Sinon.SinonStub; + export var disable: SinonChromeStub; + export var enable: SinonChromeStub; + export var getBadgeBackgroundColor: SinonChromeStub; + export var getBadgeText: SinonChromeStub; + export var getPopup: SinonChromeStub; + export var getTitle: SinonChromeStub; + export var setBadgeBackgroundColor: SinonChromeStub; + export var setBadgeText: SinonChromeStub; + export var setIcon: SinonChromeStub; + export var setPopup: SinonChromeStub; + export var setTitle: SinonChromeStub; export var onClicked: SinonChrome.events.Event; } declare namespace SinonChrome.browsingData { - export var remove: Sinon.SinonStub; - export var removeAppcache: Sinon.SinonStub; - export var removeCache: Sinon.SinonStub; - export var removeCookies: Sinon.SinonStub; - export var removeDownloads: Sinon.SinonStub; - export var removeFileSystems: Sinon.SinonStub; - export var removeFormData: Sinon.SinonStub; - export var removeHistory: Sinon.SinonStub; - export var removeIndexedDB: Sinon.SinonStub; - export var removeLocalStorage: Sinon.SinonStub; - export var removePasswords: Sinon.SinonStub; - export var removePluginData: Sinon.SinonStub; - export var removeWebSQL: Sinon.SinonStub; - export var settings: Sinon.SinonStub; + export var remove: SinonChromeStub; + export var removeAppcache: SinonChromeStub; + export var removeCache: SinonChromeStub; + export var removeCookies: SinonChromeStub; + export var removeDownloads: SinonChromeStub; + export var removeFileSystems: SinonChromeStub; + export var removeFormData: SinonChromeStub; + export var removeHistory: SinonChromeStub; + export var removeIndexedDB: SinonChromeStub; + export var removeLocalStorage: SinonChromeStub; + export var removePasswords: SinonChromeStub; + export var removePluginData: SinonChromeStub; + export var removeWebSQL: SinonChromeStub; + export var settings: SinonChromeStub; } declare namespace SinonChrome.contentSettings { interface StubbedContentSetting { - clear: Sinon.SinonStub; - get: Sinon.SinonStub; - getResourceIdentifiers: Sinon.SinonStub; - set: Sinon.SinonStub; + clear: SinonChromeStub; + get: SinonChromeStub; + getResourceIdentifiers: SinonChromeStub; + set: SinonChromeStub; } export var cookies: StubbedContentSetting; @@ -142,16 +148,16 @@ declare namespace SinonChrome.contentSettings { } declare namespace SinonChrome.contextMenus { - export var create: Sinon.SinonStub; - export var remove: Sinon.SinonStub; - export var removeAll: Sinon.SinonStub; - export var update: Sinon.SinonStub; + export var create: SinonChromeStub; + export var remove: SinonChromeStub; + export var removeAll: SinonChromeStub; + export var update: SinonChromeStub; export var onClicked: SinonChrome.events.Event; } declare namespace SinonChrome.omnibox { - export var setDefaultSuggestion: Sinon.SinonStub; + export var setDefaultSuggestion: SinonChromeStub; export var onInputStarted: SinonChrome.events.Event; export var onInputChanged: SinonChrome.events.Event; export var onInputEntered: SinonChrome.events.Event; @@ -159,20 +165,20 @@ declare namespace SinonChrome.omnibox { } declare namespace SinonChrome.cookies { - export var get: Sinon.SinonStub; - export var getAll: Sinon.SinonStub; - export var getAllCookieStores: Sinon.SinonStub; + export var get: SinonChromeStub; + export var getAll: SinonChromeStub; + export var getAllCookieStores: SinonChromeStub; export var onChanged: SinonChrome.events.Event; - export var remove: Sinon.SinonStub; - export var set: Sinon.SinonStub; + export var remove: SinonChromeStub; + export var set: SinonChromeStub; } /* TODO: Uncomment once https://github.com/Microsoft/TypeScript/issues/7840 is fixed declare module SinonChrome.debugger { - export var attach: Sinon.SinonStub; - export var detach: Sinon.SinonStub; - export var getTargets: Sinon.SinonStub; - export var sendCommand: Sinon.SinonStub; + export var attach: SinonChromeStub; + export var detach: SinonChromeStub; + export var getTargets: SinonChromeStub; + export var sendCommand: SinonChromeStub; export var onDetach: SinonChrome.events.Event; export var onEvent: SinonChrome.events.Event; @@ -180,33 +186,33 @@ declare module SinonChrome.debugger { */ declare namespace SinonChrome.declarativeContent { - export var PageStateMatcher: Sinon.SinonStub; - export var RequestContentScript: Sinon.SinonStub; - export var ShowPageAction: Sinon.SinonStub; + export var PageStateMatcher: SinonChromeStub; + export var RequestContentScript: SinonChromeStub; + export var ShowPageAction: SinonChromeStub; export var onPageChanged: SinonChrome.events.Event; } declare namespace SinonChrome. desktopCapture { - export var cancelChooseDesktopMedia: Sinon.SinonStub; - export var chooseDesktopMedia: Sinon.SinonStub; + export var cancelChooseDesktopMedia: SinonChromeStub; + export var chooseDesktopMedia: SinonChromeStub; } declare namespace SinonChrome.downloads { - export var acceptDanger: Sinon.SinonStub; - export var cancel: Sinon.SinonStub; - export var download: Sinon.SinonStub; - export var drag: Sinon.SinonStub; - export var erase: Sinon.SinonStub; - export var getFileIcon: Sinon.SinonStub; - export var open: Sinon.SinonStub; - export var pause: Sinon.SinonStub; - export var removeFile: Sinon.SinonStub; - export var resume: Sinon.SinonStub; - export var search: Sinon.SinonStub; - export var setShelfEnabled: Sinon.SinonStub; - export var show: Sinon.SinonStub; - export var showDefaultFolder: Sinon.SinonStub; + export var acceptDanger: SinonChromeStub; + export var cancel: SinonChromeStub; + export var download: SinonChromeStub; + export var drag: SinonChromeStub; + export var erase: SinonChromeStub; + export var getFileIcon: SinonChromeStub; + export var open: SinonChromeStub; + export var pause: SinonChromeStub; + export var removeFile: SinonChromeStub; + export var resume: SinonChromeStub; + export var search: SinonChromeStub; + export var setShelfEnabled: SinonChromeStub; + export var show: SinonChromeStub; + export var showDefaultFolder: SinonChromeStub; export var onChanged: SinonChrome.events.Event; export var onCreated: SinonChrome.events.Event; @@ -215,17 +221,17 @@ declare namespace SinonChrome.downloads { } declare namespace SinonChrome.extension { - export var connect: Sinon.SinonStub; - export var connectNative: Sinon.SinonStub; - export var getBackgroundPage: Sinon.SinonStub; - export var getURL: Sinon.SinonStub; - export var getViews: Sinon.SinonStub; - export var isAllowedFileSchemeAccess: Sinon.SinonStub; - export var isAllowedIncognitoAccess: Sinon.SinonStub; - export var sendMessage: Sinon.SinonStub; - export var sendNativeMessage: Sinon.SinonStub; - export var sendRequest: Sinon.SinonStub; - export var setUpdateUrlData: Sinon.SinonStub; + export var connect: SinonChromeStub; + export var connectNative: SinonChromeStub; + export var getBackgroundPage: SinonChromeStub; + export var getURL: SinonChromeStub; + export var getViews: SinonChromeStub; + export var isAllowedFileSchemeAccess: SinonChromeStub; + export var isAllowedIncognitoAccess: SinonChromeStub; + export var sendMessage: SinonChromeStub; + export var sendNativeMessage: SinonChromeStub; + export var sendRequest: SinonChromeStub; + export var setUpdateUrlData: SinonChromeStub; export var onConnect: SinonChrome.events.Event; export var onConnectExternal: SinonChrome.events.Event; @@ -236,19 +242,19 @@ declare namespace SinonChrome.extension { } declare namespace SinonChrome.fontSettings { - export var clearDefaultFixedFontSize: Sinon.SinonStub; - export var clearDefaultFontSize: Sinon.SinonStub; - export var clearFont: Sinon.SinonStub; - export var clearMinimumFontSize: Sinon.SinonStub; - export var getDefaultFixedFontSize: Sinon.SinonStub; - export var getDefaultFontSize: Sinon.SinonStub; - export var getFont: Sinon.SinonStub; - export var getFontList: Sinon.SinonStub; - export var getMinimumFontSize: Sinon.SinonStub; - export var setDefaultFixedFontSize: Sinon.SinonStub; - export var setDefaultFontSize: Sinon.SinonStub; - export var setFont: Sinon.SinonStub; - export var setMinimumFontSize: Sinon.SinonStub; + export var clearDefaultFixedFontSize: SinonChromeStub; + export var clearDefaultFontSize: SinonChromeStub; + export var clearFont: SinonChromeStub; + export var clearMinimumFontSize: SinonChromeStub; + export var getDefaultFixedFontSize: SinonChromeStub; + export var getDefaultFontSize: SinonChromeStub; + export var getFont: SinonChromeStub; + export var getFontList: SinonChromeStub; + export var getMinimumFontSize: SinonChromeStub; + export var setDefaultFixedFontSize: SinonChromeStub; + export var setDefaultFontSize: SinonChromeStub; + export var setFont: SinonChromeStub; + export var setMinimumFontSize: SinonChromeStub; export var onDefaultFixedFontSizeChanged: SinonChrome.events.Event; export var onDefaultFontSizeChanged: SinonChrome.events.Event; @@ -261,35 +267,35 @@ declare namespace SinonChrome.gcm { export var onMessagesDeleted: SinonChrome.events.Event; export var onSendError: SinonChrome.events.Event; - export var register: Sinon.SinonStub; - export var send: Sinon.SinonStub; - export var unregister: Sinon.SinonStub; + export var register: SinonChromeStub; + export var send: SinonChromeStub; + export var unregister: SinonChromeStub; } declare namespace SinonChrome.history { - export var addUrl: Sinon.SinonStub; - export var deleteAll: Sinon.SinonStub; - export var deleteRange: Sinon.SinonStub; - export var deleteUrl: Sinon.SinonStub; - export var getVisits: Sinon.SinonStub; - export var search: Sinon.SinonStub; + export var addUrl: SinonChromeStub; + export var deleteAll: SinonChromeStub; + export var deleteRange: SinonChromeStub; + export var deleteUrl: SinonChromeStub; + export var getVisits: SinonChromeStub; + export var search: SinonChromeStub; export var onVisitRemoved: SinonChrome.events.Event; export var onVisited: SinonChrome.events.Event; } declare namespace SinonChrome.i18n { - export var getAcceptLanguages: Sinon.SinonStub; - export var getMessage: Sinon.SinonStub; - export var getUILanguage: Sinon.SinonStub; + export var getAcceptLanguages: SinonChromeStub; + export var getMessage: SinonChromeStub; + export var getUILanguage: SinonChromeStub; } declare namespace SinonChrome.identity { - export var getAuthToken: Sinon.SinonStub; - export var getProfileUserInfo: Sinon.SinonStub; - export var getRedirectURL: Sinon.SinonStub; - export var launchWebAuthFlow: Sinon.SinonStub; - export var removeCachedAuthToken: Sinon.SinonStub; + export var getAuthToken: SinonChromeStub; + export var getProfileUserInfo: SinonChromeStub; + export var getRedirectURL: SinonChromeStub; + export var launchWebAuthFlow: SinonChromeStub; + export var removeCachedAuthToken: SinonChromeStub; export var onSignInChanged: SinonChrome.events.Event; } @@ -297,22 +303,22 @@ declare namespace SinonChrome.identity { declare namespace SinonChrome.idle { export var onStateChanged: SinonChrome.events.Event; - export var queryState: Sinon.SinonStub; - export var setDetectionInterval: Sinon.SinonStub; + export var queryState: SinonChromeStub; + export var setDetectionInterval: SinonChromeStub; } declare namespace SinonChrome.management { - export var createAppShortcut: Sinon.SinonStub; - export var generateAppForLink: Sinon.SinonStub; - export var get: Sinon.SinonStub; - export var getAll: Sinon.SinonStub; - export var getPermissionWarningsById: Sinon.SinonStub; - export var getPermissionWarningsByManifest: Sinon.SinonStub; - export var launchApp: Sinon.SinonStub; - export var setEnabled: Sinon.SinonStub; - export var setLaunchType: Sinon.SinonStub; - export var uninstall: Sinon.SinonStub; - export var uninstallSelf: Sinon.SinonStub; + export var createAppShortcut: SinonChromeStub; + export var generateAppForLink: SinonChromeStub; + export var get: SinonChromeStub; + export var getAll: SinonChromeStub; + export var getPermissionWarningsById: SinonChromeStub; + export var getPermissionWarningsByManifest: SinonChromeStub; + export var launchApp: SinonChromeStub; + export var setEnabled: SinonChromeStub; + export var setLaunchType: SinonChromeStub; + export var uninstall: SinonChromeStub; + export var uninstallSelf: SinonChromeStub; export var onDisabled: SinonChrome.events.Event; export var onEnabled: SinonChrome.events.Event; @@ -321,11 +327,11 @@ declare namespace SinonChrome.management { } declare namespace SinonChrome.notifications { - export var clear: Sinon.SinonStub; - export var create: Sinon.SinonStub; - export var getAll: Sinon.SinonStub; - export var getPermissionLevel: Sinon.SinonStub; - export var update: Sinon.SinonStub; + export var clear: SinonChromeStub; + export var create: SinonChromeStub; + export var getAll: SinonChromeStub; + export var getPermissionLevel: SinonChromeStub; + export var update: SinonChromeStub; export var onButtonClicked: SinonChrome.events.Event; export var onClicked: SinonChrome.events.Event; @@ -335,28 +341,28 @@ declare namespace SinonChrome.notifications { } declare namespace SinonChrome.pageCapture { - export var saveAsMHTML: Sinon.SinonStub; + export var saveAsMHTML: SinonChromeStub; } declare namespace SinonChrome.permissions { - export var contains: Sinon.SinonStub; - export var getAll: Sinon.SinonStub; + export var contains: SinonChromeStub; + export var getAll: SinonChromeStub; export var onAdded: SinonChrome.events.Event; export var onRemoved: SinonChrome.events.Event; - export var remove: Sinon.SinonStub; - export var request: Sinon.SinonStub; + export var remove: SinonChromeStub; + export var request: SinonChromeStub; } declare namespace SinonChrome.power { - export var releaseKeepAwake: Sinon.SinonStub; - export var requestKeepAwake: Sinon.SinonStub; + export var releaseKeepAwake: SinonChromeStub; + export var requestKeepAwake: SinonChromeStub; } declare namespace SinonChrome.types { interface StubbedChromeSetting { - clear: Sinon.SinonStub; - get: Sinon.SinonStub; - set: Sinon.SinonStub; + clear: SinonChromeStub; + get: SinonChromeStub; + set: SinonChromeStub; onChange: SinonChrome.events.Event; } @@ -388,22 +394,22 @@ declare namespace SinonChrome.proxy { } declare namespace SinonChrome.pushMessaging { - export var getChannelId: Sinon.SinonStub; + export var getChannelId: SinonChromeStub; export var onMessage: SinonChrome.events.Event; } declare namespace SinonChrome.runtime { - export var connect: Sinon.SinonStub; - export var connectNative: Sinon.SinonStub; - export var getBackgroundPage: Sinon.SinonStub; - export var getManifest: Sinon.SinonStub; - export var getPackageDirectoryEntry: Sinon.SinonStub; - export var getPlatformInfo: Sinon.SinonStub; - export var reload: Sinon.SinonStub; - export var requestUpdateCheck: Sinon.SinonStub; - export var restart: Sinon.SinonStub; - export var sendMessage: Sinon.SinonStub; - export var sendNativeMessage: Sinon.SinonStub; + export var connect: SinonChromeStub; + export var connectNative: SinonChromeStub; + export var getBackgroundPage: SinonChromeStub; + export var getManifest: SinonChromeStub; + export var getPackageDirectoryEntry: SinonChromeStub; + export var getPlatformInfo: SinonChromeStub; + export var reload: SinonChromeStub; + export var requestUpdateCheck: SinonChromeStub; + export var restart: SinonChromeStub; + export var sendMessage: SinonChromeStub; + export var sendNativeMessage: SinonChromeStub; export var onBrowserUpdateAvailable: SinonChrome.events.Event; export var onConnect: SinonChrome.events.Event; @@ -418,25 +424,25 @@ declare namespace SinonChrome.runtime { export var onUpdateAvailable: SinonChrome.events.Event; export var id: string; - export var getURL: Sinon.SinonSpy; + export var getURL: SinonChromeStub; export var lastError: { message?: string }; } declare namespace SinonChrome.sessions { - export var getDevices: Sinon.SinonStub; - export var getRecentlyClosed: Sinon.SinonStub; - export var restore: Sinon.SinonStub; + export var getDevices: SinonChromeStub; + export var getRecentlyClosed: SinonChromeStub; + export var restore: SinonChromeStub; export var onChanged: SinonChrome.events.Event; } declare namespace SinonChrome.storage { interface StubbedStorageArea { - clear: Sinon.SinonStub; - get: Sinon.SinonStub; - getBytesInUse: Sinon.SinonStub; - remove: Sinon.SinonStub; - set: Sinon.SinonStub; + clear: SinonChromeStub; + get: SinonChromeStub; + getBytesInUse: SinonChromeStub; + remove: SinonChromeStub; + set: SinonChromeStub; } export var local: StubbedStorageArea; @@ -447,32 +453,32 @@ declare namespace SinonChrome.storage { } declare namespace SinonChrome.tabCapture { - export var capture: Sinon.SinonStub; - export var getCapturedTabs: Sinon.SinonStub; + export var capture: SinonChromeStub; + export var getCapturedTabs: SinonChromeStub; export var onStatusChanged: SinonChrome.events.Event; } declare namespace SinonChrome.tabs { - export var captureVisibleTab: Sinon.SinonStub; - export var connect: Sinon.SinonStub; - export var create: Sinon.SinonStub; - export var detectLanguage: Sinon.SinonStub; - export var duplicate: Sinon.SinonStub; - export var executeScript: Sinon.SinonStub; - export var get: Sinon.SinonStub; - export var getAllInWindow: Sinon.SinonStub; - export var getCurrent: Sinon.SinonStub; - export var getSelected: Sinon.SinonStub; - export var highlight: Sinon.SinonStub; - export var insertCSS: Sinon.SinonStub; - export var move: Sinon.SinonStub; - export var query: Sinon.SinonStub; - export var reload: Sinon.SinonStub; - export var remove: Sinon.SinonStub; - export var sendMessage: Sinon.SinonStub; - export var sendRequest: Sinon.SinonStub; - export var update: Sinon.SinonStub; + export var captureVisibleTab: SinonChromeStub; + export var connect: SinonChromeStub; + export var create: SinonChromeStub; + export var detectLanguage: SinonChromeStub; + export var duplicate: SinonChromeStub; + export var executeScript: SinonChromeStub; + export var get: SinonChromeStub; + export var getAllInWindow: SinonChromeStub; + export var getCurrent: SinonChromeStub; + export var getSelected: SinonChromeStub; + export var highlight: SinonChromeStub; + export var insertCSS: SinonChromeStub; + export var move: SinonChromeStub; + export var query: SinonChromeStub; + export var reload: SinonChromeStub; + export var remove: SinonChromeStub; + export var sendMessage: SinonChromeStub; + export var sendRequest: SinonChromeStub; + export var update: SinonChromeStub; export var onActivated: SinonChrome.events.Event; export var onActiveChanged: SinonChrome.events.Event; @@ -490,16 +496,16 @@ declare namespace SinonChrome.tabs { } declare namespace SinonChrome.topSites { - export var get: Sinon.SinonStub; + export var get: SinonChromeStub; } declare namespace SinonChrome.tts { - export var getVoices: Sinon.SinonStub; - export var isSpeaking: Sinon.SinonStub; - export var pause: Sinon.SinonStub; - export var resume: Sinon.SinonStub; - export var speak: Sinon.SinonStub; - export var stop: Sinon.SinonStub; + export var getVoices: SinonChromeStub; + export var isSpeaking: SinonChromeStub; + export var pause: SinonChromeStub; + export var resume: SinonChromeStub; + export var speak: SinonChromeStub; + export var stop: SinonChromeStub; export var onEvent: SinonChrome.events.Event; } @@ -510,12 +516,12 @@ declare namespace SinonChrome.ttsEngine { export var onSpeak: SinonChrome.events.Event; export var onStop: SinonChrome.events.Event; - export var sendTtsEvent: Sinon.SinonStub; + export var sendTtsEvent: SinonChromeStub; } declare namespace SinonChrome.webNavigation { - export var getAllFrames: Sinon.SinonStub; - export var getFrame: Sinon.SinonStub; + export var getAllFrames: SinonChromeStub; + export var getFrame: SinonChromeStub; export var onBeforeNavigate: SinonChrome.events.Event; export var onCommitted: SinonChrome.events.Event; @@ -529,7 +535,7 @@ declare namespace SinonChrome.webNavigation { } declare namespace SinonChrome.webRequest { - export var handlerBehaviorChanged: Sinon.SinonStub; + export var handlerBehaviorChanged: SinonChromeStub; export var onAuthRequired: SinonChrome.events.Event; export var onBeforeRedirect: SinonChrome.events.Event; @@ -543,13 +549,13 @@ declare namespace SinonChrome.webRequest { } declare namespace SinonChrome.windows { - export var create: Sinon.SinonStub; - export var get: Sinon.SinonStub; - export var getAll: Sinon.SinonStub; - export var getCurrent: Sinon.SinonStub; - export var getLastFocused: Sinon.SinonStub; - export var remove: Sinon.SinonStub; - export var update: Sinon.SinonStub; + export var create: SinonChromeStub; + export var get: SinonChromeStub; + export var getAll: SinonChromeStub; + export var getCurrent: SinonChromeStub; + export var getLastFocused: SinonChromeStub; + export var remove: SinonChromeStub; + export var update: SinonChromeStub; export var onCreated: SinonChrome.events.Event; export var onFocusChanged: SinonChrome.events.Event; From 971248855852844ddea42f8741dcaf4b505c631f Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Sat, 20 Jan 2018 05:10:48 -0400 Subject: [PATCH 021/357] feat(react-native-material-ui): Add onRightElementPress callback info --- types/react-native-material-ui/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/react-native-material-ui/index.d.ts b/types/react-native-material-ui/index.d.ts index 0168f557bc..f3147eecf7 100644 --- a/types/react-native-material-ui/index.d.ts +++ b/types/react-native-material-ui/index.d.ts @@ -432,6 +432,12 @@ export interface ToolBarRightElement { menu?: {icon: string, labels: string[]}; } +export interface RightElementPressEvent { + action: string; + index: number; + result?: any; +} + export interface ToolbarProps { isSearchActive?: boolean; size?: number; @@ -443,7 +449,7 @@ export interface ToolbarProps { searchable?: Searchable; onPress?(): void; onLeftElementPress?(): void; - onRightElementPress?(): void; + onRightElementPress?(e: RightElementPressEvent): void; } /** From 5f846b17b497dc53844fb7d7d906e0a046945558 Mon Sep 17 00:00:00 2001 From: Kalle Ott Date: Mon, 22 Jan 2018 19:27:37 +0100 Subject: [PATCH 022/357] added declarations for react-router-navigation packages --- .../react-router-navigation-core/.prettierrc | 1 + types/react-router-navigation-core/index.d.ts | 157 +++++++++++++++ .../react-router-navigation-core-tests.tsx | 116 +++++++++++ .../tsconfig.json | 17 ++ .../react-router-navigation-core/tslint.json | 9 + types/react-router-navigation/.prettierrc | 1 + types/react-router-navigation/index.d.ts | 182 ++++++++++++++++++ .../react-router-navigation-tests.tsx | 21 ++ types/react-router-navigation/tsconfig.json | 17 ++ types/react-router-navigation/tslint.json | 8 + 10 files changed, 529 insertions(+) create mode 100644 types/react-router-navigation-core/.prettierrc create mode 100644 types/react-router-navigation-core/index.d.ts create mode 100644 types/react-router-navigation-core/react-router-navigation-core-tests.tsx create mode 100644 types/react-router-navigation-core/tsconfig.json create mode 100644 types/react-router-navigation-core/tslint.json create mode 100644 types/react-router-navigation/.prettierrc create mode 100644 types/react-router-navigation/index.d.ts create mode 100644 types/react-router-navigation/react-router-navigation-tests.tsx create mode 100644 types/react-router-navigation/tsconfig.json create mode 100644 types/react-router-navigation/tslint.json diff --git a/types/react-router-navigation-core/.prettierrc b/types/react-router-navigation-core/.prettierrc new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/types/react-router-navigation-core/.prettierrc @@ -0,0 +1 @@ +{} diff --git a/types/react-router-navigation-core/index.d.ts b/types/react-router-navigation-core/index.d.ts new file mode 100644 index 0000000000..c452ebb94c --- /dev/null +++ b/types/react-router-navigation-core/index.d.ts @@ -0,0 +1,157 @@ +// Type definitions for react-router-navigation-core 1.0 +// Project: https://github.com/LeoLeBras/react-router-navigation#readme +// Definitions by: Kalle Ott +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +// High-level wrappers +import { PureComponent, ReactNode, ComponentClass, ReactElement } from "react"; +import { BackHandler, StyleProp, ViewStyle } from "react-native"; +import { History, Location } from "history"; +import { RouterProps, RouteProps, match } from "react-router"; + +export type Route = { + key: string; + routeName: string; + match?: match; +}; + +export type NavigationState = { + index: number; + routes: Array; +}; + +export type RouteProps = { + component?: ComponentClass; + render?: (props: RouterProps) => ReactNode; + children?: ((props: RouterProps) => ReactNode) | ReactNode; + path?: string; + exact?: boolean; + strict?: boolean; +}; + +export type Card = RouteProps & { + key: string; +}; + +export type CardsRendererProps = { + onNavigateBack: (routeKey?: string) => boolean; + navigationState: NavigationState<{ + path?: string; + params?: object; + }>; + cards: Card[]; +}; + +export type Tab = RouteProps & { + key: string; + onIndexChange?: (index: number) => void; +}; + +export type TabsRendererProps = { + onIndexChange: (index: number) => void; + navigationState: NavigationState<{ + title?: string; + testID?: string; + }>; + loadedTabs: string[]; + tabs: Tab[]; +}; + +export type CardStackProps = { + children?: ReactNode[]; + render: (props: CardsRendererProps) => ReactNode; +}; + +export class CardStack extends PureComponent< + CardStackProps, + { + key: number; + navigationState: NavigationState<{ + path?: string; + params?: object; + }>; + cards: Card[]; + } +> { + unlistenHistory: () => void; + + constructor(props: CardStackProps, context?: any); + + onListenHistory: (history: History, nextHistory: History) => void; + + // Pop to previous scene (n-1) + onNavigateBack: () => boolean; +} + +export type TabStackProps = { + children?: ReactNode[]; + render: (props: TabsRendererProps) => ReactNode; + lazy?: boolean; + forceSync?: boolean; + style?: StyleProp; +}; + +export class TabStack extends PureComponent< + TabStackProps, + { + navigationState: NavigationState<{ + title?: string; + testID?: string; + }>; + tabs: Tab[]; + loadedTabs: string[]; + rootIndex: number; + tabsHistory: { [key: number]: Location[] }; + } +> { + static defaultProps: { + forceSync: false; + }; + + unlistenHistory?: () => void; + + constructor(props: TabStackProps); + + onListenHistory: (history: History, nextHistory: History) => void; + + onIndexChange: (index: number) => void; +} + +// Test if current stack item should be updated +export const shouldUpdate: ( + currentItem: RouteProps, + nextItem: RouteProps, + currentLocation: Location, + nextLocation: Location +) => boolean; + +// Get stack item from a specific route +export const get: (items: Item[], route: Route) => Item; + +// Generate unique key +export const createKey: (route: Route) => string; + +// Get current route from a specific history location +export const getRoute: ( + stack: RouteProps[], + location: Location +) => Route | undefined; + +// Render a subview with props +export const renderSubView: ( + render: (propsA: any, propsB: any) => ReactNode, + additionalProps?: any +) => (ownProps: any) => ReactNode; + +// Build stack with React elements +export const build: ( + children: Array>, + oldBuild?: Item[] +) => Item[]; + +// eslint-disable-next-line +export const runHistoryListenner: ( + history: History, + onListenHistory: () => void +) => () => void; diff --git a/types/react-router-navigation-core/react-router-navigation-core-tests.tsx b/types/react-router-navigation-core/react-router-navigation-core-tests.tsx new file mode 100644 index 0000000000..4f4df88f5f --- /dev/null +++ b/types/react-router-navigation-core/react-router-navigation-core-tests.tsx @@ -0,0 +1,116 @@ +import * as React from "react"; +import { + StyleSheet, + Dimensions, + View, + StyleProp, + ViewStyle +} from "react-native"; +import { TabStack, renderSubView } from "react-router-navigation-core"; +import { TabViewAnimated } from "react-native-tab-view"; +import { + TabBarProps, + TabSubViewProps, + TabProps +} from "react-router-navigation"; + +const styles = StyleSheet.create({ + container: { + flex: 1 + }, + scene: { + flex: 1, + overflow: "hidden" + } +}); + +type Props = TabBarProps & { + children?: Array>; + lazy?: boolean; + style?: StyleProp; +}; + +type State = { + key: string; +}; + +class BottomNavigation extends React.Component { + static defaultProps = { + lazy: true + }; + + state = { key: Math.random().toString(10) }; + + renderPager = (sceneProps: TabSubViewProps) => ; + + renderNavigationBar = ( + sceneProps: TabSubViewProps, + props: TabSubViewProps + ) => { + // Hide tab bar + if (sceneProps.hideTabBar) return null; + // Custom tab bar + if (sceneProps.renderTabBar) { + return React.createElement(sceneProps.renderTabBar, sceneProps); + } + // Default tab bar + return ; + }; + + renderSceneView = (sceneProps: TabSubViewProps) => { + const { render, children, component, lazy, loadedTabs } = sceneProps; + const { key } = sceneProps; + if (lazy && !loadedTabs.includes(key)) { + return null; + } else if (render) { + return render(sceneProps); + } else if (children && typeof children === "function") { + return children(sceneProps); + } else if (component) { + return React.createElement(component, sceneProps); + } + return null; + }; + + renderScene = (sceneProps: TabSubViewProps) => { + return ( + {this.renderSceneView(sceneProps)} + ); + }; + + render() { + return ( + { + const ownProps = { ...this.props, ...props }; + return ( + + ); + }} + /> + ); + } +} + +export default BottomNavigation; diff --git a/types/react-router-navigation-core/tsconfig.json b/types/react-router-navigation-core/tsconfig.json new file mode 100644 index 0000000000..b4572aa56c --- /dev/null +++ b/types/react-router-navigation-core/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "jsx": "react", + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": ["index.d.ts", "react-router-navigation-core-tests.tsx"] +} diff --git a/types/react-router-navigation-core/tslint.json b/types/react-router-navigation-core/tslint.json new file mode 100644 index 0000000000..9771c6e171 --- /dev/null +++ b/types/react-router-navigation-core/tslint.json @@ -0,0 +1,9 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-over-type-literal": false, + "prefer-method-signature": false, + "prefer-declare-function": false, + "semicolon": false + } +} diff --git a/types/react-router-navigation/.prettierrc b/types/react-router-navigation/.prettierrc new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/types/react-router-navigation/.prettierrc @@ -0,0 +1 @@ +{} diff --git a/types/react-router-navigation/index.d.ts b/types/react-router-navigation/index.d.ts new file mode 100644 index 0000000000..452c7bea7b --- /dev/null +++ b/types/react-router-navigation/index.d.ts @@ -0,0 +1,182 @@ +// Type definitions for react-router-navigation 1.0 +// Project: https://github.com/LeoLeBras/react-router-navigation#readme +// Definitions by: Kalle Ott +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import { Component, ReactNode, ReactElement, ComponentClass } from "react"; +import { StyleProp, ViewProperties, ViewStyle, TextStyle } from "react-native"; +import { TabViewAnimated, TabViewPagerPan } from "react-native-tab-view"; +import { RouteProps } from "react-router-navigation-core"; +import { + NavigationTransitionProps, + NavigationTransitionSpec +} from "react-navigation"; + +/** + * Navigation + */ + +export type CardProps = RouteProps & NavBarProps; + +export type CardSubViewProps = any; +// NavigationSceneRendererProps & +// CardsRendererProps & +// CardProps + +export type NavBarProps = { + // General + hideNavBar?: boolean; + renderNavBar?: (props: CardSubViewProps) => ReactNode; + navBarStyle?: StyleProp; + // Left button + hideBackButton?: boolean; + backButtonTintColor?: string; + backButtonTitle?: string; + renderLeftButton?: (props: CardSubViewProps) => ReactNode; + // Title + title?: string; + titleStyle?: StyleProp; + renderTitle?: (props: CardSubViewProps) => ReactNode; + // Right button + renderRightButton?: (props: CardSubViewProps) => ReactNode; +}; + +export type NavigationProps = NavBarProps & { + cardStyle?: StyleProp; + configureTransition?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps?: NavigationTransitionProps + ) => NavigationTransitionSpec; + onTransitionStart?: (...args: any[]) => void; + onTransitionEnd?: (...args: any[]) => void; +}; + +export type Card = CardProps & { key: string }; + +/** + * Tabs + */ + +export type TabSubViewProps = any; +// SceneRendererProps & +// TabsRendererProps & +// TabBarProps + +export type TabBarProps = { + hideTabBar?: boolean; + renderTabBar?: (props: TabSubViewProps) => ReactNode; + tabBarStyle?: StyleProp; + tabStyle?: StyleProp; + label?: string; + labelStyle?: StyleProp; + renderLabel?: (props: TabSubViewProps) => ReactNode; + tabTintColor?: string; + tabActiveTintColor?: string; + // only: + renderTabIcon?: (props: TabSubViewProps) => ReactNode; + // only: + tabBarPosition?: "top" | "bottom"; + tabBarIndicatorStyle?: StyleProp; +}; + +export type TabsProps = TabBarProps & { + // only: + initialLayout?: { width?: number; height?: number }; + configureTransition?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps?: NavigationTransitionProps + ) => NavigationTransitionSpec; +}; + +export type TabProps = RouteProps & + TabBarProps & { + onReset?: (props: TabBarProps & RouteProps) => void; + onIndexChange?: (index: number) => void; + }; + +export type Tab = TabProps & { key: string }; + +// High-level wrappers +export type BottomNavigationProps = TabBarProps & { + children?: ReactNode[]; + lazy?: boolean; + style?: StyleProp; +}; + +export class BottomNavigation extends Component< + BottomNavigationProps, + { + key: string; + } +> { + static defaultProps: { + lazy: true; + }; + + renderPager: (sceneProps: TabSubViewProps) => ReactNode; + + renderNavigationBar: ( + sceneProps: TabSubViewProps, + props: TabSubViewProps + ) => ReactNode; + + renderSceneView: (sceneProps: TabSubViewProps) => ReactNode; + + renderScene: (sceneProps: TabSubViewProps) => ReactElement; +} + +export const Card: (props: CardProps) => ReactElement; + +export class NavBar extends Component { + props: CardSubViewProps; + + renderLeftComponent: (sceneProps: CardSubViewProps) => ReactNode; + + renderTitleComponent: (sceneProps: CardSubViewProps) => ReactNode; + + renderRightComponent: (sceneProps: CardSubViewProps) => ReactNode; +} + +export type NavigationComponentProps = NavigationProps & { + children?: Array>; +}; + +export class Navigation extends Component { + props: NavigationComponentProps; + + renderHeader: ( + sceneProps: CardSubViewProps, + props: CardSubViewProps + ) => ReactNode; + + renderSceneComponent: ( + sceneProps: CardSubViewProps + ) => ComponentClass | undefined; +} + +export const Tab: (props: TabProps) => ReactElement<{}>; + +export type TabBarComponentProps = TabBarProps & { + children?: Array>; +}; + +export class Tabs extends Component< + TabBarComponentProps, + { + key: string; + } +> { + props: TabBarComponentProps; + + renderHeader: (sceneProps: TabSubViewProps) => ReactElement | null; + + renderFooter: (sceneProps: TabSubViewProps) => ReactElement | null; + + renderTabBar: ( + sceneProps: TabSubViewProps, + props: TabSubViewProps + ) => ReactElement | null; + + renderScene: (sceneProps: TabSubViewProps) => ReactElement | null; +} diff --git a/types/react-router-navigation/react-router-navigation-tests.tsx b/types/react-router-navigation/react-router-navigation-tests.tsx new file mode 100644 index 0000000000..a70ad1ef60 --- /dev/null +++ b/types/react-router-navigation/react-router-navigation-tests.tsx @@ -0,0 +1,21 @@ +import * as React from "react"; +import { Text } from "react-native"; +import { NativeRouter, Link } from "react-router-native"; +import { Navigation, Card } from "react-router-navigation"; + +const App = () => ( + + + ( + + Press it + + )} + /> + Hello} /> + + +); diff --git a/types/react-router-navigation/tsconfig.json b/types/react-router-navigation/tsconfig.json new file mode 100644 index 0000000000..d9909d32a6 --- /dev/null +++ b/types/react-router-navigation/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "jsx": "react", + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": ["index.d.ts", "react-router-navigation-tests.tsx"] +} diff --git a/types/react-router-navigation/tslint.json b/types/react-router-navigation/tslint.json new file mode 100644 index 0000000000..34f6d3563e --- /dev/null +++ b/types/react-router-navigation/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-over-type-literal": false, + "prefer-method-signature": false, + "prefer-declare-function": false + } +} From ee1c3ee4d5334d7b6ff92b6db6684b34293d191d Mon Sep 17 00:00:00 2001 From: Kalle Ott Date: Mon, 22 Jan 2018 21:10:29 +0100 Subject: [PATCH 023/357] Delete .prettierrc --- types/react-router-navigation/.prettierrc | 1 - 1 file changed, 1 deletion(-) delete mode 100644 types/react-router-navigation/.prettierrc diff --git a/types/react-router-navigation/.prettierrc b/types/react-router-navigation/.prettierrc deleted file mode 100644 index 0967ef424b..0000000000 --- a/types/react-router-navigation/.prettierrc +++ /dev/null @@ -1 +0,0 @@ -{} From 419889311a18be089410db79adac1a833be9f7c9 Mon Sep 17 00:00:00 2001 From: Kalle Ott Date: Mon, 22 Jan 2018 21:10:39 +0100 Subject: [PATCH 024/357] Delete .prettierrc --- types/react-router-navigation-core/.prettierrc | 1 - 1 file changed, 1 deletion(-) delete mode 100644 types/react-router-navigation-core/.prettierrc diff --git a/types/react-router-navigation-core/.prettierrc b/types/react-router-navigation-core/.prettierrc deleted file mode 100644 index 0967ef424b..0000000000 --- a/types/react-router-navigation-core/.prettierrc +++ /dev/null @@ -1 +0,0 @@ -{} From 3fd04b134241f40d65208f4bb268edc21017264f Mon Sep 17 00:00:00 2001 From: Kalle Ott Date: Tue, 23 Jan 2018 10:35:34 +0100 Subject: [PATCH 025/357] narrowd down test file for core lib --- .../react-router-navigation-core-tests.tsx | 77 ++----------------- 1 file changed, 5 insertions(+), 72 deletions(-) diff --git a/types/react-router-navigation-core/react-router-navigation-core-tests.tsx b/types/react-router-navigation-core/react-router-navigation-core-tests.tsx index 4f4df88f5f..6d6d048886 100644 --- a/types/react-router-navigation-core/react-router-navigation-core-tests.tsx +++ b/types/react-router-navigation-core/react-router-navigation-core-tests.tsx @@ -1,33 +1,12 @@ import * as React from "react"; -import { - StyleSheet, - Dimensions, - View, - StyleProp, - ViewStyle -} from "react-native"; +import { View } from "react-native"; import { TabStack, renderSubView } from "react-router-navigation-core"; +import { TabBarProps, TabProps } from "react-router-navigation"; import { TabViewAnimated } from "react-native-tab-view"; -import { - TabBarProps, - TabSubViewProps, - TabProps -} from "react-router-navigation"; - -const styles = StyleSheet.create({ - container: { - flex: 1 - }, - scene: { - flex: 1, - overflow: "hidden" - } -}); type Props = TabBarProps & { children?: Array>; lazy?: boolean; - style?: StyleProp; }; type State = { @@ -35,54 +14,12 @@ type State = { }; class BottomNavigation extends React.Component { - static defaultProps = { - lazy: true - }; - state = { key: Math.random().toString(10) }; - renderPager = (sceneProps: TabSubViewProps) => ; - - renderNavigationBar = ( - sceneProps: TabSubViewProps, - props: TabSubViewProps - ) => { - // Hide tab bar - if (sceneProps.hideTabBar) return null; - // Custom tab bar - if (sceneProps.renderTabBar) { - return React.createElement(sceneProps.renderTabBar, sceneProps); - } - // Default tab bar - return ; - }; - - renderSceneView = (sceneProps: TabSubViewProps) => { - const { render, children, component, lazy, loadedTabs } = sceneProps; - const { key } = sceneProps; - if (lazy && !loadedTabs.includes(key)) { - return null; - } else if (render) { - return render(sceneProps); - } else if (children && typeof children === "function") { - return children(sceneProps); - } else if (component) { - return React.createElement(component, sceneProps); - } - return null; - }; - - renderScene = (sceneProps: TabSubViewProps) => { - return ( - {this.renderSceneView(sceneProps)} - ); - }; - render() { return ( { const ownProps = { ...this.props, ...props }; @@ -90,19 +27,17 @@ class BottomNavigation extends React.Component { , ownProps )} renderFooter={renderSubView( - this.renderNavigationBar, + sceneProps => , ownProps )} renderScene={renderSubView( - this.renderScene, + sceneProps => , ownProps )} /> @@ -112,5 +47,3 @@ class BottomNavigation extends React.Component { ); } } - -export default BottomNavigation; From ea5d8731d5e5bd04c44227d4f00de4b58da86d6c Mon Sep 17 00:00:00 2001 From: Kalle Ott Date: Tue, 23 Jan 2018 10:35:53 +0100 Subject: [PATCH 026/357] added todos for any-types --- types/react-router-navigation/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-router-navigation/index.d.ts b/types/react-router-navigation/index.d.ts index 452c7bea7b..0053f7ea30 100644 --- a/types/react-router-navigation/index.d.ts +++ b/types/react-router-navigation/index.d.ts @@ -19,6 +19,7 @@ import { export type CardProps = RouteProps & NavBarProps; +// TODO specify exact type when lib changes export type CardSubViewProps = any; // NavigationSceneRendererProps & // CardsRendererProps & @@ -58,6 +59,7 @@ export type Card = CardProps & { key: string }; * Tabs */ +// TODO specify exact type when lib changes export type TabSubViewProps = any; // SceneRendererProps & // TabsRendererProps & From ec269fbabef474816602e98fb9d2202af8c13d0f Mon Sep 17 00:00:00 2001 From: Kalle Ott Date: Tue, 23 Jan 2018 10:36:20 +0100 Subject: [PATCH 027/357] removed eslint-comment --- types/react-router-navigation-core/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react-router-navigation-core/index.d.ts b/types/react-router-navigation-core/index.d.ts index c452ebb94c..a7ad09748c 100644 --- a/types/react-router-navigation-core/index.d.ts +++ b/types/react-router-navigation-core/index.d.ts @@ -150,7 +150,6 @@ export const build: ( oldBuild?: Item[] ) => Item[]; -// eslint-disable-next-line export const runHistoryListenner: ( history: History, onListenHistory: () => void From ede9553e0cc289e29c6cf4a6e92e7474ee26cfde Mon Sep 17 00:00:00 2001 From: CodeAnimal Date: Tue, 23 Jan 2018 17:34:26 +0000 Subject: [PATCH 028/357] Update Stripe package (#23083) * Update ICard#customer type def Add `string` to `customer` type. * Add pay options to Invoices#pay method * Add tests * Change IMetadata to a `type` equal to `any` See tests as to the reasons why I believe it's useful for it to be changed. * Add proration creation options to SubscriptionItems Plus tests. Documentation: https://stripe.com/docs/api#create_subscription_item * Update IMetadata definition with tests * Add IOptionsMetadata --- types/stripe/index.d.ts | 81 ++++++++++++++++++++---------------- types/stripe/stripe-tests.ts | 43 +++++++++++++++++-- 2 files changed, 85 insertions(+), 39 deletions(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index b2e4d3ff25..c2d60ea644 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -8,6 +8,7 @@ // Kyle Kamperschroer // Kensuke Hoshikawa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// @@ -557,7 +558,7 @@ declare namespace Stripe { interface IApplicationFeeRefunds extends IList, resources.ApplicationFeeRefunds { } - interface IApplicationFeeRefundCreationOptions extends IDataOptions { + interface IApplicationFeeRefundCreationOptions extends IDataOptionsWithMetadata { /** * A positive integer in pence representing how much of this fee to refund. * Can only refund up to the unrefunded amount remaining of the fee. @@ -565,14 +566,6 @@ declare namespace Stripe { * default is entire application fee */ amount?: number; - - /** - * A set of key/value pairs that you can attach to a refund object. It can be - * useful for storing additional information about the refund in a structured - * format. You can unset an individual key by setting its value to null and - * then saving. To clear all keys, set metadata to null, then save. - */ - metadata?: IMetadata; } } @@ -878,7 +871,7 @@ declare namespace Stripe { transfer: string | transfers.ITransfer; } - interface IChargeCreationOptions extends IDataOptions { + interface IChargeCreationOptions extends IDataOptionsWithMetadata { /** * A positive integer in the smallest currency unit (e.g 100 cents to charge * $1.00, or 1 to charge ¥1, a 0-decimal currency) representing how much to @@ -947,14 +940,6 @@ declare namespace Stripe { */ on_behalf_of?: string; - /** - * A set of key/value pairs that you can attach to a charge object. It can be - * useful for storing additional information about the customer in a - * structured format. It's often a good idea to store an email address in - * metadata for tracking later. - */ - metadata?: IMetadata; - /** * The email address to send this charge's receipt to. The receipt will not be * sent until the charge is paid. If this charge is for a customer, the email @@ -2088,6 +2073,14 @@ declare namespace Stripe { tax_percent?: number; } + interface IInvoicePayOptions extends IDataOptionsWithMetadata { + /** + * A payment source to be charged. The source must be the ID of a source + * belonging to the customer associated with the invoice being paid. + */ + source?: sources.ISourceCreationOptions; + } + interface IInvoiceListOptions extends IListOptions { /** * The identifier of the customer whose invoices to return. If none is provided, all invoices will be returned. @@ -4024,7 +4017,7 @@ declare namespace Stripe { * in the card object if the card belongs to an account or recipient * instead. */ - customer?: customers.ICustomer; + customer?: string | customers.ICustomer; /** * Only applicable on accounts (not customers or recipients). This @@ -4157,7 +4150,7 @@ declare namespace Stripe { interface ISourceCreationOptions { /** - * he type of payment source. Should be "card". + * The type of payment source. Should be "card". */ object: "card"; @@ -4195,7 +4188,7 @@ declare namespace Stripe { address_state?: string; address_zip?: string; - metadata?: IMetadata; + metadata?: IOptionsMetadata; } interface ISourceCreationOptionsExtended extends ISourceCreationOptions { @@ -4550,6 +4543,17 @@ declare namespace Stripe { * The quantity you’d like to apply to the subscription item you’re creating. */ quantity?: number; + + /** + * Flag indicating whether to prorate switching plans during a billing cycle. + */ + prorate?: boolean; + + /** + * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same + * proration that was previewed with the upcoming invoice endpoint. + */ + proration_date?: number; } interface ISubscriptionItemUpdateOptions extends IDataOptionsWithMetadata { @@ -4646,7 +4650,7 @@ declare namespace Stripe { receipt_number: string; } - interface IRefundCreationOptions extends IDataOptions { + interface IRefundCreationOptions extends IDataOptionsWithMetadata { /** * A positive integer in cents/pence representing how much of this charge to * refund. Can only refund up to the unrefunded amount remaining of the @@ -4656,14 +4660,6 @@ declare namespace Stripe { */ amount?: number; - /** - * A set of key/value pairs that you can attach to a refund object. It can be - * useful for storing additional information about the refund in a structured - * format. You can unset an individual key by setting its value to null and - * then saving. To clear all keys, set metadata to null, then save. - */ - metadata?: IMetadata; - /** * String indicating the reason for the refund. If set, possible values are * "duplicate", "fraudulent", and "requested_by_customer". Specifying @@ -4980,8 +4976,8 @@ declare namespace Stripe { * * This request only accepts metadata as an argument. */ - updateRefund(feeId: string, refundId: string, data: { metadata?: IMetadata }, options: HeaderOptions, response?: IResponseFn): Promise; - updateRefund(feeId: string, refundId: string, data: { metadata?: IMetadata }, response?: IResponseFn): Promise; + updateRefund(feeId: string, refundId: string, data: { metadata?: IOptionsMetadata }, options: HeaderOptions, response?: IResponseFn): Promise; + updateRefund(feeId: string, refundId: string, data: { metadata?: IOptionsMetadata }, response?: IResponseFn): Promise; /** * You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available @@ -5025,8 +5021,8 @@ declare namespace Stripe { * * This request only accepts metadata as an argument. */ - update(refundId: string, data: { metadata?: IMetadata }, options: HeaderOptions, response?: IResponseFn): Promise; - update(refundId: string, data: { metadata?: IMetadata }, response?: IResponseFn): Promise; + update(refundId: string, data: { metadata?: IOptionsMetadata }, options: HeaderOptions, response?: IResponseFn): Promise; + update(refundId: string, data: { metadata?: IOptionsMetadata }, response?: IResponseFn): Promise; /** * You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available @@ -6155,6 +6151,9 @@ declare namespace Stripe { * * @param id The ID of the invoice to pay. */ + pay(id: string, data: invoices.IInvoicePayOptions, options: HeaderOptions, response?: IResponseFn): Promise; + pay(id: string, data: invoices.IInvoicePayOptions, response: IResponseFn): Promise; + pay(id: string, data: invoices.IInvoicePayOptions): Promise; pay(id: string, options: HeaderOptions, response?: IResponseFn): Promise; pay(id: string, response?: IResponseFn): Promise; @@ -6790,7 +6789,17 @@ declare namespace Stripe { * A set of key/value pairs that you can attach to an object. It can be useful for storing * additional information about the object in a structured format. */ - interface IMetadata { } + interface IOptionsMetadata { + [x: string]: string | number; + } + + /** + * A set of key/value pairs that you can attach to an object. It can be useful for storing + * additional information about the object in a structured format. + */ + interface IMetadata { + [x: string]: string; + } interface IShippingInformation { /** @@ -6919,7 +6928,7 @@ declare namespace Stripe { * format. You can unset an individual key by setting its value to null and * then saving. To clear all keys, set metadata to null, then save. */ - metadata?: IMetadata; + metadata?: IOptionsMetadata; } interface IHeaderOptions { diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index a2ada0a182..60374b697d 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -1,4 +1,5 @@ import Stripe = require('stripe'); +import { customers } from 'stripe'; var stripe = new Stripe("sk_test_BF573NobVn98OiIsPAv7A04K") @@ -230,17 +231,22 @@ stripe.charges.markAsFraudulent('ch_15fvyXEe31JkLCeQOo0SwFk9').then(function (re stripe.customers.create({ description: 'Customer for test@example.com', - source: "tok_15V2YhEe31JkLCeQy9iUgsJX" // obtained with Stripe.js + source: "tok_15V2YhEe31JkLCeQy9iUgsJX", // obtained with Stripe.js + metadata: { test: "123", test2: 123 } // IOptionsMetadata test }, function (err, customer) { // asynchronously called }); stripe.customers.create({ description: 'Customer for test@example.com', - source: "tok_15V2YhEe31JkLCeQy9iUgsJX" // obtained with Stripe.js + source: "tok_15V2YhEe31JkLCeQy9iUgsJX", // obtained with Stripe.js + metadata: null // IOptionsMetadata test }).then( function (customer) { // asynchronously called customer.cards.create({ card: "tok_17wV94BoqMA9o2xkhlAd3ALf"}).then(function (customer) {}); - customer.cards.retrieve("card_17xMvXBoqMA9o2xkq6W5gamx").then(function (card) {}); + customer.cards.retrieve("card_17xMvXBoqMA9o2xkq6W5gamx").then(function (card) { + let strCustomer: string = card.customer; + let objCustomer: customers.ICustomer = card.customer; + }); customer.cards.update("card_17xMvXBoqMA9o2xkq6W5gamx", { name: "Test" }).then(function (card) {}); customer.cards.list().then(function (cards) {}); customer.cards.del("card_17xMvXBoqMA9o2xkq6W5gamx").then(function (confirmation) {}); @@ -251,6 +257,29 @@ stripe.customers.create({ customer.subscriptions.list().then(function (subscriptions) { }); customer.subscriptions.del("sub_8Eluur5KoIKxuy").then(function (subscription) { }); customer.subscriptions.deleteDiscount("sub_8Eluur5KoIKxuy").then(function (confirmation) { }); + + // IMetadata tests: + let str: string; + customer.metadata["test"] == str; + customer.metadata.test1 == str; + + //IOptionsMetadata tests: + let metadata: Stripe.IOptionsMetadata; + let num: number; + metadata["test"] = str; + metadata["test"] = num; + metadata["test"] == str; + metadata["test"] == num; + metadata.testStr = str; + metadata.testNum = num; + metadata.test1 == str; + metadata.test2 == num; + metadata = { + test1: str, + test2: num + } + metadata = {}; + metadata = null; }); @@ -880,6 +909,10 @@ stripe.invoices.pay("in_15fvyXEe31JkLCeQH7QbgZZb").then(function (invoice) { // asynchronously called }); +stripe.invoices.pay("in_15fvyXEe31JkLCeQH7QbgZZb", { source: "source_id" }).then(function (invoice) { + // asynchronously called +}); + stripe.invoices.list( { customer: "cus_5rfJKDJkuxzh5Q", limit: 3 }, function (err, invoices) { @@ -1134,6 +1167,10 @@ stripe.subscriptionItems.create({ subscription: "sub_C9giwDfCeN8fwt", plan: "pla // asynchronously called }); +stripe.subscriptionItems.create({ subscription: "sub_C9giwDfCeN8fwt", plan: "platypi-dev", prorate: true, proration_date: Math.round(new Date().valueOf() / 1000) }).then(function(subscriptionItem) { + // asynchronously called +}); + stripe.subscriptionItems.retrieve("si_C9gimdd2l9qvCU", function(err, subscriptionItem) { // asynchronously called }); From acbc6ad7f5d0c7680cfc2a637d42696a748dfcb3 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 23 Jan 2018 10:09:50 -0800 Subject: [PATCH 029/357] Fixed typo and updated test for 'silent' option in 'gulp-connect'. (#23124) --- types/gulp-connect/gulp-connect-tests.ts | 3 ++- types/gulp-connect/index.d.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/gulp-connect/gulp-connect-tests.ts b/types/gulp-connect/gulp-connect-tests.ts index feafa1007b..f1767701b0 100644 --- a/types/gulp-connect/gulp-connect-tests.ts +++ b/types/gulp-connect/gulp-connect-tests.ts @@ -100,7 +100,8 @@ gulp.task('connect', () => { root: [__dirname], port: 8081, livereload: true, - middleware: (connect, opt) => middleware + middleware: (connect, opt) => middleware, + silent: true }); }); diff --git a/types/gulp-connect/index.d.ts b/types/gulp-connect/index.d.ts index e099f62a39..b8b1a467f9 100644 --- a/types/gulp-connect/index.d.ts +++ b/types/gulp-connect/index.d.ts @@ -39,7 +39,7 @@ export interface ConnectAppOptions { host?: string; /** Don't log any messages. Defaults to false. */ - slient?: boolean; + silent?: boolean; /** * Options to pass to http.createServer (or false to disable https). From 27a4ffdc6f5139e3c03e507ae7c7086ba3d82cb0 Mon Sep 17 00:00:00 2001 From: YairTawil Date: Tue, 23 Jan 2018 20:10:26 +0200 Subject: [PATCH 030/357] types/openlayers - updates for olx.interaction.SelectOptions and ol.View (#23123) * Initialize ol type * Type definitions * import openlayers * Update tsconfig.json * Update index.d.ts * fix(): no-declare-current-package * lint(): new line at end of files * fix(test, lint) * fix(tsconfig): format tsconfig.json * fix(types/ol): add import 'ol' from 'openalyers' * types/openlayers add hitTolerance to SelectOptions * update 'Definitions by' --- types/openlayers/index.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/types/openlayers/index.d.ts b/types/openlayers/index.d.ts index c2e7ab1530..924b66f514 100644 --- a/types/openlayers/index.d.ts +++ b/types/openlayers/index.d.ts @@ -6,6 +6,7 @@ // Alexandre Melard // Chad Johnston // Dan Manastireanu +// Yair Tawil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Definitions partially generated using tsd-jsdoc (https://github.com/englercj/tsd-jsdoc) @@ -12383,11 +12384,11 @@ declare module ol { * The size is the pixel dimensions of the box into which the calculated extent * should fit. In most cases you want to get the extent of the entire map, * that is `map.getSize()`. - * @param {ol.Size} size Box pixel size. + * @param {ol.Size=} size Box pixel size. * @return {ol.Extent} Extent. * @api stable */ - calculateExtent(size: ol.Size): ol.Extent; + calculateExtent(size?: ol.Size): ol.Extent; /** * Get the maximum resolution of the view. @@ -13325,7 +13326,8 @@ declare module olx { * multi: (boolean|undefined), * features: (ol.Collection.|undefined), * filter: (ol.SelectFilterFunction|undefined), - * wrapX: (boolean|undefined)}} + * wrapX: (boolean|undefined), + * hitTolerance: (number|undefined)}} */ interface SelectOptions { addCondition?: ol.EventsConditionType; @@ -13338,6 +13340,7 @@ declare module olx { features?: ol.Collection; filter?: ol.SelectFilterFunction; wrapX?: boolean; + hitTolerance?: number; } From e2a3302098ed6ed7e75407eafc2d7bdc1af93163 Mon Sep 17 00:00:00 2001 From: lihao Date: Wed, 24 Jan 2018 02:11:10 +0800 Subject: [PATCH 031/357] export mongodb Logger (#23122) * export mongodb Logger * format file --- types/mongodb/index.d.ts | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 4364c0efe2..8bd069dcd6 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1453,3 +1453,49 @@ export interface ChangeStreamOptions { } type GridFSBucketWriteStreamId = string | number | Object | ObjectID; + +export interface LoggerOptions { + loggerLevel: string // Custom logger function + logger: log // Override default global log level. +} + +export type log = (message?: string, state?: LoggerState) => void + +export interface LoggerState { + type: string + message: string + className: string + pid: number + date: number +} + +/** http://mongodb.github.io/node-mongodb-native/3.0/api/Logger.html */ +export class Logger{ + constructor(className: string,options: LoggerOptions) + // Log a message at the debug level + debug(message: string, state: LoggerState):void + // Log a message at the warn level + warn(message: string, state: LoggerState):void + // Log a message at the info level + info(message: string, state: LoggerState):void + // Log a message at the error level + error(message: string, state: LoggerState):void + // Is the logger set at info level + isInfo():boolean + // Is the logger set at error level + isError():boolean + // Is the logger set at error level + isWarn():boolean + // Is the logger set at debug level + isDebug():boolean + // Resets the logger to default settings, error and no filtered classes + static reset():void + // Get the current logger function + static currentLogger():log + //Set the current logger function + static setCurrentLogger(log: log):void + // Set what classes to log. + static filter(type: string,values: string[]):void + // Set the current log level + static setLevel(level: string):void +} From e4bb06153ab26d3b37a7787b12f9fb633e7a36fd Mon Sep 17 00:00:00 2001 From: jimwards17 Date: Tue, 23 Jan 2018 13:11:39 -0500 Subject: [PATCH 032/357] Update index.d.ts (#23117) see this related issue that is now closed: https://github.com/leongersen/noUiSlider/issues/813 When calling get type should be strings --- types/nouislider/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nouislider/index.d.ts b/types/nouislider/index.d.ts index 0e070e89c7..76b62371fe 100644 --- a/types/nouislider/index.d.ts +++ b/types/nouislider/index.d.ts @@ -179,7 +179,7 @@ declare namespace noUiSlider { * To get the current slider value. For one-handle sliders, calling .get() will return the value. * For two-handle sliders, an array[value, value] will be returned. */ - get(): number | number[]; + get(): string | string[]; /** * noUiSlider will keep your values within the slider range, which saves you a bunch of validation. * If you have configured the slider to use one handle, you can change the current value by passing From ae52dc806ca2d2c3b425a70191834f192449034c Mon Sep 17 00:00:00 2001 From: Akos Krivachy Date: Tue, 23 Jan 2018 18:12:15 +0000 Subject: [PATCH 033/357] Update @types/username typings from 1.0.1 to 3.0.0 (#23112) The API has been promisifyed, instead of using a callback based one --- types/username/index.d.ts | 7 ++++--- types/username/username-tests.ts | 11 +++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/types/username/index.d.ts b/types/username/index.d.ts index e0bceed481..4d8c34ee10 100644 --- a/types/username/index.d.ts +++ b/types/username/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for username v1.0.1 +// Type definitions for username v3.0.0 // Project: https://www.npmjs.com/package/username // Definitions by: Klaus Reimer +// Akos Krivachy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,9 +10,9 @@ * Falls back to `id -un` on OS X / Linux and `whoami` on Windows in the rare case none of the environment * variables are set. The result is cached. * - * @param callback The callback function to call asynchronously with the result. + * @return Promise A promise containing the username or empty string if not found. */ -declare function username(callback: (err: Error, result: string) => void): void; +declare function username(): Promise; declare namespace username { /** diff --git a/types/username/username-tests.ts b/types/username/username-tests.ts index c6e739c14f..a5bbe51aca 100644 --- a/types/username/username-tests.ts +++ b/types/username/username-tests.ts @@ -1,9 +1,12 @@ import username = require("username"); -username(function(err, username) { - err === new Error(); - username === "string"; -}); +username() + .then((username) => { + username === "string"; + }) + .catch((err) => { + err === new Error(); + }); username.sync() === "string"; From 716acfd6b29b6b15cb497f1168f756a98d856d26 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 23 Jan 2018 10:15:13 -0800 Subject: [PATCH 034/357] core-js: Fix lint (#23135) --- types/core-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/core-js/index.d.ts b/types/core-js/index.d.ts index 36024c3c8a..171aebc943 100644 --- a/types/core-js/index.d.ts +++ b/types/core-js/index.d.ts @@ -712,7 +712,7 @@ declare namespace core { from(arrayLike: ArrayLike | Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; from(arrayLike: ArrayLike | Iterable): T[]; of(...items: T[]): T[]; - isArray(arg: any): arg is Array; + isArray(arg: any): arg is any[]; push(array: ArrayLike, ...items: T[]): number; pop(array: ArrayLike): T; concat(array: ArrayLike, ...items: Array): T[]; From 2e2da6027f2980901ca23f484343f8828c515190 Mon Sep 17 00:00:00 2001 From: UselessPickles Date: Tue, 23 Jan 2018 13:18:02 -0500 Subject: [PATCH 035/357] [enzyme] Fix signature of the "filter" method. (#23108) * Improve signature of ShallowWrapper.filter and ReactWrapper.filter to return appropriate specific types when the apram is a ComponentClass or StatelessComponent. * Improve signature of filter() to return a wrapper with HTMLAttributes props when a string CSS selector is provided. * Improve unit tests to properly test various signatures of methods that are expected to return wrappers with different props types. * [enzyme] Fix signature of "filter" when param type does not narrow down the possible type of the element/component collection. * [enzyme] Fix incorrect use of "this" return type in "filter" signatures. --- types/enzyme/enzyme-tests.tsx | 14 ++++++++++++-- types/enzyme/index.d.ts | 6 ++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index 720037cbfa..50f9bf3f38 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -109,8 +109,13 @@ function ShallowWrapperTest() { function test_filter() { anotherComponentWrapper = shallowWrapper.filter(AnotherComponent); anotherStatelessWrapper = shallowWrapper.filter(AnotherStatelessComponent); + // NOTE: The following calls to filter do not narrow down the possible type of the result based + // on the type of the param, so the return type should not be different than the original + // "this". This is a special case for "filter" vs other methods like "find", because "filter" + // is guaranteed to return only a subset of the existing list of components/elements without + // finding/adding more. shallowWrapper = shallowWrapper.filter({ numberProp: 12 }); - elementWrapper = shallowWrapper.filter('.selector'); + shallowWrapper = shallowWrapper.filter('.selector'); } function test_filterWhere() { @@ -487,10 +492,15 @@ function ReactWrapperTest() { } function test_filter() { - elementWrapper = reactWrapper.filter('.selector'); anotherComponentWrapper = reactWrapper.filter(AnotherComponent); anotherStatelessWrapper = reactWrapper.filter(AnotherStatelessComponent); + // NOTE: The following calls to filter do not narrow down the possible type of the result based + // on the type of the param, so the return type should not be different than the original + // "this". This is a special case for "filter" vs other methods like "find", because "filter" + // is guaranteed to return only a subset of the existing list of components/elements without + // finding/adding more. reactWrapper = reactWrapper.filter({ numberProp: 12 }); + reactWrapper = reactWrapper.filter('.selector'); } function test_filterWhere() { diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index 4d3c75d6c1..d23af4ab04 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -375,8 +375,7 @@ export class ShallowWrapper

{ */ filter(component: ComponentClass): ShallowWrapper; filter(statelessComponent: StatelessComponent): ShallowWrapper; - filter(props: EnzymePropSelector): this; - filter(selector: string): ShallowWrapper; + filter(props: EnzymePropSelector | string): ShallowWrapper; /** * Finds every node in the render tree that returns true for the provided predicate function. @@ -496,8 +495,7 @@ export class ReactWrapper

{ */ filter(component: ComponentClass): ReactWrapper; filter(statelessComponent: StatelessComponent): ReactWrapper; - filter(props: EnzymePropSelector): this; - filter(selector: string): ReactWrapper; + filter(props: EnzymePropSelector | string): ReactWrapper; /** * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector From c2f0e4aea16259f12d7e4512b56d2b716fb9119b Mon Sep 17 00:00:00 2001 From: suXin Date: Wed, 24 Jan 2018 01:19:03 +0700 Subject: [PATCH 036/357] Add @types/forms (#23103) --- types/forms/forms-tests.ts | 74 ++++++++++++ types/forms/index.d.ts | 238 +++++++++++++++++++++++++++++++++++++ types/forms/tsconfig.json | 23 ++++ types/forms/tslint.json | 1 + 4 files changed, 336 insertions(+) create mode 100644 types/forms/forms-tests.ts create mode 100644 types/forms/index.d.ts create mode 100644 types/forms/tsconfig.json create mode 100644 types/forms/tslint.json diff --git a/types/forms/forms-tests.ts b/types/forms/forms-tests.ts new file mode 100644 index 0000000000..df785a12cb --- /dev/null +++ b/types/forms/forms-tests.ts @@ -0,0 +1,74 @@ +import { create, fields, validators, widgets, FieldBound } from 'forms'; + +const complexForm = create({ + name: fields.string({ required: validators.required('%s is required, silly!') }), + email: fields.email({ required: true, label: 'Email Address' }), + website: fields.url(), + password: fields.password({ required: true }), + password_confirm: fields.password({ + required: true, + validators: [validators.matchField('password')] + }), + phone_1: fields.string({ validators: [validators.requiresFieldIfEmpty('phone_2')] }), + phone_2: fields.string({ validators: [validators.requiresFieldIfEmpty('phone_1')] }), + options: fields.string({ + choices: { + one: 'option one', + two: 'option two', + three: 'option three' + }, + widget: widgets.select(), + validators: [ (form, field, callback) => { + if (field.data === 'two') { + callback('two?! are you crazy?!'); + } else { + callback(); + } + } ] + }), + more_options: fields.array({ + choices: { one: 'item 1', two: 'item 2', three: 'item 3' }, + widget: widgets.multipleCheckbox() + }), + even_more: fields.string({ + choices: { one: 'item 1', two: 'item 2', three: 'item 3' }, + widget: widgets.multipleRadio() + }), + and_more: fields.array({ + choices: { one: 'item 1', two: 'item 2', three: 'item 3' }, + widget: widgets.multipleSelect() + }), + notes: fields.string({ widget: widgets.textarea({ rows: 6 }) }), + spam_me: fields.boolean(), + nested_1: { + nested_2: { + nested: fields.string() + } + }, + bootstrapTitle: fields.string({ + required: true, + widget: widgets.text({ classes: [ 'input-with-feedback' ] }), + errorAfterField: true, + cssClasses: { + label: [ 'control-label col col-lg-3' ] + } + }) +}); + +const output = complexForm.toHTML(); +const bootstrapOutput = complexForm.toHTML((name, object) => { + if (!Array.isArray(object.widget.classes)) { + object.widget.classes = []; + } + + if (object.widget.classes.indexOf('form-control') === -1) { + object.widget.classes.push('form-control'); + } + + const validationclass = object.error ? 'has-error' : ''; + const label = object.labelHTML(name); + const widget = object.widget.toHTML(name, object); + const error = object.error ? `

${object.error}
` : ''; + + return `
${label}${widget}${error}
`; +}); diff --git a/types/forms/index.d.ts b/types/forms/index.d.ts new file mode 100644 index 0000000000..a9690dde47 --- /dev/null +++ b/types/forms/index.d.ts @@ -0,0 +1,238 @@ +// Type definitions for forms 1.3 +// Project: https://github.com/caolan/forms +// Definitions by: suXin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface FieldObjectChoice { + [key: string]: string | FieldObjectChoice; +} + +export interface FieldArrayChoice extends Array<[string, string | FieldArrayChoice]> {} + +export interface FieldParameters { + /** Optional label text which overrides the default. */ + label?: string; + + /** Boolean describing whether the field is mandatory. */ + required?: boolean | ValidatorFunction; + + /** An array of functions which validate the field data. */ + validators?: ValidatorFunction[]; + + /** A widget object to use when rendering the field. */ + widget?: Widget; + + /** An optional id to override the default. */ + id?: string; + + /** A list of options, used for multiple choice fields. */ + choices?: FieldObjectChoice | FieldArrayChoice; + + /** A list of CSS classes for label and field wrapper. */ + cssClasses?: { + field?: string[] + label?: string[] + }; + + /** If true, errors won't be rendered automatically. */ + hideError?: boolean; + + /** If true, the label text will be displayed after the field, rather than before. */ + labelAfterField?: boolean; + + /** If true, the error message will be displayed after the field, rather than before. */ + errorAfterField?: boolean; + + /** For widgets with a fieldset (multipleRadio and multipleCheckbox), set classes for the fieldset. */ + fieldsetClasses?: string[]; + + /** For widgets with a fieldset (multipleRadio and multipleCheckbox), set classes for the fieldset's legend. */ + legendClasses?: string[]; +} + +export type FieldIterator = (name: string, field: FieldBound) => string; + +export interface Field extends FieldParameters { + /** A widget object to use when rendering the field. */ + widget: Widget; + + /** Coerces the raw data from the request into the correct format for the field, returning the result, e.g. '123' becomes 123 for the number field. */ + parse: (rawData: any) => any; + + /** Returns a new bound field object. Calls parse on the data and stores in the bound field's data attribute, stores the raw value in the value attribute. */ + bind: (rawData: any) => FieldBound; + + /** Returns a string containing a HTML element containing the fields error message, or an empty string if there is no error associated with the field. */ + errorHTML: () => string; + + /** Returns a string containing the label text from field.label, or defaults to using the field name with underscores replaced with spaces and the first letter capitalised. */ + labelText: (name?: string) => string; + + /** Returns a string containing a label element with the correct 'for' attribute containing the text from field.labelText(name). */ + labelHTML: (name: string, id?: string | boolean) => string; + + /** Returns an array of default CSS classes considering the field's attributes, e.g. ['field', 'required', 'error'] for a required field with an error message. */ + classes: () => string[]; + + /** + * Calls the iterator with the name and field object as arguments. Defaults to using forms.render.div as the iterator, + * which returns a HTML representation of the field label, error message and widget wrapped in a div. + */ + toHTML: (name?: string, iterator?: FieldIterator) => string; +} + +export interface FieldBound extends Field { + /** The raw value from the request data. */ + value: any; + + /** The request data coerced to the correct format for this field. */ + data: any; + + /** An error message if the field fails validation. */ + error: string; + + /** + * Checks if the field is required and whether it is empty. Then runs the validator functions in order until one fails or they all pass. + * If a validator fails, the resulting message is stored in the field's error attribute. + */ + validate: (form: Form, callback: (err: string, field: Field) => void) => void; +} + +export interface Widget extends WidgetParameters { + formatValue: (value: any) => any; + + /** Returns a string containing a HTML representation of the widget for the given field. */ + toHTML: (name: string, field?: Field) => string; +} + +export interface WidgetParameters { + /** Custom classes to add to the rendered widget. */ + classes?: string[]; + + /** Custom classes to add to the choices label when applicable (multipleRadio and multipleCheckbox) */ + labelClasses?: string[]; + + /** A string representing the widget type, e.g. 'text' or 'checkbox' */ + type?: string; +} + +/** + * A function that accepts a bound form, bound field and a callback as arguments. + * It should apply a test to the field to assert its validity. + * Once processing has completed it must call the callback with no arguments if the field is valid or with an error message if the field is invalid. + */ +export type ValidatorFunction = (form: FormBound, field: FieldBound, callback: (err?: string) => void) => void; + +export interface FormFields { + [key: string]: Field | FormFields; +} + +export type FormHandleCallback = (form: Form) => void; + +export interface Form { + /** Field objects this form was created with */ + fields: FormFields; + + /** Inspects a request or object literal and binds any data to the correct fields. */ + handle: ( + req: { + method: string, + url: string + body: string + }, + callbacks: { + success?: FormHandleCallback + error?: FormHandleCallback + empty?: FormHandleCallback + other?: FormHandleCallback + } + ) => void; + + /** Binds data to correct fields, returning a new bound form object. */ + bind: (data: any) => FormBound; + + /** + * Runs toHTML on each field returning the result. + * If an iterator is specified, it is called for each field with the field name and object as it's arguments, + * the iterator's results are concatenated to create the HTML output, allowing for highly customised markup. + */ + toHTML: (iterator?: FieldIterator) => string; +} + +export interface FormBound extends Form { + /** Object containing all the parsed data keyed by field name. */ + data: any; + + /** Calls validate on each field in the bound form and returns the resulting form object to the callback. */ + validate: (callback: (err: string, form: FormBound) => void) => void; + + /** Checks all fields for an error attribute. Returns false if any exist, otherwise returns true. */ + isValid: () => boolean; +} + +/** Converts a form definition (an object literal containing field objects) into a form object. */ +export function create(fields: FormFields, options?: { + /** If false, the first validation error will halt form validation, otherwise all fields will be validated. */ + validatePastFirstError?: boolean +}): Form; + +export namespace fields { + function array(params?: FieldParameters): Field; + function boolean(params?: FieldParameters): Field; + function date(params?: FieldParameters): Field; + function email(params?: FieldParameters): Field; + function number(params?: FieldParameters): Field; + function password(params?: FieldParameters): Field; + function string(params?: FieldParameters): Field; + function tel(params?: FieldParameters): Field; + function url(params?: FieldParameters): Field; +} + +export namespace validators { + function alphanumeric(errorMessage?: string): ValidatorFunction; + function color(errorMessage?: string): ValidatorFunction; + function date(errorMessage?: string): ValidatorFunction; + function digits(errorMessage?: string): ValidatorFunction; + function integer(errorMessage?: string): ValidatorFunction; + function email(errorMessage?: string): ValidatorFunction; + function matchField(matchedField: string, errorMessage?: string): ValidatorFunction; + function matchValue(valueGetter: () => any, errorMessage?: string): ValidatorFunction; + function max(value: number, errorMessage?: string): ValidatorFunction; + function maxlength(value: number, errorMessage?: string): ValidatorFunction; + function min(value: number, errorMessage?: string): ValidatorFunction; + function minlength(value: number, errorMessage?: string): ValidatorFunction; + function range(min: number, max: number, errorMessage?: string): ValidatorFunction; + function rangelength(min: number, max: number, errorMessage?: string): ValidatorFunction; + function regexp(regexp: RegExp, errorMessage?: string): ValidatorFunction; + function required(errorMessage?: string): ValidatorFunction; + function requiresFieldIfEmpty(alternateField: string, errorMessage?: string): ValidatorFunction; + function url(errorMessage?: string): ValidatorFunction; +} + +export namespace widgets { + function checkbox(params?: WidgetParameters): Widget; + function color(params?: WidgetParameters): Widget; + function date(params?: WidgetParameters): Widget; + function email(params?: WidgetParameters): Widget; + function hidden(params?: WidgetParameters): Widget; + function number(params?: WidgetParameters): Widget; + function label(params?: WidgetParameters): Widget; + function multipleCheckbox(params?: WidgetParameters): Widget; + function multipleRadio(params?: WidgetParameters): Widget; + function multipleSelect(params?: WidgetParameters): Widget; + function password(params?: WidgetParameters): Widget; + function select(params?: WidgetParameters): Widget; + function tel(params?: WidgetParameters): Widget; + function text(params?: WidgetParameters): Widget; + function textarea(params?: WidgetParameters & { rows?: number, cols?: number }): Widget; +} + +/** A function which accepts a name and field as arguments and returns a string containing a HTML representation of the field. */ +export type RenderFunction = (name: string, field: Field) => string; + +export namespace render { + const div: RenderFunction; + const p: RenderFunction; + const li: RenderFunction; + const table: RenderFunction; +} diff --git a/types/forms/tsconfig.json b/types/forms/tsconfig.json new file mode 100644 index 0000000000..1185c1ffbb --- /dev/null +++ b/types/forms/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "forms-tests.ts" + ] +} diff --git a/types/forms/tslint.json b/types/forms/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/forms/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 37685e11dd4e4d1d169a549a3b5c4a3367975c78 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 23 Jan 2018 10:19:36 -0800 Subject: [PATCH 037/357] Add tslint disables for no-const-enum (#23134) --- types/activex-access/tslint.json | 4 ++-- types/activex-adodb/tslint.json | 7 ++++++- types/activex-dao/tslint.json | 4 ++-- types/activex-excel/tslint.json | 4 ++-- types/activex-infopath/tslint.json | 4 ++-- types/activex-libreoffice/tslint.json | 2 +- types/activex-msforms/tslint.json | 4 ++-- types/activex-mshtml/tslint.json | 4 ++-- types/activex-msxml2/tslint.json | 4 ++-- types/activex-office/tslint.json | 4 ++-- types/activex-outlook/tslint.json | 4 ++-- types/activex-powerpoint/tslint.json | 4 ++-- types/activex-scripting/tslint.json | 7 ++++++- types/activex-stdole/tslint.json | 4 ++-- types/activex-vbide/tslint.json | 4 ++-- types/activex-wia/tslint.json | 7 ++++++- types/activex-word/tslint.json | 4 ++-- types/big.js/tslint.json | 5 ++++- types/eonasdan-bootstrap-datetimepicker/tslint.json | 1 + types/exceljs/tslint.json | 4 +++- types/firmata/tslint.json | 7 ++++++- types/ftpd/tslint.json | 1 + types/intl-tel-input/tslint.json | 1 + types/jquery.qrcode/tslint.json | 1 + types/jquery/tslint.json | 1 + types/mfiles/tslint.json | 3 ++- types/microsoftteams/tslint.json | 7 +++++-- types/mysql/tslint.json | 5 ++++- types/nblas/tslint.json | 7 ++++++- types/node/v6/tslint.json | 1 + types/nodegit/tslint.json | 1 + types/nouislider/tslint.json | 1 + types/nouislider/v8/tslint.json | 1 + types/novnc-core/tslint.json | 7 ++++++- types/onesignal-cordova-plugin/tslint.json | 7 ++++++- types/parse/tslint.json | 1 + types/range-parser/tslint.json | 7 ++++++- types/ronomon__crypto-async/tslint.json | 7 ++++++- types/sharepoint/tslint.json | 1 + types/signalr/tslint.json | 1 + types/vexflow/tslint.json | 1 + types/webcl/tslint.json | 1 + types/wiiu/tslint.json | 1 + types/xrm/tslint.json | 1 + types/xrm/v6/tslint.json | 1 + types/xrm/v7/tslint.json | 1 + types/xrm/v8/tslint.json | 1 + types/youtube/tslint.json | 1 + 48 files changed, 119 insertions(+), 42 deletions(-) diff --git a/types/activex-access/tslint.json b/types/activex-access/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-access/tslint.json +++ b/types/activex-access/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-adodb/tslint.json b/types/activex-adodb/tslint.json index 2750cc0197..3224b40b8b 100644 --- a/types/activex-adodb/tslint.json +++ b/types/activex-adodb/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } \ No newline at end of file +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/activex-dao/tslint.json b/types/activex-dao/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-dao/tslint.json +++ b/types/activex-dao/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-excel/tslint.json b/types/activex-excel/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-excel/tslint.json +++ b/types/activex-excel/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-infopath/tslint.json b/types/activex-infopath/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-infopath/tslint.json +++ b/types/activex-infopath/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-libreoffice/tslint.json b/types/activex-libreoffice/tslint.json index 8e56cb082c..37a3c27489 100644 --- a/types/activex-libreoffice/tslint.json +++ b/types/activex-libreoffice/tslint.json @@ -1,8 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false], "ban-types": false, + "no-const-enum": false, "no-redundant-jsdoc": false, "no-redundant-jsdoc-2": false, "no-unnecessary-qualifier": false diff --git a/types/activex-msforms/tslint.json b/types/activex-msforms/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-msforms/tslint.json +++ b/types/activex-msforms/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-mshtml/tslint.json b/types/activex-mshtml/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-mshtml/tslint.json +++ b/types/activex-mshtml/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-msxml2/tslint.json b/types/activex-msxml2/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-msxml2/tslint.json +++ b/types/activex-msxml2/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-office/tslint.json b/types/activex-office/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-office/tslint.json +++ b/types/activex-office/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-outlook/tslint.json b/types/activex-outlook/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-outlook/tslint.json +++ b/types/activex-outlook/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-powerpoint/tslint.json b/types/activex-powerpoint/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-powerpoint/tslint.json +++ b/types/activex-powerpoint/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-scripting/tslint.json b/types/activex-scripting/tslint.json index 2750cc0197..3224b40b8b 100644 --- a/types/activex-scripting/tslint.json +++ b/types/activex-scripting/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } \ No newline at end of file +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/activex-stdole/tslint.json b/types/activex-stdole/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-stdole/tslint.json +++ b/types/activex-stdole/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-vbide/tslint.json b/types/activex-vbide/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-vbide/tslint.json +++ b/types/activex-vbide/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/activex-wia/tslint.json b/types/activex-wia/tslint.json index 2750cc0197..3224b40b8b 100644 --- a/types/activex-wia/tslint.json +++ b/types/activex-wia/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } \ No newline at end of file +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/activex-word/tslint.json b/types/activex-word/tslint.json index 4ac54521fe..3224b40b8b 100644 --- a/types/activex-word/tslint.json +++ b/types/activex-word/tslint.json @@ -1,6 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "interface-name": [false] + "no-const-enum": false } -} \ No newline at end of file +} diff --git a/types/big.js/tslint.json b/types/big.js/tslint.json index f93cf8562a..3224b40b8b 100644 --- a/types/big.js/tslint.json +++ b/types/big.js/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } } diff --git a/types/eonasdan-bootstrap-datetimepicker/tslint.json b/types/eonasdan-bootstrap-datetimepicker/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/eonasdan-bootstrap-datetimepicker/tslint.json +++ b/types/eonasdan-bootstrap-datetimepicker/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/exceljs/tslint.json b/types/exceljs/tslint.json index d9d49e375e..f7f033a1b7 100644 --- a/types/exceljs/tslint.json +++ b/types/exceljs/tslint.json @@ -1,6 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - "no-any-union": false + // TODO + "no-any-union": false, + "no-const-enum": false } } diff --git a/types/firmata/tslint.json b/types/firmata/tslint.json index 3db14f85ea..3224b40b8b 100644 --- a/types/firmata/tslint.json +++ b/types/firmata/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/ftpd/tslint.json b/types/ftpd/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/ftpd/tslint.json +++ b/types/ftpd/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/intl-tel-input/tslint.json b/types/intl-tel-input/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/intl-tel-input/tslint.json +++ b/types/intl-tel-input/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/jquery.qrcode/tslint.json b/types/jquery.qrcode/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/jquery.qrcode/tslint.json +++ b/types/jquery.qrcode/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/jquery/tslint.json b/types/jquery/tslint.json index dea67c016f..deae83dc66 100644 --- a/types/jquery/tslint.json +++ b/types/jquery/tslint.json @@ -9,6 +9,7 @@ "no-any-union": false, "no-arg": false, "no-boolean-literal-compare": false, + "no-const-enum": false, "no-declare-current-package": false, "no-empty-interface": false, "no-misused-new": false, diff --git a/types/mfiles/tslint.json b/types/mfiles/tslint.json index d2b1bdc0e6..42cc02d1f5 100644 --- a/types/mfiles/tslint.json +++ b/types/mfiles/tslint.json @@ -4,6 +4,7 @@ // The definitions need to use the same naming as the original typelib, see http://www.m-files.com/UI_Extensibility_Framework/#MFClientScript_P.html "interface-name": false, // The definition file is generated by a tool and not edited manually, thus long lines may be created - "max-line-length": false + "max-line-length": false, + "no-const-enum": false } } \ No newline at end of file diff --git a/types/microsoftteams/tslint.json b/types/microsoftteams/tslint.json index 30a1bdde2e..3224b40b8b 100644 --- a/types/microsoftteams/tslint.json +++ b/types/microsoftteams/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" -} \ No newline at end of file + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/mysql/tslint.json b/types/mysql/tslint.json index f93cf8562a..3224b40b8b 100644 --- a/types/mysql/tslint.json +++ b/types/mysql/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } } diff --git a/types/nblas/tslint.json b/types/nblas/tslint.json index 3db14f85ea..3224b40b8b 100644 --- a/types/nblas/tslint.json +++ b/types/nblas/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/node/v6/tslint.json b/types/node/v6/tslint.json index 518f58df03..82d575f726 100644 --- a/types/node/v6/tslint.json +++ b/types/node/v6/tslint.json @@ -14,6 +14,7 @@ "jsdoc-format": false, "max-line-length": false, "no-any-union": false, + "no-const-enum": false, "no-consecutive-blank-lines": false, "no-duplicate-imports": false, "no-duplicate-variable": false, diff --git a/types/nodegit/tslint.json b/types/nodegit/tslint.json index 0ec275bd05..4ce3d76bf7 100644 --- a/types/nodegit/tslint.json +++ b/types/nodegit/tslint.json @@ -3,6 +3,7 @@ "rules": { // TODOs "ban-types": false, + "no-const-enum": false, "no-unnecessary-class": false } } diff --git a/types/nouislider/tslint.json b/types/nouislider/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/nouislider/tslint.json +++ b/types/nouislider/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/nouislider/v8/tslint.json b/types/nouislider/v8/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/nouislider/v8/tslint.json +++ b/types/nouislider/v8/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/novnc-core/tslint.json b/types/novnc-core/tslint.json index 3db14f85ea..3224b40b8b 100644 --- a/types/novnc-core/tslint.json +++ b/types/novnc-core/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/onesignal-cordova-plugin/tslint.json b/types/onesignal-cordova-plugin/tslint.json index 3db14f85ea..3224b40b8b 100644 --- a/types/onesignal-cordova-plugin/tslint.json +++ b/types/onesignal-cordova-plugin/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/parse/tslint.json b/types/parse/tslint.json index e3610fefae..e2172b7f24 100644 --- a/types/parse/tslint.json +++ b/types/parse/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/range-parser/tslint.json b/types/range-parser/tslint.json index 3db14f85ea..3224b40b8b 100644 --- a/types/range-parser/tslint.json +++ b/types/range-parser/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/ronomon__crypto-async/tslint.json b/types/ronomon__crypto-async/tslint.json index 3db14f85ea..3224b40b8b 100644 --- a/types/ronomon__crypto-async/tslint.json +++ b/types/ronomon__crypto-async/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } +} diff --git a/types/sharepoint/tslint.json b/types/sharepoint/tslint.json index 4f0bed9264..c1514ba316 100644 --- a/types/sharepoint/tslint.json +++ b/types/sharepoint/tslint.json @@ -6,6 +6,7 @@ "jsdoc-format": false, "max-line-length": false, "no-any-union": false, + "no-const-enum": false, "no-duplicate-imports": false, "no-inferrable-types": false, "no-namespace": false, diff --git a/types/signalr/tslint.json b/types/signalr/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/signalr/tslint.json +++ b/types/signalr/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/vexflow/tslint.json b/types/vexflow/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/vexflow/tslint.json +++ b/types/vexflow/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/webcl/tslint.json b/types/webcl/tslint.json index 7f51cc6e38..067a495dc9 100644 --- a/types/webcl/tslint.json +++ b/types/webcl/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/wiiu/tslint.json b/types/wiiu/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/wiiu/tslint.json +++ b/types/wiiu/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/xrm/tslint.json b/types/xrm/tslint.json index 6164356b33..aa02ac13ae 100644 --- a/types/xrm/tslint.json +++ b/types/xrm/tslint.json @@ -12,6 +12,7 @@ true, 250 ], + "no-const-enum": false, "no-unnecessary-type-assertion": false, "quotemark": [ true, diff --git a/types/xrm/v6/tslint.json b/types/xrm/v6/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/xrm/v6/tslint.json +++ b/types/xrm/v6/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/xrm/v7/tslint.json b/types/xrm/v7/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/xrm/v7/tslint.json +++ b/types/xrm/v7/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, diff --git a/types/xrm/v8/tslint.json b/types/xrm/v8/tslint.json index f4cc3f2d22..d2aeed8848 100644 --- a/types/xrm/v8/tslint.json +++ b/types/xrm/v8/tslint.json @@ -12,6 +12,7 @@ true, 250 ], + "no-const-enum": false, "no-unnecessary-type-assertion": false, "quotemark": [ true, diff --git a/types/youtube/tslint.json b/types/youtube/tslint.json index a41bf5d19a..b6afb8acee 100644 --- a/types/youtube/tslint.json +++ b/types/youtube/tslint.json @@ -21,6 +21,7 @@ "no-boolean-literal-compare": false, "no-conditional-assignment": false, "no-consecutive-blank-lines": false, + "no-const-enum": false, "no-construct": false, "no-declare-current-package": false, "no-duplicate-imports": false, From 8b292ec78a8260ec9f76c9b49a1c179a0f66e12a Mon Sep 17 00:00:00 2001 From: Dominique Rau Date: Tue, 23 Jan 2018 19:22:44 +0100 Subject: [PATCH 038/357] Lodash: split up monolith file and use per file per method. (#23100) * feat(restructure): split up monolith * fix(header): fix typo in file header * fix(properties): add missing property files * fix(tests): delete new empty test-files for now * fix(test): revert type changes --- types/lodash/array/chunk.d.ts | 36 + types/lodash/array/compact.d.ts | 26 + types/lodash/array/concat.d.ts | 38 + types/lodash/array/difference.d.ts | 36 + types/lodash/array/differenceBy.d.ts | 242 + types/lodash/array/differenceWith.d.ts | 131 + types/lodash/array/drop.d.ts | 26 + types/lodash/array/dropRight.d.ts | 29 + types/lodash/array/dropRightWhile.d.ts | 46 + types/lodash/array/dropWhile.d.ts | 46 + types/lodash/array/fill.d.ts | 123 + types/lodash/array/findIndex.d.ts | 49 + types/lodash/array/findLastIndex.d.ts | 48 + types/lodash/array/first.d.ts | 22 + types/lodash/array/flatten.d.ts | 42 + types/lodash/array/flattenDeep.d.ts | 25 + types/lodash/array/flattenDepth.d.ts | 26 + types/lodash/array/fromPairs.d.ts | 58 + types/lodash/array/head.d.ts | 27 + types/lodash/array/indexOf.d.ts | 52 + types/lodash/array/initial.d.ts | 25 + types/lodash/array/intersection.d.ts | 32 + types/lodash/array/intersectionBy.d.ts | 133 + types/lodash/array/intersectionWith.d.ts | 132 + types/lodash/array/join.d.ts | 29 + types/lodash/array/last.d.ts | 25 + types/lodash/array/lastIndexOf.d.ts | 39 + types/lodash/array/nth.d.ts | 35 + types/lodash/array/pull.d.ts | 45 + types/lodash/array/pullAll.d.ts | 53 + types/lodash/array/pullAllBy.d.ts | 76 + types/lodash/array/pullAllWith.d.ts | 76 + types/lodash/array/pullAt.d.ts | 33 + types/lodash/array/remove.d.ts | 48 + types/lodash/array/reverse.d.ts | 26 + types/lodash/array/slice.d.ts | 39 + types/lodash/array/sortedIndex.d.ts | 44 + types/lodash/array/sortedIndexBy.d.ts | 96 + types/lodash/array/sortedIndexOf.d.ts | 41 + types/lodash/array/sortedLastIndex.d.ts | 42 + types/lodash/array/sortedLastIndexBy.d.ts | 47 + types/lodash/array/sortedLastIndexOf.d.ts | 41 + types/lodash/array/sortedUniq.d.ts | 33 + types/lodash/array/sortedUniqBy.d.ts | 65 + types/lodash/array/tail.d.ts | 25 + types/lodash/array/take.d.ts | 35 + types/lodash/array/takeRight.d.ts | 35 + types/lodash/array/takeRightWhile.d.ts | 46 + types/lodash/array/takeWhile.d.ts | 46 + types/lodash/array/union.d.ts | 32 + types/lodash/array/unionBy.d.ts | 163 + types/lodash/array/unionWith.d.ts | 102 + types/lodash/array/uniq.d.ts | 35 + types/lodash/array/uniqBy.d.ts | 70 + types/lodash/array/uniqWith.d.ts | 44 + types/lodash/array/unzip.d.ts | 26 + types/lodash/array/unzipWith.d.ts | 59 + types/lodash/array/without.d.ts | 35 + types/lodash/array/xor.d.ts | 31 + types/lodash/array/xorBy.d.ts | 103 + types/lodash/array/xorWith.d.ts | 102 + types/lodash/array/zip.d.ts | 32 + types/lodash/array/zipObject.d.ts | 57 + types/lodash/array/zipObjectDeep.d.ts | 35 + types/lodash/array/zipWith.d.ts | 190 + types/lodash/collection/countBy.d.ts | 120 + types/lodash/collection/each.d.ts | 39 + types/lodash/collection/eachRight.d.ts | 39 + types/lodash/collection/every.d.ts | 84 + types/lodash/collection/filter.d.ts | 142 + types/lodash/collection/find.d.ts | 130 + types/lodash/collection/findLast.d.ts | 120 + types/lodash/collection/flatMap.d.ts | 163 + types/lodash/collection/flatMapDeep.d.ts | 163 + types/lodash/collection/flatMapDepth.d.ts | 179 + types/lodash/collection/forEach.d.ts | 112 + types/lodash/collection/forEachRight.d.ts | 107 + types/lodash/collection/groupBy.d.ts | 120 + types/lodash/collection/includes.d.ts | 40 + types/lodash/collection/invokeMap.d.ts | 57 + types/lodash/collection/keyBy.d.ts | 120 + types/lodash/collection/map.d.ts | 179 + types/lodash/collection/orderBy.d.ts | 191 + types/lodash/collection/partition.d.ts | 71 + types/lodash/collection/reduce.d.ts | 219 + types/lodash/collection/reduceRight.d.ts | 216 + types/lodash/collection/reject.d.ts | 85 + types/lodash/collection/sample.d.ts | 73 + types/lodash/collection/sampleSize.d.ts | 59 + types/lodash/collection/shuffle.d.ts | 40 + types/lodash/collection/size.d.ts | 26 + types/lodash/collection/some.d.ts | 84 + types/lodash/collection/sortBy.d.ts | 83 + types/lodash/common/common.d.ts | 254 + types/lodash/date/now.d.ts | 24 + types/lodash/function/after.d.ts | 29 + types/lodash/function/ary.d.ts | 29 + types/lodash/function/before.d.ts | 31 + types/lodash/function/bind.d.ts | 49 + types/lodash/function/bindKey.d.ts | 50 + types/lodash/function/curry.d.ts | 202 + types/lodash/function/curryRight.d.ts | 131 + types/lodash/function/debounce.d.ts | 66 + types/lodash/function/defer.d.ts | 30 + types/lodash/function/delay.d.ts | 63 + types/lodash/function/flip.d.ts | 27 + types/lodash/function/memoize.d.ts | 36 + types/lodash/function/negate.d.ts | 19 + types/lodash/function/once.d.ts | 19 + types/lodash/function/overArgs.d.ts | 30 + types/lodash/function/partial.d.ts | 158 + types/lodash/function/partialRight.d.ts | 149 + types/lodash/function/rearg.d.ts | 27 + types/lodash/function/rest.d.ts | 32 + types/lodash/function/spread.d.ts | 43 + types/lodash/function/throttle.d.ts | 57 + types/lodash/function/unary.d.ts | 31 + types/lodash/function/wrap.d.ts | 60 + types/lodash/index.d.ts | 17696 +--------------- types/lodash/lang/castArray.d.ts | 25 + types/lodash/lang/clone.d.ts | 30 + types/lodash/lang/cloneDeep.d.ts | 25 + types/lodash/lang/cloneDeepWith.d.ts | 50 + types/lodash/lang/cloneWith.d.ts | 73 + types/lodash/lang/conformsTo.d.ts | 30 + types/lodash/lang/eq.d.ts | 54 + types/lodash/lang/gt.d.ts | 29 + types/lodash/lang/gte.d.ts | 29 + types/lodash/lang/isArguments.d.ts | 25 + types/lodash/lang/isArray.d.ts | 30 + types/lodash/lang/isArrayBuffer.d.ts | 25 + types/lodash/lang/isArrayLike.d.ts | 51 + types/lodash/lang/isArrayLikeObject.d.ts | 52 + types/lodash/lang/isBoolean.d.ts | 25 + types/lodash/lang/isBuffer.d.ts | 25 + types/lodash/lang/isDate.d.ts | 25 + types/lodash/lang/isElement.d.ts | 25 + types/lodash/lang/isEmpty.d.ts | 26 + types/lodash/lang/isEqual.d.ts | 51 + types/lodash/lang/isEqualWith.d.ts | 60 + types/lodash/lang/isError.d.ts | 26 + types/lodash/lang/isFinite.d.ts | 27 + types/lodash/lang/isFunction.d.ts | 25 + types/lodash/lang/isInteger.d.ts | 41 + types/lodash/lang/isLength.d.ts | 41 + types/lodash/lang/isMap.d.ts | 25 + types/lodash/lang/isMatch.d.ts | 41 + types/lodash/lang/isMatchWith.d.ts | 50 + types/lodash/lang/isNaN.d.ts | 27 + types/lodash/lang/isNative.d.ts | 25 + types/lodash/lang/isNil.d.ts | 36 + types/lodash/lang/isNull.d.ts | 25 + types/lodash/lang/isNumber.d.ts | 27 + types/lodash/lang/isObject.d.ts | 26 + types/lodash/lang/isObjectLike.d.ts | 40 + types/lodash/lang/isPlainObject.d.ts | 28 + types/lodash/lang/isRegExp.d.ts | 25 + types/lodash/lang/isSafeInteger.d.ts | 42 + types/lodash/lang/isSet.d.ts | 25 + types/lodash/lang/isString.d.ts | 25 + types/lodash/lang/isSymbol.d.ts | 33 + types/lodash/lang/isTypedArray.d.ts | 25 + types/lodash/lang/isUndefined.d.ts | 25 + types/lodash/lang/isWeakMap.d.ts | 25 + types/lodash/lang/isWeakSet.d.ts | 25 + types/lodash/lang/lt.d.ts | 29 + types/lodash/lang/lte.d.ts | 29 + types/lodash/lang/toArray.d.ts | 45 + types/lodash/lang/toFinite.d.ts | 40 + types/lodash/lang/toInteger.d.ts | 41 + types/lodash/lang/toLength.d.ts | 42 + types/lodash/lang/toNumber.d.ts | 39 + types/lodash/lang/toPlainObject.d.ts | 26 + types/lodash/lang/toSafeInteger.d.ts | 40 + types/lodash/lang/toString.d.ts | 23 + types/lodash/math/add.d.ts | 29 + types/lodash/math/ceil.d.ts | 29 + types/lodash/math/divide.d.ts | 29 + types/lodash/math/floor.d.ts | 29 + types/lodash/math/max.d.ts | 29 + types/lodash/math/maxBy.d.ts | 48 + types/lodash/math/mean.d.ts | 32 + types/lodash/math/meanBy.d.ts | 40 + types/lodash/math/min.d.ts | 29 + types/lodash/math/minBy.d.ts | 48 + types/lodash/math/multiply.d.ts | 28 + types/lodash/math/round.d.ts | 29 + types/lodash/math/subtract.d.ts | 38 + types/lodash/math/sum.d.ts | 30 + types/lodash/math/sumBy.d.ts | 52 + .../methods/templateSettings.imports._.d.ts | 0 types/lodash/number/clamp.d.ts | 55 + types/lodash/number/inRange.d.ts | 38 + types/lodash/number/random.d.ts | 84 + types/lodash/object/assign.d.ts | 171 + types/lodash/object/assignIn.d.ts | 170 + types/lodash/object/assignInWith.d.ts | 182 + types/lodash/object/assignWith.d.ts | 179 + types/lodash/object/at.d.ts | 60 + types/lodash/object/create.d.ts | 30 + types/lodash/object/defaults.d.ts | 154 + types/lodash/object/defaultsDeep.d.ts | 27 + types/lodash/object/entries.d.ts | 37 + types/lodash/object/entriesIn.d.ts | 37 + types/lodash/object/extend.d.ts | 146 + types/lodash/object/extendWith.d.ts | 158 + types/lodash/object/findKey.d.ts | 46 + types/lodash/object/findLastKey.d.ts | 45 + types/lodash/object/forIn.d.ts | 36 + types/lodash/object/forInRight.d.ts | 34 + types/lodash/object/forOwn.d.ts | 36 + types/lodash/object/forOwnRight.d.ts | 34 + types/lodash/object/functions.d.ts | 38 + types/lodash/object/functionsIn.d.ts | 38 + types/lodash/object/get.d.ts | 237 + types/lodash/object/has.d.ts | 46 + types/lodash/object/hasIn.d.ts | 45 + types/lodash/object/invert.d.ts | 29 + types/lodash/object/invertBy.d.ts | 61 + types/lodash/object/invoke.d.ts | 32 + types/lodash/object/keys.d.ts | 27 + types/lodash/object/keysIn.d.ts | 27 + types/lodash/object/mapKeys.d.ts | 85 + types/lodash/object/mapValues.d.ts | 188 + types/lodash/object/merge.d.ts | 155 + types/lodash/object/mergeWith.d.ts | 132 + types/lodash/object/omit.d.ts | 68 + types/lodash/object/omitBy.d.ts | 44 + types/lodash/object/pick.d.ts | 67 + types/lodash/object/pickBy.d.ts | 43 + types/lodash/object/result.d.ts | 38 + types/lodash/object/set.d.ts | 64 + types/lodash/object/setWith.d.ts | 70 + types/lodash/object/toPairs.d.ts | 40 + types/lodash/object/toPairsIn.d.ts | 40 + types/lodash/object/transform.d.ts | 162 + types/lodash/object/unset.d.ts | 31 + types/lodash/object/update.d.ts | 38 + types/lodash/object/updateWith.d.ts | 82 + types/lodash/object/values.d.ts | 55 + types/lodash/object/valuesIn.d.ts | 40 + types/lodash/properties/VERSION.d.ts | 0 types/lodash/properties/templateSettings.d.ts | 0 .../properties/templateSettings.escape.d.ts | 0 .../properties/templateSettings.evaluate.d.ts | 0 .../properties/templateSettings.imports.d.ts | 0 .../templateSettings.interpolate.d.ts | 0 .../properties/templateSettings.variable.d.ts | 0 types/lodash/seq/chain.d.ts | 25 + types/lodash/seq/prototype.at.d.ts | 11 + types/lodash/seq/prototype.chain.d.ts | 25 + types/lodash/seq/prototype.commit.d.ts | 10 + types/lodash/seq/prototype.next.d.ts | 0 types/lodash/seq/prototype.plant.d.ts | 17 + types/lodash/seq/prototype.reverse.d.ts | 13 + types/lodash/seq/prototype.toJSON.d.ts | 8 + types/lodash/seq/prototype.toString.d.ts | 10 + types/lodash/seq/prototype.value.d.ts | 12 + types/lodash/seq/prototype.valueOf.d.ts | 8 + .../seq/prototype[Symbol.iterator].d.ts | 0 types/lodash/seq/tap.d.ts | 27 + types/lodash/seq/thru.d.ts | 30 + types/lodash/string/camelCase.d.ts | 25 + types/lodash/string/capitalize.d.ts | 25 + types/lodash/string/deburr.d.ts | 26 + types/lodash/string/endsWith.d.ts | 37 + types/lodash/string/escape.d.ts | 36 + types/lodash/string/escapeRegExp.d.ts | 26 + types/lodash/string/kebabCase.d.ts | 25 + types/lodash/string/lowerCase.d.ts | 25 + types/lodash/string/lowerFirst.d.ts | 25 + types/lodash/string/pad.d.ts | 38 + types/lodash/string/padEnd.d.ts | 38 + types/lodash/string/padStart.d.ts | 38 + types/lodash/string/parseInt.d.ts | 32 + types/lodash/string/repeat.d.ts | 31 + types/lodash/string/replace.d.ts | 58 + types/lodash/string/snakeCase.d.ts | 25 + types/lodash/string/split.d.ts | 55 + types/lodash/string/startCase.d.ts | 25 + types/lodash/string/startsWith.d.ts | 37 + types/lodash/string/template.d.ts | 60 + types/lodash/string/toLower.d.ts | 25 + types/lodash/string/toUpper.d.ts | 25 + types/lodash/string/trim.d.ts | 43 + types/lodash/string/trimEnd.d.ts | 43 + types/lodash/string/trimStart.d.ts | 43 + types/lodash/string/truncate.d.ts | 39 + types/lodash/string/unescape.d.ts | 29 + types/lodash/string/upperCase.d.ts | 25 + types/lodash/string/upperFirst.d.ts | 25 + types/lodash/string/words.d.ts | 43 + types/lodash/util/attempt.d.ts | 26 + types/lodash/util/bindAll.d.ts | 27 + types/lodash/util/cond.d.ts | 32 + types/lodash/util/conforms.d.ts | 27 + types/lodash/util/constant.d.ts | 25 + types/lodash/util/defaultTo.d.ts | 52 + types/lodash/util/flow.d.ts | 170 + types/lodash/util/flowRight.d.ts | 155 + types/lodash/util/identity.d.ts | 30 + types/lodash/util/iteratee.d.ts | 57 + types/lodash/util/matches.d.ts | 35 + types/lodash/util/matchesProperty.d.ts | 58 + types/lodash/util/method.d.ts | 30 + types/lodash/util/methodOf.d.ts | 34 + types/lodash/util/mixin.d.ts | 68 + types/lodash/util/noConflict.d.ts | 24 + types/lodash/util/noop.d.ts | 24 + types/lodash/util/nthArg.d.ts | 25 + types/lodash/util/over.d.ts | 32 + types/lodash/util/overEvery.d.ts | 26 + types/lodash/util/overSome.d.ts | 26 + types/lodash/util/property.d.ts | 25 + types/lodash/util/propertyOf.d.ts | 26 + types/lodash/util/range.d.ts | 55 + types/lodash/util/rangeRight.d.ts | 76 + types/lodash/util/runInContext.d.ts | 18 + types/lodash/util/stubArray.d.ts | 24 + types/lodash/util/stubFalse.d.ts | 24 + types/lodash/util/stubObject.d.ts | 24 + types/lodash/util/stubString.d.ts | 24 + types/lodash/util/stubTrue.d.ts | 24 + types/lodash/util/times.d.ts | 49 + types/lodash/util/toPath.d.ts | 42 + types/lodash/util/uniqueId.d.ts | 25 + 326 files changed, 17555 insertions(+), 17355 deletions(-) create mode 100644 types/lodash/array/chunk.d.ts create mode 100644 types/lodash/array/compact.d.ts create mode 100644 types/lodash/array/concat.d.ts create mode 100644 types/lodash/array/difference.d.ts create mode 100644 types/lodash/array/differenceBy.d.ts create mode 100644 types/lodash/array/differenceWith.d.ts create mode 100644 types/lodash/array/drop.d.ts create mode 100644 types/lodash/array/dropRight.d.ts create mode 100644 types/lodash/array/dropRightWhile.d.ts create mode 100644 types/lodash/array/dropWhile.d.ts create mode 100644 types/lodash/array/fill.d.ts create mode 100644 types/lodash/array/findIndex.d.ts create mode 100644 types/lodash/array/findLastIndex.d.ts create mode 100644 types/lodash/array/first.d.ts create mode 100644 types/lodash/array/flatten.d.ts create mode 100644 types/lodash/array/flattenDeep.d.ts create mode 100644 types/lodash/array/flattenDepth.d.ts create mode 100644 types/lodash/array/fromPairs.d.ts create mode 100644 types/lodash/array/head.d.ts create mode 100644 types/lodash/array/indexOf.d.ts create mode 100644 types/lodash/array/initial.d.ts create mode 100644 types/lodash/array/intersection.d.ts create mode 100644 types/lodash/array/intersectionBy.d.ts create mode 100644 types/lodash/array/intersectionWith.d.ts create mode 100644 types/lodash/array/join.d.ts create mode 100644 types/lodash/array/last.d.ts create mode 100644 types/lodash/array/lastIndexOf.d.ts create mode 100644 types/lodash/array/nth.d.ts create mode 100644 types/lodash/array/pull.d.ts create mode 100644 types/lodash/array/pullAll.d.ts create mode 100644 types/lodash/array/pullAllBy.d.ts create mode 100644 types/lodash/array/pullAllWith.d.ts create mode 100644 types/lodash/array/pullAt.d.ts create mode 100644 types/lodash/array/remove.d.ts create mode 100644 types/lodash/array/reverse.d.ts create mode 100644 types/lodash/array/slice.d.ts create mode 100644 types/lodash/array/sortedIndex.d.ts create mode 100644 types/lodash/array/sortedIndexBy.d.ts create mode 100644 types/lodash/array/sortedIndexOf.d.ts create mode 100644 types/lodash/array/sortedLastIndex.d.ts create mode 100644 types/lodash/array/sortedLastIndexBy.d.ts create mode 100644 types/lodash/array/sortedLastIndexOf.d.ts create mode 100644 types/lodash/array/sortedUniq.d.ts create mode 100644 types/lodash/array/sortedUniqBy.d.ts create mode 100644 types/lodash/array/tail.d.ts create mode 100644 types/lodash/array/take.d.ts create mode 100644 types/lodash/array/takeRight.d.ts create mode 100644 types/lodash/array/takeRightWhile.d.ts create mode 100644 types/lodash/array/takeWhile.d.ts create mode 100644 types/lodash/array/union.d.ts create mode 100644 types/lodash/array/unionBy.d.ts create mode 100644 types/lodash/array/unionWith.d.ts create mode 100644 types/lodash/array/uniq.d.ts create mode 100644 types/lodash/array/uniqBy.d.ts create mode 100644 types/lodash/array/uniqWith.d.ts create mode 100644 types/lodash/array/unzip.d.ts create mode 100644 types/lodash/array/unzipWith.d.ts create mode 100644 types/lodash/array/without.d.ts create mode 100644 types/lodash/array/xor.d.ts create mode 100644 types/lodash/array/xorBy.d.ts create mode 100644 types/lodash/array/xorWith.d.ts create mode 100644 types/lodash/array/zip.d.ts create mode 100644 types/lodash/array/zipObject.d.ts create mode 100644 types/lodash/array/zipObjectDeep.d.ts create mode 100644 types/lodash/array/zipWith.d.ts create mode 100644 types/lodash/collection/countBy.d.ts create mode 100644 types/lodash/collection/each.d.ts create mode 100644 types/lodash/collection/eachRight.d.ts create mode 100644 types/lodash/collection/every.d.ts create mode 100644 types/lodash/collection/filter.d.ts create mode 100644 types/lodash/collection/find.d.ts create mode 100644 types/lodash/collection/findLast.d.ts create mode 100644 types/lodash/collection/flatMap.d.ts create mode 100644 types/lodash/collection/flatMapDeep.d.ts create mode 100644 types/lodash/collection/flatMapDepth.d.ts create mode 100644 types/lodash/collection/forEach.d.ts create mode 100644 types/lodash/collection/forEachRight.d.ts create mode 100644 types/lodash/collection/groupBy.d.ts create mode 100644 types/lodash/collection/includes.d.ts create mode 100644 types/lodash/collection/invokeMap.d.ts create mode 100644 types/lodash/collection/keyBy.d.ts create mode 100644 types/lodash/collection/map.d.ts create mode 100644 types/lodash/collection/orderBy.d.ts create mode 100644 types/lodash/collection/partition.d.ts create mode 100644 types/lodash/collection/reduce.d.ts create mode 100644 types/lodash/collection/reduceRight.d.ts create mode 100644 types/lodash/collection/reject.d.ts create mode 100644 types/lodash/collection/sample.d.ts create mode 100644 types/lodash/collection/sampleSize.d.ts create mode 100644 types/lodash/collection/shuffle.d.ts create mode 100644 types/lodash/collection/size.d.ts create mode 100644 types/lodash/collection/some.d.ts create mode 100644 types/lodash/collection/sortBy.d.ts create mode 100644 types/lodash/common/common.d.ts create mode 100644 types/lodash/date/now.d.ts create mode 100644 types/lodash/function/after.d.ts create mode 100644 types/lodash/function/ary.d.ts create mode 100644 types/lodash/function/before.d.ts create mode 100644 types/lodash/function/bind.d.ts create mode 100644 types/lodash/function/bindKey.d.ts create mode 100644 types/lodash/function/curry.d.ts create mode 100644 types/lodash/function/curryRight.d.ts create mode 100644 types/lodash/function/debounce.d.ts create mode 100644 types/lodash/function/defer.d.ts create mode 100644 types/lodash/function/delay.d.ts create mode 100644 types/lodash/function/flip.d.ts create mode 100644 types/lodash/function/memoize.d.ts create mode 100644 types/lodash/function/negate.d.ts create mode 100644 types/lodash/function/once.d.ts create mode 100644 types/lodash/function/overArgs.d.ts create mode 100644 types/lodash/function/partial.d.ts create mode 100644 types/lodash/function/partialRight.d.ts create mode 100644 types/lodash/function/rearg.d.ts create mode 100644 types/lodash/function/rest.d.ts create mode 100644 types/lodash/function/spread.d.ts create mode 100644 types/lodash/function/throttle.d.ts create mode 100644 types/lodash/function/unary.d.ts create mode 100644 types/lodash/function/wrap.d.ts create mode 100644 types/lodash/lang/castArray.d.ts create mode 100644 types/lodash/lang/clone.d.ts create mode 100644 types/lodash/lang/cloneDeep.d.ts create mode 100644 types/lodash/lang/cloneDeepWith.d.ts create mode 100644 types/lodash/lang/cloneWith.d.ts create mode 100644 types/lodash/lang/conformsTo.d.ts create mode 100644 types/lodash/lang/eq.d.ts create mode 100644 types/lodash/lang/gt.d.ts create mode 100644 types/lodash/lang/gte.d.ts create mode 100644 types/lodash/lang/isArguments.d.ts create mode 100644 types/lodash/lang/isArray.d.ts create mode 100644 types/lodash/lang/isArrayBuffer.d.ts create mode 100644 types/lodash/lang/isArrayLike.d.ts create mode 100644 types/lodash/lang/isArrayLikeObject.d.ts create mode 100644 types/lodash/lang/isBoolean.d.ts create mode 100644 types/lodash/lang/isBuffer.d.ts create mode 100644 types/lodash/lang/isDate.d.ts create mode 100644 types/lodash/lang/isElement.d.ts create mode 100644 types/lodash/lang/isEmpty.d.ts create mode 100644 types/lodash/lang/isEqual.d.ts create mode 100644 types/lodash/lang/isEqualWith.d.ts create mode 100644 types/lodash/lang/isError.d.ts create mode 100644 types/lodash/lang/isFinite.d.ts create mode 100644 types/lodash/lang/isFunction.d.ts create mode 100644 types/lodash/lang/isInteger.d.ts create mode 100644 types/lodash/lang/isLength.d.ts create mode 100644 types/lodash/lang/isMap.d.ts create mode 100644 types/lodash/lang/isMatch.d.ts create mode 100644 types/lodash/lang/isMatchWith.d.ts create mode 100644 types/lodash/lang/isNaN.d.ts create mode 100644 types/lodash/lang/isNative.d.ts create mode 100644 types/lodash/lang/isNil.d.ts create mode 100644 types/lodash/lang/isNull.d.ts create mode 100644 types/lodash/lang/isNumber.d.ts create mode 100644 types/lodash/lang/isObject.d.ts create mode 100644 types/lodash/lang/isObjectLike.d.ts create mode 100644 types/lodash/lang/isPlainObject.d.ts create mode 100644 types/lodash/lang/isRegExp.d.ts create mode 100644 types/lodash/lang/isSafeInteger.d.ts create mode 100644 types/lodash/lang/isSet.d.ts create mode 100644 types/lodash/lang/isString.d.ts create mode 100644 types/lodash/lang/isSymbol.d.ts create mode 100644 types/lodash/lang/isTypedArray.d.ts create mode 100644 types/lodash/lang/isUndefined.d.ts create mode 100644 types/lodash/lang/isWeakMap.d.ts create mode 100644 types/lodash/lang/isWeakSet.d.ts create mode 100644 types/lodash/lang/lt.d.ts create mode 100644 types/lodash/lang/lte.d.ts create mode 100644 types/lodash/lang/toArray.d.ts create mode 100644 types/lodash/lang/toFinite.d.ts create mode 100644 types/lodash/lang/toInteger.d.ts create mode 100644 types/lodash/lang/toLength.d.ts create mode 100644 types/lodash/lang/toNumber.d.ts create mode 100644 types/lodash/lang/toPlainObject.d.ts create mode 100644 types/lodash/lang/toSafeInteger.d.ts create mode 100644 types/lodash/lang/toString.d.ts create mode 100644 types/lodash/math/add.d.ts create mode 100644 types/lodash/math/ceil.d.ts create mode 100644 types/lodash/math/divide.d.ts create mode 100644 types/lodash/math/floor.d.ts create mode 100644 types/lodash/math/max.d.ts create mode 100644 types/lodash/math/maxBy.d.ts create mode 100644 types/lodash/math/mean.d.ts create mode 100644 types/lodash/math/meanBy.d.ts create mode 100644 types/lodash/math/min.d.ts create mode 100644 types/lodash/math/minBy.d.ts create mode 100644 types/lodash/math/multiply.d.ts create mode 100644 types/lodash/math/round.d.ts create mode 100644 types/lodash/math/subtract.d.ts create mode 100644 types/lodash/math/sum.d.ts create mode 100644 types/lodash/math/sumBy.d.ts create mode 100644 types/lodash/methods/templateSettings.imports._.d.ts create mode 100644 types/lodash/number/clamp.d.ts create mode 100644 types/lodash/number/inRange.d.ts create mode 100644 types/lodash/number/random.d.ts create mode 100644 types/lodash/object/assign.d.ts create mode 100644 types/lodash/object/assignIn.d.ts create mode 100644 types/lodash/object/assignInWith.d.ts create mode 100644 types/lodash/object/assignWith.d.ts create mode 100644 types/lodash/object/at.d.ts create mode 100644 types/lodash/object/create.d.ts create mode 100644 types/lodash/object/defaults.d.ts create mode 100644 types/lodash/object/defaultsDeep.d.ts create mode 100644 types/lodash/object/entries.d.ts create mode 100644 types/lodash/object/entriesIn.d.ts create mode 100644 types/lodash/object/extend.d.ts create mode 100644 types/lodash/object/extendWith.d.ts create mode 100644 types/lodash/object/findKey.d.ts create mode 100644 types/lodash/object/findLastKey.d.ts create mode 100644 types/lodash/object/forIn.d.ts create mode 100644 types/lodash/object/forInRight.d.ts create mode 100644 types/lodash/object/forOwn.d.ts create mode 100644 types/lodash/object/forOwnRight.d.ts create mode 100644 types/lodash/object/functions.d.ts create mode 100644 types/lodash/object/functionsIn.d.ts create mode 100644 types/lodash/object/get.d.ts create mode 100644 types/lodash/object/has.d.ts create mode 100644 types/lodash/object/hasIn.d.ts create mode 100644 types/lodash/object/invert.d.ts create mode 100644 types/lodash/object/invertBy.d.ts create mode 100644 types/lodash/object/invoke.d.ts create mode 100644 types/lodash/object/keys.d.ts create mode 100644 types/lodash/object/keysIn.d.ts create mode 100644 types/lodash/object/mapKeys.d.ts create mode 100644 types/lodash/object/mapValues.d.ts create mode 100644 types/lodash/object/merge.d.ts create mode 100644 types/lodash/object/mergeWith.d.ts create mode 100644 types/lodash/object/omit.d.ts create mode 100644 types/lodash/object/omitBy.d.ts create mode 100644 types/lodash/object/pick.d.ts create mode 100644 types/lodash/object/pickBy.d.ts create mode 100644 types/lodash/object/result.d.ts create mode 100644 types/lodash/object/set.d.ts create mode 100644 types/lodash/object/setWith.d.ts create mode 100644 types/lodash/object/toPairs.d.ts create mode 100644 types/lodash/object/toPairsIn.d.ts create mode 100644 types/lodash/object/transform.d.ts create mode 100644 types/lodash/object/unset.d.ts create mode 100644 types/lodash/object/update.d.ts create mode 100644 types/lodash/object/updateWith.d.ts create mode 100644 types/lodash/object/values.d.ts create mode 100644 types/lodash/object/valuesIn.d.ts create mode 100644 types/lodash/properties/VERSION.d.ts create mode 100644 types/lodash/properties/templateSettings.d.ts create mode 100644 types/lodash/properties/templateSettings.escape.d.ts create mode 100644 types/lodash/properties/templateSettings.evaluate.d.ts create mode 100644 types/lodash/properties/templateSettings.imports.d.ts create mode 100644 types/lodash/properties/templateSettings.interpolate.d.ts create mode 100644 types/lodash/properties/templateSettings.variable.d.ts create mode 100644 types/lodash/seq/chain.d.ts create mode 100644 types/lodash/seq/prototype.at.d.ts create mode 100644 types/lodash/seq/prototype.chain.d.ts create mode 100644 types/lodash/seq/prototype.commit.d.ts create mode 100644 types/lodash/seq/prototype.next.d.ts create mode 100644 types/lodash/seq/prototype.plant.d.ts create mode 100644 types/lodash/seq/prototype.reverse.d.ts create mode 100644 types/lodash/seq/prototype.toJSON.d.ts create mode 100644 types/lodash/seq/prototype.toString.d.ts create mode 100644 types/lodash/seq/prototype.value.d.ts create mode 100644 types/lodash/seq/prototype.valueOf.d.ts create mode 100644 types/lodash/seq/prototype[Symbol.iterator].d.ts create mode 100644 types/lodash/seq/tap.d.ts create mode 100644 types/lodash/seq/thru.d.ts create mode 100644 types/lodash/string/camelCase.d.ts create mode 100644 types/lodash/string/capitalize.d.ts create mode 100644 types/lodash/string/deburr.d.ts create mode 100644 types/lodash/string/endsWith.d.ts create mode 100644 types/lodash/string/escape.d.ts create mode 100644 types/lodash/string/escapeRegExp.d.ts create mode 100644 types/lodash/string/kebabCase.d.ts create mode 100644 types/lodash/string/lowerCase.d.ts create mode 100644 types/lodash/string/lowerFirst.d.ts create mode 100644 types/lodash/string/pad.d.ts create mode 100644 types/lodash/string/padEnd.d.ts create mode 100644 types/lodash/string/padStart.d.ts create mode 100644 types/lodash/string/parseInt.d.ts create mode 100644 types/lodash/string/repeat.d.ts create mode 100644 types/lodash/string/replace.d.ts create mode 100644 types/lodash/string/snakeCase.d.ts create mode 100644 types/lodash/string/split.d.ts create mode 100644 types/lodash/string/startCase.d.ts create mode 100644 types/lodash/string/startsWith.d.ts create mode 100644 types/lodash/string/template.d.ts create mode 100644 types/lodash/string/toLower.d.ts create mode 100644 types/lodash/string/toUpper.d.ts create mode 100644 types/lodash/string/trim.d.ts create mode 100644 types/lodash/string/trimEnd.d.ts create mode 100644 types/lodash/string/trimStart.d.ts create mode 100644 types/lodash/string/truncate.d.ts create mode 100644 types/lodash/string/unescape.d.ts create mode 100644 types/lodash/string/upperCase.d.ts create mode 100644 types/lodash/string/upperFirst.d.ts create mode 100644 types/lodash/string/words.d.ts create mode 100644 types/lodash/util/attempt.d.ts create mode 100644 types/lodash/util/bindAll.d.ts create mode 100644 types/lodash/util/cond.d.ts create mode 100644 types/lodash/util/conforms.d.ts create mode 100644 types/lodash/util/constant.d.ts create mode 100644 types/lodash/util/defaultTo.d.ts create mode 100644 types/lodash/util/flow.d.ts create mode 100644 types/lodash/util/flowRight.d.ts create mode 100644 types/lodash/util/identity.d.ts create mode 100644 types/lodash/util/iteratee.d.ts create mode 100644 types/lodash/util/matches.d.ts create mode 100644 types/lodash/util/matchesProperty.d.ts create mode 100644 types/lodash/util/method.d.ts create mode 100644 types/lodash/util/methodOf.d.ts create mode 100644 types/lodash/util/mixin.d.ts create mode 100644 types/lodash/util/noConflict.d.ts create mode 100644 types/lodash/util/noop.d.ts create mode 100644 types/lodash/util/nthArg.d.ts create mode 100644 types/lodash/util/over.d.ts create mode 100644 types/lodash/util/overEvery.d.ts create mode 100644 types/lodash/util/overSome.d.ts create mode 100644 types/lodash/util/property.d.ts create mode 100644 types/lodash/util/propertyOf.d.ts create mode 100644 types/lodash/util/range.d.ts create mode 100644 types/lodash/util/rangeRight.d.ts create mode 100644 types/lodash/util/runInContext.d.ts create mode 100644 types/lodash/util/stubArray.d.ts create mode 100644 types/lodash/util/stubFalse.d.ts create mode 100644 types/lodash/util/stubObject.d.ts create mode 100644 types/lodash/util/stubString.d.ts create mode 100644 types/lodash/util/stubTrue.d.ts create mode 100644 types/lodash/util/times.d.ts create mode 100644 types/lodash/util/toPath.d.ts create mode 100644 types/lodash/util/uniqueId.d.ts diff --git a/types/lodash/array/chunk.d.ts b/types/lodash/array/chunk.d.ts new file mode 100644 index 0000000000..de40df8673 --- /dev/null +++ b/types/lodash/array/chunk.d.ts @@ -0,0 +1,36 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the + * final chunk will be the remaining elements. + * + * @param array The array to process. + * @param size The length of each chunk. + * @return Returns the new array containing chunks. + */ + chunk( + array: List | null | undefined, + size?: number + ): T[][]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.chunk + */ + chunk( + this: LoDashImplicitWrapper | null | undefined>, + size?: number, + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.chunk + */ + chunk( + this: LoDashExplicitWrapper | null | undefined>, + size?: number, + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/compact.d.ts b/types/lodash/array/compact.d.ts new file mode 100644 index 0000000000..1de3bbae4c --- /dev/null +++ b/types/lodash/array/compact.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are + * falsey. + * + * @param array The array to compact. + * @return Returns the new array of filtered values. + */ + compact(array: List | null | undefined): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.compact + */ + compact(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.compact + */ + compact(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/concat.d.ts b/types/lodash/array/concat.d.ts new file mode 100644 index 0000000000..977a086525 --- /dev/null +++ b/types/lodash/array/concat.d.ts @@ -0,0 +1,38 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @category Array + * @param array The array to concatenate. + * @param [values] The values to concatenate. + * @returns Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + concat(array: Many, ...values: Array>): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.compact + */ + concat(this: LoDashImplicitWrapper>, ...values: Array>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.compact + */ + concat(this: LoDashExplicitWrapper>, ...values: Array>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/difference.d.ts b/types/lodash/array/difference.d.ts new file mode 100644 index 0000000000..c6d1797192 --- /dev/null +++ b/types/lodash/array/difference.d.ts @@ -0,0 +1,36 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of unique array values not included in the other provided arrays using SameValueZero for + * equality comparisons. + * + * @param array The array to inspect. + * @param values The arrays of values to exclude. + * @return Returns the new array of filtered values. + */ + difference( + array: List | null | undefined, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.difference + */ + difference( + this: LoDashImplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.difference + */ + difference( + this: LoDashExplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/differenceBy.d.ts b/types/lodash/array/differenceBy.d.ts new file mode 100644 index 0000000000..6b291ac272 --- /dev/null +++ b/types/lodash/array/differenceBy.d.ts @@ -0,0 +1,242 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.difference except that it accepts iteratee which is invoked for each element of array + * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one + * argument: (value). + * + * @param array The array to inspect. + * @param values The values to exclude. + * @param iteratee The iteratee invoked per element. + * @returns Returns the new array of filtered values. + */ + differenceBy( + array: List | null | undefined, + values: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + values1: List, + values2: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + values1: List, + values2: List, + values3: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + values1: List, + values2: List, + values3: List, + values4: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + ...values: Array | ValueIteratee> + ): T1[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: List | null | undefined, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + ...values: Array | ValueIteratee> + ): LoDashImplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashImplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + values3: List, + values4: List, + values5: List, + ...values: Array | ValueIteratee> + ): LoDashExplicitWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + this: LoDashExplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/differenceWith.d.ts b/types/lodash/array/differenceWith.d.ts new file mode 100644 index 0000000000..c238f54b06 --- /dev/null +++ b/types/lodash/array/differenceWith.d.ts @@ -0,0 +1,131 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of unique `array` values not included in the other + * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @category Array + * @param [values] The arrays to inspect. + * @param [comparator] The comparator invoked per element. + * @returns Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + differenceWith( + array: List | null | undefined, + values: List, + comparator: Comparator2 + ): T1[]; + + /** + * @see _.differenceWith + */ + differenceWith( + array: List | null | undefined, + values1: List, + values2: List, + comparator: Comparator2 + ): T1[]; + + /** + * @see _.differenceWith + */ + differenceWith( + array: List | null | undefined, + values1: List, + values2: List, + ...values: Array | Comparator2> + ): T1[]; + + /** + * @see _.differenceWith + */ + differenceWith( + array: List | null | undefined, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashImplicitWrapper | null | undefined>, + values: List, + comparator: Comparator2 + ): LoDashImplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + comparator: Comparator2 + ): LoDashImplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | Comparator2> + ): LoDashImplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashImplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashExplicitWrapper | null | undefined>, + values: List, + comparator: Comparator2 + ): LoDashExplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + comparator: Comparator2 + ): LoDashExplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | Comparator2> + ): LoDashExplicitWrapper; + + /** + * @see _.differenceWith + */ + differenceWith( + this: LoDashExplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/drop.d.ts b/types/lodash/array/drop.d.ts new file mode 100644 index 0000000000..89e5b68b9b --- /dev/null +++ b/types/lodash/array/drop.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a slice of array with n elements dropped from the beginning. + * + * @param array The array to query. + * @param n The number of elements to drop. + * @return Returns the slice of array. + */ + drop(array: List | null | undefined, n?: number): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.drop + */ + drop(this: LoDashImplicitWrapper | null | undefined>, n?: number): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.drop + */ + drop(this: LoDashExplicitWrapper | null | undefined>, n?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/dropRight.d.ts b/types/lodash/array/dropRight.d.ts new file mode 100644 index 0000000000..518080db8b --- /dev/null +++ b/types/lodash/array/dropRight.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a slice of array with n elements dropped from the end. + * + * @param array The array to query. + * @param n The number of elements to drop. + * @return Returns the slice of array. + */ + dropRight( + array: List | null | undefined, + n?: number + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.dropRight + */ + dropRight(this: LoDashImplicitWrapper | null | undefined>, n?: number): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.dropRight + */ + dropRight(this: LoDashExplicitWrapper | null | undefined>, n?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/dropRightWhile.d.ts b/types/lodash/array/dropRightWhile.d.ts new file mode 100644 index 0000000000..26aeba29eb --- /dev/null +++ b/types/lodash/array/dropRightWhile.d.ts @@ -0,0 +1,46 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate + * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * match the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + dropRightWhile( + array: List | null | undefined, + predicate?: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/dropWhile.d.ts b/types/lodash/array/dropWhile.d.ts new file mode 100644 index 0000000000..6335cec6b6 --- /dev/null +++ b/types/lodash/array/dropWhile.d.ts @@ -0,0 +1,46 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate + * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + dropWhile( + array: List | null | undefined, + predicate?: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.dropWhile + */ + dropWhile( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.dropWhile + */ + dropWhile( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/fill.d.ts b/types/lodash/array/fill.d.ts new file mode 100644 index 0000000000..de22051cc8 --- /dev/null +++ b/types/lodash/array/fill.d.ts @@ -0,0 +1,123 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Fills elements of array with value from start up to, but not including, end. + * + * Note: This method mutates array. + * + * @param array The array to fill. + * @param value The value to fill array with. + * @param start The start position. + * @param end The end position. + * @return Returns array. + */ + fill( + array: any[] | null | undefined, + value: T + ): T[]; + + /** + * @see _.fill + */ + fill( + array: List | null | undefined, + value: T + ): List; + + /** + * @see _.fill + */ + fill( + array: U[] | null | undefined, + value: T, + start?: number, + end?: number + ): Array; + + /** + * @see _.fill + */ + fill( + array: List | null | undefined, + value: T, + start?: number, + end?: number + ): List; + } + + interface LoDashImplicitWrapper { + /** + * @see _.fill + */ + fill( + this: LoDashImplicitWrapper, + value: T + ): LoDashImplicitWrapper; + + /** + * @see _.fill + */ + fill( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): LoDashImplicitWrapper>; + + /** + * @see _.fill + */ + fill( + this: LoDashImplicitWrapper, + value: T, + start?: number, + end?: number + ): LoDashImplicitWrapper>; + + /** + * @see _.fill + */ + fill( + this: LoDashImplicitWrapper | null | undefined>, + value: T, + start?: number, + end?: number + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.fill + */ + fill( + this: LoDashExplicitWrapper, + value: T + ): LoDashExplicitWrapper; + + /** + * @see _.fill + */ + fill( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper>; + + /** + * @see _.fill + */ + fill( + this: LoDashExplicitWrapper, + value: T, + start?: number, + end?: number + ): LoDashExplicitWrapper>; + + /** + * @see _.fill + */ + fill( + this: LoDashExplicitWrapper | null | undefined>, + value: T, + start?: number, + end?: number + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/array/findIndex.d.ts b/types/lodash/array/findIndex.d.ts new file mode 100644 index 0000000000..eb0d6ae1a1 --- /dev/null +++ b/types/lodash/array/findIndex.d.ts @@ -0,0 +1,49 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.find except that it returns the index of the first element predicate returns truthy + * for instead of the element itself. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to search. + * @param predicate The function invoked per iteration. + * @param fromIndex The index to search from. + * @return Returns the index of the found element, else -1. + */ + findIndex( + array: List | null | undefined, + predicate?: ListIterateeCustom, + fromIndex?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.findIndex + */ + findIndex( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.findIndex + */ + findIndex( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/findLastIndex.d.ts b/types/lodash/array/findLastIndex.d.ts new file mode 100644 index 0000000000..04088a7ea2 --- /dev/null +++ b/types/lodash/array/findLastIndex.d.ts @@ -0,0 +1,48 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.findIndex except that it iterates over elements of collection from right to left. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to search. + * @param predicate The function invoked per iteration. + * @param fromIndex The index to search from. + * @return Returns the index of the found element, else -1. + */ + findLastIndex( + array: List | null | undefined, + predicate?: ListIterateeCustom, + fromIndex?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.findLastIndex + */ + findLastIndex( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.findLastIndex + */ + findLastIndex( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/first.d.ts b/types/lodash/array/first.d.ts new file mode 100644 index 0000000000..13c28fbce0 --- /dev/null +++ b/types/lodash/array/first.d.ts @@ -0,0 +1,22 @@ +declare namespace _ { + interface LoDashStatic { + first: typeof _.head; // tslint:disable-line:no-unnecessary-qualifier + } + + interface LoDashImplicitWrapper { + /** + * @see _.head + */ + first(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.head + */ + first(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } + + interface RecursiveArray extends Array> {} + interface ListOfRecursiveArraysOrValues extends List> {} +} \ No newline at end of file diff --git a/types/lodash/array/flatten.d.ts b/types/lodash/array/flatten.d.ts new file mode 100644 index 0000000000..cce7ded984 --- /dev/null +++ b/types/lodash/array/flatten.d.ts @@ -0,0 +1,42 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only + * flattened a single level. + * + * @param array The array to flatten. + * @param isDeep Specify a deep flatten. + * @return Returns the new flattened array. + */ + flatten(array: ListOfRecursiveArraysOrValues | null | undefined, isDeep: boolean): T[]; + + /** + * @see _.flatten + */ + flatten(array: List> | null | undefined): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatten + */ + flatten(this: LoDashImplicitWrapper | null | undefined>, isDeep: boolean): LoDashImplicitWrapper; + + /** + * @see _.flatten + */ + flatten(this: LoDashImplicitWrapper> | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatten + */ + flatten(this: LoDashExplicitWrapper | null | undefined>, isDeep: boolean): LoDashExplicitWrapper; + + /** + * @see _.flatten + */ + flatten(this: LoDashExplicitWrapper> | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/flattenDeep.d.ts b/types/lodash/array/flattenDeep.d.ts new file mode 100644 index 0000000000..f25386327a --- /dev/null +++ b/types/lodash/array/flattenDeep.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Recursively flattens a nested array. + * + * @param array The array to recursively flatten. + * @return Returns the new flattened array. + */ + flattenDeep(array: ListOfRecursiveArraysOrValues | null | undefined): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/flattenDepth.d.ts b/types/lodash/array/flattenDepth.d.ts new file mode 100644 index 0000000000..807e925308 --- /dev/null +++ b/types/lodash/array/flattenDepth.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Recursively flatten array up to depth times. + * + * @param array The array to recursively flatten. + * @param number The maximum recursion depth. + * @return Returns the new flattened array. + */ + flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDepth(this: LoDashImplicitWrapper | null | undefined>, depth?: number): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDepth(this: LoDashExplicitWrapper | null | undefined>, depth?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/fromPairs.d.ts b/types/lodash/array/fromPairs.d.ts new file mode 100644 index 0000000000..08af96f8e2 --- /dev/null +++ b/types/lodash/array/fromPairs.d.ts @@ -0,0 +1,58 @@ +declare namespace _ { + interface LoDashStatic { + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @category Array + * @param pairs The key-value pairs. + * @returns Returns the new object. + * @example + * + * _.fromPairs([['fred', 30], ['barney', 40]]); + * // => { 'fred': 30, 'barney': 40 } + */ + fromPairs( + pairs: List<[PropertyName, T]> | null | undefined + ): Dictionary; + + /** + @see _.fromPairs + */ + fromPairs( + pairs: List | null | undefined + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.fromPairs + */ + fromPairs( + this: LoDashImplicitWrapper | null | undefined> + ): LoDashImplicitWrapper>; + + /** + @see _.fromPairs + */ + fromPairs( + this: LoDashImplicitWrapper | null | undefined> + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.fromPairs + */ + fromPairs( + this: LoDashExplicitWrapper | null | undefined> + ): LoDashExplicitWrapper>; + + /** + @see _.fromPairs + */ + fromPairs( + this: LoDashExplicitWrapper | null | undefined> + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/array/head.d.ts b/types/lodash/array/head.d.ts new file mode 100644 index 0000000000..19c2d2df77 --- /dev/null +++ b/types/lodash/array/head.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets the first element of array. + * + * @alias _.first + * + * @param array The array to query. + * @return Returns the first element of array. + */ + head(array: List | null | undefined): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.head + */ + head(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.head + */ + head(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/indexOf.d.ts b/types/lodash/array/indexOf.d.ts new file mode 100644 index 0000000000..da5d91e0d3 --- /dev/null +++ b/types/lodash/array/indexOf.d.ts @@ -0,0 +1,52 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the offset + * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` + * performs a faster binary search. + * + * @category Array + * @param array The array to search. + * @param value The value to search for. + * @param [fromIndex=0] The index to search from. + * @returns Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // using `fromIndex` + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + indexOf( + array: List | null | undefined, + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.indexOf + */ + indexOf( + this: LoDashImplicitWrapper | null | undefined>, + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.indexOf + */ + indexOf( + this: LoDashExplicitWrapper | null | undefined>, + value: T, + fromIndex?: boolean|number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/initial.d.ts b/types/lodash/array/initial.d.ts new file mode 100644 index 0000000000..d011a0998f --- /dev/null +++ b/types/lodash/array/initial.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets all but the last element of array. + * + * @param array The array to query. + * @return Returns the slice of array. + */ + initial(array: List | null | undefined): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.initial + */ + initial(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.initial + */ + initial(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/intersection.d.ts b/types/lodash/array/intersection.d.ts new file mode 100644 index 0000000000..71a7c06abc --- /dev/null +++ b/types/lodash/array/intersection.d.ts @@ -0,0 +1,32 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for + * equality comparisons. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of shared values. + */ + intersection(...arrays: Array>): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.intersection + */ + intersection( + this: LoDashImplicitWrapper>, + ...arrays: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.intersection + */ + intersection( + this: LoDashExplicitWrapper>, + ...arrays: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/intersectionBy.d.ts b/types/lodash/array/intersectionBy.d.ts new file mode 100644 index 0000000000..251dbd78f7 --- /dev/null +++ b/types/lodash/array/intersectionBy.d.ts @@ -0,0 +1,133 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @category Array + * @param [arrays] The arrays to inspect. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the new array of shared values. + * @example + * + * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [2.1] + * + * // using the `_.property` iteratee shorthand + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + intersectionBy( + array: List | null, + values: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.intersectionBy + */ + intersectionBy( + array: List | null, + values1: List, + values2: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.intersectionBy + */ + intersectionBy( + array: List | null | undefined, + values1: List, + values2: List, + ...values: Array | ValueIteratee> + ): T1[]; + + /** + * @see _.intersectionBy + */ + intersectionBy( + array?: List | null, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashImplicitWrapper | null | undefined>, + values: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + iteratee: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | ValueIteratee> + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashImplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashExplicitWrapper | null | undefined>, + values: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | ValueIteratee> + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionBy + */ + intersectionBy( + this: LoDashExplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/intersectionWith.d.ts b/types/lodash/array/intersectionWith.d.ts new file mode 100644 index 0000000000..5dce77beab --- /dev/null +++ b/types/lodash/array/intersectionWith.d.ts @@ -0,0 +1,132 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of unique `array` values not included in the other + * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @category Array + * @param [values] The arrays to inspect. + * @param [comparator] The comparator invoked per element. + * @returns Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + intersectionWith( + array: List | null | undefined, + values: List, + comparator: Comparator2 + ): T1[]; + + /** + * @see _.intersectionWith + */ + intersectionWith( + array: List | null | undefined, + values1: List, + values2: List, + comparator: Comparator2 + ): T1[]; + + /** + * @see _.intersectionWith + */ + intersectionWith( + array: List | null | undefined, + values1: List, + values2: List, + ...values: Array | Comparator2> + ): T1[]; + + /** + * @see _.intersectionWith + */ + intersectionWith( + array?: List | null, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashImplicitWrapper | null | undefined>, + values: List, + comparator: Comparator2 + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + comparator: Comparator2 + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashImplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | Comparator2>, + ): LoDashImplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashImplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashExplicitWrapper | null | undefined>, + values: List, + comparator: Comparator2 + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + comparator: Comparator2 + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashExplicitWrapper | null | undefined>, + values1: List, + values2: List, + ...values: Array | Comparator2>, + ): LoDashExplicitWrapper; + + /** + * @see _.intersectionWith + */ + intersectionWith( + this: LoDashExplicitWrapper | null | undefined>, + ...values: Array> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/join.d.ts b/types/lodash/array/join.d.ts new file mode 100644 index 0000000000..27d62caaff --- /dev/null +++ b/types/lodash/array/join.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @param array The array to convert. + * @param separator The element separator. + * @returns Returns the joined string. + */ + join( + array: List | null | undefined, + separator?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.join + */ + join(separator?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.join + */ + join(separator?: string): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/last.d.ts b/types/lodash/array/last.d.ts new file mode 100644 index 0000000000..1c6d435eff --- /dev/null +++ b/types/lodash/array/last.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets the last element of array. + * + * @param array The array to query. + * @return Returns the last element of array. + */ + last(array: List | null | undefined): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.last + */ + last(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.last + */ + last(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/lastIndexOf.d.ts b/types/lodash/array/lastIndexOf.d.ts new file mode 100644 index 0000000000..454b8b2676 --- /dev/null +++ b/types/lodash/array/lastIndexOf.d.ts @@ -0,0 +1,39 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.indexOf except that it iterates over elements of array from right to left. + * + * @param array The array to search. + * @param value The value to search for. + * @param fromIndex The index to search from or true to perform a binary search on a sorted array. + * @return Returns the index of the matched value, else -1. + */ + lastIndexOf( + array: List | null | undefined, + value: T, + fromIndex?: true|number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.indexOf + */ + lastIndexOf( + this: LoDashImplicitWrapper | null | undefined>, + value: T, + fromIndex?: true|number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.indexOf + */ + lastIndexOf( + this: LoDashExplicitWrapper | null | undefined>, + value: T, + fromIndex?: true|number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/nth.d.ts b/types/lodash/array/nth.d.ts new file mode 100644 index 0000000000..e6ebe7834d --- /dev/null +++ b/types/lodash/array/nth.d.ts @@ -0,0 +1,35 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. + * + * @param array array The array to query. + * @param value The index of the element to return. + * @return Returns the nth element of `array`. + */ + nth( + array: List | null | undefined, + n?: number + ): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.nth + */ + nth( + this: LoDashImplicitWrapper | null | undefined>, + n?: number + ): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.nth + */ + nth( + this: LoDashExplicitWrapper | null | undefined>, + n?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/pull.d.ts b/types/lodash/array/pull.d.ts new file mode 100644 index 0000000000..b604bc9ff7 --- /dev/null +++ b/types/lodash/array/pull.d.ts @@ -0,0 +1,45 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Removes all provided values from array using SameValueZero for equality comparisons. + * + * Note: Unlike _.without, this method mutates array. + * + * @param array The array to modify. + * @param values The values to remove. + * @return Returns array. + */ + pull( + array: T[], + ...values: T[] + ): T[]; + + /** + * @see _.pull + */ + pull( + array: List, + ...values: T[] + ): List; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pull + */ + pull( + this: LoDashImplicitWrapper>, + ...values: T[] + ): this; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pull + */ + pull( + this: LoDashExplicitWrapper>, + ...values: T[] + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/array/pullAll.d.ts b/types/lodash/array/pullAll.d.ts new file mode 100644 index 0000000000..33e663c8be --- /dev/null +++ b/types/lodash/array/pullAll.d.ts @@ -0,0 +1,53 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @category Array + * @param array The array to modify. + * @param values The values to remove. + * @returns Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * + * _.pull(array, [2, 3]); + * console.log(array); + * // => [1, 1] + */ + pullAll( + array: T[], + values?: List, + ): T[]; + + /** + * @see _.pullAll + */ + pullAll( + array: List, + values?: List, + ): List; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pullAll + */ + pullAll( + this: LoDashImplicitWrapper>, + values?: List + ): this; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pullAll + */ + pullAll( + this: LoDashExplicitWrapper>, + values?: List + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/array/pullAllBy.d.ts b/types/lodash/array/pullAllBy.d.ts new file mode 100644 index 0000000000..e2261a7d8b --- /dev/null +++ b/types/lodash/array/pullAllBy.d.ts @@ -0,0 +1,76 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to to generate the criterion + * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @category Array + * @param array The array to modify. + * @param values The values to remove. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + pullAllBy( + array: T[], + values?: List, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.pullAllBy + */ + pullAllBy( + array: List, + values?: List, + iteratee?: ValueIteratee + ): List; + + /** + * @see _.pullAllBy + */ + pullAllBy( + array: T1[], + values: List, + iteratee: ValueIteratee + ): T1[]; + + /** + * @see _.pullAllBy + */ + pullAllBy( + array: List, + values: List, + iteratee: ValueIteratee + ): List; + } + + interface LoDashWrapper { + /** + * @see _.pullAllBy + */ + pullAllBy( + this: LoDashWrapper>, + values?: List, + iteratee?: ValueIteratee + ): this; + + /** + * @see _.pullAllBy + */ + pullAllBy( + this: LoDashWrapper>, + values: List, + iteratee: ValueIteratee + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/array/pullAllWith.d.ts b/types/lodash/array/pullAllWith.d.ts new file mode 100644 index 0000000000..aefdf90981 --- /dev/null +++ b/types/lodash/array/pullAllWith.d.ts @@ -0,0 +1,76 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.pullAll` except that it accepts `comparator` which is + * invoked to compare elements of array to values. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @category Array + * @param array The array to modify. + * @param values The values to remove. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + pullAllWith( + array: T[], + values?: List, + comparator?: Comparator + ): T[]; + + /** + * @see _.pullAllWith + */ + pullAllWith( + array: List, + values?: List, + comparator?: Comparator + ): List; + + /** + * @see _.pullAllWith + */ + pullAllWith( + array: T1[], + values: List, + comparator: Comparator2 + ): T1[]; + + /** + * @see _.pullAllWith + */ + pullAllWith( + array: List, + values: List, + comparator: Comparator2 + ): List; + } + + interface LoDashWrapper { + /** + * @see _.pullAllWith + */ + pullAllWith( + this: LoDashWrapper>, + values?: List, + comparator?: Comparator + ): this; + + /** + * @see _.pullAllWith + */ + pullAllWith( + this: LoDashWrapper>, + values: List, + comparator: Comparator2 + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/array/pullAt.d.ts b/types/lodash/array/pullAt.d.ts new file mode 100644 index 0000000000..8a161cfd97 --- /dev/null +++ b/types/lodash/array/pullAt.d.ts @@ -0,0 +1,33 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. + * Indexes may be specified as an array of indexes or as individual arguments. + * + * Note: Unlike _.at, this method mutates array. + * + * @param array The array to modify. + * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. + * @return Returns the new array of removed elements. + */ + pullAt( + array: T[], + ...indexes: Array> + ): T[]; + + /** + * @see _.pullAt + */ + pullAt( + array: List, + ...indexes: Array> + ): List; + } + + interface LoDashWrapper { + /** + * @see _.pullAt + */ + pullAt(...indexes: Array>): this; + } +} \ No newline at end of file diff --git a/types/lodash/array/remove.d.ts b/types/lodash/array/remove.d.ts new file mode 100644 index 0000000000..cc8ed55a3c --- /dev/null +++ b/types/lodash/array/remove.d.ts @@ -0,0 +1,48 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Removes all elements from array that predicate returns truthy for and returns an array of the removed + * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * Note: Unlike _.filter, this method mutates array. + * + * @param array The array to modify. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new array of removed elements. + */ + remove( + array: List, + predicate?: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.remove + */ + remove( + this: LoDashImplicitWrapper>, + predicate?: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.remove + */ + remove( + this: LoDashExplicitWrapper>, + predicate?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/reverse.d.ts b/types/lodash/array/reverse.d.ts new file mode 100644 index 0000000000..a5a4c61b2a --- /dev/null +++ b/types/lodash/array/reverse.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @category Array + * @returns Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + reverse>( + array: TList, + ): TList; + } +} \ No newline at end of file diff --git a/types/lodash/array/slice.d.ts b/types/lodash/array/slice.d.ts new file mode 100644 index 0000000000..4161cf25de --- /dev/null +++ b/types/lodash/array/slice.d.ts @@ -0,0 +1,39 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a slice of array from start up to, but not including, end. + * + * @param array The array to slice. + * @param start The start position. + * @param end The end position. + * @return Returns the slice of array. + */ + slice( + array: List | null | undefined, + start?: number, + end?: number + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.slice + */ + slice( + this: LoDashImplicitWrapper | null | undefined>, + start?: number, + end?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.slice + */ + slice( + this: LoDashExplicitWrapper | null | undefined>, + start?: number, + end?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedIndex.d.ts b/types/lodash/array/sortedIndex.d.ts new file mode 100644 index 0000000000..2390a19e66 --- /dev/null +++ b/types/lodash/array/sortedIndex.d.ts @@ -0,0 +1,44 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Uses a binary search to determine the lowest index at which `value` should + * be inserted into `array` in order to maintain its sort order. + * + * @category Array + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @returns Returns the index at which `value` should be inserted into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + * + * _.sortedIndex([4, 5], 4); + * // => 0 + */ + sortedIndex( + array: List | null | undefined, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedIndexBy.d.ts b/types/lodash/array/sortedIndexBy.d.ts new file mode 100644 index 0000000000..b71ae3b859 --- /dev/null +++ b/types/lodash/array/sortedIndexBy.d.ts @@ -0,0 +1,96 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Uses a binary search to determine the lowest index at which `value` should + * be inserted into `array` in order to maintain its sort order. + * + * @category Array + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @returns Returns the index at which `value` should be inserted into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + * + * _.sortedIndex([4, 5], 4); + * // => 0 + */ + sortedIndex( + array: List | null | undefined, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper; + } + + // _.sortedIndexBy + interface LoDashStatic { + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @category Array + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the index at which `value` should be inserted into `array`. + * @example + * + * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; + * + * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); + * // => 1 + * + * // using the `_.property` iteratee shorthand + * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 0 + */ + sortedIndexBy( + array: List | null | undefined, + value: T, + iteratee?: ValueIteratee + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + this: LoDashImplicitWrapper | null | undefined>, + value: T, + iteratee?: ValueIteratee + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + this: LoDashExplicitWrapper | null | undefined>, + value: T, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedIndexOf.d.ts b/types/lodash/array/sortedIndexOf.d.ts new file mode 100644 index 0000000000..f3e7143074 --- /dev/null +++ b/types/lodash/array/sortedIndexOf.d.ts @@ -0,0 +1,41 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @category Array + * @param array The array to search. + * @param value The value to search for. + * @returns Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([1, 1, 2, 2], 2); + * // => 2 + */ + sortedIndexOf( + array: List | null | undefined, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedLastIndex.d.ts b/types/lodash/array/sortedLastIndex.d.ts new file mode 100644 index 0000000000..af4cc1663b --- /dev/null +++ b/types/lodash/array/sortedLastIndex.d.ts @@ -0,0 +1,42 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @category Array + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @returns Returns the index at which `value` should be inserted into `array`. + * @example + * + * _.sortedLastIndex([4, 5], 4); + * // => 1 + */ + sortedLastIndex( + array: List | null | undefined, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedLastIndexBy.d.ts b/types/lodash/array/sortedLastIndexBy.d.ts new file mode 100644 index 0000000000..5a691a6b28 --- /dev/null +++ b/types/lodash/array/sortedLastIndexBy.d.ts @@ -0,0 +1,47 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @category Array + * @param array The sorted array to inspect. + * @param value The value to evaluate. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the index at which `value` should be inserted into `array`. + * @example + * + * // using the `_.property` iteratee shorthand + * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 1 + */ + sortedLastIndexBy( + array: List | null | undefined, + value: T, + iteratee: ValueIteratee + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + this: LoDashImplicitWrapper | null | undefined>, + value: T, + iteratee: ValueIteratee + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + this: LoDashExplicitWrapper | null | undefined>, + value: T, + iteratee: ValueIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedLastIndexOf.d.ts b/types/lodash/array/sortedLastIndexOf.d.ts new file mode 100644 index 0000000000..6230ec6c44 --- /dev/null +++ b/types/lodash/array/sortedLastIndexOf.d.ts @@ -0,0 +1,41 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @category Array + * @param array The array to search. + * @param value The value to search for. + * @returns Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([1, 1, 2, 2], 2); + * // => 3 + */ + sortedLastIndexOf( + array: List | null | undefined, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedLastIndexOf + */ + sortedLastIndexOf( + this: LoDashImplicitWrapper | null | undefined>, + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedLastIndexOf + */ + sortedLastIndexOf( + this: LoDashExplicitWrapper | null | undefined>, + value: T + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedUniq.d.ts b/types/lodash/array/sortedUniq.d.ts new file mode 100644 index 0000000000..74e7e79f0f --- /dev/null +++ b/types/lodash/array/sortedUniq.d.ts @@ -0,0 +1,33 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @category Array + * @param array The array to inspect. + * @returns Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + sortedUniq( + array: List | null | undefined + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/sortedUniqBy.d.ts b/types/lodash/array/sortedUniqBy.d.ts new file mode 100644 index 0000000000..6cad3ad107 --- /dev/null +++ b/types/lodash/array/sortedUniqBy.d.ts @@ -0,0 +1,65 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @category Array + * @param array The array to inspect. + * @param [iteratee] The iteratee invoked per element. + * @returns Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.2] + */ + sortedUniqBy( + array: string | null | undefined, + iteratee: StringIterator + ): string[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + array: List | null | undefined, + iteratee: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + this: LoDashImplicitWrapper, + iteratee: StringIterator + ): LoDashImplicitWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + this: LoDashExplicitWrapper, + iteratee: StringIterator + ): LoDashExplicitWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/tail.d.ts b/types/lodash/array/tail.d.ts new file mode 100644 index 0000000000..ed73ef0fbe --- /dev/null +++ b/types/lodash/array/tail.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets all but the first element of array. + * + * @param array The array to query. + * @return Returns the slice of array. + */ + tail(array: List | null | undefined): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.tail + */ + tail(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.tail + */ + tail(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/take.d.ts b/types/lodash/array/take.d.ts new file mode 100644 index 0000000000..5044113e2d --- /dev/null +++ b/types/lodash/array/take.d.ts @@ -0,0 +1,35 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a slice of array with n elements taken from the beginning. + * + * @param array The array to query. + * @param n The number of elements to take. + * @return Returns the slice of array. + */ + take( + array: List | null | undefined, + n?: number + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.take + */ + take( + this: LoDashImplicitWrapper | null | undefined>, + n?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.take + */ + take( + this: LoDashExplicitWrapper | null | undefined>, + n?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/takeRight.d.ts b/types/lodash/array/takeRight.d.ts new file mode 100644 index 0000000000..4620ac6e4d --- /dev/null +++ b/types/lodash/array/takeRight.d.ts @@ -0,0 +1,35 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a slice of array with n elements taken from the end. + * + * @param array The array to query. + * @param n The number of elements to take. + * @return Returns the slice of array. + */ + takeRight( + array: List | null | undefined, + n?: number + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.takeRight + */ + takeRight( + this: LoDashImplicitWrapper | null | undefined>, + n?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.takeRight + */ + takeRight( + this: LoDashExplicitWrapper | null | undefined>, + n?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/takeRightWhile.d.ts b/types/lodash/array/takeRightWhile.d.ts new file mode 100644 index 0000000000..aa9822bbfb --- /dev/null +++ b/types/lodash/array/takeRightWhile.d.ts @@ -0,0 +1,46 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns + * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + takeRightWhile( + array: List | null | undefined, + predicate?: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/takeWhile.d.ts b/types/lodash/array/takeWhile.d.ts new file mode 100644 index 0000000000..e9d28e076a --- /dev/null +++ b/types/lodash/array/takeWhile.d.ts @@ -0,0 +1,46 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns + * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + takeWhile( + array: List | null | undefined, + predicate?: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.takeWhile + */ + takeWhile( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.takeWhile + */ + takeWhile( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/union.d.ts b/types/lodash/array/union.d.ts new file mode 100644 index 0000000000..4e977dc4f5 --- /dev/null +++ b/types/lodash/array/union.d.ts @@ -0,0 +1,32 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for + * equality comparisons. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of combined values. + */ + union(...arrays: Array | null | undefined>): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.union + */ + union( + this: LoDashImplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.union + */ + union( + this: LoDashExplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/unionBy.d.ts b/types/lodash/array/unionBy.d.ts new file mode 100644 index 0000000000..bafedc0b14 --- /dev/null +++ b/types/lodash/array/unionBy.d.ts @@ -0,0 +1,163 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @param arrays The arrays to inspect. + * @param iteratee The iteratee invoked per element. + * @return Returns the new array of combined values. + */ + unionBy( + arrays: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: List | null | undefined, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + arrays5: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unionBy + */ + unionBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + arrays5: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unionBy + */ + unionBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.unionBy + */ + unionBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + arrays5: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/unionWith.d.ts b/types/lodash/array/unionWith.d.ts new file mode 100644 index 0000000000..9e427abdbf --- /dev/null +++ b/types/lodash/array/unionWith.d.ts @@ -0,0 +1,102 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @category Array + * @param [arrays] The arrays to inspect. + * @param [comparator] The comparator invoked per element. + * @returns Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + unionWith( + arrays: List | null | undefined, + comparator?: Comparator + ): T[]; + + /** + * @see _.unionBy + */ + unionWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + comparator?: Comparator + ): T[]; + + /** + * @see _.unionWith + */ + unionWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unionWith + */ + unionWith( + this: LoDashImplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashImplicitWrapper; + + /** + * @see _.unionWith + */ + unionWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + comparator?: Comparator + ): LoDashImplicitWrapper; + + /** + * @see _.unionWith + */ + unionWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unionWith + */ + unionWith( + this: LoDashExplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashExplicitWrapper; + + /** + * @see _.unionWith + */ + unionWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + comparator?: Comparator + ): LoDashExplicitWrapper; + + /** + * @see _.unionWith + */ + unionWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/uniq.d.ts b/types/lodash/array/uniq.d.ts new file mode 100644 index 0000000000..670000bfb7 --- /dev/null +++ b/types/lodash/array/uniq.d.ts @@ -0,0 +1,35 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. + * + * @category Array + * @param array The array to inspect. + * @returns Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + uniq( + array: List | null | undefined + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniq + */ + uniq(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniq + */ + uniq(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/uniqBy.d.ts b/types/lodash/array/uniqBy.d.ts new file mode 100644 index 0000000000..61345382c1 --- /dev/null +++ b/types/lodash/array/uniqBy.d.ts @@ -0,0 +1,70 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @category Array + * @param array The array to inspect. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // using the `_.property` iteratee shorthand + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + uniqBy( + array: string | null | undefined, + iteratee: StringIterator + ): string[]; + + /** + * @see _.uniqBy + */ + uniqBy( + array: List | null | undefined, + iteratee: ListIteratee + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + this: LoDashImplicitWrapper, + iteratee: StringIterator + ): LoDashImplicitWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIteratee + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + this: LoDashExplicitWrapper, + iteratee: StringIterator + ): LoDashExplicitWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/uniqWith.d.ts b/types/lodash/array/uniqWith.d.ts new file mode 100644 index 0000000000..e5c28bb2d3 --- /dev/null +++ b/types/lodash/array/uniqWith.d.ts @@ -0,0 +1,44 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @category Array + * @param array The array to inspect. + * @param [comparator] The comparator invoked per element. + * @returns Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + uniqWith( + array: List | null | undefined, + comparator?: Comparator + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniqWith + */ + uniqWith( + this: LoDashImplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniqWith + */ + uniqWith( + this: LoDashExplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/unzip.d.ts b/types/lodash/array/unzip.d.ts new file mode 100644 index 0000000000..c374a2369b --- /dev/null +++ b/types/lodash/array/unzip.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.zip except that it accepts an array of grouped elements and creates an array + * regrouping the elements to their pre-zip configuration. + * + * @param array The array of grouped elements to process. + * @return Returns the new array of regrouped elements. + */ + unzip(array: T[][] | List> | null | undefined): T[][]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unzip + */ + unzip(this: LoDashImplicitWrapper> | null | undefined>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unzip + */ + unzip(this: LoDashExplicitWrapper> | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/unzipWith.d.ts b/types/lodash/array/unzipWith.d.ts new file mode 100644 index 0000000000..2b0c0bf119 --- /dev/null +++ b/types/lodash/array/unzipWith.d.ts @@ -0,0 +1,59 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be + * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, + * group). + * + * @param array The array of grouped elements to process. + * @param iteratee The function to combine regrouped values. + * @param thisArg The this binding of iteratee. + * @return Returns the new array of regrouped elements. + */ + unzipWith( + array: List> | null | undefined, + iteratee: (...values: T[]) => TResult + ): TResult[]; + + /** + * @see _.unzipWith + */ + unzipWith( + array: List> | null | undefined + ): T[][]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unzipWith + */ + unzipWith( + this: LoDashImplicitWrapper> | null | undefined>, + iteratee: (...values: T[]) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.unzipWith + */ + unzipWith( + this: LoDashImplicitWrapper> | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unzipWith + */ + unzipWith( + this: LoDashExplicitWrapper> | null | undefined>, + iteratee: (...values: T[]) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.unzipWith + */ + unzipWith( + this: LoDashExplicitWrapper> | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/without.d.ts b/types/lodash/array/without.d.ts new file mode 100644 index 0000000000..d722342d89 --- /dev/null +++ b/types/lodash/array/without.d.ts @@ -0,0 +1,35 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array excluding all provided values using SameValueZero for equality comparisons. + * + * @param array The array to filter. + * @param values The values to exclude. + * @return Returns the new array of filtered values. + */ + without( + array: List | null | undefined, + ...values: T[] + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.without + */ + without( + this: LoDashImplicitWrapper | null | undefined>, + ...values: T[] + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.without + */ + without( + this: LoDashExplicitWrapper | null | undefined>, + ...values: T[] + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/xor.d.ts b/types/lodash/array/xor.d.ts new file mode 100644 index 0000000000..04eaa051e7 --- /dev/null +++ b/types/lodash/array/xor.d.ts @@ -0,0 +1,31 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of unique values that is the symmetric difference of the provided arrays. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of values. + */ + xor(...arrays: Array | null | undefined>): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.xor + */ + xor( + this: LoDashImplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.xor + */ + xor( + this: LoDashExplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/xorBy.d.ts b/types/lodash/array/xorBy.d.ts new file mode 100644 index 0000000000..6728c569dc --- /dev/null +++ b/types/lodash/array/xorBy.d.ts @@ -0,0 +1,103 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @category Array + * @param [arrays] The arrays to inspect. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the new array of values. + * @example + * + * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [1.2, 4.3] + * + * // using the `_.property` iteratee shorthand + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + xorBy( + arrays: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.xorBy + */ + xorBy( + arrays: List | null | undefined, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): T[]; + + /** + * @see _.xorBy + */ + xorBy( + arrays: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.xor + */ + xorBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.xorBy + */ + xorBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashImplicitWrapper; + + /** + * @see _.xorBy + */ + xorBy( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.xorBy + */ + xorBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.xorBy + */ + xorBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + iteratee?: ValueIteratee + ): LoDashExplicitWrapper; + + /** + * @see _.xorBy + */ + xorBy( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...iteratee: Array | List | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/xorWith.d.ts b/types/lodash/array/xorWith.d.ts new file mode 100644 index 0000000000..cec73890d3 --- /dev/null +++ b/types/lodash/array/xorWith.d.ts @@ -0,0 +1,102 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @category Array + * @param [arrays] The arrays to inspect. + * @param [comparator] The comparator invoked per element. + * @returns Returns the new array of values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + xorWith( + arrays: List | null | undefined, + comparator?: Comparator + ): T[]; + + /** + * @see _.xorWith + */ + xorWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + comparator?: Comparator + ): T[]; + + /** + * @see _.xorWith + */ + xorWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.xorWith + */ + xorWith( + this: LoDashImplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashImplicitWrapper; + + /** + * @see _.xorWith + */ + xorWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + comparator?: Comparator + ): LoDashImplicitWrapper; + + /** + * @see _.xorWith + */ + xorWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.xorWith + */ + xorWith( + this: LoDashExplicitWrapper | null | undefined>, + comparator?: Comparator + ): LoDashExplicitWrapper; + + /** + * @see _.xorWith + */ + xorWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + comparator?: Comparator + ): LoDashExplicitWrapper; + + /** + * @see _.xorWith + */ + xorWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + ...comparator: Array | List | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/zip.d.ts b/types/lodash/array/zip.d.ts new file mode 100644 index 0000000000..612899b87e --- /dev/null +++ b/types/lodash/array/zip.d.ts @@ -0,0 +1,32 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, + * the second of which contains the second elements of the given arrays, and so on. + * + * @param arrays The arrays to process. + * @return Returns the new array of grouped elements. + */ + zip(...arrays: Array | null | undefined>): T[][]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/zipObject.d.ts b/types/lodash/array/zipObject.d.ts new file mode 100644 index 0000000000..49b34166c2 --- /dev/null +++ b/types/lodash/array/zipObject.d.ts @@ -0,0 +1,57 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.fromPairs except that it accepts two arrays, one of property + * identifiers and one of corresponding values. + * + * @param props The property names. + * @param values The property values. + * @return Returns the new object. + */ + zipObject( + props: List, + values: List + ): Dictionary; + + /** + * @see _.zipObject + */ + zipObject( + props?: List + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.zipObject + */ + zipObject( + this: LoDashImplicitWrapper>, + values: List + ): LoDashImplicitWrapper>; + + /** + * @see _.zipObject + */ + zipObject( + this: LoDashImplicitWrapper> + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.zipObject + */ + zipObject( + this: LoDashExplicitWrapper>, + values: List + ): LoDashExplicitWrapper>; + + /** + * @see _.zipObject + */ + zipObject( + this: LoDashExplicitWrapper> + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/array/zipObjectDeep.d.ts b/types/lodash/array/zipObjectDeep.d.ts new file mode 100644 index 0000000000..e68c5d1292 --- /dev/null +++ b/types/lodash/array/zipObjectDeep.d.ts @@ -0,0 +1,35 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.zipObject except that it supports property paths. + * + * @param paths The property names. + * @param values The property values. + * @return Returns the new object. + */ + zipObjectDeep( + paths?: List, + values?: List + ): object; + } + + interface LoDashImplicitWrapper { + /** + * @see _.zipObjectDeep + */ + zipObjectDeep( + this: LoDashImplicitWrapper>, + values?: List + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.zipObjectDeep + */ + zipObjectDeep( + this: LoDashExplicitWrapper>, + values?: List + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/array/zipWith.d.ts b/types/lodash/array/zipWith.d.ts new file mode 100644 index 0000000000..f0cef3776a --- /dev/null +++ b/types/lodash/array/zipWith.d.ts @@ -0,0 +1,190 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be + * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, + * group). + * @param [arrays] The arrays to process. + * @param [iteratee] The function to combine grouped values. + * @param [thisArg] The `this` binding of `iteratee`. + * @return Returns the new array of grouped elements. + */ + zipWith( + ...arrays: Array | null | undefined> + ): T[][]; + + /** + * @see _.zipWith + */ + zipWith( + arrays: List | null | undefined, + iteratee: (value1: T) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + iteratee: (value1: T, value2: T) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + iteratee: (value1: T, value2: T, value3: T) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + iteratee: (value1: T, value2: T, value3: T, value4: T) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays: List | null | undefined, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + arrays5: List | null | undefined, + iteratee: (value1: T, value2: T, value3: T, value4: T, value5: T) => TResult + ): TResult[]; + + zipWith( + ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> + ): TResult[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: (value1: T) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + iteratee: (value1: T, value2: T) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + iteratee: (value1: T, value2: T, value3: T) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + iteratee: (value1: T, value2: T, value3: T, value4: T) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + arrays5: List | null | undefined, + ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: (value1: T) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + iteratee: (value1: T, value2: T) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + iteratee: (value1: T, value2: T, value3: T) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + iteratee: (value1: T, value2: T, value3: T, value4: T) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper | null | undefined>, + arrays2: List | null | undefined, + arrays3: List | null | undefined, + arrays4: List | null | undefined, + arrays5: List | null | undefined, + ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/countBy.d.ts b/types/lodash/collection/countBy.d.ts new file mode 100644 index 0000000000..0a6a819c5f --- /dev/null +++ b/types/lodash/collection/countBy.d.ts @@ -0,0 +1,120 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The + * iteratee is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + countBy( + collection: string | null | undefined, + iteratee?: StringIterator + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: List | null | undefined, + iteratee?: ListIteratee + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: NumericDictionary | null | undefined, + iteratee?: NumericDictionaryIteratee + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: T | null | undefined, + iteratee?: ObjectIteratee + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.countBy + */ + countBy( + this: LoDashImplicitWrapper, + iteratee?: StringIterator + ): LoDashImplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashImplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.countBy + */ + countBy( + this: LoDashExplicitWrapper, + iteratee?: StringIterator + ): LoDashExplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashExplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.countBy + */ + countBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIteratee + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/each.d.ts b/types/lodash/collection/each.d.ts new file mode 100644 index 0000000000..a12df91b30 --- /dev/null +++ b/types/lodash/collection/each.d.ts @@ -0,0 +1,39 @@ +declare namespace _ { + interface LoDashStatic { + each: typeof _.forEach; // tslint:disable-line:no-unnecessary-qualifier + } + + interface LoDashWrapper { + /** + * @see _.forEach + */ + each( + this: LoDashWrapper, + iteratee?: ArrayIterator + ): this; + + /** + * @see _.forEach + */ + each( + this: LoDashWrapper, + iteratee?: StringIterator + ): this; + + /** + * @see _.forEach + */ + each( + this: LoDashWrapper | null | undefined>, + iteratee?: ListIterator + ): this; + + /** + * @see _.forEach + */ + each( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/collection/eachRight.d.ts b/types/lodash/collection/eachRight.d.ts new file mode 100644 index 0000000000..d8e448a486 --- /dev/null +++ b/types/lodash/collection/eachRight.d.ts @@ -0,0 +1,39 @@ +declare namespace _ { + interface LoDashStatic { + eachRight: typeof _.forEachRight; // tslint:disable-line:no-unnecessary-qualifier + } + + interface LoDashWrapper { + /** + * @see _.forEachRight + */ + eachRight( + this: LoDashWrapper, + iteratee?: ArrayIterator + ): this; + + /** + * @see _.forEachRight + */ + eachRight( + this: LoDashWrapper, + iteratee?: StringIterator + ): this; + + /** + * @see _.forEachRight + */ + eachRight( + this: LoDashWrapper | null | undefined>, + iteratee?: ListIterator + ): this; + + /** + * @see _.forEachRight + */ + eachRight( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/collection/every.d.ts b/types/lodash/collection/every.d.ts new file mode 100644 index 0000000000..76e6e659d7 --- /dev/null +++ b/types/lodash/collection/every.d.ts @@ -0,0 +1,84 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate + * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @return Returns true if all elements pass the predicate check, else false. + */ + every( + collection: List | null | undefined, + predicate?: ListIterateeCustom + ): boolean; + + /** + * @see _.every + */ + every( + collection: NumericDictionary | null | undefined, + predicate?: NumericDictionaryIterateeCustom + ): boolean; + + /** + * @see _.every + */ + every( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.every + */ + every( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): boolean; + + /** + * @see _.every + */ + every( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom + ): boolean; + + /** + * @see _.every + */ + every( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: NumericDictionaryIterateeCustom + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.every + */ + every( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.every + */ + every( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.every + */ + every( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: NumericDictionaryIterateeCustom + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/filter.d.ts b/types/lodash/collection/filter.d.ts new file mode 100644 index 0000000000..adfe9a22c7 --- /dev/null +++ b/types/lodash/collection/filter.d.ts @@ -0,0 +1,142 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The + * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new filtered array. + */ + filter( + collection: string | null | undefined, + predicate?: StringIterator + ): string[]; + + /** + * @see _.filter + */ + filter( + collection: List | null | undefined, + predicate: ListIteratorTypeGuard + ): S[]; + + /** + * @see _.filter + */ + filter( + collection: List | null | undefined, + predicate?: ListIterateeCustom + ): T[]; + + /** + * @see _.filter + */ + filter( + collection: T | null | undefined, + predicate: ObjectIteratorTypeGuard + ): S[]; + + /** + * @see _.filter + */ + filter( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom + ): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.filter + */ + filter( + this: LoDashImplicitWrapper, + predicate?: StringIterator + ): LoDashImplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashImplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard + ): LoDashImplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashImplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashImplicitWrapper, + predicate: ObjectIteratorTypeGuard + ): LoDashImplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.filter + */ + filter( + this: LoDashExplicitWrapper, + predicate?: StringIterator + ): LoDashExplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashExplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard + ): LoDashExplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashExplicitWrapper, + predicate: ObjectIteratorTypeGuard + ): LoDashExplicitWrapper; + + /** + * @see _.filter + */ + filter( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/find.d.ts b/types/lodash/collection/find.d.ts new file mode 100644 index 0000000000..d4593ac9d3 --- /dev/null +++ b/types/lodash/collection/find.d.ts @@ -0,0 +1,130 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Iterates over elements of collection, returning the first element predicate returns truthy for. + * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to search. + * @param predicate The function invoked per iteration. + * @param fromIndex The index to search from. + * @return Returns the matched element, else undefined. + */ + find( + collection: List | null | undefined, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.find + */ + find( + collection: List | null | undefined, + predicate?: ListIterateeCustom, + fromIndex?: number + ): T|undefined; + + /** + * @see _.find + */ + find( + collection: T | null | undefined, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.find + */ + find( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): T[keyof T]|undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.find + */ + find( + this: LoDashImplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.find + */ + find( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): T|undefined; + + /** + * @see _.find + */ + find( + this: LoDashImplicitWrapper, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.find + */ + find( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): T[keyof T]|undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.find + */ + find( + this: LoDashExplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.find + */ + find( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.find + */ + find( + this: LoDashExplicitWrapper, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.find + */ + find( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/findLast.d.ts b/types/lodash/collection/findLast.d.ts new file mode 100644 index 0000000000..43b3dfbd28 --- /dev/null +++ b/types/lodash/collection/findLast.d.ts @@ -0,0 +1,120 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.find except that it iterates over elements of a collection from + * right to left. + * @param collection Searches for a value in this list. + * @param predicate The function called per iteration. + * @param fromIndex The index to search from. + * @return The found element, else undefined. + **/ + findLast( + collection: List | null | undefined, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.findLast + */ + findLast( + collection: List | null | undefined, + predicate?: ListIterateeCustom, + fromIndex?: number + ): T|undefined; + + /** + * @see _.findLast + */ + findLast( + collection: T | null | undefined, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.findLast + */ + findLast( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): T[keyof T]|undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.findLast + */ + findLast( + this: LoDashImplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): S | undefined; + + /** + * @see _.findLast + */ + findLast( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): T | undefined; + + /** + * @see _.findLast + */ + findLast( + this: LoDashImplicitWrapper, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): S|undefined; + + /** + * @see _.findLast + */ + findLast( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): T[keyof T]|undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.findLast + */ + findLast( + this: LoDashExplicitWrapper | null | undefined>, + predicate: ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findLast + */ + findLast( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findLast + */ + findLast( + this: LoDashExplicitWrapper, + predicate: ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findLast + */ + findLast( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/flatMap.d.ts b/types/lodash/collection/flatMap.d.ts new file mode 100644 index 0000000000..8eec7ddea1 --- /dev/null +++ b/types/lodash/collection/flatMap.d.ts @@ -0,0 +1,163 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of flattened values by running each element in collection through iteratee + * and concating its result to the other mapped values. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @return Returns the new flattened array. + */ + flatMap( + collection: List> | Dictionary> | NumericDictionary> | null | undefined + ): T[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: object | null | undefined + ): any[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: List | null | undefined, + iteratee: ListIterator> + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: NumericDictionary | null | undefined, + iteratee: NumericDictionaryIterator> + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: T | null | undefined, + iteratee: ObjectIterator> + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: object | null | undefined, + iteratee: string + ): any[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: object | null | undefined, + iteratee: object + ): boolean[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatMap + */ + flatMap(this: LoDashImplicitWrapper> | Dictionary> | NumericDictionary> | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap(): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIterator> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashImplicitWrapper, + iteratee: ObjectIterator> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: string + ): LoDashImplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: object + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatMap + */ + flatMap(this: LoDashExplicitWrapper> | Dictionary> | NumericDictionary> | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap(): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIterator> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + this: LoDashExplicitWrapper, + iteratee: ObjectIterator> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: string + ): LoDashExplicitWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: object + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/flatMapDeep.d.ts b/types/lodash/collection/flatMapDeep.d.ts new file mode 100644 index 0000000000..d15ce69070 --- /dev/null +++ b/types/lodash/collection/flatMapDeep.d.ts @@ -0,0 +1,163 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @since 4.7.0 + * @category Collection + * @param collection The collection to iterate over. + * @param [iteratee=_.identity] The function invoked per iteration. + * @returns Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + flatMapDeep( + collection: List | T> | Dictionary | T> | NumericDictionary | T> | null | undefined + ): T[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: List | null | undefined, + iteratee: ListIterator | TResult> + ): TResult[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: NumericDictionary | null | undefined, + iteratee: NumericDictionaryIterator | TResult> + ): TResult[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: T | null | undefined, + iteratee: ObjectIterator | TResult> + ): TResult[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: object | null | undefined, + iteratee: string + ): any[]; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + collection: object | null | undefined, + iteratee: object + ): boolean[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIterator | TResult> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator | TResult> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper, + iteratee: ObjectIterator | TResult> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper, + iteratee: string + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashImplicitWrapper, + iteratee: object + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIterator | TResult> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator | TResult> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper, + iteratee: ObjectIterator | TResult> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper, + iteratee: string + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDeep + */ + flatMapDeep( + this: LoDashExplicitWrapper, + iteratee: object + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/flatMapDepth.d.ts b/types/lodash/collection/flatMapDepth.d.ts new file mode 100644 index 0000000000..fd8004dc1a --- /dev/null +++ b/types/lodash/collection/flatMapDepth.d.ts @@ -0,0 +1,179 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @since 4.7.0 + * @category Collection + * @param collection The collection to iterate over. + * @param [iteratee=_.identity] The function invoked per iteration. + * @param [depth=1] The maximum recursion depth. + * @returns Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + flatMapDepth( + collection: List | T> | Dictionary | T> | NumericDictionary | T> | null | undefined + ): T[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: List | null | undefined, + iteratee: ListIterator | TResult>, + depth?: number + ): TResult[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: NumericDictionary | null | undefined, + iteratee: NumericDictionaryIterator | TResult>, + depth?: number + ): TResult[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: T | null | undefined, + iteratee: ObjectIterator | TResult>, + depth?: number + ): TResult[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: object | null | undefined, + iteratee: string, + depth?: number + ): any[]; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + collection: object | null | undefined, + iteratee: object, + depth?: number + ): boolean[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIterator | TResult>, + depth?: number + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator | TResult>, + depth?: number + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper, + iteratee: ObjectIterator | TResult>, + depth?: number + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper, + iteratee: string, + depth?: number + ): LoDashImplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashImplicitWrapper, + iteratee: object, + depth?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIterator | TResult>, + depth?: number + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: NumericDictionaryIterator | TResult>, + depth?: number + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper, + iteratee: ObjectIterator | TResult>, + depth?: number + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper, + iteratee: string, + depth?: number + ): LoDashExplicitWrapper; + + /** + * @see _.flatMapDepth + */ + flatMapDepth( + this: LoDashExplicitWrapper, + iteratee: object, + depth?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/forEach.d.ts b/types/lodash/collection/forEach.d.ts new file mode 100644 index 0000000000..8ede8dfc15 --- /dev/null +++ b/types/lodash/collection/forEach.d.ts @@ -0,0 +1,112 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg + * and invoked with three arguments: + * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. + * + * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To + * avoid this behavior _.forIn or _.forOwn may be used for object iteration. + * + * @alias _.each + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + */ + forEach( + collection: T[], + iteratee?: ArrayIterator + ): T[]; + + /** + * @see _.forEach + */ + forEach( + collection: string, + iteratee?: StringIterator + ): string; + + /** + * @see _.forEach + */ + forEach( + collection: List, + iteratee?: ListIterator + ): List; + + /** + * @see _.forEach + */ + forEach( + collection: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forEach + */ + forEach( + collection: TArray & (T[] | null | undefined), + iteratee?: ArrayIterator + ): TArray; + + /** + * @see _.forEach + */ + forEach( + collection: TString, + iteratee?: StringIterator + ): TString; + + /** + * @see _.forEach + */ + forEach | null | undefined>( + collection: TList & (List | null | undefined), + iteratee?: ListIterator + ): TList; + + /** + * @see _.forEach + */ + forEach( + collection: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forEach + */ + forEach( + this: LoDashWrapper, + iteratee?: ArrayIterator + ): this; + + /** + * @see _.forEach + */ + forEach( + this: LoDashWrapper, + iteratee?: StringIterator + ): this; + + /** + * @see _.forEach + */ + forEach( + this: LoDashWrapper | null | undefined>, + iteratee?: ListIterator + ): this; + + /** + * @see _.forEach + */ + forEach( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/collection/forEachRight.d.ts b/types/lodash/collection/forEachRight.d.ts new file mode 100644 index 0000000000..67c3ec3b8b --- /dev/null +++ b/types/lodash/collection/forEachRight.d.ts @@ -0,0 +1,107 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.forEach except that it iterates over elements of collection from right to left. + * + * @alias _.eachRight + * + * @param collection The collection to iterate over. + * @param iteratee The function called per iteration. + * @param thisArg The this binding of callback. + */ + forEachRight( + collection: T[], + iteratee?: ArrayIterator + ): T[]; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: string, + iteratee?: StringIterator + ): string; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: List, + iteratee?: ListIterator + ): List; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: TArray & (T[] | null | undefined), + iteratee?: ArrayIterator + ): TArray; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: TString, + iteratee?: StringIterator + ): TString; + + /** + * @see _.forEachRight + */ + forEachRight | null | undefined>( + collection: TList & (List | null | undefined), + iteratee?: ListIterator + ): TList; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forEachRight + */ + forEachRight( + this: LoDashWrapper, + iteratee?: ArrayIterator + ): this; + + /** + * @see _.forEachRight + */ + forEachRight( + this: LoDashWrapper, + iteratee?: StringIterator + ): this; + + /** + * @see _.forEachRight + */ + forEachRight( + this: LoDashWrapper | null | undefined>, + iteratee?: ListIterator + ): this; + + /** + * @see _.forEachRight + */ + forEachRight( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/collection/groupBy.d.ts b/types/lodash/collection/groupBy.d.ts new file mode 100644 index 0000000000..192154de0a --- /dev/null +++ b/types/lodash/collection/groupBy.d.ts @@ -0,0 +1,120 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is an array of the elements responsible for generating the + * key. The iteratee is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + groupBy( + collection: string | null | undefined, + iteratee?: StringIterator + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: List | null | undefined, + iteratee?: ListIteratee + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: NumericDictionary | null | undefined, + iteratee?: NumericDictionaryIteratee + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: T | null | undefined, + iteratee?: ObjectIteratee + ): Dictionary>; + } + + interface LoDashImplicitWrapper { + /** + * @see _.groupBy + */ + groupBy( + this: LoDashImplicitWrapper, + iteratee?: StringIterator + ): LoDashImplicitWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashImplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashImplicitWrapper>>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.groupBy + */ + groupBy( + this: LoDashExplicitWrapper, + iteratee?: StringIterator + ): LoDashExplicitWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + this: LoDashExplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashExplicitWrapper>>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/includes.d.ts b/types/lodash/collection/includes.d.ts new file mode 100644 index 0000000000..76fcd79a6f --- /dev/null +++ b/types/lodash/collection/includes.d.ts @@ -0,0 +1,40 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, + * it’s used as the offset from the end of collection. + * + * @param collection The collection to search. + * @param target The value to search for. + * @param fromIndex The index to search from. + * @return True if the target element is found, else false. + */ + includes( + collection: List|Dictionary | null | undefined, + target: T, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.includes + */ + includes( + this: LoDashImplicitWrapper | Dictionary | null | undefined>, + target: T, + fromIndex?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.includes + */ + includes( + this: LoDashExplicitWrapper | Dictionary | null | undefined>, + target: T, + fromIndex?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/invokeMap.d.ts b/types/lodash/collection/invokeMap.d.ts new file mode 100644 index 0000000000..73c283fbde --- /dev/null +++ b/types/lodash/collection/invokeMap.d.ts @@ -0,0 +1,57 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Invokes the method named by methodName on each element in the collection returning + * an array of the results of each invoked method. Additional arguments will be provided + * to each invoked method. If methodName is a function it will be invoked for, and this + * bound to, each element in the collection. + * @param collection The collection to iterate over. + * @param methodName The name of the method to invoke. + * @param args Arguments to invoke the method with. + **/ + invokeMap( + collection: object | null | undefined, + methodName: string, + ...args: any[]): any[]; + + /** + * @see _.invokeMap + **/ + invokeMap( + collection: object | null | undefined, + method: (...args: any[]) => TResult, + ...args: any[]): TResult[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.invokeMap + **/ + invokeMap( + methodName: string, + ...args: any[]): LoDashImplicitWrapper; + + /** + * @see _.invokeMap + **/ + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.invokeMap + **/ + invokeMap( + methodName: string, + ...args: any[]): LoDashExplicitWrapper; + + /** + * @see _.invokeMap + **/ + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/keyBy.d.ts b/types/lodash/collection/keyBy.d.ts new file mode 100644 index 0000000000..47f2c35cc5 --- /dev/null +++ b/types/lodash/collection/keyBy.d.ts @@ -0,0 +1,120 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the last element responsible for generating the key. The + * iteratee function is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + keyBy( + collection: string | null | undefined, + iteratee?: StringIterator + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: List | null | undefined, + iteratee?: ListIterateeCustom + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: T | null | undefined, + iteratee?: ObjectIterateeCustom + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: NumericDictionary | null | undefined, + iteratee?: NumericDictionaryIterateeCustom + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.keyBy + */ + keyBy( + this: LoDashImplicitWrapper, + iteratee?: StringIterator + ): LoDashImplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIterateeCustom + ): LoDashImplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashImplicitWrapper, + iteratee?: ObjectIterateeCustom + ): LoDashImplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIterateeCustom + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.keyBy + */ + keyBy( + this: LoDashExplicitWrapper, + iteratee?: StringIterator + ): LoDashExplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIterateeCustom + ): LoDashExplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashExplicitWrapper, + iteratee?: ObjectIterateeCustom + ): LoDashExplicitWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIterateeCustom + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/map.d.ts b/types/lodash/collection/map.d.ts new file mode 100644 index 0000000000..493f6300b6 --- /dev/null +++ b/types/lodash/collection/map.d.ts @@ -0,0 +1,179 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to + * thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property value + * of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, + * _.reject, and _.some. + * + * The guarded methods are: + * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, + * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, + * sample, some, sum, uniq, and words + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the new mapped array. + */ + map( + collection: List | null | undefined, + iteratee: ListIterator + ): TResult[]; + + /** + * @see _.map + */ + map(collection: List | Dictionary | null | undefined): T[]; + + /** + * @see _.map + */ + map( + collection: Dictionary | null | undefined, + iteratee: DictionaryIterator + ): TResult[]; + + /** @see _.map */ + map( + collection: List | Dictionary | null | undefined, + iteratee: K + ): Array; + + /** @see _.map */ + map( + collection: NumericDictionary | null | undefined, + iteratee?: NumericDictionaryIterator + ): TResult[]; + + /** + * @see _.map + */ + map( + collection: List|Dictionary|NumericDictionary | null | undefined, + iteratee?: string + ): TResult[]; + + /** + * @see _.map + */ + map( + collection: List|Dictionary|NumericDictionary | null | undefined, + iteratee?: object + ): boolean[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.map + */ + map( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: ListIterator + ): LoDashImplicitWrapper; + + /** + * @see _.map + */ + map(this: LoDashImplicitWrapper | Dictionary | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: DictionaryIterator + ): LoDashImplicitWrapper; + + /** @see _.map */ + map( + this: LoDashImplicitWrapper | Dictionary | null | undefined>, + iteratee: K + ): LoDashImplicitWrapper>; + + /** @see _.map */ + map( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIterator + ): LoDashImplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + iteratee?: string + ): LoDashImplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + iteratee?: object + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.map + */ + map( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: ListIterator + ): LoDashExplicitWrapper; + + /** + * @see _.map + */ + map(this: LoDashExplicitWrapper | Dictionary | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: DictionaryIterator + ): LoDashExplicitWrapper; + + /** @see _.map */ + map( + this: LoDashExplicitWrapper | Dictionary | null | undefined>, + iteratee: K + ): LoDashExplicitWrapper>; + + /** + * @see _.map + */ + map( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: NumericDictionaryIterator + ): LoDashExplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + iteratee?: string + ): LoDashExplicitWrapper; + + /** + * @see _.map + */ + map( + this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + iteratee?: object + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/orderBy.d.ts b/types/lodash/collection/orderBy.d.ts new file mode 100644 index 0000000000..bac15cefa4 --- /dev/null +++ b/types/lodash/collection/orderBy.d.ts @@ -0,0 +1,191 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @category Collection + * @param collection The collection to iterate over. + * @param [iteratees=[_.identity]] The iteratees to sort by. + * @param [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. + * @returns Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // sort by `user` in ascending order and by `age` in descending order + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */ + orderBy( + collection: List | null | undefined, + iteratees?: Many>, + orders?: Many + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: List | null | undefined, + iteratees?: Many>, + orders?: Many + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: T | null | undefined, + iteratees?: Many>, + orders?: Many + ): Array; + + /** + * @see _.orderBy + */ + orderBy( + collection: T | null | undefined, + iteratees?: Many>, + orders?: Many + ): Array; + + /** + * @see _.orderBy + */ + orderBy( + collection: NumericDictionary | null | undefined, + iteratees?: Many>, + orders?: Many + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: NumericDictionary | null | undefined, + iteratees?: Many>, + orders?: Many + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper>; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper>; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper>; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper>; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper; + + /** + * @see _.orderBy + */ + orderBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratees?: Many>, + orders?: Many + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/partition.d.ts b/types/lodash/collection/partition.d.ts new file mode 100644 index 0000000000..e293220770 --- /dev/null +++ b/types/lodash/collection/partition.d.ts @@ -0,0 +1,71 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, + * while the second of which contains elements predicate returns falsey for. + * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback + * returns the property value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback + * returns true for elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns + * true for elements that have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the array of grouped elements. + **/ + partition( + collection: List | null | undefined, + callback: ValueIteratee + ): [T[], T[]]; + + /** + * @see _.partition + */ + partition( + collection: T | null | undefined, + callback: ValueIteratee + ): [Array, Array]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.partition + */ + partition( + this: LoDashImplicitWrapper | null | undefined>, + callback: ValueIteratee + ): LoDashImplicitWrapper<[T[], T[]]>; + + /** + * @see _.partition + */ + partition( + this: LoDashImplicitWrapper, + callback: ValueIteratee + ): LoDashImplicitWrapper<[Array, Array]>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.partition + */ + partition( + this: LoDashExplicitWrapper | null | undefined>, + callback: ValueIteratee + ): LoDashExplicitWrapper<[T[], T[]]>; + + /** + * @see _.partition + */ + partition( + this: LoDashExplicitWrapper, + callback: ValueIteratee + ): LoDashExplicitWrapper<[Array, Array]>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/reduce.d.ts b/types/lodash/collection/reduce.d.ts new file mode 100644 index 0000000000..f924a149bb --- /dev/null +++ b/types/lodash/collection/reduce.d.ts @@ -0,0 +1,219 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Reduces a collection to a value which is the accumulated result of running each + * element in the collection through the callback, where each successive callback execution + * consumes the return value of the previous execution. If accumulator is not provided the + * first element of the collection will be used as the initial accumulator value. The callback + * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param accumulator Initial value of the accumulator. + * @return Returns the accumulated value. + **/ + reduce( + collection: T[] | null | undefined, + callback: MemoListIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: List | null | undefined, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: T | null | undefined, + callback: MemoObjectIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: NumericDictionary | null | undefined, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: T[] | null | undefined, + callback: MemoListIterator + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + collection: List | null | undefined, + callback: MemoListIterator> + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + collection: T | null | undefined, + callback: MemoObjectIterator + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + collection: NumericDictionary | null | undefined, + callback: MemoListIterator> + ): TResult | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper, + callback: MemoListIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper, + callback: MemoObjectIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper, + callback: MemoListIterator + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper, + callback: MemoObjectIterator + ): TResult | undefined; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): TResult | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper, + callback: MemoListIterator, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper, + callback: MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper, + callback: MemoListIterator + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper, + callback: MemoObjectIterator + ): LoDashExplicitWrapper; + + /** + * @see _.reduce + **/ + reduce( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/reduceRight.d.ts b/types/lodash/collection/reduceRight.d.ts new file mode 100644 index 0000000000..d250def9a6 --- /dev/null +++ b/types/lodash/collection/reduceRight.d.ts @@ -0,0 +1,216 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.reduce except that it iterates over elements of a collection from + * right to left. + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param accumulator Initial value of the accumulator. + * @return The accumulated value. + **/ + reduceRight( + collection: T[] | null | undefined, + callback: MemoListIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: List | null | undefined, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: T | null | undefined, + callback: MemoObjectIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: NumericDictionary | null | undefined, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: T[] | null | undefined, + callback: MemoListIterator + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: List | null | undefined, + callback: MemoListIterator> + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: T | null | undefined, + callback: MemoObjectIterator + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: NumericDictionary | null | undefined, + callback: MemoListIterator> + ): TResult | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper, + callback: MemoListIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper, + callback: MemoObjectIterator, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper, + callback: MemoListIterator + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper, + callback: MemoObjectIterator + ): TResult | undefined; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashImplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): TResult | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper, + callback: MemoListIterator, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper, + callback: MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator>, + accumulator: TResult + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper, + callback: MemoListIterator + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper, + callback: MemoObjectIterator + ): LoDashExplicitWrapper; + + /** + * @see _.reduceRight + **/ + reduceRight( + this: LoDashExplicitWrapper | null | undefined>, + callback: MemoListIterator> + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/reject.d.ts b/types/lodash/collection/reject.d.ts new file mode 100644 index 0000000000..a475baf1ee --- /dev/null +++ b/types/lodash/collection/reject.d.ts @@ -0,0 +1,85 @@ +declare namespace _ { + interface LoDashStatic { + /** + * The opposite of _.filter; this method returns the elements of collection that predicate does not return + * truthy for. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new filtered array. + */ + reject( + collection: string | null | undefined, + predicate?: StringIterator + ): string[]; + + /** + * @see _.reject + */ + reject( + collection: List | null | undefined, + predicate?: ListIterateeCustom + ): T[]; + + /** + * @see _.reject + */ + reject( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom + ): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.reject + */ + reject( + this: LoDashImplicitWrapper, + predicate?: StringIterator + ): LoDashImplicitWrapper; + + /** + * @see _.reject + */ + reject( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashImplicitWrapper; + + /** + * @see _.reject + */ + reject( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.reject + */ + reject( + this: LoDashExplicitWrapper, + predicate?: StringIterator + ): LoDashExplicitWrapper; + + /** + * @see _.reject + */ + reject( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.reject + */ + reject( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/sample.d.ts b/types/lodash/collection/sample.d.ts new file mode 100644 index 0000000000..f078711033 --- /dev/null +++ b/types/lodash/collection/sample.d.ts @@ -0,0 +1,73 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets a random element from collection. + * + * @param collection The collection to sample. + * @return Returns the random element. + */ + sample( + collection: List | Dictionary | NumericDictionary | null | undefined + ): T | undefined; + + /** + * @see _.sample + */ + sample( + collection: T + ): T[keyof T]; + + /** + * @see _.sample + */ + sample( + collection: T | null | undefined + ): T[keyof T] | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sample + */ + sample( + this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined> + ): T | undefined; + + /** + * @see _.sample + */ + sample( + this: LoDashImplicitWrapper, + ): T[keyof T]; + + /** + * @see _.sample + */ + sample( + this: LoDashImplicitWrapper + ): T[keyof T] | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sample + */ + sample( + this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined> + ): LoDashExplicitWrapper; + + /** + * @see _.sample + */ + sample( + this: LoDashExplicitWrapper, + ): LoDashExplicitWrapper; + + /** + * @see _.sample + */ + sample( + this: LoDashExplicitWrapper + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/sampleSize.d.ts b/types/lodash/collection/sampleSize.d.ts new file mode 100644 index 0000000000..e21ed6eea4 --- /dev/null +++ b/types/lodash/collection/sampleSize.d.ts @@ -0,0 +1,59 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets n random elements at unique keys from collection up to the size of collection. + * + * @param collection The collection to sample. + * @param n The number of elements to sample. + * @return Returns the random elements. + */ + sampleSize( + collection: List|Dictionary|NumericDictionary | null | undefined, + n?: number + ): T[]; + + /** + * @see _.sampleSize + */ + sampleSize( + collection: T | null | undefined, + n?: number + ): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sampleSize + */ + sampleSize( + this: LoDashImplicitWrapper|Dictionary|NumericDictionary | null | undefined>, + n?: number + ): LoDashImplicitWrapper; + + /** + * @see _.sampleSize + */ + sampleSize( + this: LoDashImplicitWrapper, + n?: number + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sampleSize + */ + sampleSize( + this: LoDashExplicitWrapper|Dictionary|NumericDictionary | null | undefined>, + n?: number + ): LoDashExplicitWrapper; + + /** + * @see _.sampleSize + */ + sampleSize( + this: LoDashExplicitWrapper, + n?: number + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/shuffle.d.ts b/types/lodash/collection/shuffle.d.ts new file mode 100644 index 0000000000..0c91dc097d --- /dev/null +++ b/types/lodash/collection/shuffle.d.ts @@ -0,0 +1,40 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. + * + * @param collection The collection to shuffle. + * @return Returns the new shuffled array. + */ + shuffle(collection: List | null | undefined): T[]; + + /** + * @see _.shuffle + */ + shuffle(collection: T | null | undefined): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.shuffle + */ + shuffle(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.shuffle + */ + shuffle(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.shuffle + */ + shuffle(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.shuffle + */ + shuffle(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/collection/size.d.ts b/types/lodash/collection/size.d.ts new file mode 100644 index 0000000000..6653becb5f --- /dev/null +++ b/types/lodash/collection/size.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets the size of collection by returning its length for array-like values or the number of own enumerable + * properties for objects. + * + * @param collection The collection to inspect. + * @return Returns the size of collection. + */ + size(collection: object | string | null | undefined): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.size + */ + size(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/some.d.ts b/types/lodash/collection/some.d.ts new file mode 100644 index 0000000000..b6393023ec --- /dev/null +++ b/types/lodash/collection/some.d.ts @@ -0,0 +1,84 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate + * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @return Returns true if any element passes the predicate check, else false. + */ + some( + collection: List | null | undefined, + predicate?: ListIterateeCustom + ): boolean; + + /** + * @see _.some + */ + some( + collection: T | null | undefined, + predicate?: ObjectIterateeCustom + ): boolean; + + /** + * @see _.some + */ + some( + collection: NumericDictionary | null | undefined, + predicate?: NumericDictionaryIterateeCustom + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.some + */ + some( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): boolean; + + /** + * @see _.some + */ + some( + this: LoDashImplicitWrapper, + predicate?: ObjectIterateeCustom + ): boolean; + + /** + * @see _.some + */ + some( + this: LoDashImplicitWrapper | null | undefined>, + predicate?: NumericDictionaryIterateeCustom + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.some + */ + some( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: ListIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + this: LoDashExplicitWrapper, + predicate?: ObjectIterateeCustom + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + this: LoDashExplicitWrapper | null | undefined>, + predicate?: NumericDictionaryIterateeCustom + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/collection/sortBy.d.ts b/types/lodash/collection/sortBy.d.ts new file mode 100644 index 0000000000..c2bcdcf9e8 --- /dev/null +++ b/types/lodash/collection/sortBy.d.ts @@ -0,0 +1,83 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @category Collection + * @param collection The collection to iterate over. + * @param [iteratees=[_.identity]] + * The iteratees to sort by, specified individually or in arrays. + * @returns Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */ + sortBy( + collection: List | null | undefined, + ...iteratees: Array>> + ): T[]; + + /** + * @see _.sortBy + */ + sortBy( + collection: T | null | undefined, + ...iteratees: Array>> + ): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortBy + */ + sortBy( + this: LoDashImplicitWrapper | null | undefined>, + ...iteratees: Array>> + ): LoDashImplicitWrapper; + + /** + * @see _.sortBy + */ + sortBy( + this: LoDashImplicitWrapper, + ...iteratees: Array>> + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortBy + */ + sortBy( + this: LoDashExplicitWrapper | null | undefined>, + ...iteratees: Array>> + ): LoDashExplicitWrapper; + + /** + * @see _.sortBy + */ + sortBy( + this: LoDashExplicitWrapper, + ...iteratees: Array>> + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/common/common.d.ts b/types/lodash/common/common.d.ts new file mode 100644 index 0000000000..930525f1f0 --- /dev/null +++ b/types/lodash/common/common.d.ts @@ -0,0 +1,254 @@ +declare let _: _.LoDashStatic; +type PartialObject = Partial; +declare namespace _ { + type Many = T | T[]; + interface LoDashStatic { + /** + * Creates a lodash object which wraps value to enable implicit method chain sequences. + * Methods that operate on and return arrays, collections, and functions can be chained together. + * Methods that retrieve a single value or may return a primitive value will automatically end the + * chain sequence and return the unwrapped value. Otherwise, the value must be unwrapped with value(). + * + * Explicit chain sequences, which must be unwrapped with value(), may be enabled using _.chain. + * + * The execution of chained methods is lazy, that is, it's deferred until value() is + * implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. Shortcut fusion + * is an optimization to merge iteratee calls; this avoids the creation of intermediate + * arrays and can greatly reduce the number of iteratee executions. Sections of a chain + * sequence qualify for shortcut fusion if the section is applied to an array and iteratees + * accept only one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the value() method is directly or + * indirectly included in the build. + * + * In addition to lodash methods, wrappers have Array and String methods. + * The wrapper Array methods are: + * concat, join, pop, push, shift, sort, splice, and unshift. + * The wrapper String methods are: + * replace and split. + * + * The wrapper methods that support shortcut fusion are: + * at, compact, drop, dropRight, dropWhile, filter, find, findLast, head, initial, last, + * map, reject, reverse, slice, tail, take, takeRight, takeRightWhile, takeWhile, and toArray + * + * The chainable wrapper methods are: + * after, ary, assign, assignIn, assignInWith, assignWith, at, before, bind, bindAll, bindKey, + * castArray, chain, chunk, commit, compact, concat, conforms, constant, countBy, create, + * curry, debounce, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, + * drop, dropRight, dropRightWhile, dropWhile, extend, extendWith, fill, filter, flatMap, + * flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, flow, flowRight, + * fromPairs, functions, functionsIn, groupBy, initial, intersection, intersectionBy, intersectionWith, + * invert, invertBy, invokeMap, iteratee, keyBy, keys, keysIn, map, mapKeys, mapValues, + * matches, matchesProperty, memoize, merge, mergeWith, method, methodOf, mixin, negate, + * nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, partial, partialRight, + * partition, pick, pickBy, plant, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, + * push, range, rangeRight, rearg, reject, remove, rest, reverse, sampleSize, set, setWith, + * shuffle, slice, sort, sortBy, sortedUniq, sortedUniqBy, splice, spread, tail, take, + * takeRight, takeRightWhile, takeWhile, tap, throttle, thru, toArray, toPairs, toPairsIn, + * toPath, toPlainObject, transform, unary, union, unionBy, unionWith, uniq, uniqBy, uniqWith, + * unset, unshift, unzip, unzipWith, update, updateWith, values, valuesIn, without, wrap, + * xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, and zipWith. + * + * The wrapper methods that are not chainable by default are: + * add, attempt, camelCase, capitalize, ceil, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, + * conformsTo, deburr, defaultTo, divide, each, eachRight, endsWith, eq, escape, escapeRegExp, + * every, find, findIndex, findKey, findLast, findLastIndex, findLastKey, first, floor, forEach, + * forEachRight, forIn, forInRight, forOwn, forOwnRight, get, gt, gte, has, hasIn, head, + * identity, includes, indexOf, inRange, invoke, isArguments, isArray, isArrayBuffer, + * isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, + * isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, + * isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, + * isSafeInteger, isSet, isString, isUndefined, isTypedArray, isWeakMap, isWeakSet, join, + * kebabCase, last, lastIndexOf, lowerCase, lowerFirst, lt, lte, max, maxBy, mean, meanBy, + * min, minBy, multiply, noConflict, noop, now, nth, pad, padEnd, padStart, parseInt, pop, + * random, reduce, reduceRight, repeat, result, round, runInContext, sample, shift, size, + * snakeCase, some, sortedIndex, sortedIndexBy, sortedLastIndex, sortedLastIndexBy, startCase, + * startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, + * template, times, toFinite, toInteger, toJSON, toLength, toLower, toNumber, toSafeInteger, + * toString, toUpper, trim, trimEnd, trimStart, truncate, unescape, uniqueId, upperCase, + * upperFirst, value, and words. + **/ + (value: T): LoDashImplicitWrapper; + + /** + * The semantic version number. + **/ + VERSION: string; + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby + * (ERB). Change the following template settings to use alternative delimiters. + **/ + templateSettings: TemplateSettings; + } + + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby + * (ERB). Change the following template settings to use alternative delimiters. + **/ + interface TemplateSettings { + /** + * The "escape" delimiter. + **/ + escape?: RegExp; + + /** + * The "evaluate" delimiter. + **/ + evaluate?: RegExp; + + /** + * An object to import into the template as local variables. + **/ + imports?: Dictionary; + + /** + * The "interpolate" delimiter. + **/ + interpolate?: RegExp; + + /** + * Used to reference the data object in the template text. + **/ + variable?: string; + } + + /** + * Creates a cache object to store key/value pairs. + */ + interface MapCache { + /** + * Removes `key` and its value from the cache. + * @param key The key of the value to remove. + * @return Returns `true` if the entry was removed successfully, else `false`. + */ + delete(key: string): boolean; + + /** + * Gets the cached value for `key`. + * @param key The key of the value to get. + * @return Returns the cached value. + */ + get(key: string): any; + + /** + * Checks if a cached value for `key` exists. + * @param key The key of the entry to check. + * @return Returns `true` if an entry for `key` exists, else `false`. + */ + has(key: string): boolean; + + /** + * Sets `value` to `key` of the cache. + * @param key The key of the value to cache. + * @param value The value to cache. + * @return Returns the cache object. + */ + set(key: string, value: any): Dictionary; + + /** + * Removes all key-value entries from the map. + */ + clear(): void; + } + interface MapCacheConstructor { + new (): MapCache; + } + + interface LoDashImplicitWrapper extends LoDashWrapper { + pop(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + push(this: LoDashImplicitWrapper | null | undefined>, ...items: T[]): this; + shift(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + sort(this: LoDashImplicitWrapper | null | undefined>, compareFn?: (a: T, b: T) => number): this; + splice(this: LoDashImplicitWrapper | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; + unshift(this: LoDashImplicitWrapper | null | undefined>, ...items: T[]): this; + } + + interface LoDashExplicitWrapper extends LoDashWrapper { + pop(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + push(this: LoDashExplicitWrapper | null | undefined>, ...items: T[]): this; + shift(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + sort(this: LoDashExplicitWrapper | null | undefined>, compareFn?: (a: T, b: T) => number): this; + splice(this: LoDashExplicitWrapper | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; + unshift(this: LoDashExplicitWrapper | null | undefined>, ...items: T[]): this; + } + + type NotVoid = {} | null | undefined; + type ArrayIterator = (value: T, index: number, collection: T[]) => TResult; + type ListIterator = (value: T, index: number, collection: List) => TResult; + type ListIteratee = ListIterator | string | [string, any] | PartialDeep; + type ListIterateeCustom = ListIterator | string | object | [string, any] | PartialDeep; + type ListIteratorTypeGuard = (value: T, index: number, collection: List) => value is S; + + // Note: key should be string, not keyof T, because the actual object may contain extra properties that were not specified in the type. + type ObjectIterator = (value: TObject[keyof TObject], key: string, collection: TObject) => TResult; + type ObjectIteratee = ObjectIterator | string | [string, any] | PartialDeep; + type ObjectIterateeCustom = ObjectIterator | string | object | [string, any] | PartialDeep; + type ObjectIteratorTypeGuard = (value: TObject[keyof TObject], key: string, collection: TObject) => value is S; + + type DictionaryIterator = ObjectIterator, TResult>; + type DictionaryIteratee = ObjectIteratee>; + type DictionaryIteratorTypeGuard = ObjectIteratorTypeGuard, S>; + + type NumericDictionaryIterator = (value: T, key: number, collection: NumericDictionary) => TResult; + type NumericDictionaryIteratee = NumericDictionaryIterator | string | [string, any] | PartialDeep; + type NumericDictionaryIterateeCustom = NumericDictionaryIterator | string | [string, any] | PartialDeep; + + type StringIterator = (char: string, index: number, string: string) => TResult; + + type MemoVoidIterator = (prev: TResult, curr: T, indexOrKey: any, list: T[]) => void; + + /** @deprecated Use MemoListIterator or MemoObjectIterator instead. */ + type MemoIterator = (prev: TResult, curr: T, indexOrKey: any, list: T[]) => TResult; + type MemoListIterator = (prev: TResult, curr: T, index: number, list: TList) => TResult; + type MemoObjectIterator = (prev: TResult, curr: T, key: string, list: TList) => TResult; + + type MemoVoidArrayIterator = (acc: TResult, curr: T, index: number, arr: T[]) => void; + type MemoVoidDictionaryIterator = (acc: TResult, curr: T, key: string, dict: Dictionary) => void; + + type ValueIteratee = ((value: T) => NotVoid) | string | [string, any] | PartialDeep; + type ValueKeyIteratee = ((value: T, key: string) => NotVoid) | string | [string, any] | PartialDeep; + type Comparator = (a: T, b: T) => boolean; + type Comparator2 = (a: T1, b: T2) => boolean; + + type PropertyName = string | number | symbol; + type PropertyPath = Many; + + /** Common interface between Arrays and jQuery objects */ + type List = ArrayLike; + + interface Dictionary { + [index: string]: T; + } + + interface NumericDictionary { + [index: number]: T; + } + + interface Cancelable { + cancel(): void; + flush(): void; + } + + type PartialDeep = { + [P in keyof T]?: PartialDeep; + }; + + // For backwards compatibility + type LoDashImplicitArrayWrapper = LoDashImplicitWrapper; + type LoDashImplicitNillableArrayWrapper = LoDashImplicitWrapper; + type LoDashImplicitObjectWrapper = LoDashImplicitWrapper; + type LoDashImplicitNillableObjectWrapper = LoDashImplicitWrapper; + type LoDashImplicitNumberArrayWrapper = LoDashImplicitWrapper; + type LoDashImplicitStringWrapper = LoDashImplicitWrapper; + type LoDashExplicitArrayWrapper = LoDashExplicitWrapper; + type LoDashExplicitNillableArrayWrapper = LoDashExplicitWrapper; + type LoDashExplicitObjectWrapper = LoDashExplicitWrapper; + type LoDashExplicitNillableObjectWrapper = LoDashExplicitWrapper; + type LoDashExplicitNumberArrayWrapper = LoDashExplicitWrapper; + type LoDashExplicitStringWrapper = LoDashExplicitWrapper; +} \ No newline at end of file diff --git a/types/lodash/date/now.d.ts b/types/lodash/date/now.d.ts new file mode 100644 index 0000000000..1213cc0ea1 --- /dev/null +++ b/types/lodash/date/now.d.ts @@ -0,0 +1,24 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @return The number of milliseconds. + */ + now(): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.now + */ + now(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.now + */ + now(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/after.d.ts b/types/lodash/function/after.d.ts new file mode 100644 index 0000000000..4585a1a87d --- /dev/null +++ b/types/lodash/function/after.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. + * + * @param n The number of calls before func is invoked. + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + after any>( + n: number, + func: TFunc + ): TFunc; + } + + interface LoDashImplicitWrapper { + /** + * @see _.after + **/ + after any>(func: TFunc): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.after + **/ + after any>(func: TFunc): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/ary.d.ts b/types/lodash/function/ary.d.ts new file mode 100644 index 0000000000..3e81a1b72c --- /dev/null +++ b/types/lodash/function/ary.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that accepts up to n arguments ignoring any additional arguments. + * + * @param func The function to cap arguments for. + * @param n The arity cap. + * @returns Returns the new function. + */ + ary( + func: (...args: any[]) => any, + n?: number + ): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.ary + */ + ary(n?: number): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.ary + */ + ary(n?: number): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/before.d.ts b/types/lodash/function/before.d.ts new file mode 100644 index 0000000000..3d2df831da --- /dev/null +++ b/types/lodash/function/before.d.ts @@ -0,0 +1,31 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that invokes func, with the this binding and arguments of the created function, while + * it’s called less than n times. Subsequent calls to the created function return the result of the last func + * invocation. + * + * @param n The number of calls at which func is no longer invoked. + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + before any>( + n: number, + func: TFunc + ): TFunc; + } + + interface LoDashImplicitWrapper { + /** + * @see _.before + **/ + before any>(func: TFunc): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.before + **/ + before any>(func: TFunc): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/bind.d.ts b/types/lodash/function/bind.d.ts new file mode 100644 index 0000000000..73311a37b7 --- /dev/null +++ b/types/lodash/function/bind.d.ts @@ -0,0 +1,49 @@ +declare namespace _ { + interface FunctionBind { + placeholder: any; + + ( + func: (...args: any[]) => any, + thisArg: any, + ...partials: any[] + ): (...args: any[]) => any; + } + + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind + * arguments to those provided to the bound function. + * + * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for + * partially applied arguments. + * + * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. + * + * @param func The function to bind. + * @param thisArg The this binding of func. + * @param partials The arguments to be partially applied. + * @return Returns the new bound function. + */ + bind: FunctionBind; + } + + interface LoDashImplicitWrapper { + /** + * @see _.bind + */ + bind( + thisArg: any, + ...partials: any[] + ): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.bind + */ + bind( + thisArg: any, + ...partials: any[] + ): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/bindKey.d.ts b/types/lodash/function/bindKey.d.ts new file mode 100644 index 0000000000..8cf23ae4a1 --- /dev/null +++ b/types/lodash/function/bindKey.d.ts @@ -0,0 +1,50 @@ +declare namespace _ { + interface FunctionBindKey { + placeholder: any; + + ( + object: object, + key: string, + ...partials: any[] + ): (...args: any[]) => any; + } + + interface LoDashStatic { + /** + * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments + * to those provided to the bound function. + * + * This method differs from _.bind by allowing bound functions to reference methods that may be redefined + * or don’t yet exist. See Peter Michaux’s article for more details. + * + * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder + * for partially applied arguments. + * + * @param object The object the method belongs to. + * @param key The key of the method. + * @param partials The arguments to be partially applied. + * @return Returns the new bound function. + */ + bindKey: FunctionBindKey; + } + + interface LoDashImplicitWrapper { + /** + * @see _.bindKey + */ + bindKey( + key: string, + ...partials: any[] + ): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.bindKey + */ + bindKey( + key: string, + ...partials: any[] + ): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/curry.d.ts b/types/lodash/function/curry.d.ts new file mode 100644 index 0000000000..5810d89a9b --- /dev/null +++ b/types/lodash/function/curry.d.ts @@ -0,0 +1,202 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (t1: T1) => R, arity?: number): + CurriedFunction1; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2) => R, arity?: number): + CurriedFunction2; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): + CurriedFunction3; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): + CurriedFunction4; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): + CurriedFunction5; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + } + + interface CurriedFunction1 { + (): CurriedFunction1; + (t1: T1): R; + } + + interface CurriedFunction2 { + (): CurriedFunction2; + (t1: T1): CurriedFunction1; + (t1: T1, t2: T2): R; + } + + interface CurriedFunction3 { + (): CurriedFunction3; + (t1: T1): CurriedFunction2; + (t1: T1, t2: T2): CurriedFunction1; + (t1: T1, t2: T2, t3: T3): R; + } + + interface CurriedFunction4 { + (): CurriedFunction4; + (t1: T1): CurriedFunction3; + (t1: T1, t2: T2): CurriedFunction2; + (t1: T1, t2: T2, t3: T3): CurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4): R; + } + + interface CurriedFunction5 { + (): CurriedFunction5; + (t1: T1): CurriedFunction4; + (t1: T1, t2: T2): CurriedFunction3; + (t1: T1, t2: T2, t3: T3): CurriedFunction2; + (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; + } + interface RightCurriedFunction1 { + (): RightCurriedFunction1; + (t1: T1): R; + } + interface RightCurriedFunction2 { + (): RightCurriedFunction2; + (t2: T2): RightCurriedFunction1; + (t1: T1, t2: T2): R; + } + interface RightCurriedFunction3 { + (): RightCurriedFunction3; + (t3: T3): RightCurriedFunction2; + (t2: T2, t3: T3): RightCurriedFunction1; + (t1: T1, t2: T2, t3: T3): R; + } + interface RightCurriedFunction4 { + (): RightCurriedFunction4; + (t4: T4): RightCurriedFunction3; + (t3: T3, t4: T4): RightCurriedFunction2; + (t2: T2, t3: T3, t4: T4): RightCurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4): R; + } + interface RightCurriedFunction5 { + (): RightCurriedFunction5; + (t5: T5): RightCurriedFunction4; + (t4: T4, t5: T5): RightCurriedFunction3; + (t3: T3, t4: T4, t5: T5): RightCurriedFunction2; + (t2: T2, t3: T3, t4: T4, t5: T5): RightCurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; + } + + interface LoDashImplicitWrapper { + /** + * @see _.curry + **/ + curry(this: LoDashImplicitWrapper<(t1: T1) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curry + **/ + curry(arity?: number): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.curry + **/ + curry(this: LoDashExplicitWrapper<(t1: T1) => R>): + LoDashExplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2) => R>): + LoDashExplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>): + LoDashExplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>): + LoDashExplicitWrapper>; + + /** + * @see _.curry + **/ + curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>): + LoDashExplicitWrapper>; + + /** + * @see _.curry + **/ + curry(arity?: number): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/curryRight.d.ts b/types/lodash/function/curryRight.d.ts new file mode 100644 index 0000000000..73249d8fe8 --- /dev/null +++ b/types/lodash/function/curryRight.d.ts @@ -0,0 +1,131 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1) => R, arity?: number): + RightCurriedFunction1; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2) => R, arity?: number): + RightCurriedFunction2; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): + RightCurriedFunction3; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): + RightCurriedFunction4; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): + RightCurriedFunction5; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.curryRight + **/ + curryRight(this: LoDashImplicitWrapper<(t1: T1) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): + LoDashImplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(arity?: number): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.curryRight + **/ + curryRight(this: LoDashExplicitWrapper<(t1: T1) => R>, arity?: number): + LoDashExplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): + LoDashExplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): + LoDashExplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): + LoDashExplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): + LoDashExplicitWrapper>; + + /** + * @see _.curryRight + **/ + curryRight(arity?: number): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/debounce.d.ts b/types/lodash/function/debounce.d.ts new file mode 100644 index 0000000000..ef3adff643 --- /dev/null +++ b/types/lodash/function/debounce.d.ts @@ -0,0 +1,66 @@ +declare namespace _ { + interface DebounceSettings { + /** + * Specify invoking on the leading edge of the timeout. + */ + leading?: boolean; + + /** + * The maximum time func is allowed to be delayed before it’s invoked. + */ + maxWait?: number; + + /** + * Specify invoking on the trailing edge of the timeout. + */ + trailing?: boolean; + } + + interface LoDashStatic { + /** + * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since + * the last time the debounced function was invoked. The debounced function comes with a cancel method to + * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to + * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent + * calls to the debounced function return the result of the last func invocation. + * + * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only + * if the the debounced function is invoked more than once during the wait timeout. + * + * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. + * + * @param func The function to debounce. + * @param wait The number of milliseconds to delay. + * @param options The options object. + * @param options.leading Specify invoking on the leading edge of the timeout. + * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. + * @param options.trailing Specify invoking on the trailing edge of the timeout. + * @return Returns the new debounced function. + */ + debounce any>( + func: T, + wait?: number, + options?: DebounceSettings + ): T & Cancelable; + } + + interface LoDashImplicitWrapper { + /** + * @see _.debounce + */ + debounce( + wait?: number, + options?: DebounceSettings + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.debounce + */ + debounce( + wait?: number, + options?: DebounceSettings + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/defer.d.ts b/types/lodash/function/defer.d.ts new file mode 100644 index 0000000000..15488207c9 --- /dev/null +++ b/types/lodash/function/defer.d.ts @@ -0,0 +1,30 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to + * func when it’s invoked. + * + * @param func The function to defer. + * @param args The arguments to invoke the function with. + * @return Returns the timer id. + */ + defer( + func: (...args: any[]) => any, + ...args: any[] + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.defer + */ + defer(...args: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.defer + */ + defer(...args: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/delay.d.ts b/types/lodash/function/delay.d.ts new file mode 100644 index 0000000000..4273689166 --- /dev/null +++ b/types/lodash/function/delay.d.ts @@ -0,0 +1,63 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. + * + * @param func The function to delay. + * @param wait The number of milliseconds to delay invocation. + * @param args The arguments to invoke the function with. + * @return Returns the timer id. + */ + delay( + func: (...args: any[]) => any, + wait: number, + ...args: any[] + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.delay + */ + delay( + wait: number, + ...args: any[] + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.delay + */ + delay( + wait: number, + ...args: any[] + ): LoDashExplicitWrapper; + } + + interface LoDashStatic { + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @category Function + * @param func The function to flip arguments for. + * @returns Returns the new function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + flip any>(func: T): T; + } + + interface LoDashWrapper { + /** + * @see _.flip + */ + flip(): this; + } +} \ No newline at end of file diff --git a/types/lodash/function/flip.d.ts b/types/lodash/function/flip.d.ts new file mode 100644 index 0000000000..428dcf774d --- /dev/null +++ b/types/lodash/function/flip.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @category Function + * @param func The function to flip arguments for. + * @returns Returns the new function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + flip any>(func: T): T; + } + + interface LoDashWrapper { + /** + * @see _.flip + */ + flip(): this; + } +} \ No newline at end of file diff --git a/types/lodash/function/memoize.d.ts b/types/lodash/function/memoize.d.ts new file mode 100644 index 0000000000..88257bd8ce --- /dev/null +++ b/types/lodash/function/memoize.d.ts @@ -0,0 +1,36 @@ +declare namespace _ { + interface MemoizedFunction { + cache: MapCache; + } + + interface LoDashStatic { + /** + * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for + * storing the result based on the arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with + * the this binding of the memoized function. + * + * @param func The function to have its output memoized. + * @param resolver The function to resolve the cache key. + * @return Returns the new memoizing function. + */ + memoize: { + any>(func: T, resolver?: (...args: any[]) => any): T & MemoizedFunction; + Cache: MapCacheConstructor; + }; + } + + interface LoDashImplicitWrapper { + /** + * @see _.memoize + */ + memoize(resolver?: (...args: any[]) => any): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.memoize + */ + memoize(resolver?: (...args: any[]) => any): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/negate.d.ts b/types/lodash/function/negate.d.ts new file mode 100644 index 0000000000..b42e395cf6 --- /dev/null +++ b/types/lodash/function/negate.d.ts @@ -0,0 +1,19 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that negates the result of the predicate func. The func predicate is invoked with + * the this binding and arguments of the created function. + * + * @param predicate The predicate to negate. + * @return Returns the new function. + */ + negate any>(predicate: T): T; + } + + interface LoDashWrapper { + /** + * @see _.negate + */ + negate(): this; + } +} \ No newline at end of file diff --git a/types/lodash/function/once.d.ts b/types/lodash/function/once.d.ts new file mode 100644 index 0000000000..a49423171f --- /dev/null +++ b/types/lodash/function/once.d.ts @@ -0,0 +1,19 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value + * of the first call. The func is invoked with the this binding and arguments of the created function. + * + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + once any>(func: T): T; + } + + interface LoDashWrapper { + /** + * @see _.once + */ + once(): this; + } +} \ No newline at end of file diff --git a/types/lodash/function/overArgs.d.ts b/types/lodash/function/overArgs.d.ts new file mode 100644 index 0000000000..6cc5cf6c41 --- /dev/null +++ b/types/lodash/function/overArgs.d.ts @@ -0,0 +1,30 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that runs each argument through a corresponding transform function. + * + * @param func The function to wrap. + * @param transforms The functions to transform arguments, specified as individual functions or arrays + * of functions. + * @return Returns the new function. + */ + overArgs( + func: (...args: any[]) => any, + ...transforms: Array any>> + ): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.overArgs + */ + overArgs(...transforms: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.overArgs + */ + overArgs(...transforms: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/partial.d.ts b/types/lodash/function/partial.d.ts new file mode 100644 index 0000000000..1d15995cea --- /dev/null +++ b/types/lodash/function/partial.d.ts @@ -0,0 +1,158 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that, when called, invokes func with any additional partial arguments + * prepended to those provided to the new function. This method is similar to _.bind except + * it does not alter the this binding. + * @param func The function to partially apply arguments to. + * @param args Arguments to be partially applied. + * @return The new partially applied function. + **/ + partial: Partial; + } + + interface LoDashImplicitWrapper { + /** + * @see _.partial + */ + partial: ImplicitPartial; + } + + interface LoDashExplicitWrapper { + /** + * @see _.partial + */ + partial: ExplicitPartial; + } + + type PH = LoDashStatic; + + type Function0 = () => R; + type Function1 = (t1: T1) => R; + type Function2 = (t1: T1, t2: T2) => R; + type Function3 = (t1: T1, t2: T2, t3: T3) => R; + type Function4 = (t1: T1, t2: T2, t3: T3, t4: T4) => R; + + interface Partial { + // arity 0 + (func: Function0): Function0; + // arity 1 + (func: Function1): Function1; + (func: Function1, arg1: T1): Function0; + // arity 2 + (func: Function2): Function2; + (func: Function2, arg1: T1): Function1< T2, R>; + (func: Function2, plc1: PH, arg2: T2): Function1; + (func: Function2, arg1: T1, arg2: T2): Function0< R>; + // arity 3 + (func: Function3): Function3; + (func: Function3, arg1: T1): Function2< T2, T3, R>; + (func: Function3, plc1: PH, arg2: T2): Function2; + (func: Function3, arg1: T1, arg2: T2): Function1< T3, R>; + (func: Function3, plc1: PH, plc2: PH, arg3: T3): Function2; + (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; + (func: Function3, plc1: PH, arg2: T2, arg3: T3): Function1; + (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; + // arity 4 + (func: Function4): Function4; + (func: Function4, arg1: T1): Function3< T2, T3, T4, R>; + (func: Function4, plc1: PH, arg2: T2): Function3; + (func: Function4, arg1: T1, arg2: T2): Function2< T3, T4, R>; + (func: Function4, plc1: PH, plc2: PH, arg3: T3): Function3; + (func: Function4, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>; + (func: Function4, plc1: PH, arg2: T2, arg3: T3): Function2; + (func: Function4, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>; + (func: Function4, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3; + (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; + (func: Function4, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2; + (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; + (func: Function4, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2; + (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; + (func: Function4, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; + // catch-all + (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; + } + + interface ImplicitPartial { + // arity 0 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + // arity 1 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; + // arity 2 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; + // arity 3 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + // arity 4 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + // catch-all + (...args: any[]): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface ExplicitPartial { + // arity 0 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + // arity 1 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; + // arity 2 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; + // arity 3 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + // arity 4 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + // catch-all + (...args: any[]): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/partialRight.d.ts b/types/lodash/function/partialRight.d.ts new file mode 100644 index 0000000000..e0280262e8 --- /dev/null +++ b/types/lodash/function/partialRight.d.ts @@ -0,0 +1,149 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.partial except that partial arguments are appended to those provided + * to the new function. + * @param func The function to partially apply arguments to. + * @param args Arguments to be partially applied. + * @return The new partially applied function. + **/ + partialRight: PartialRight; + } + + interface LoDashImplicitWrapper { + /** + * @see _.partialRight + */ + partialRight: ImplicitPartialRight; + } + + interface LoDashExplicitWrapper { + /** + * @see _.partialRight + */ + partialRight: ExplicitPartialRight; + } + + interface PartialRight { + // arity 0 + (func: Function0): Function0; + // arity 1 + (func: Function1): Function1; + (func: Function1, arg1: T1): Function0; + // arity 2 + (func: Function2): Function2; + (func: Function2, arg1: T1, plc2: PH): Function1< T2, R>; + (func: Function2, arg2: T2): Function1; + (func: Function2, arg1: T1, arg2: T2): Function0< R>; + // arity 3 + (func: Function3): Function3; + (func: Function3, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>; + (func: Function3, arg2: T2, plc3: PH): Function2; + (func: Function3, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>; + (func: Function3, arg3: T3): Function2; + (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; + (func: Function3, arg2: T2, arg3: T3): Function1; + (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; + // arity 4 + (func: Function4): Function4; + (func: Function4, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>; + (func: Function4, arg2: T2, plc3: PH, plc4: PH): Function3; + (func: Function4, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>; + (func: Function4, arg3: T3, plc4: PH): Function3; + (func: Function4, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>; + (func: Function4, arg2: T2, arg3: T3, plc4: PH): Function2; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>; + (func: Function4, arg4: T4): Function3; + (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; + (func: Function4, arg2: T2, plc3: PH, arg4: T4): Function2; + (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; + (func: Function4, arg3: T3, arg4: T4): Function2; + (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; + (func: Function4, arg2: T2, arg3: T3, arg4: T4): Function1; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; + // catch-all + (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; + } + + interface ImplicitPartialRight { + // arity 0 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + // arity 1 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; + // arity 2 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; + // arity 3 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; + // arity 4 + (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg3: T3, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; + // catch-all + (...args: any[]): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface ExplicitPartialRight { + // arity 0 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + // arity 1 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; + // arity 2 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; + // arity 3 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; + // arity 4 + (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg3: T3, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; + // catch-all + (...args: any[]): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/rearg.d.ts b/types/lodash/function/rearg.d.ts new file mode 100644 index 0000000000..bcabbbb62b --- /dev/null +++ b/types/lodash/function/rearg.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that invokes func with arguments arranged according to the specified indexes where the + * argument value at the first index is provided as the first argument, the argument value at the second index + * is provided as the second argument, and so on. + * @param func The function to rearrange arguments for. + * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. + * @return Returns the new function. + */ + rearg(func: (...args: any[]) => any, ...indexes: Array>): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.rearg + */ + rearg(...indexes: Array>): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.rearg + */ + rearg(...indexes: Array>): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/rest.d.ts b/types/lodash/function/rest.d.ts new file mode 100644 index 0000000000..738f206967 --- /dev/null +++ b/types/lodash/function/rest.d.ts @@ -0,0 +1,32 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of the created function and arguments from start + * and beyond provided as an array. + * + * Note: This method is based on the rest parameter. + * + * @param func The function to apply a rest parameter to. + * @param start The start position of the rest parameter. + * @return Returns the new function. + */ + rest( + func: (...args: any[]) => any, + start?: number + ): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.rest + */ + rest(start?: number): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.rest + */ + rest(start?: number): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/function/spread.d.ts b/types/lodash/function/spread.d.ts new file mode 100644 index 0000000000..36aab5fe33 --- /dev/null +++ b/types/lodash/function/spread.d.ts @@ -0,0 +1,43 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of the created function and an array of arguments + * much like Function#apply. + * + * Note: This method is based on the spread operator. + * + * @param func The function to spread arguments over. + * @return Returns the new function. + */ + spread(func: (...args: any[]) => TResult): (...args: any[]) => TResult; + + /** + * @see _.spread + */ + spread(func: (...args: any[]) => TResult, start: number): (...args: any[]) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.spread + */ + spread(this: LoDashImplicitWrapper<(...args: any[]) => TResult>): LoDashImplicitWrapper<(...args: any[]) => TResult>; + + /** + * @see _.spread + */ + spread(this: LoDashImplicitWrapper<(...args: any[]) => TResult>, start: number): LoDashImplicitWrapper<(...args: any[]) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.spread + */ + spread(this: LoDashExplicitWrapper<(...args: any[]) => TResult>): LoDashExplicitWrapper<(...args: any[]) => TResult>; + + /** + * @see _.spread + */ + spread(this: LoDashExplicitWrapper<(...args: any[]) => TResult>, start: number): LoDashExplicitWrapper<(...args: any[]) => TResult>; + } +} \ No newline at end of file diff --git a/types/lodash/function/throttle.d.ts b/types/lodash/function/throttle.d.ts new file mode 100644 index 0000000000..37a1c60bec --- /dev/null +++ b/types/lodash/function/throttle.d.ts @@ -0,0 +1,57 @@ +declare namespace _ { + interface ThrottleSettings { + /** + * If you'd like to disable the leading-edge call, pass this as false. + */ + leading?: boolean; + + /** + * If you'd like to disable the execution on the trailing-edge, pass false. + */ + trailing?: boolean; + } + + interface LoDashStatic { + /** + * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled + * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke + * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge + * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. + * + * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if + * the the throttled function is invoked more than once during the wait timeout. + * + * @param func The function to throttle. + * @param wait The number of milliseconds to throttle invocations to. + * @param options The options object. + * @param options.leading Specify invoking on the leading edge of the timeout. + * @param options.trailing Specify invoking on the trailing edge of the timeout. + * @return Returns the new throttled function. + */ + throttle any>( + func: T, + wait?: number, + options?: ThrottleSettings + ): T & Cancelable; + } + + interface LoDashImplicitWrapper { + /** + * @see _.throttle + */ + throttle( + wait?: number, + options?: ThrottleSettings + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.throttle + */ + throttle( + wait?: number, + options?: ThrottleSettings + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/function/unary.d.ts b/types/lodash/function/unary.d.ts new file mode 100644 index 0000000000..810f359a6c --- /dev/null +++ b/types/lodash/function/unary.d.ts @@ -0,0 +1,31 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @category Function + * @param func The function to cap arguments for. + * @returns Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + unary(func: (arg1: T, ...args: any[]) => TResult): (arg1: T) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unary + */ + unary(this: LoDashImplicitWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashImplicitWrapper<(arg1: T) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unary + */ + unary(this: LoDashExplicitWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashExplicitWrapper<(arg1: T) => TResult>; + } +} \ No newline at end of file diff --git a/types/lodash/function/wrap.d.ts b/types/lodash/function/wrap.d.ts new file mode 100644 index 0000000000..f00a27fc74 --- /dev/null +++ b/types/lodash/function/wrap.d.ts @@ -0,0 +1,60 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that provides value to the wrapper function as its first argument. Any additional + * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is + * invoked with the this binding of the created function. + * + * @param value The value to wrap. + * @param wrapper The wrapper function. + * @return Returns the new function. + */ + wrap( + value: T, + wrapper: (value: T, ...args: TArgs[]) => TResult + ): (...args: TArgs[]) => TResult; + + /** + * @see _.wrap + */ + wrap( + value: T, + wrapper: (value: T, ...args: any[]) => TResult + ): (...args: any[]) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.wrap + */ + wrap( + wrapper: (value: TValue, ...args: TArgs[]) => TResult + ): LoDashImplicitWrapper<(...args: TArgs[]) => TResult>; + + /** + * @see _.wrap + */ + wrap( + wrapper: (value: TValue, ...args: any[]) => TResult + ): LoDashImplicitWrapper<(...args: any[]) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.wrap + */ + /** + * @see _.wrap + */ + wrap( + wrapper: (value: TValue, ...args: TArgs[]) => TResult + ): LoDashExplicitWrapper<(...args: TArgs[]) => TResult>; + + /** + * @see _.wrap + */ + wrap( + wrapper: (value: TValue, ...args: any[]) => TResult + ): LoDashExplicitWrapper<(...args: any[]) => TResult>; + } +} \ No newline at end of file diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index cffc5c78fa..519685c1a3 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -8,17381 +8,367 @@ // Junyoung Clare Jang , // e-cloud , // Georgii Dolzhykov , -// Jack Moore +// Jack Moore , +// Dominique Rau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -/** -### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog) +// common +/// -#### TODO: -removed: -- [x] Removed _.support -- [x] Removed _.findWhere in favor of _.find with iteratee shorthand -- [x] Removed _.where in favor of _.filter with iteratee shorthand -- [x] Removed _.pluck in favor of _.map with iteratee shorthand +// array +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -renamed: -- [x] Renamed _.first to _.head -- [x] Renamed _.indexBy to _.keyBy -- [x] Renamed _.invoke to _.invokeMap -- [x] Renamed _.overArgs to _.overArgs -- [x] Renamed _.padLeft & _.padRight to _.padStart & _.padEnd -- [x] Renamed _.pairs to _.toPairs -- [x] Renamed _.rest to _.tail -- [x] Renamed _.restParam to _.rest -- [x] Renamed _.sortByOrder to _.orderBy -- [x] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd -- [x] Renamed _.trunc to _.truncate +// collection +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -split: -- [x] Split _.indexOf & _.lastIndexOf into _.sortedIndexOf & _.sortedLastIndexOf -- [x] Split _.max & _.min into _.maxBy & _.minBy -- [x] Split _.omit & _.pick into _.omitBy & _.pickBy -- [x] Split _.sample into _.sampleSize -- [x] Split _.sortedIndex into _.sortedIndexBy -- [x] Split _.sortedLastIndex into _.sortedLastIndexBy -- [x] Split _.uniq into _.sortedUniq, _.sortedUniqBy, & _.uniqBy +// date +/// -changes: -- [x] Absorbed _.sortByAll into _.sortBy -- [x] Changed the category of _.at to “Object” -- [x] Changed the category of _.bindAll to “Utility” -- [x] Made _.capitalize uppercase the first character & lowercase the rest -- [x] Made _.functions return only own method names +// function +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 23 array methods: -- [x] _.concat -- [x] _.differenceBy -- [x] _.differenceWith -- [x] _.flatMap -- [x] _.fromPairs -- [x] _.intersectionBy -- [x] _.intersectionWith -- [x] _.join -- [x] _.pullAll -- [x] _.pullAllBy -- [x] _.reverse -- [x] _.sortedIndexBy -- [x] _.sortedIndexOf -- [x] _.sortedLastIndexBy -- [x] _.sortedLastIndexOf -- [x] _.sortedUniq -- [x] _.sortedUniqBy -- [x] _.unionBy -- [x] _.unionWith -- [x] _.uniqBy -- [x] _.uniqWith -- [x] _.xorBy -- [x] _.xorWith +// lang +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 20 lang methods: -- [x] _.cloneDeepWith -- [x] _.cloneWith -- [x] _.eq -- [x] _.isArrayLike -- [x] _.isArrayLikeObject -- [x] _.isEqualWith -- [x] _.isInteger -- [x] _.isLength -- [x] _.isMatchWith -- [x] _.isNil -- [x] _.isObjectLike -- [x] _.isSafeInteger -- [x] _.isSymbol -- [x] _.toInteger -- [x] _.toLength -- [x] _.toNumber -- [x] _.toSafeInteger -- [x] _.toString -- [X] _.conforms -- [X] _.conformsTo +// math +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 13 object methods: -- [x] _.assignIn -- [x] _.assignInWith -- [x] _.assignWith -- [x] _.functionsIn -- [x] _.hasIn -- [x] _.mergeWith -- [x] _.omitBy -- [x] _.pickBy +// number +/// +/// +/// -added 8 string methods: -- [x] _.lowerCase -- [x] _.lowerFirst -- [x] _.upperCase -- [x] _.upperFirst -- [x] _.toLower -- [x] _.toUpper +// object +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 8 utility methods: -- [x] _.toPath +// _ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 4 math methods: -- [x] _.maxBy -- [x] _.mean -- [x] _.minBy -- [x] _.sumBy +// string +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 2 function methods: -- [x] _.flip -- [x] _.unary +// util +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// -added 2 number methods: -- [x] _.clamp -- [x] _.subtract +// properties +/// +/// +/// +/// +/// +/// +/// -added collection method: -- [x] _.sampleSize - -Added 3 aliases - -- [x] _.first as an alias of _.head - -Removed 17 aliases -- [x] Removed aliase _.all -- [x] Removed aliase _.any -- [x] Removed aliase _.backflow -- [x] Removed aliase _.callback -- [x] Removed aliase _.collect -- [x] Removed aliase _.compose -- [x] Removed aliase _.contains -- [x] Removed aliase _.detect -- [x] Removed aliase _.foldl -- [x] Removed aliase _.foldr -- [x] Removed aliase _.include -- [x] Removed aliase _.inject -- [x] Removed aliase _.methods -- [x] Removed aliase _.object -- [x] Removed aliase _.run -- [x] Removed aliase _.select -- [x] Removed aliase _.unique - -Other changes -- [x] Added support for array buffers to _.isEqual -- [x] Added support for converting iterators to _.toArray -- [x] Added support for deep paths to _.zipObject -- [x] Changed UMD to export to window or self when available regardless of other exports -- [x] Ensured debounce cancel clears args & thisArg references -- [x] Ensured _.add, _.subtract, & _.sum don’t skip NaN values -- [x] Ensured _.clone treats generators like functions -- [x] Ensured _.clone produces clones with the source’s [[Prototype]] -- [x] Ensured _.defaults assigns properties that shadow Object.prototype -- [x] Ensured _.defaultsDeep doesn’t merge a string into an array -- [x] Ensured _.defaultsDeep & _.merge don’t modify sources -- [x] Ensured _.defaultsDeep works with circular references -- [x] Ensured _.keys skips “length” on strict mode arguments objects in Safari 9 -- [x] Ensured _.merge doesn’t convert strings to arrays -- [x] Ensured _.merge merges plain-objects onto non plain-objects -- [x] Ensured _#plant resets iterator data of cloned sequences -- [x] Ensured _.random swaps min & max if min is greater than max -- [x] Ensured _.range preserves the sign of start of -0 -- [x] Ensured _.reduce & _.reduceRight use getIteratee in their array branch -- [x] Fixed rounding issue with the precision param of _.floor -- [x] Added flush method to debounced & throttled functions - -** LATER ** -Misc: -- [ ] Made _.forEach, _.forIn, _.forOwn, & _.times implicitly end a chain sequence -- [ ] Removed thisArg params from most methods -- [ ] Made “By” methods provide a single param to iteratees -- [ ] Made _.words chainable by default -- [ ] Removed isDeep params from _.clone & _.flatten -- [ ] Removed _.bindAll support for binding all methods when no names are provided -- [ ] Removed func-first param signature from _.before & _.after -- [ ] _.extend as an alias of _.assignIn -- [ ] _.extendWith as an alias of _.assignInWith -- [ ] Added clear method to _.memoize.Cache -- [ ] Added support for ES6 maps, sets, & symbols to _.clone, _.isEqual, & _.toArray -- [x] Enabled _.flow & _.flowRight to accept an array of functions -- [ ] Ensured “Collection” methods treat functions as objects -- [ ] Ensured _.assign, _.defaults, & _.merge coerce object values to objects -- [ ] Ensured _.bindKey bound functions call object[key] when called with the new operator -- [ ] Ensured _.isFunction returns true for generator functions -- [ ] Ensured _.merge assigns typed arrays directly -- [ ] Made _(...) an iterator & iterable -- [ ] Made _.drop, _.take, & right forms coerce n of undefined to 0 - -Methods: -- [ ] _.concat -- [ ] _.differenceBy -- [ ] _.differenceWith -- [ ] _.flatMap -- [ ] _.fromPairs -- [ ] _.intersectionBy -- [ ] _.intersectionWith -- [ ] _.join -- [ ] _.pullAll -- [ ] _.pullAllBy -- [ ] _.reverse -- [ ] _.sortedLastIndexOf -- [ ] _.unionBy -- [ ] _.unionWith -- [ ] _.uniqWith -- [ ] _.xorBy -- [ ] _.xorWith -- [ ] _.toString - -- [ ] _.invoke -- [ ] _.setWith -- [ ] _.toPairs -- [ ] _.toPairsIn -- [ ] _.unset - -- [ ] _.replace -- [ ] _.split - -- [ ] _.cond -- [ ] _.nthArg -- [ ] _.over -- [ ] _.overEvery -- [ ] _.overSome -- [ ] _.rangeRight - -- [ ] _.next -*/ +// methods +/// export = _; export as namespace _; -declare let _: _.LoDashStatic; - -type PartialObject = Partial; - -declare namespace _ { - type Many = T | T[]; - - interface LoDashStatic { - /** - * Creates a lodash object which wraps value to enable implicit method chain sequences. - * Methods that operate on and return arrays, collections, and functions can be chained together. - * Methods that retrieve a single value or may return a primitive value will automatically end the - * chain sequence and return the unwrapped value. Otherwise, the value must be unwrapped with value(). - * - * Explicit chain sequences, which must be unwrapped with value(), may be enabled using _.chain. - * - * The execution of chained methods is lazy, that is, it's deferred until value() is - * implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut fusion - * is an optimization to merge iteratee calls; this avoids the creation of intermediate - * arrays and can greatly reduce the number of iteratee executions. Sections of a chain - * sequence qualify for shortcut fusion if the section is applied to an array and iteratees - * accept only one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the value() method is directly or - * indirectly included in the build. - * - * In addition to lodash methods, wrappers have Array and String methods. - * The wrapper Array methods are: - * concat, join, pop, push, shift, sort, splice, and unshift. - * The wrapper String methods are: - * replace and split. - * - * The wrapper methods that support shortcut fusion are: - * at, compact, drop, dropRight, dropWhile, filter, find, findLast, head, initial, last, - * map, reject, reverse, slice, tail, take, takeRight, takeRightWhile, takeWhile, and toArray - * - * The chainable wrapper methods are: - * after, ary, assign, assignIn, assignInWith, assignWith, at, before, bind, bindAll, bindKey, - * castArray, chain, chunk, commit, compact, concat, conforms, constant, countBy, create, - * curry, debounce, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, - * drop, dropRight, dropRightWhile, dropWhile, extend, extendWith, fill, filter, flatMap, - * flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, flow, flowRight, - * fromPairs, functions, functionsIn, groupBy, initial, intersection, intersectionBy, intersectionWith, - * invert, invertBy, invokeMap, iteratee, keyBy, keys, keysIn, map, mapKeys, mapValues, - * matches, matchesProperty, memoize, merge, mergeWith, method, methodOf, mixin, negate, - * nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, partial, partialRight, - * partition, pick, pickBy, plant, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, - * push, range, rangeRight, rearg, reject, remove, rest, reverse, sampleSize, set, setWith, - * shuffle, slice, sort, sortBy, sortedUniq, sortedUniqBy, splice, spread, tail, take, - * takeRight, takeRightWhile, takeWhile, tap, throttle, thru, toArray, toPairs, toPairsIn, - * toPath, toPlainObject, transform, unary, union, unionBy, unionWith, uniq, uniqBy, uniqWith, - * unset, unshift, unzip, unzipWith, update, updateWith, values, valuesIn, without, wrap, - * xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, and zipWith. - * - * The wrapper methods that are not chainable by default are: - * add, attempt, camelCase, capitalize, ceil, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, - * conformsTo, deburr, defaultTo, divide, each, eachRight, endsWith, eq, escape, escapeRegExp, - * every, find, findIndex, findKey, findLast, findLastIndex, findLastKey, first, floor, forEach, - * forEachRight, forIn, forInRight, forOwn, forOwnRight, get, gt, gte, has, hasIn, head, - * identity, includes, indexOf, inRange, invoke, isArguments, isArray, isArrayBuffer, - * isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, - * isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, - * isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, - * isSafeInteger, isSet, isString, isUndefined, isTypedArray, isWeakMap, isWeakSet, join, - * kebabCase, last, lastIndexOf, lowerCase, lowerFirst, lt, lte, max, maxBy, mean, meanBy, - * min, minBy, multiply, noConflict, noop, now, nth, pad, padEnd, padStart, parseInt, pop, - * random, reduce, reduceRight, repeat, result, round, runInContext, sample, shift, size, - * snakeCase, some, sortedIndex, sortedIndexBy, sortedLastIndex, sortedLastIndexBy, startCase, - * startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, - * template, times, toFinite, toInteger, toJSON, toLength, toLower, toNumber, toSafeInteger, - * toString, toUpper, trim, trimEnd, trimStart, truncate, unescape, uniqueId, upperCase, - * upperFirst, value, and words. - **/ - (value: T): LoDashImplicitWrapper; - - /** - * The semantic version number. - **/ - VERSION: string; - - /** - * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby - * (ERB). Change the following template settings to use alternative delimiters. - **/ - templateSettings: TemplateSettings; - } - - /** - * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby - * (ERB). Change the following template settings to use alternative delimiters. - **/ - interface TemplateSettings { - /** - * The "escape" delimiter. - **/ - escape?: RegExp; - - /** - * The "evaluate" delimiter. - **/ - evaluate?: RegExp; - - /** - * An object to import into the template as local variables. - **/ - imports?: Dictionary; - - /** - * The "interpolate" delimiter. - **/ - interpolate?: RegExp; - - /** - * Used to reference the data object in the template text. - **/ - variable?: string; - } - - /** - * Creates a cache object to store key/value pairs. - */ - interface MapCache { - /** - * Removes `key` and its value from the cache. - * @param key The key of the value to remove. - * @return Returns `true` if the entry was removed successfully, else `false`. - */ - delete(key: string): boolean; - - /** - * Gets the cached value for `key`. - * @param key The key of the value to get. - * @return Returns the cached value. - */ - get(key: string): any; - - /** - * Checks if a cached value for `key` exists. - * @param key The key of the entry to check. - * @return Returns `true` if an entry for `key` exists, else `false`. - */ - has(key: string): boolean; - - /** - * Sets `value` to `key` of the cache. - * @param key The key of the value to cache. - * @param value The value to cache. - * @return Returns the cache object. - */ - set(key: string, value: any): Dictionary; - - /** - * Removes all key-value entries from the map. - */ - clear(): void; - } - interface MapCacheConstructor { - new (): MapCache; - } - - interface LoDashImplicitWrapper extends LoDashWrapper { - pop(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - push(this: LoDashImplicitWrapper | null | undefined>, ...items: T[]): this; - shift(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - sort(this: LoDashImplicitWrapper | null | undefined>, compareFn?: (a: T, b: T) => number): this; - splice(this: LoDashImplicitWrapper | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; - unshift(this: LoDashImplicitWrapper | null | undefined>, ...items: T[]): this; - } - - interface LoDashExplicitWrapper extends LoDashWrapper { - pop(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - push(this: LoDashExplicitWrapper | null | undefined>, ...items: T[]): this; - shift(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - sort(this: LoDashExplicitWrapper | null | undefined>, compareFn?: (a: T, b: T) => number): this; - splice(this: LoDashExplicitWrapper | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; - unshift(this: LoDashExplicitWrapper | null | undefined>, ...items: T[]): this; - } - - /********* - * Array * - *********/ - - //_.chunk - interface LoDashStatic { - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - chunk( - array: List | null | undefined, - size?: number - ): T[][]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.chunk - */ - chunk( - this: LoDashImplicitWrapper | null | undefined>, - size?: number, - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.chunk - */ - chunk( - this: LoDashExplicitWrapper | null | undefined>, - size?: number, - ): LoDashExplicitWrapper; - } - - //_.compact - interface LoDashStatic { - /** - * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are - * falsey. - * - * @param array The array to compact. - * @return Returns the new array of filtered values. - */ - compact(array: List | null | undefined): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.compact - */ - compact(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.compact - */ - compact(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.concat - interface LoDashStatic { - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @category Array - * @param array The array to concatenate. - * @param [values] The values to concatenate. - * @returns Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - concat(array: Many, ...values: Array>): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.compact - */ - concat(this: LoDashImplicitWrapper>, ...values: Array>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.compact - */ - concat(this: LoDashExplicitWrapper>, ...values: Array>): LoDashExplicitWrapper; - } - - //_.difference - interface LoDashStatic { - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - difference( - array: List | null | undefined, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.difference - */ - difference( - this: LoDashImplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.difference - */ - difference( - this: LoDashExplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashExplicitWrapper; - } - - //_.differenceBy - interface LoDashStatic { - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - differenceBy( - array: List | null | undefined, - values: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - values1: List, - values2: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - values1: List, - values2: List, - values3: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - values1: List, - values2: List, - values3: List, - values4: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - ...values: Array | ValueIteratee> - ): T1[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List | null | undefined, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - ...values: Array | ValueIteratee> - ): LoDashImplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashImplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - values3: List, - values4: List, - values5: List, - ...values: Array | ValueIteratee> - ): LoDashExplicitWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - this: LoDashExplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashExplicitWrapper; - } - - //_.differenceWith - interface LoDashStatic { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - differenceWith( - array: List | null | undefined, - values: List, - comparator: Comparator2 - ): T1[]; - - /** - * @see _.differenceWith - */ - differenceWith( - array: List | null | undefined, - values1: List, - values2: List, - comparator: Comparator2 - ): T1[]; - - /** - * @see _.differenceWith - */ - differenceWith( - array: List | null | undefined, - values1: List, - values2: List, - ...values: Array | Comparator2> - ): T1[]; - - /** - * @see _.differenceWith - */ - differenceWith( - array: List | null | undefined, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashImplicitWrapper | null | undefined>, - values: List, - comparator: Comparator2 - ): LoDashImplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - comparator: Comparator2 - ): LoDashImplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | Comparator2> - ): LoDashImplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashImplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashExplicitWrapper | null | undefined>, - values: List, - comparator: Comparator2 - ): LoDashExplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - comparator: Comparator2 - ): LoDashExplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | Comparator2> - ): LoDashExplicitWrapper; - - /** - * @see _.differenceWith - */ - differenceWith( - this: LoDashExplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashExplicitWrapper; - } - - //_.drop - interface LoDashStatic { - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - drop(array: List | null | undefined, n?: number): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.drop - */ - drop(this: LoDashImplicitWrapper | null | undefined>, n?: number): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.drop - */ - drop(this: LoDashExplicitWrapper | null | undefined>, n?: number): LoDashExplicitWrapper; - } - - //_.dropRight - interface LoDashStatic { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - dropRight( - array: List | null | undefined, - n?: number - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.dropRight - */ - dropRight(this: LoDashImplicitWrapper | null | undefined>, n?: number): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.dropRight - */ - dropRight(this: LoDashExplicitWrapper | null | undefined>, n?: number): LoDashExplicitWrapper; - } - - //_.dropRightWhile - interface LoDashStatic { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - dropRightWhile( - array: List | null | undefined, - predicate?: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.dropWhile - interface LoDashStatic { - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - dropWhile( - array: List | null | undefined, - predicate?: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.fill - interface LoDashStatic { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - fill( - array: any[] | null | undefined, - value: T - ): T[]; - - /** - * @see _.fill - */ - fill( - array: List | null | undefined, - value: T - ): List; - - /** - * @see _.fill - */ - fill( - array: U[] | null | undefined, - value: T, - start?: number, - end?: number - ): Array; - - /** - * @see _.fill - */ - fill( - array: List | null | undefined, - value: T, - start?: number, - end?: number - ): List; - } - - interface LoDashImplicitWrapper { - /** - * @see _.fill - */ - fill( - this: LoDashImplicitWrapper, - value: T - ): LoDashImplicitWrapper; - - /** - * @see _.fill - */ - fill( - this: LoDashImplicitWrapper | null | undefined>, - value: T - ): LoDashImplicitWrapper>; - - /** - * @see _.fill - */ - fill( - this: LoDashImplicitWrapper, - value: T, - start?: number, - end?: number - ): LoDashImplicitWrapper>; - - /** - * @see _.fill - */ - fill( - this: LoDashImplicitWrapper | null | undefined>, - value: T, - start?: number, - end?: number - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.fill - */ - fill( - this: LoDashExplicitWrapper, - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.fill - */ - fill( - this: LoDashExplicitWrapper | null | undefined>, - value: T - ): LoDashExplicitWrapper>; - - /** - * @see _.fill - */ - fill( - this: LoDashExplicitWrapper, - value: T, - start?: number, - end?: number - ): LoDashExplicitWrapper>; - - /** - * @see _.fill - */ - fill( - this: LoDashExplicitWrapper | null | undefined>, - value: T, - start?: number, - end?: number - ): LoDashExplicitWrapper>; - } - - //_.findIndex - interface LoDashStatic { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - findIndex( - array: List | null | undefined, - predicate?: ListIterateeCustom, - fromIndex?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.findIndex - */ - findIndex( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.findIndex - */ - findIndex( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.findLastIndex - interface LoDashStatic { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - findLastIndex( - array: List | null | undefined, - predicate?: ListIterateeCustom, - fromIndex?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.first - interface LoDashStatic { - first: typeof _.head; // tslint:disable-line:no-unnecessary-qualifier - } - - interface LoDashImplicitWrapper { - /** - * @see _.head - */ - first(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.head - */ - first(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - interface RecursiveArray extends Array> {} - interface ListOfRecursiveArraysOrValues extends List> {} - - //_.flatten - interface LoDashStatic { - /** - * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only - * flattened a single level. - * - * @param array The array to flatten. - * @param isDeep Specify a deep flatten. - * @return Returns the new flattened array. - */ - flatten(array: ListOfRecursiveArraysOrValues | null | undefined, isDeep: boolean): T[]; - - /** - * @see _.flatten - */ - flatten(array: List> | null | undefined): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatten - */ - flatten(this: LoDashImplicitWrapper | null | undefined>, isDeep: boolean): LoDashImplicitWrapper; - - /** - * @see _.flatten - */ - flatten(this: LoDashImplicitWrapper> | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatten - */ - flatten(this: LoDashExplicitWrapper | null | undefined>, isDeep: boolean): LoDashExplicitWrapper; - - /** - * @see _.flatten - */ - flatten(this: LoDashExplicitWrapper> | null | undefined>): LoDashExplicitWrapper; - } - - //_.flattenDeep - interface LoDashStatic { - /** - * Recursively flattens a nested array. - * - * @param array The array to recursively flatten. - * @return Returns the new flattened array. - */ - flattenDeep(array: ListOfRecursiveArraysOrValues | null | undefined): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - // _.flattenDepth - interface LoDashStatic { - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDepth(this: LoDashImplicitWrapper | null | undefined>, depth?: number): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDepth(this: LoDashExplicitWrapper | null | undefined>, depth?: number): LoDashExplicitWrapper; - } - - //_.fromPairs - interface LoDashStatic { - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @category Array - * @param pairs The key-value pairs. - * @returns Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ - fromPairs( - pairs: List<[PropertyName, T]> | null | undefined - ): Dictionary; - - /** - @see _.fromPairs - */ - fromPairs( - pairs: List | null | undefined - ): Dictionary; - } - - //_.fromPairs - interface LoDashImplicitWrapper { - /** - * @see _.fromPairs - */ - fromPairs( - this: LoDashImplicitWrapper | null | undefined> - ): LoDashImplicitWrapper>; - - /** - @see _.fromPairs - */ - fromPairs( - this: LoDashImplicitWrapper | null | undefined> - ): LoDashImplicitWrapper>; - } - //_.fromPairs - interface LoDashExplicitWrapper { - /** - * @see _.fromPairs - */ - fromPairs( - this: LoDashExplicitWrapper | null | undefined> - ): LoDashExplicitWrapper>; - - /** - @see _.fromPairs - */ - fromPairs( - this: LoDashExplicitWrapper | null | undefined> - ): LoDashExplicitWrapper>; - } - - //_.head - interface LoDashStatic { - /** - * Gets the first element of array. - * - * @alias _.first - * - * @param array The array to query. - * @return Returns the first element of array. - */ - head(array: List | null | undefined): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.head - */ - head(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.head - */ - head(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.indexOf - interface LoDashStatic { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` - * performs a faster binary search. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @param [fromIndex=0] The index to search from. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - indexOf( - array: List | null | undefined, - value: T, - fromIndex?: boolean|number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.indexOf - */ - indexOf( - this: LoDashImplicitWrapper | null | undefined>, - value: T, - fromIndex?: boolean|number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.indexOf - */ - indexOf( - this: LoDashExplicitWrapper | null | undefined>, - value: T, - fromIndex?: boolean|number - ): LoDashExplicitWrapper; - } - - //_.sortedIndexOf - interface LoDashStatic { - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - sortedIndexOf( - array: List | null | undefined, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - this: LoDashImplicitWrapper | null | undefined>, - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - this: LoDashExplicitWrapper | null | undefined>, - value: T - ): LoDashExplicitWrapper; - } - - //_.initial - interface LoDashStatic { - /** - * Gets all but the last element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - initial(array: List | null | undefined): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.initial - */ - initial(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.initial - */ - initial(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.intersection - interface LoDashStatic { - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - intersection(...arrays: Array>): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.intersection - */ - intersection( - this: LoDashImplicitWrapper>, - ...arrays: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.intersection - */ - intersection( - this: LoDashExplicitWrapper>, - ...arrays: Array> - ): LoDashExplicitWrapper; - } - - //_.intersectionBy - interface LoDashStatic { - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - intersectionBy( - array: List | null, - values: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.intersectionBy - */ - intersectionBy( - array: List | null, - values1: List, - values2: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.intersectionBy - */ - intersectionBy( - array: List | null | undefined, - values1: List, - values2: List, - ...values: Array | ValueIteratee> - ): T1[]; - - /** - * @see _.intersectionBy - */ - intersectionBy( - array?: List | null, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashImplicitWrapper | null | undefined>, - values: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - iteratee: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | ValueIteratee> - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashImplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashExplicitWrapper | null | undefined>, - values: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | ValueIteratee> - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionBy - */ - intersectionBy( - this: LoDashExplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashExplicitWrapper; - } - - //_.intersectionWith - interface LoDashStatic { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @category Array - * @param [values] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - intersectionWith( - array: List | null | undefined, - values: List, - comparator: Comparator2 - ): T1[]; - - /** - * @see _.intersectionWith - */ - intersectionWith( - array: List | null | undefined, - values1: List, - values2: List, - comparator: Comparator2 - ): T1[]; - - /** - * @see _.intersectionWith - */ - intersectionWith( - array: List | null | undefined, - values1: List, - values2: List, - ...values: Array | Comparator2> - ): T1[]; - - /** - * @see _.intersectionWith - */ - intersectionWith( - array?: List | null, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashImplicitWrapper | null | undefined>, - values: List, - comparator: Comparator2 - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - comparator: Comparator2 - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashImplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | Comparator2>, - ): LoDashImplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashImplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashExplicitWrapper | null | undefined>, - values: List, - comparator: Comparator2 - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - comparator: Comparator2 - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashExplicitWrapper | null | undefined>, - values1: List, - values2: List, - ...values: Array | Comparator2>, - ): LoDashExplicitWrapper; - - /** - * @see _.intersectionWith - */ - intersectionWith( - this: LoDashExplicitWrapper | null | undefined>, - ...values: Array> - ): LoDashExplicitWrapper; - } - - //_.join - interface LoDashStatic { - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - join( - array: List | null | undefined, - separator?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.join - */ - join(separator?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.join - */ - join(separator?: string): LoDashExplicitWrapper; - } - - //_.reverse - interface LoDashStatic { - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @category Array - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - reverse>( - array: TList, - ): TList; - } - - //_.prototype.reverse - interface LoDashWrapper { - /** - * Reverses the wrapped array so the first element becomes the last, the second element becomes the second to - * last, and so on. - * - * Note: This method mutates the wrapped array. - * - * @return Returns the new reversed lodash wrapper instance. - */ - reverse(): this; - } - - //_.last - interface LoDashStatic { - /** - * Gets the last element of array. - * - * @param array The array to query. - * @return Returns the last element of array. - */ - last(array: List | null | undefined): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.last - */ - last(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.last - */ - last(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.lastIndexOf - interface LoDashStatic { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - lastIndexOf( - array: List | null | undefined, - value: T, - fromIndex?: true|number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.indexOf - */ - lastIndexOf( - this: LoDashImplicitWrapper | null | undefined>, - value: T, - fromIndex?: true|number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.indexOf - */ - lastIndexOf( - this: LoDashExplicitWrapper | null | undefined>, - value: T, - fromIndex?: true|number - ): LoDashExplicitWrapper; - } - - //_.nth - interface LoDashStatic { - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. - * - * @param array array The array to query. - * @param value The index of the element to return. - * @return Returns the nth element of `array`. - */ - nth( - array: List | null | undefined, - n?: number - ): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.nth - */ - nth( - this: LoDashImplicitWrapper | null | undefined>, - n?: number - ): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.nth - */ - nth( - this: LoDashExplicitWrapper | null | undefined>, - n?: number - ): LoDashExplicitWrapper; - } - - //_.pull - interface LoDashStatic { - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - pull( - array: T[], - ...values: T[] - ): T[]; - - /** - * @see _.pull - */ - pull( - array: List, - ...values: T[] - ): List; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pull - */ - pull( - this: LoDashImplicitWrapper>, - ...values: T[] - ): this; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pull - */ - pull( - this: LoDashExplicitWrapper>, - ...values: T[] - ): this; - } - - //_.pullAt - interface LoDashStatic { - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - pullAt( - array: T[], - ...indexes: Array> - ): T[]; - - /** - * @see _.pullAt - */ - pullAt( - array: List, - ...indexes: Array> - ): List; - } - - interface LoDashWrapper { - /** - * @see _.pullAt - */ - pullAt(...indexes: Array>): this; - } - - //_.pullAll - interface LoDashStatic { - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @returns Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - pullAll( - array: T[], - values?: List, - ): T[]; - - /** - * @see _.pullAll - */ - pullAll( - array: List, - values?: List, - ): List; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pullAll - */ - pullAll( - this: LoDashImplicitWrapper>, - values?: List - ): this; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pullAll - */ - pullAll( - this: LoDashExplicitWrapper>, - values?: List - ): this; - } - - //_.pullAllBy - interface LoDashStatic { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - pullAllBy( - array: T[], - values?: List, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.pullAllBy - */ - pullAllBy( - array: List, - values?: List, - iteratee?: ValueIteratee - ): List; - - /** - * @see _.pullAllBy - */ - pullAllBy( - array: T1[], - values: List, - iteratee: ValueIteratee - ): T1[]; - - /** - * @see _.pullAllBy - */ - pullAllBy( - array: List, - values: List, - iteratee: ValueIteratee - ): List; - } - - interface LoDashWrapper { - /** - * @see _.pullAllBy - */ - pullAllBy( - this: LoDashWrapper>, - values?: List, - iteratee?: ValueIteratee - ): this; - - /** - * @see _.pullAllBy - */ - pullAllBy( - this: LoDashWrapper>, - values: List, - iteratee: ValueIteratee - ): this; - } - - //_.pullAllWith - interface LoDashStatic { - /** - * This method is like `_.pullAll` except that it accepts `comparator` which is - * invoked to compare elements of array to values. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @category Array - * @param array The array to modify. - * @param values The values to remove. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - pullAllWith( - array: T[], - values?: List, - comparator?: Comparator - ): T[]; - - /** - * @see _.pullAllWith - */ - pullAllWith( - array: List, - values?: List, - comparator?: Comparator - ): List; - - /** - * @see _.pullAllWith - */ - pullAllWith( - array: T1[], - values: List, - comparator: Comparator2 - ): T1[]; - - /** - * @see _.pullAllWith - */ - pullAllWith( - array: List, - values: List, - comparator: Comparator2 - ): List; - } - - interface LoDashWrapper { - /** - * @see _.pullAllWith - */ - pullAllWith( - this: LoDashWrapper>, - values?: List, - comparator?: Comparator - ): this; - - /** - * @see _.pullAllWith - */ - pullAllWith( - this: LoDashWrapper>, - values: List, - comparator: Comparator2 - ): this; - } - - //_.remove - interface LoDashStatic { - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - remove( - array: List, - predicate?: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.remove - */ - remove( - this: LoDashImplicitWrapper>, - predicate?: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.remove - */ - remove( - this: LoDashExplicitWrapper>, - predicate?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.tail - interface LoDashStatic { - /** - * Gets all but the first element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - tail(array: List | null | undefined): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.tail - */ - tail(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.tail - */ - tail(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.slice - interface LoDashStatic { - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - slice( - array: List | null | undefined, - start?: number, - end?: number - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.slice - */ - slice( - this: LoDashImplicitWrapper | null | undefined>, - start?: number, - end?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.slice - */ - slice( - this: LoDashExplicitWrapper | null | undefined>, - start?: number, - end?: number - ): LoDashExplicitWrapper; - } - - //_.sortedIndex - interface LoDashStatic { - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - sortedIndex( - array: List | null | undefined, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - this: LoDashImplicitWrapper | null | undefined>, - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - this: LoDashExplicitWrapper | null | undefined>, - value: T - ): LoDashExplicitWrapper; - } - - // _.sortedIndexBy - interface LoDashStatic { - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - sortedIndexBy( - array: List | null | undefined, - value: T, - iteratee?: ValueIteratee - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - this: LoDashImplicitWrapper | null | undefined>, - value: T, - iteratee?: ValueIteratee - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - this: LoDashExplicitWrapper | null | undefined>, - value: T, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndex - interface LoDashStatic { - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - sortedLastIndex( - array: List | null | undefined, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - this: LoDashImplicitWrapper | null | undefined>, - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - this: LoDashExplicitWrapper | null | undefined>, - value: T - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndexBy - interface LoDashStatic { - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The sorted array to inspect. - * @param value The value to evaluate. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - sortedLastIndexBy( - array: List | null | undefined, - value: T, - iteratee: ValueIteratee - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - this: LoDashImplicitWrapper | null | undefined>, - value: T, - iteratee: ValueIteratee - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - this: LoDashExplicitWrapper | null | undefined>, - value: T, - iteratee: ValueIteratee - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndexOf - interface LoDashStatic { - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @category Array - * @param array The array to search. - * @param value The value to search for. - * @returns Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - sortedLastIndexOf( - array: List | null | undefined, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedLastIndexOf - */ - sortedLastIndexOf( - this: LoDashImplicitWrapper | null | undefined>, - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedLastIndexOf - */ - sortedLastIndexOf( - this: LoDashExplicitWrapper | null | undefined>, - value: T - ): LoDashExplicitWrapper; - } - - //_.take - interface LoDashStatic { - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - take( - array: List | null | undefined, - n?: number - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.take - */ - take( - this: LoDashImplicitWrapper | null | undefined>, - n?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.take - */ - take( - this: LoDashExplicitWrapper | null | undefined>, - n?: number - ): LoDashExplicitWrapper; - } - - //_.takeRight - interface LoDashStatic { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - takeRight( - array: List | null | undefined, - n?: number - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.takeRight - */ - takeRight( - this: LoDashImplicitWrapper | null | undefined>, - n?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.takeRight - */ - takeRight( - this: LoDashExplicitWrapper | null | undefined>, - n?: number - ): LoDashExplicitWrapper; - } - - //_.takeRightWhile - interface LoDashStatic { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - takeRightWhile( - array: List | null | undefined, - predicate?: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.takeWhile - interface LoDashStatic { - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - takeWhile( - array: List | null | undefined, - predicate?: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.union - interface LoDashStatic { - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - union(...arrays: Array | null | undefined>): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.union - */ - union( - this: LoDashImplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.union - */ - union( - this: LoDashExplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.unionBy - interface LoDashStatic { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - unionBy( - arrays: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List | null | undefined, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unionBy - */ - unionBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unionBy - */ - unionBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.unionBy - */ - unionBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.unionWith - interface LoDashStatic { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - unionWith( - arrays: List | null | undefined, - comparator?: Comparator - ): T[]; - - /** - * @see _.unionBy - */ - unionWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - comparator?: Comparator - ): T[]; - - /** - * @see _.unionWith - */ - unionWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unionWith - */ - unionWith( - this: LoDashImplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashImplicitWrapper; - - /** - * @see _.unionWith - */ - unionWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - comparator?: Comparator - ): LoDashImplicitWrapper; - - /** - * @see _.unionWith - */ - unionWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unionWith - */ - unionWith( - this: LoDashExplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashExplicitWrapper; - - /** - * @see _.unionWith - */ - unionWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - comparator?: Comparator - ): LoDashExplicitWrapper; - - /** - * @see _.unionWith - */ - unionWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.uniq - interface LoDashStatic { - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. - * - * @category Array - * @param array The array to inspect. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - uniq( - array: List | null | undefined - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniq - */ - uniq(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniq - */ - uniq(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.uniqBy - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param array The array to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - uniqBy( - array: string | null | undefined, - iteratee: StringIterator - ): string[]; - - /** - * @see _.uniqBy - */ - uniqBy( - array: List | null | undefined, - iteratee: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashImplicitWrapper, - iteratee: StringIterator - ): LoDashImplicitWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashExplicitWrapper, - iteratee: StringIterator - ): LoDashExplicitWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.uniqWith - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param array The array to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - uniqWith( - array: List | null | undefined, - comparator?: Comparator - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniqWith - */ - uniqWith( - this: LoDashImplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniqWith - */ - uniqWith( - this: LoDashExplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashExplicitWrapper; - } - - //_.sortedUniq - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - sortedUniq( - array: List | null | undefined - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.sortedUniqBy - interface LoDashStatic { - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @category Array - * @param array The array to inspect. - * @param [iteratee] The iteratee invoked per element. - * @returns Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - sortedUniqBy( - array: string | null | undefined, - iteratee: StringIterator - ): string[]; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - array: List | null | undefined, - iteratee: ListIteratee - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashImplicitWrapper, - iteratee: StringIterator - ): LoDashImplicitWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIteratee - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashExplicitWrapper, - iteratee: StringIterator - ): LoDashExplicitWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.unzip - interface LoDashStatic { - /** - * This method is like _.zip except that it accepts an array of grouped elements and creates an array - * regrouping the elements to their pre-zip configuration. - * - * @param array The array of grouped elements to process. - * @return Returns the new array of regrouped elements. - */ - unzip(array: T[][] | List> | null | undefined): T[][]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unzip - */ - unzip(this: LoDashImplicitWrapper> | null | undefined>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unzip - */ - unzip(this: LoDashExplicitWrapper> | null | undefined>): LoDashExplicitWrapper; - } - - //_.unzipWith - interface LoDashStatic { - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - unzipWith( - array: List> | null | undefined, - iteratee: (...values: T[]) => TResult - ): TResult[]; - - /** - * @see _.unzipWith - */ - unzipWith( - array: List> | null | undefined - ): T[][]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unzipWith - */ - unzipWith( - this: LoDashImplicitWrapper> | null | undefined>, - iteratee: (...values: T[]) => TResult - ): LoDashImplicitWrapper; - - /** - * @see _.unzipWith - */ - unzipWith( - this: LoDashImplicitWrapper> | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unzipWith - */ - unzipWith( - this: LoDashExplicitWrapper> | null | undefined>, - iteratee: (...values: T[]) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.unzipWith - */ - unzipWith( - this: LoDashExplicitWrapper> | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.without - interface LoDashStatic { - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - without( - array: List | null | undefined, - ...values: T[] - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.without - */ - without( - this: LoDashImplicitWrapper | null | undefined>, - ...values: T[] - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.without - */ - without( - this: LoDashExplicitWrapper | null | undefined>, - ...values: T[] - ): LoDashExplicitWrapper; - } - - //_.xor - interface LoDashStatic { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - xor(...arrays: Array | null | undefined>): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.xor - */ - xor( - this: LoDashImplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.xor - */ - xor( - this: LoDashExplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.xorBy - interface LoDashStatic { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - xorBy( - arrays: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.xorBy - */ - xorBy( - arrays: List | null | undefined, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): T[]; - - /** - * @see _.xorBy - */ - xorBy( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.xor - */ - xorBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.xorBy - */ - xorBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashImplicitWrapper; - - /** - * @see _.xorBy - */ - xorBy( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.xorBy - */ - xorBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.xorBy - */ - xorBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee?: ValueIteratee - ): LoDashExplicitWrapper; - - /** - * @see _.xorBy - */ - xorBy( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...iteratee: Array | List | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.xorWith - interface LoDashStatic { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @category Array - * @param [arrays] The arrays to inspect. - * @param [comparator] The comparator invoked per element. - * @returns Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - xorWith( - arrays: List | null | undefined, - comparator?: Comparator - ): T[]; - - /** - * @see _.xorWith - */ - xorWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - comparator?: Comparator - ): T[]; - - /** - * @see _.xorWith - */ - xorWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.xorWith - */ - xorWith( - this: LoDashImplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashImplicitWrapper; - - /** - * @see _.xorWith - */ - xorWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - comparator?: Comparator - ): LoDashImplicitWrapper; - - /** - * @see _.xorWith - */ - xorWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.xorWith - */ - xorWith( - this: LoDashExplicitWrapper | null | undefined>, - comparator?: Comparator - ): LoDashExplicitWrapper; - - /** - * @see _.xorWith - */ - xorWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - comparator?: Comparator - ): LoDashExplicitWrapper; - - /** - * @see _.xorWith - */ - xorWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - ...comparator: Array | List | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.zip - interface LoDashStatic { - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - zip(...arrays: Array | null | undefined>): T[][]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.zip - */ - zip( - this: LoDashImplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.zip - */ - zip( - this: LoDashExplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashExplicitWrapper; - } - - //_.zipObject - interface LoDashStatic { - /** - * This method is like _.fromPairs except that it accepts two arrays, one of property - * identifiers and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - zipObject( - props: List, - values: List - ): Dictionary; - - /** - * @see _.zipObject - */ - zipObject( - props?: List - ): Dictionary; - - /** - * This method is like _.zipObject except that it supports property paths. - * - * @param paths The property names. - * @param values The property values. - * @return Returns the new object. - */ - zipObjectDeep( - paths?: List, - values?: List - ): object; - } - - interface LoDashImplicitWrapper { - /** - * @see _.zipObject - */ - zipObject( - this: LoDashImplicitWrapper>, - values: List - ): LoDashImplicitWrapper>; - - /** - * @see _.zipObject - */ - zipObject( - this: LoDashImplicitWrapper> - ): LoDashImplicitWrapper>; - - /** - * @see _.zipObjectDeep - */ - zipObjectDeep( - this: LoDashImplicitWrapper>, - values?: List - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.zipObject - */ - zipObject( - this: LoDashExplicitWrapper>, - values: List - ): LoDashExplicitWrapper>; - - /** - * @see _.zipObject - */ - zipObject( - this: LoDashExplicitWrapper> - ): LoDashExplicitWrapper>; - - /** - * @see _.zipObjectDeep - */ - zipObjectDeep( - this: LoDashExplicitWrapper>, - values?: List - ): LoDashExplicitWrapper; - } - - //_.zipWith - interface LoDashStatic { - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - zipWith( - ...arrays: Array | null | undefined> - ): T[][]; - - /** - * @see _.zipWith - */ - zipWith( - arrays: List | null | undefined, - iteratee: (value1: T) => TResult - ): TResult[]; - - /** - * @see _.zipWith - */ - zipWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - iteratee: (value1: T, value2: T) => TResult - ): TResult[]; - - /** - * @see _.zipWith - */ - zipWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T) => TResult - ): TResult[]; - - /** - * @see _.zipWith - */ - zipWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T, value4: T) => TResult - ): TResult[]; - - /** - * @see _.zipWith - */ - zipWith( - arrays: List | null | undefined, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T, value4: T, value5: T) => TResult - ): TResult[]; - - zipWith( - ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> - ): TResult[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashImplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: (value1: T) => TResult - ): LoDashImplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee: (value1: T, value2: T) => TResult - ): LoDashImplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T) => TResult - ): LoDashImplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T, value4: T) => TResult - ): LoDashImplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashImplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - ...arrays: Array | null | undefined> - ): LoDashExplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: (value1: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - iteratee: (value1: T, value2: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - iteratee: (value1: T, value2: T, value3: T, value4: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.zipWith - */ - zipWith( - this: LoDashExplicitWrapper | null | undefined>, - arrays2: List | null | undefined, - arrays3: List | null | undefined, - arrays4: List | null | undefined, - arrays5: List | null | undefined, - ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> - ): LoDashExplicitWrapper; - } - - /********* - * Chain * - *********/ - - //_.chain - interface LoDashStatic { - /** - * Creates a lodash object that wraps value with explicit method chaining enabled. - * - * @param value The value to wrap. - * @return Returns the new lodash wrapper instance. - */ - chain(value: T): LoDashExplicitWrapper; - } - - interface LoDashImplicitWrapper { - /** - * @see _.chain - */ - chain(): LoDashExplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.chain - */ - chain(): this; - } - - //_.tap - interface LoDashStatic { - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - tap( - value: T, - interceptor: (value: T) => void - ): T; - } - - interface LoDashWrapper { - /** - * @see _.tap - */ - tap( - interceptor: (value: TValue) => void - ): this; - } - - //_.thru - interface LoDashStatic { - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - thru( - value: T, - interceptor: (value: T) => TResult - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.thru - */ - thru(interceptor: (value: TValue) => TResult): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.thru - */ - thru(interceptor: (value: TValue) => TResult): LoDashExplicitWrapper; - } - - //_.prototype.commit - interface LoDashWrapper { - /** - * Executes the chained sequence and returns the wrapped result. - * - * @return Returns the new lodash wrapper instance. - */ - commit(): this; - } - - //_.prototype.plant - interface LoDashImplicitWrapper { - /** - * Creates a clone of the chained sequence planting value as the wrapped value. - * @param value The value to plant as the wrapped value. - * @return Returns the new lodash wrapper instance. - */ - plant(value: T): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.plant - */ - plant(value: T): LoDashExplicitWrapper; - } - - //_.prototype.toJSON - interface LoDashWrapper { - /** - * @see _.value - */ - toJSON(): TValue; - } - - //_.prototype.toString - interface LoDashWrapper { - /** - * Produces the result of coercing the unwrapped value to a string. - * - * @return Returns the coerced string value. - */ - toString(): string; - } - - //_.prototype.value - interface LoDashWrapper { - /** - * Executes the chained sequence to extract the unwrapped value. - * - * @alias _.toJSON, _.valueOf - * - * @return Returns the resolved unwrapped value. - */ - value(): TValue; - } - - //_.valueOf - interface LoDashWrapper { - /** - * @see _.value - */ - valueOf(): TValue; - } - - /************** - * Collection * - **************/ - - //_.at - interface LoDashStatic { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param object The object to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - at( - object: List | Dictionary | null | undefined, - ...props: PropertyPath[] - ): T[]; - - /** - * @see _.at - */ - at( - object: T | null | undefined, - ...props: Array> - ): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.at - */ - at( - this: LoDashImplicitWrapper | Dictionary | null | undefined>, - ...props: PropertyPath[] - ): LoDashImplicitWrapper; - - /** - * @see _.at - */ - at( - this: LoDashImplicitWrapper, - ...props: Array> - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.at - */ - at( - this: LoDashExplicitWrapper | Dictionary | null | undefined>, - ...props: PropertyPath[] - ): LoDashExplicitWrapper; - - /** - * @see _.at - */ - at( - this: LoDashExplicitWrapper, - ...props: Array> - ): LoDashExplicitWrapper>; - } - - //_.countBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - countBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: List | null | undefined, - iteratee?: ListIteratee - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: NumericDictionary | null | undefined, - iteratee?: NumericDictionaryIteratee - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: T | null | undefined, - iteratee?: ObjectIteratee - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.countBy - */ - countBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashImplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.countBy - */ - countBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashExplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.countBy - */ - countBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIteratee - ): LoDashExplicitWrapper>; - } - - //_.each - interface LoDashStatic { - each: typeof _.forEach; // tslint:disable-line:no-unnecessary-qualifier - } - - interface LoDashWrapper { - /** - * @see _.forEach - */ - each( - this: LoDashWrapper, - iteratee?: ArrayIterator - ): this; - - /** - * @see _.forEach - */ - each( - this: LoDashWrapper, - iteratee?: StringIterator - ): this; - - /** - * @see _.forEach - */ - each( - this: LoDashWrapper | null | undefined>, - iteratee?: ListIterator - ): this; - - /** - * @see _.forEach - */ - each( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.eachRight - interface LoDashStatic { - eachRight: typeof _.forEachRight; // tslint:disable-line:no-unnecessary-qualifier - } - - interface LoDashWrapper { - /** - * @see _.forEachRight - */ - eachRight( - this: LoDashWrapper, - iteratee?: ArrayIterator - ): this; - - /** - * @see _.forEachRight - */ - eachRight( - this: LoDashWrapper, - iteratee?: StringIterator - ): this; - - /** - * @see _.forEachRight - */ - eachRight( - this: LoDashWrapper | null | undefined>, - iteratee?: ListIterator - ): this; - - /** - * @see _.forEachRight - */ - eachRight( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.every - interface LoDashStatic { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - every( - collection: List | null | undefined, - predicate?: ListIterateeCustom - ): boolean; - - /** - * @see _.every - */ - every( - collection: NumericDictionary | null | undefined, - predicate?: NumericDictionaryIterateeCustom - ): boolean; - - /** - * @see _.every - */ - every( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.every - */ - every( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): boolean; - - /** - * @see _.every - */ - every( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom - ): boolean; - - /** - * @see _.every - */ - every( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: NumericDictionaryIterateeCustom - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.every - */ - every( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: NumericDictionaryIterateeCustom - ): LoDashExplicitWrapper; - } - - //_.filter - interface LoDashStatic { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - filter( - collection: string | null | undefined, - predicate?: StringIterator - ): string[]; - - /** - * @see _.filter - */ - filter( - collection: List | null | undefined, - predicate: ListIteratorTypeGuard - ): S[]; - - /** - * @see _.filter - */ - filter( - collection: List | null | undefined, - predicate?: ListIterateeCustom - ): T[]; - - /** - * @see _.filter - */ - filter( - collection: T | null | undefined, - predicate: ObjectIteratorTypeGuard - ): S[]; - - /** - * @see _.filter - */ - filter( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom - ): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.filter - */ - filter( - this: LoDashImplicitWrapper, - predicate?: StringIterator - ): LoDashImplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashImplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard - ): LoDashImplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashImplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashImplicitWrapper, - predicate: ObjectIteratorTypeGuard - ): LoDashImplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.filter - */ - filter( - this: LoDashExplicitWrapper, - predicate?: StringIterator - ): LoDashExplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashExplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard - ): LoDashExplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashExplicitWrapper, - predicate: ObjectIteratorTypeGuard - ): LoDashExplicitWrapper; - - /** - * @see _.filter - */ - filter( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashExplicitWrapper>; - } - - //_.find - interface LoDashStatic { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - find( - collection: List | null | undefined, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.find - */ - find( - collection: List | null | undefined, - predicate?: ListIterateeCustom, - fromIndex?: number - ): T|undefined; - - /** - * @see _.find - */ - find( - collection: T | null | undefined, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.find - */ - find( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): T[keyof T]|undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.find - */ - find( - this: LoDashImplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.find - */ - find( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): T|undefined; - - /** - * @see _.find - */ - find( - this: LoDashImplicitWrapper, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.find - */ - find( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): T[keyof T]|undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.find - */ - find( - this: LoDashExplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.find - */ - find( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.find - */ - find( - this: LoDashExplicitWrapper, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.find - */ - find( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.findLast - interface LoDashStatic { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param predicate The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - **/ - findLast( - collection: List | null | undefined, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.findLast - */ - findLast( - collection: List | null | undefined, - predicate?: ListIterateeCustom, - fromIndex?: number - ): T|undefined; - - /** - * @see _.findLast - */ - findLast( - collection: T | null | undefined, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.findLast - */ - findLast( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): T[keyof T]|undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.findLast - */ - findLast( - this: LoDashImplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): S | undefined; - - /** - * @see _.findLast - */ - findLast( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): T | undefined; - - /** - * @see _.findLast - */ - findLast( - this: LoDashImplicitWrapper, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): S|undefined; - - /** - * @see _.findLast - */ - findLast( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): T[keyof T]|undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.findLast - */ - findLast( - this: LoDashExplicitWrapper | null | undefined>, - predicate: ListIteratorTypeGuard, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findLast - */ - findLast( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findLast - */ - findLast( - this: LoDashExplicitWrapper, - predicate: ObjectIteratorTypeGuard, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findLast - */ - findLast( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.flatMap - interface LoDashStatic { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - flatMap( - collection: List> | Dictionary> | NumericDictionary> | null | undefined - ): T[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: object | null | undefined - ): any[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: List | null | undefined, - iteratee: ListIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: NumericDictionary | null | undefined, - iteratee: NumericDictionaryIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: T | null | undefined, - iteratee: ObjectIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: object | null | undefined, - iteratee: string - ): any[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: object | null | undefined, - iteratee: object - ): boolean[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatMap - */ - flatMap(this: LoDashImplicitWrapper> | Dictionary> | NumericDictionary> | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIterator> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashImplicitWrapper, - iteratee: ObjectIterator> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: string - ): LoDashImplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: object - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatMap - */ - flatMap(this: LoDashExplicitWrapper> | Dictionary> | NumericDictionary> | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIterator> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - this: LoDashExplicitWrapper, - iteratee: ObjectIterator> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: object - ): LoDashExplicitWrapper; - } - - //_.flatMapDeep - interface LoDashStatic { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - flatMapDeep( - collection: List | T> | Dictionary | T> | NumericDictionary | T> | null | undefined - ): T[]; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - collection: List | null | undefined, - iteratee: ListIterator | TResult> - ): TResult[]; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - collection: NumericDictionary | null | undefined, - iteratee: NumericDictionaryIterator | TResult> - ): TResult[]; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - collection: T | null | undefined, - iteratee: ObjectIterator | TResult> - ): TResult[]; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - collection: object | null | undefined, - iteratee: string - ): any[]; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - collection: object | null | undefined, - iteratee: object - ): boolean[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIterator | TResult> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator | TResult> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper, - iteratee: ObjectIterator | TResult> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper, - iteratee: string - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashImplicitWrapper, - iteratee: object - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIterator | TResult> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator | TResult> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper, - iteratee: ObjectIterator | TResult> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper, - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDeep - */ - flatMapDeep( - this: LoDashExplicitWrapper, - iteratee: object - ): LoDashExplicitWrapper; - } - - //_.flatMapDepth - interface LoDashStatic { - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @since 4.7.0 - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [depth=1] The maximum recursion depth. - * @returns Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - flatMapDepth( - collection: List | T> | Dictionary | T> | NumericDictionary | T> | null | undefined - ): T[]; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - collection: List | null | undefined, - iteratee: ListIterator | TResult>, - depth?: number - ): TResult[]; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - collection: NumericDictionary | null | undefined, - iteratee: NumericDictionaryIterator | TResult>, - depth?: number - ): TResult[]; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - collection: T | null | undefined, - iteratee: ObjectIterator | TResult>, - depth?: number - ): TResult[]; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - collection: object | null | undefined, - iteratee: string, - depth?: number - ): any[]; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - collection: object | null | undefined, - iteratee: object, - depth?: number - ): boolean[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIterator | TResult>, - depth?: number - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator | TResult>, - depth?: number - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper, - iteratee: ObjectIterator | TResult>, - depth?: number - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper, - iteratee: string, - depth?: number - ): LoDashImplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashImplicitWrapper, - iteratee: object, - depth?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper | T> | Dictionary | T> | NumericDictionary | T> | null | undefined> - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIterator | TResult>, - depth?: number - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: NumericDictionaryIterator | TResult>, - depth?: number - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper, - iteratee: ObjectIterator | TResult>, - depth?: number - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper, - iteratee: string, - depth?: number - ): LoDashExplicitWrapper; - - /** - * @see _.flatMapDepth - */ - flatMapDepth( - this: LoDashExplicitWrapper, - iteratee: object, - depth?: number - ): LoDashExplicitWrapper; - } - - //_.forEach - interface LoDashStatic { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - forEach( - collection: T[], - iteratee?: ArrayIterator - ): T[]; - - /** - * @see _.forEach - */ - forEach( - collection: string, - iteratee?: StringIterator - ): string; - - /** - * @see _.forEach - */ - forEach( - collection: List, - iteratee?: ListIterator - ): List; - - /** - * @see _.forEach - */ - forEach( - collection: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forEach - */ - forEach( - collection: TArray & (T[] | null | undefined), - iteratee?: ArrayIterator - ): TArray; - - /** - * @see _.forEach - */ - forEach( - collection: TString, - iteratee?: StringIterator - ): TString; - - /** - * @see _.forEach - */ - forEach | null | undefined>( - collection: TList & (List | null | undefined), - iteratee?: ListIterator - ): TList; - - /** - * @see _.forEach - */ - forEach( - collection: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forEach - */ - forEach( - this: LoDashWrapper, - iteratee?: ArrayIterator - ): this; - - /** - * @see _.forEach - */ - forEach( - this: LoDashWrapper, - iteratee?: StringIterator - ): this; - - /** - * @see _.forEach - */ - forEach( - this: LoDashWrapper | null | undefined>, - iteratee?: ListIterator - ): this; - - /** - * @see _.forEach - */ - forEach( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.forEachRight - interface LoDashStatic { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - forEachRight( - collection: T[], - iteratee?: ArrayIterator - ): T[]; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: string, - iteratee?: StringIterator - ): string; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: List, - iteratee?: ListIterator - ): List; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: TArray & (T[] | null | undefined), - iteratee?: ArrayIterator - ): TArray; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: TString, - iteratee?: StringIterator - ): TString; - - /** - * @see _.forEachRight - */ - forEachRight | null | undefined>( - collection: TList & (List | null | undefined), - iteratee?: ListIterator - ): TList; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - this: LoDashWrapper, - iteratee?: ArrayIterator - ): this; - - /** - * @see _.forEachRight - */ - forEachRight( - this: LoDashWrapper, - iteratee?: StringIterator - ): this; - - /** - * @see _.forEachRight - */ - forEachRight( - this: LoDashWrapper | null | undefined>, - iteratee?: ListIterator - ): this; - - /** - * @see _.forEachRight - */ - forEachRight( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.groupBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - groupBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List | null | undefined, - iteratee?: ListIteratee - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: NumericDictionary | null | undefined, - iteratee?: NumericDictionaryIteratee - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: T | null | undefined, - iteratee?: ObjectIteratee - ): Dictionary>; - } - - interface LoDashImplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashImplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashImplicitWrapper>>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - this: LoDashExplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashExplicitWrapper>>; - } - - //_.includes - interface LoDashStatic { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - includes( - collection: List|Dictionary | null | undefined, - target: T, - fromIndex?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.includes - */ - includes( - this: LoDashImplicitWrapper | Dictionary | null | undefined>, - target: T, - fromIndex?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.includes - */ - includes( - this: LoDashExplicitWrapper | Dictionary | null | undefined>, - target: T, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.keyBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - keyBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: List | null | undefined, - iteratee?: ListIterateeCustom - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: T | null | undefined, - iteratee?: ObjectIterateeCustom - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: NumericDictionary | null | undefined, - iteratee?: NumericDictionaryIterateeCustom - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIterateeCustom - ): LoDashImplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashImplicitWrapper, - iteratee?: ObjectIterateeCustom - ): LoDashImplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIterateeCustom - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIterateeCustom - ): LoDashExplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashExplicitWrapper, - iteratee?: ObjectIterateeCustom - ): LoDashExplicitWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIterateeCustom - ): LoDashExplicitWrapper>; - } - - //_.invoke - interface LoDashStatic { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - invoke( - object: any, - path: PropertyPath, - ...args: any[]): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.invoke - **/ - invoke( - path: PropertyPath, - ...args: any[]): any; - } - - interface LoDashExplicitWrapper { - /** - * @see _.invoke - **/ - invoke( - path: PropertyPath, - ...args: any[]): LoDashExplicitWrapper; - } - - //_.invokeMap - interface LoDashStatic { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - invokeMap( - collection: object | null | undefined, - methodName: string, - ...args: any[]): any[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: object | null | undefined, - method: (...args: any[]) => TResult, - ...args: any[]): TResult[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashImplicitWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashExplicitWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashExplicitWrapper; - } - - //_.map - interface LoDashStatic { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - map( - collection: List | null | undefined, - iteratee: ListIterator - ): TResult[]; - - /** - * @see _.map - */ - map(collection: List | Dictionary | null | undefined): T[]; - - /** - * @see _.map - */ - map( - collection: Dictionary | null | undefined, - iteratee: DictionaryIterator - ): TResult[]; - - /** @see _.map */ - map( - collection: List | Dictionary | null | undefined, - iteratee: K - ): Array; - - /** @see _.map */ - map( - collection: NumericDictionary | null | undefined, - iteratee?: NumericDictionaryIterator - ): TResult[]; - - /** - * @see _.map - */ - map( - collection: List|Dictionary|NumericDictionary | null | undefined, - iteratee?: string - ): TResult[]; - - /** - * @see _.map - */ - map( - collection: List|Dictionary|NumericDictionary | null | undefined, - iteratee?: object - ): boolean[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.map - */ - map( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIterator - ): LoDashImplicitWrapper; - - /** - * @see _.map - */ - map(this: LoDashImplicitWrapper | Dictionary | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: DictionaryIterator - ): LoDashImplicitWrapper; - - /** @see _.map */ - map( - this: LoDashImplicitWrapper | Dictionary | null | undefined>, - iteratee: K - ): LoDashImplicitWrapper>; - - /** @see _.map */ - map( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIterator - ): LoDashImplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - iteratee?: string - ): LoDashImplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - iteratee?: object - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.map - */ - map( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIterator - ): LoDashExplicitWrapper; - - /** - * @see _.map - */ - map(this: LoDashExplicitWrapper | Dictionary | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: DictionaryIterator - ): LoDashExplicitWrapper; - - /** @see _.map */ - map( - this: LoDashExplicitWrapper | Dictionary | null | undefined>, - iteratee: K - ): LoDashExplicitWrapper>; - - /** - * @see _.map - */ - map( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: NumericDictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - iteratee?: string - ): LoDashExplicitWrapper; - - /** - * @see _.map - */ - map( - this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - iteratee?: object - ): LoDashExplicitWrapper; - } - - //_.partition - interface LoDashStatic { - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - partition( - collection: List | null | undefined, - callback: ValueIteratee - ): [T[], T[]]; - - /** - * @see _.partition - */ - partition( - collection: T | null | undefined, - callback: ValueIteratee - ): [Array, Array]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.partition - */ - partition( - this: LoDashImplicitWrapper | null | undefined>, - callback: ValueIteratee - ): LoDashImplicitWrapper<[T[], T[]]>; - - /** - * @see _.partition - */ - partition( - this: LoDashImplicitWrapper, - callback: ValueIteratee - ): LoDashImplicitWrapper<[Array, Array]>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.partition - */ - partition( - this: LoDashExplicitWrapper | null | undefined>, - callback: ValueIteratee - ): LoDashExplicitWrapper<[T[], T[]]>; - - /** - * @see _.partition - */ - partition( - this: LoDashExplicitWrapper, - callback: ValueIteratee - ): LoDashExplicitWrapper<[Array, Array]>; - } - - //_.reduce - interface LoDashStatic { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return Returns the accumulated value. - **/ - reduce( - collection: T[] | null | undefined, - callback: MemoListIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: List | null | undefined, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: T | null | undefined, - callback: MemoObjectIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: NumericDictionary | null | undefined, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: T[] | null | undefined, - callback: MemoListIterator - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - collection: List | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - collection: T | null | undefined, - callback: MemoObjectIterator - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - collection: NumericDictionary | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper, - callback: MemoListIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper, - callback: MemoObjectIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper, - callback: MemoListIterator - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper, - callback: MemoObjectIterator - ): TResult | undefined; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper, - callback: MemoListIterator, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper, - callback: MemoObjectIterator, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper, - callback: MemoListIterator - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper, - callback: MemoObjectIterator - ): LoDashExplicitWrapper; - - /** - * @see _.reduce - **/ - reduce( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; - } - - //_.reduceRight - interface LoDashStatic { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @return The accumulated value. - **/ - reduceRight( - collection: T[] | null | undefined, - callback: MemoListIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: List | null | undefined, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: T | null | undefined, - callback: MemoObjectIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: NumericDictionary | null | undefined, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: T[] | null | undefined, - callback: MemoListIterator - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: List | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: T | null | undefined, - callback: MemoObjectIterator - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: NumericDictionary | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper, - callback: MemoListIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper, - callback: MemoObjectIterator, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper, - callback: MemoListIterator - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper, - callback: MemoObjectIterator - ): TResult | undefined; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper, - callback: MemoListIterator, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper, - callback: MemoObjectIterator, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator>, - accumulator: TResult - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper, - callback: MemoListIterator - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper, - callback: MemoObjectIterator - ): LoDashExplicitWrapper; - - /** - * @see _.reduceRight - **/ - reduceRight( - this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; - } - - //_.reject - interface LoDashStatic { - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - reject( - collection: string | null | undefined, - predicate?: StringIterator - ): string[]; - - /** - * @see _.reject - */ - reject( - collection: List | null | undefined, - predicate?: ListIterateeCustom - ): T[]; - - /** - * @see _.reject - */ - reject( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom - ): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.reject - */ - reject( - this: LoDashImplicitWrapper, - predicate?: StringIterator - ): LoDashImplicitWrapper; - - /** - * @see _.reject - */ - reject( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashImplicitWrapper; - - /** - * @see _.reject - */ - reject( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.reject - */ - reject( - this: LoDashExplicitWrapper, - predicate?: StringIterator - ): LoDashExplicitWrapper; - - /** - * @see _.reject - */ - reject( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.reject - */ - reject( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashExplicitWrapper>; - } - - //_.sample - interface LoDashStatic { - /** - * Gets a random element from collection. - * - * @param collection The collection to sample. - * @return Returns the random element. - */ - sample( - collection: List | Dictionary | NumericDictionary | null | undefined - ): T | undefined; - - /** - * @see _.sample - */ - sample( - collection: T - ): T[keyof T]; - - /** - * @see _.sample - */ - sample( - collection: T | null | undefined - ): T[keyof T] | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sample - */ - sample( - this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined> - ): T | undefined; - - /** - * @see _.sample - */ - sample( - this: LoDashImplicitWrapper, - ): T[keyof T]; - - /** - * @see _.sample - */ - sample( - this: LoDashImplicitWrapper - ): T[keyof T] | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sample - */ - sample( - this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined> - ): LoDashExplicitWrapper; - - /** - * @see _.sample - */ - sample( - this: LoDashExplicitWrapper, - ): LoDashExplicitWrapper; - - /** - * @see _.sample - */ - sample( - this: LoDashExplicitWrapper - ): LoDashExplicitWrapper; - } - - //_.sampleSize - interface LoDashStatic { - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - sampleSize( - collection: List|Dictionary|NumericDictionary | null | undefined, - n?: number - ): T[]; - - /** - * @see _.sampleSize - */ - sampleSize( - collection: T | null | undefined, - n?: number - ): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - this: LoDashImplicitWrapper|Dictionary|NumericDictionary | null | undefined>, - n?: number - ): LoDashImplicitWrapper; - - /** - * @see _.sampleSize - */ - sampleSize( - this: LoDashImplicitWrapper, - n?: number - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - this: LoDashExplicitWrapper|Dictionary|NumericDictionary | null | undefined>, - n?: number - ): LoDashExplicitWrapper; - - /** - * @see _.sampleSize - */ - sampleSize( - this: LoDashExplicitWrapper, - n?: number - ): LoDashExplicitWrapper>; - } - - //_.shuffle - interface LoDashStatic { - /** - * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. - * - * @param collection The collection to shuffle. - * @return Returns the new shuffled array. - */ - shuffle(collection: List | null | undefined): T[]; - - /** - * @see _.shuffle - */ - shuffle(collection: T | null | undefined): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.shuffle - */ - shuffle(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.shuffle - */ - shuffle(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.shuffle - */ - shuffle(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.shuffle - */ - shuffle(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; - } - - //_.size - interface LoDashStatic { - /** - * Gets the size of collection by returning its length for array-like values or the number of own enumerable - * properties for objects. - * - * @param collection The collection to inspect. - * @return Returns the size of collection. - */ - size(collection: object | string | null | undefined): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.size - */ - size(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.size - */ - size(): LoDashExplicitWrapper; - } - - //_.some - interface LoDashStatic { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - some( - collection: List | null | undefined, - predicate?: ListIterateeCustom - ): boolean; - - /** - * @see _.some - */ - some( - collection: T | null | undefined, - predicate?: ObjectIterateeCustom - ): boolean; - - /** - * @see _.some - */ - some( - collection: NumericDictionary | null | undefined, - predicate?: NumericDictionaryIterateeCustom - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.some - */ - some( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): boolean; - - /** - * @see _.some - */ - some( - this: LoDashImplicitWrapper, - predicate?: ObjectIterateeCustom - ): boolean; - - /** - * @see _.some - */ - some( - this: LoDashImplicitWrapper | null | undefined>, - predicate?: NumericDictionaryIterateeCustom - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.some - */ - some( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: ListIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - this: LoDashExplicitWrapper, - predicate?: ObjectIterateeCustom - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - this: LoDashExplicitWrapper | null | undefined>, - predicate?: NumericDictionaryIterateeCustom - ): LoDashExplicitWrapper; - } - - //_.sortBy - interface LoDashStatic { - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - sortBy( - collection: List | null | undefined, - ...iteratees: Array>> - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: T | null | undefined, - ...iteratees: Array>> - ): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortBy - */ - sortBy( - this: LoDashImplicitWrapper | null | undefined>, - ...iteratees: Array>> - ): LoDashImplicitWrapper; - - /** - * @see _.sortBy - */ - sortBy( - this: LoDashImplicitWrapper, - ...iteratees: Array>> - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortBy - */ - sortBy( - this: LoDashExplicitWrapper | null | undefined>, - ...iteratees: Array>> - ): LoDashExplicitWrapper; - - /** - * @see _.sortBy - */ - sortBy( - this: LoDashExplicitWrapper, - ...iteratees: Array>> - ): LoDashExplicitWrapper>; - } - - //_.orderBy - interface LoDashStatic { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @category Collection - * @param collection The collection to iterate over. - * @param [iteratees=[_.identity]] The iteratees to sort by. - * @param [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - orderBy( - collection: List | null | undefined, - iteratees?: Many>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: List | null | undefined, - iteratees?: Many>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: T | null | undefined, - iteratees?: Many>, - orders?: Many - ): Array; - - /** - * @see _.orderBy - */ - orderBy( - collection: T | null | undefined, - iteratees?: Many>, - orders?: Many - ): Array; - - /** - * @see _.orderBy - */ - orderBy( - collection: NumericDictionary | null | undefined, - iteratees?: Many>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: NumericDictionary | null | undefined, - iteratees?: Many>, - orders?: Many - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper>; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper>; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper>; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper>; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper; - - /** - * @see _.orderBy - */ - orderBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratees?: Many>, - orders?: Many - ): LoDashExplicitWrapper; - } - - /******** - * Date * - ********/ - - //_.now - interface LoDashStatic { - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @return The number of milliseconds. - */ - now(): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.now - */ - now(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.now - */ - now(): LoDashExplicitWrapper; - } - - /************* - * Functions * - *************/ - - //_.after - interface LoDashStatic { - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - after any>( - n: number, - func: TFunc - ): TFunc; - } - - interface LoDashImplicitWrapper { - /** - * @see _.after - **/ - after any>(func: TFunc): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.after - **/ - after any>(func: TFunc): LoDashExplicitWrapper; - } - - //_.ary - interface LoDashStatic { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - ary( - func: (...args: any[]) => any, - n?: number - ): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.ary - */ - ary(n?: number): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.ary - */ - ary(n?: number): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.before - interface LoDashStatic { - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * it’s called less than n times. Subsequent calls to the created function return the result of the last func - * invocation. - * - * @param n The number of calls at which func is no longer invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - before any>( - n: number, - func: TFunc - ): TFunc; - } - - interface LoDashImplicitWrapper { - /** - * @see _.before - **/ - before any>(func: TFunc): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.before - **/ - before any>(func: TFunc): LoDashExplicitWrapper; - } - - //_.bind - interface FunctionBind { - placeholder: any; - - ( - func: (...args: any[]) => any, - thisArg: any, - ...partials: any[] - ): (...args: any[]) => any; - } - - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - bind: FunctionBind; - } - - interface LoDashImplicitWrapper { - /** - * @see _.bind - */ - bind( - thisArg: any, - ...partials: any[] - ): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.bind - */ - bind( - thisArg: any, - ...partials: any[] - ): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.bindAll - interface LoDashStatic { - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - bindAll( - object: T, - ...methodNames: Array> - ): T; - } - - interface LoDashWrapper { - /** - * @see _.bindAll - */ - bindAll(...methodNames: Array>): this; - } - - //_.bindKey - interface FunctionBindKey { - placeholder: any; - - ( - object: object, - key: string, - ...partials: any[] - ): (...args: any[]) => any; - } - - interface LoDashStatic { - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - bindKey: FunctionBindKey; - } - - interface LoDashImplicitWrapper { - /** - * @see _.bindKey - */ - bindKey( - key: string, - ...partials: any[] - ): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.bindKey - */ - bindKey( - key: string, - ...partials: any[] - ): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.curry - interface LoDashStatic { - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (t1: T1) => R, arity?: number): - CurriedFunction1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2) => R, arity?: number): - CurriedFunction2; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): - CurriedFunction3; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): - CurriedFunction4; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): - CurriedFunction5; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; - } - - interface CurriedFunction1 { - (): CurriedFunction1; - (t1: T1): R; - } - - interface CurriedFunction2 { - (): CurriedFunction2; - (t1: T1): CurriedFunction1; - (t1: T1, t2: T2): R; - } - - interface CurriedFunction3 { - (): CurriedFunction3; - (t1: T1): CurriedFunction2; - (t1: T1, t2: T2): CurriedFunction1; - (t1: T1, t2: T2, t3: T3): R; - } - - interface CurriedFunction4 { - (): CurriedFunction4; - (t1: T1): CurriedFunction3; - (t1: T1, t2: T2): CurriedFunction2; - (t1: T1, t2: T2, t3: T3): CurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4): R; - } - - interface CurriedFunction5 { - (): CurriedFunction5; - (t1: T1): CurriedFunction4; - (t1: T1, t2: T2): CurriedFunction3; - (t1: T1, t2: T2, t3: T3): CurriedFunction2; - (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; - } - interface RightCurriedFunction1 { - (): RightCurriedFunction1; - (t1: T1): R; - } - interface RightCurriedFunction2 { - (): RightCurriedFunction2; - (t2: T2): RightCurriedFunction1; - (t1: T1, t2: T2): R; - } - interface RightCurriedFunction3 { - (): RightCurriedFunction3; - (t3: T3): RightCurriedFunction2; - (t2: T2, t3: T3): RightCurriedFunction1; - (t1: T1, t2: T2, t3: T3): R; - } - interface RightCurriedFunction4 { - (): RightCurriedFunction4; - (t4: T4): RightCurriedFunction3; - (t3: T3, t4: T4): RightCurriedFunction2; - (t2: T2, t3: T3, t4: T4): RightCurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4): R; - } - interface RightCurriedFunction5 { - (): RightCurriedFunction5; - (t5: T5): RightCurriedFunction4; - (t4: T4, t5: T5): RightCurriedFunction3; - (t3: T3, t4: T4, t5: T5): RightCurriedFunction2; - (t2: T2, t3: T3, t4: T4, t5: T5): RightCurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; - } - - interface LoDashImplicitWrapper { - /** - * @see _.curry - **/ - curry(this: LoDashImplicitWrapper<(t1: T1) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curry - **/ - curry(arity?: number): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.curry - **/ - curry(this: LoDashExplicitWrapper<(t1: T1) => R>): - LoDashExplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2) => R>): - LoDashExplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>): - LoDashExplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>): - LoDashExplicitWrapper>; - - /** - * @see _.curry - **/ - curry(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>): - LoDashExplicitWrapper>; - - /** - * @see _.curry - **/ - curry(arity?: number): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.curryRight - interface LoDashStatic { - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1) => R, arity?: number): - RightCurriedFunction1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2) => R, arity?: number): - RightCurriedFunction2; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): - RightCurriedFunction3; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): - RightCurriedFunction4; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): - RightCurriedFunction5; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight(func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.curryRight - **/ - curryRight(this: LoDashImplicitWrapper<(t1: T1) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashImplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): - LoDashImplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(arity?: number): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.curryRight - **/ - curryRight(this: LoDashExplicitWrapper<(t1: T1) => R>, arity?: number): - LoDashExplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2) => R>, arity?: number): - LoDashExplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): - LoDashExplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): - LoDashExplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(this: LoDashExplicitWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): - LoDashExplicitWrapper>; - - /** - * @see _.curryRight - **/ - curryRight(arity?: number): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.debounce - interface DebounceSettings { - /** - * Specify invoking on the leading edge of the timeout. - */ - leading?: boolean; - - /** - * The maximum time func is allowed to be delayed before it’s invoked. - */ - maxWait?: number; - - /** - * Specify invoking on the trailing edge of the timeout. - */ - trailing?: boolean; - } - - interface LoDashStatic { - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - debounce any>( - func: T, - wait?: number, - options?: DebounceSettings - ): T & Cancelable; - } - - interface LoDashImplicitWrapper { - /** - * @see _.debounce - */ - debounce( - wait?: number, - options?: DebounceSettings - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.debounce - */ - debounce( - wait?: number, - options?: DebounceSettings - ): LoDashExplicitWrapper; - } - - //_.defer - interface LoDashStatic { - /** - * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to - * func when it’s invoked. - * - * @param func The function to defer. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - defer( - func: (...args: any[]) => any, - ...args: any[] - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.defer - */ - defer(...args: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.defer - */ - defer(...args: any[]): LoDashExplicitWrapper; - } - - //_.delay - interface LoDashStatic { - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - delay( - func: (...args: any[]) => any, - wait: number, - ...args: any[] - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.delay - */ - delay( - wait: number, - ...args: any[] - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.delay - */ - delay( - wait: number, - ...args: any[] - ): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @category Function - * @param func The function to flip arguments for. - * @returns Returns the new function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - flip any>(func: T): T; - } - - interface LoDashWrapper { - /** - * @see _.flip - */ - flip(): this; - } - - //_.flow - interface LoDashStatic { - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - // 0-argument first function - flow(f1: () => R1, f2: (a: R1) => R2): () => R2; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; - flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): () => any; - // 1-argument first function - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1) => any; - // 2-argument first function - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2) => any; - // 3-argument first function - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3) => any; - // 4-argument first function - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4) => any; - // any-argument first function - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any; - flow(funcs: Array any>>): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flow - */ - // 0-argument first function - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<() => R2>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<() => R3>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<() => R4>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<() => R5>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<() => R6>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<() => R7>; - flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<() => any>; - // 1-argument first function - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1) => R2>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1) => R3>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1) => R4>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1) => R5>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1) => R6>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1) => R7>; - flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1) => any>; - // 2-argument first function - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2) => R2>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2) => R3>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2) => R4>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2) => R5>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2) => R6>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2) => R7>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2) => any>; - // 3-argument first function - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => any>; - // 4-argument first function - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; - // any-argument first function - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; - flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; - flow(this: LoDashImplicitWrapper<(...args: any[]) => any>, funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flow - */ - // 0-argument first function - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<() => R2>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<() => R3>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<() => R4>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<() => R5>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<() => R6>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<() => R7>; - flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<() => any>; - // 1-argument first function - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1) => R2>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1) => R3>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1) => R4>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1) => R5>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1) => R6>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1) => R7>; - flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1) => any>; - // 2-argument first function - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2) => R2>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2) => R3>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2) => R4>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2) => R5>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2) => R6>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2) => R7>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2) => any>; - // 3-argument first function - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => any>; - // 4-argument first function - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; - // any-argument first function - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; - flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; - flow(this: LoDashExplicitWrapper<(...args: any[]) => any>, funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.flowRight - interface LoDashStatic { - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - // 0-argument first function - flowRight(f2: (a: R1) => R2, f1: () => R1): () => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R7; - // 1-argument first function - flowRight(f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R7; - // 2-argument first function - flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R7; - // 3-argument first function - flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R7; - // 4-argument first function - flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - // any-argument first function - flowRight(f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R2; - flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R3; - flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R4; - flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R5; - flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R6; - flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R7; - flowRight(f7: (a: any) => any, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): (...args: any[]) => any; - flowRight(funcs: Array any>>): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flowRight - */ - // 0-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: () => R1): LoDashImplicitWrapper<() => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R7>; - // 1-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R7>; - // 2-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R7>; - // 3-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; - // 4-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; - // any-argument first function - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R2>; - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R3>; - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R4>; - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R5>; - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R6>; - flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R7>; - flowRight(this: LoDashImplicitWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; - flowRight(this: LoDashImplicitWrapper<(a: any) => any>, funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flowRight - */ - // 0-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: () => R1): LoDashExplicitWrapper<() => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R7>; - // 1-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R7>; - // 2-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R7>; - // 3-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; - // 4-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; - // any-argument first function - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R2>; - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R3>; - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R4>; - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R5>; - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R6>; - flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R7>; - flowRight(this: LoDashExplicitWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; - flowRight(this: LoDashExplicitWrapper<(a: any) => any>, funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.memoize - interface MemoizedFunction { - cache: MapCache; - } - - interface LoDashStatic { - /** - * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for - * storing the result based on the arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with - * the this binding of the memoized function. - * - * @param func The function to have its output memoized. - * @param resolver The function to resolve the cache key. - * @return Returns the new memoizing function. - */ - memoize: { - any>(func: T, resolver?: (...args: any[]) => any): T & MemoizedFunction; - Cache: MapCacheConstructor; - }; - } - - interface LoDashImplicitWrapper { - /** - * @see _.memoize - */ - memoize(resolver?: (...args: any[]) => any): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.memoize - */ - memoize(resolver?: (...args: any[]) => any): LoDashExplicitWrapper; - } - - //_.overArgs (was _.modArgs) - interface LoDashStatic { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - overArgs( - func: (...args: any[]) => any, - ...transforms: Array any>> - ): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.overArgs - */ - overArgs(...transforms: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.overArgs - */ - overArgs(...transforms: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.negate - interface LoDashStatic { - /** - * Creates a function that negates the result of the predicate func. The func predicate is invoked with - * the this binding and arguments of the created function. - * - * @param predicate The predicate to negate. - * @return Returns the new function. - */ - negate any>(predicate: T): T; - } - - interface LoDashWrapper { - /** - * @see _.negate - */ - negate(): this; - } - - //_.once - interface LoDashStatic { - /** - * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value - * of the first call. The func is invoked with the this binding and arguments of the created function. - * - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - once any>(func: T): T; - } - - interface LoDashWrapper { - /** - * @see _.once - */ - once(): this; - } - - //_.partial - interface LoDashStatic { - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - partial: Partial; - } - - interface LoDashImplicitWrapper { - /** - * @see _.partial - */ - partial: ImplicitPartial; - } - - interface LoDashExplicitWrapper { - /** - * @see _.partial - */ - partial: ExplicitPartial; - } - - type PH = LoDashStatic; - - type Function0 = () => R; - type Function1 = (t1: T1) => R; - type Function2 = (t1: T1, t2: T2) => R; - type Function3 = (t1: T1, t2: T2, t3: T3) => R; - type Function4 = (t1: T1, t2: T2, t3: T3, t4: T4) => R; - - interface Partial { - // arity 0 - (func: Function0): Function0; - // arity 1 - (func: Function1): Function1; - (func: Function1, arg1: T1): Function0; - // arity 2 - (func: Function2): Function2; - (func: Function2, arg1: T1): Function1< T2, R>; - (func: Function2, plc1: PH, arg2: T2): Function1; - (func: Function2, arg1: T1, arg2: T2): Function0< R>; - // arity 3 - (func: Function3): Function3; - (func: Function3, arg1: T1): Function2< T2, T3, R>; - (func: Function3, plc1: PH, arg2: T2): Function2; - (func: Function3, arg1: T1, arg2: T2): Function1< T3, R>; - (func: Function3, plc1: PH, plc2: PH, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; - (func: Function3, plc1: PH, arg2: T2, arg3: T3): Function1; - (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; - // arity 4 - (func: Function4): Function4; - (func: Function4, arg1: T1): Function3< T2, T3, T4, R>; - (func: Function4, plc1: PH, arg2: T2): Function3; - (func: Function4, arg1: T1, arg2: T2): Function2< T3, T4, R>; - (func: Function4, plc1: PH, plc2: PH, arg3: T3): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>; - (func: Function4, plc1: PH, arg2: T2, arg3: T3): Function2; - (func: Function4, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>; - (func: Function4, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; - (func: Function4, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; - (func: Function4, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; - (func: Function4, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; - // catch-all - (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; - } - - interface ImplicitPartial { - // arity 0 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - // arity 1 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - // arity 2 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - // arity 3 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - // arity 4 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - // catch-all - (...args: any[]): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface ExplicitPartial { - // arity 0 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - // arity 1 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - // arity 2 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - // arity 3 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - // arity 4 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - // catch-all - (...args: any[]): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.partialRight - interface LoDashStatic { - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - partialRight: PartialRight; - } - - interface LoDashImplicitWrapper { - /** - * @see _.partialRight - */ - partialRight: ImplicitPartialRight; - } - - interface LoDashExplicitWrapper { - /** - * @see _.partialRight - */ - partialRight: ExplicitPartialRight; - } - - interface PartialRight { - // arity 0 - (func: Function0): Function0; - // arity 1 - (func: Function1): Function1; - (func: Function1, arg1: T1): Function0; - // arity 2 - (func: Function2): Function2; - (func: Function2, arg1: T1, plc2: PH): Function1< T2, R>; - (func: Function2, arg2: T2): Function1; - (func: Function2, arg1: T1, arg2: T2): Function0< R>; - // arity 3 - (func: Function3): Function3; - (func: Function3, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>; - (func: Function3, arg2: T2, plc3: PH): Function2; - (func: Function3, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>; - (func: Function3, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; - (func: Function3, arg2: T2, arg3: T3): Function1; - (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; - // arity 4 - (func: Function4): Function4; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>; - (func: Function4, arg2: T2, plc3: PH, plc4: PH): Function3; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>; - (func: Function4, arg3: T3, plc4: PH): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>; - (func: Function4, arg2: T2, arg3: T3, plc4: PH): Function2; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>; - (func: Function4, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; - (func: Function4, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; - (func: Function4, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; - (func: Function4, arg2: T2, arg3: T3, arg4: T4): Function1; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; - // catch-all - (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; - } - - interface ImplicitPartialRight { - // arity 0 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - // arity 1 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1): LoDashImplicitWrapper>; - // arity 2 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2): LoDashImplicitWrapper>; - // arity 3 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashImplicitWrapper>; - // arity 4 - (this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - (this: LoDashImplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashImplicitWrapper>; - // catch-all - (...args: any[]): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface ExplicitPartialRight { - // arity 0 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - // arity 1 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1): LoDashExplicitWrapper>; - // arity 2 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2): LoDashExplicitWrapper>; - // arity 3 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3): LoDashExplicitWrapper>; - // arity 4 - (this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - (this: LoDashExplicitWrapper>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): LoDashExplicitWrapper>; - // catch-all - (...args: any[]): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.rearg - interface LoDashStatic { - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - rearg(func: (...args: any[]) => any, ...indexes: Array>): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.rearg - */ - rearg(...indexes: Array>): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.rearg - */ - rearg(...indexes: Array>): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.rest - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - rest( - func: (...args: any[]) => any, - start?: number - ): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.rest - */ - rest(start?: number): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.rest - */ - rest(start?: number): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.spread - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - spread(func: (...args: any[]) => TResult): (...args: any[]) => TResult; - - /** - * @see _.spread - */ - spread(func: (...args: any[]) => TResult, start: number): (...args: any[]) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.spread - */ - spread(this: LoDashImplicitWrapper<(...args: any[]) => TResult>): LoDashImplicitWrapper<(...args: any[]) => TResult>; - - /** - * @see _.spread - */ - spread(this: LoDashImplicitWrapper<(...args: any[]) => TResult>, start: number): LoDashImplicitWrapper<(...args: any[]) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.spread - */ - spread(this: LoDashExplicitWrapper<(...args: any[]) => TResult>): LoDashExplicitWrapper<(...args: any[]) => TResult>; - - /** - * @see _.spread - */ - spread(this: LoDashExplicitWrapper<(...args: any[]) => TResult>, start: number): LoDashExplicitWrapper<(...args: any[]) => TResult>; - } - - //_.throttle - interface ThrottleSettings { - /** - * If you'd like to disable the leading-edge call, pass this as false. - */ - leading?: boolean; - - /** - * If you'd like to disable the execution on the trailing-edge, pass false. - */ - trailing?: boolean; - } - - interface LoDashStatic { - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - throttle any>( - func: T, - wait?: number, - options?: ThrottleSettings - ): T & Cancelable; - } - - interface LoDashImplicitWrapper { - /** - * @see _.throttle - */ - throttle( - wait?: number, - options?: ThrottleSettings - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.throttle - */ - throttle( - wait?: number, - options?: ThrottleSettings - ): LoDashExplicitWrapper; - } - - //_.unary - interface LoDashStatic { - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @category Function - * @param func The function to cap arguments for. - * @returns Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - unary(func: (arg1: T, ...args: any[]) => TResult): (arg1: T) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unary - */ - unary(this: LoDashImplicitWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashImplicitWrapper<(arg1: T) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unary - */ - unary(this: LoDashExplicitWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashExplicitWrapper<(arg1: T) => TResult>; - } - - //_.wrap - interface LoDashStatic { - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - wrap( - value: T, - wrapper: (value: T, ...args: TArgs[]) => TResult - ): (...args: TArgs[]) => TResult; - - /** - * @see _.wrap - */ - wrap( - value: T, - wrapper: (value: T, ...args: any[]) => TResult - ): (...args: any[]) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.wrap - */ - wrap( - wrapper: (value: TValue, ...args: TArgs[]) => TResult - ): LoDashImplicitWrapper<(...args: TArgs[]) => TResult>; - - /** - * @see _.wrap - */ - wrap( - wrapper: (value: TValue, ...args: any[]) => TResult - ): LoDashImplicitWrapper<(...args: any[]) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.wrap - */ - /** - * @see _.wrap - */ - wrap( - wrapper: (value: TValue, ...args: TArgs[]) => TResult - ): LoDashExplicitWrapper<(...args: TArgs[]) => TResult>; - - /** - * @see _.wrap - */ - wrap( - wrapper: (value: TValue, ...args: any[]) => TResult - ): LoDashExplicitWrapper<(...args: any[]) => TResult>; - } - - /******** - * Lang * - ********/ - - //_.castArray - interface LoDashStatic { - /** - * Casts value as an array if it’s not one. - * - * @param value The value to inspect. - * @return Returns the cast array. - */ - castArray(value?: Many): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.castArray - */ - castArray(this: LoDashImplicitWrapper>): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.castArray - */ - castArray(this: LoDashExplicitWrapper>): LoDashExplicitWrapper; - } - - //_.clone - interface LoDashStatic { - /** - * Creates a shallow clone of value. - * - * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, - * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, - * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty - * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps. - * - * @param value The value to clone. - * @return Returns the cloned value. - */ - clone(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.clone - */ - clone(): TValue; - } - - interface LoDashExplicitWrapper { - /** - * @see _.clone - */ - clone(): this; - } - - //_.cloneDeep - interface LoDashStatic { - /** - * This method is like _.clone except that it recursively clones value. - * - * @param value The value to recursively clone. - * @return Returns the deep cloned value. - */ - cloneDeep(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): TValue; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): this; - } - - //_.cloneDeepWith - type CloneDeepWithCustomizer = (value: any, key: number | string | undefined, object: TObject | undefined, stack: any) => any; - - interface LoDashStatic { - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - cloneDeepWith( - value: T, - customizer: CloneDeepWithCustomizer - ): any; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer: CloneDeepWithCustomizer - ): any; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith(): TValue; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer: CloneDeepWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith(): this; - } - - //_.cloneWith - type CloneWithCustomizer = (value: TValue, key: number | string | undefined, object: any, stack: any) => TResult; - - interface LoDashStatic { - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - cloneWith( - value: T, - customizer: CloneWithCustomizer - ): TResult; - - /** - * @see _.cloneWith - */ - cloneWith( - value: T, - customizer: CloneWithCustomizer - ): TResult | T; - - /** - * @see _.cloneWith - */ - cloneWith(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer: CloneWithCustomizer - ): TResult; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer: CloneWithCustomizer - ): TResult | TValue; - - /** - * @see _.cloneWith - */ - cloneWith(): TValue; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer: CloneWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer: CloneWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneWith - */ - cloneWith(): this; - } - - /** - * An object containing predicate functions for each property of T - */ - type ConformsPredicateObject = { - [P in keyof T]?: (val: T[P]) => boolean; - }; - - //_.conforms - interface LoDashStatic { - /** - * Creates a function that invokes the predicate properties of `source` with the corresponding - * property values of a given object, returning true if all predicates return truthy, else false. - */ - conforms(source: ConformsPredicateObject): (value: T) => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.conforms - */ - conforms(this: LoDashImplicitWrapper>): LoDashImplicitWrapper<(value: T) => boolean>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.conforms - */ - conforms(this: LoDashExplicitWrapper>): LoDashExplicitWrapper<(value: T) => boolean>; - } - - //_.conformsTo - interface LoDashStatic { - /** - * Checks if object conforms to source by invoking the predicate properties of source with the - * corresponding property values of object. - * - * Note: This method is equivalent to _.conforms when source is partially applied. - */ - conformsTo(object: T, source: ConformsPredicateObject): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.conformsTo - */ - conformsTo(this: LoDashImplicitWrapper, source: ConformsPredicateObject): boolean; - // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. - } - - interface LoDashExplicitWrapper { - /** - * @see _.conformsTo - */ - conformsTo(this: LoDashImplicitWrapper, source: ConformsPredicateObject): LoDashExplicitWrapper; - // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. - } - - type CondPair = [(val: T) => boolean, (val: T) => R] - - //_.cond - interface LoDashStatic { - /** - * Creates a function that iterates over `pairs` and invokes the corresponding - * function of the first predicate to return truthy. The predicate-function - * pairs are invoked with the `this` binding and arguments of the created - * function. - * - * @since 4.0.0 - * @category Util - * @param pairs The predicate-function pairs. - * @returns Returns the new composite function. - * @example - * - * var func = _.cond([ - * [_.matches({ 'a': 1 }), _.constant('matches A')], - * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], - * [_.stubTrue, _.constant('no match')] - * ]); - * - * func({ 'a': 1, 'b': 2 }); - * // => 'matches A' - * - * func({ 'a': 0, 'b': 1 }); - * // => 'matches B' - * - * func({ 'a': '1', 'b': '2' }); - * // => 'no match' - */ - cond(pairs: Array>): (Target: T) => R; - } - - //_.eq - interface LoDashStatic { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - eq( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.eq - */ - eq( - other: any - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.eq - */ - eq( - other: any - ): LoDashExplicitWrapper; - } - - //_.gt - interface LoDashStatic { - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - gt( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.gt - */ - gt(other: any): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.gt - */ - gt(other: any): LoDashExplicitWrapper; - } - - //_.gte - interface LoDashStatic { - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - gte( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.gte - */ - gte(other: any): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.gte - */ - gte(other: any): LoDashExplicitWrapper; - } - - //_.isArguments - interface LoDashStatic { - /** - * Checks if value is classified as an arguments object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isArguments(value?: any): value is IArguments; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isArguments - */ - isArguments(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isArguments - */ - isArguments(): LoDashExplicitWrapper; - } - - //_.isArray - interface LoDashStatic { - /** - * Checks if value is classified as an Array object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isArray(value?: any): value is any[]; - - /** - * DEPRECATED - */ - isArray(value?: any): value is any[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isArray - */ - isArray(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isArray - */ - isArray(): LoDashExplicitWrapper; - } - - //_.isArrayBuffer - interface LoDashStatic { - /** - * Checks if value is classified as an ArrayBuffer object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isArrayBuffer(value?: any): value is ArrayBuffer; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isArrayBuffer - */ - isArrayBuffer(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isArrayBuffer - */ - isArrayBuffer(): LoDashExplicitWrapper; - } - - //_.isArrayLike - interface LoDashStatic { - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - isArrayLike(value: T & string & number): boolean; // should only match if T = any - - /** - * @see _.isArrayLike - */ - isArrayLike(value: ((...args: any[]) => any) | null | undefined): value is never; - - /** - * @see _.isArrayLike - */ - isArrayLike(value: any): value is { length: number }; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isArrayLike - */ - isArrayLike(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isArrayLike - */ - isArrayLike(): LoDashExplicitWrapper; - } - - //_.isArrayLikeObject - interface LoDashStatic { - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - isArrayLikeObject(value: T & string & number): boolean; // should only match if T = any - - /** - * @see _.isArrayLike - */ - // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) - isArrayLikeObject(value: ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is never; - - /** - * @see _.isArrayLike - */ - // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) - isArrayLikeObject(value: T | ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is T & { length: number }; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isArrayLikeObject - */ - isArrayLikeObject(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isArrayLikeObject - */ - isArrayLikeObject(): LoDashExplicitWrapper; - } - - //_.isBoolean - interface LoDashStatic { - /** - * Checks if value is classified as a boolean primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isBoolean(value?: any): value is boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isBoolean - */ - isBoolean(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isBoolean - */ - isBoolean(): LoDashExplicitWrapper; - } - - //_.isBuffer - interface LoDashStatic { - /** - * Checks if value is a buffer. - * - * @param value The value to check. - * @return Returns true if value is a buffer, else false. - */ - isBuffer(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isBuffer - */ - isBuffer(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isBuffer - */ - isBuffer(): LoDashExplicitWrapper; - } - - //_.isDate - interface LoDashStatic { - /** - * Checks if value is classified as a Date object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isDate(value?: any): value is Date; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isDate - */ - isDate(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isDate - */ - isDate(): LoDashExplicitWrapper; - } - - //_.isElement - interface LoDashStatic { - /** - * Checks if value is a DOM element. - * - * @param value The value to check. - * @return Returns true if value is a DOM element, else false. - */ - isElement(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isElement - */ - isElement(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isElement - */ - isElement(): LoDashExplicitWrapper; - } - - //_.isEmpty - interface LoDashStatic { - /** - * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or - * jQuery-like collection with a length greater than 0 or an object with own enumerable properties. - * - * @param value The value to inspect. - * @return Returns true if value is empty, else false. - */ - isEmpty(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isEmpty - */ - isEmpty(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isEmpty - */ - isEmpty(): LoDashExplicitWrapper; - } - - //_.isEqual - interface LoDashStatic { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - isEqual( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isEqual - */ - isEqual( - other: any - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isEqual - */ - isEqual( - other: any - ): LoDashExplicitWrapper; - } - - // _.isEqualWith - type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyName | undefined, parent: any, otherParent: any, stack: any) => boolean|undefined; - - interface LoDashStatic { - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @category Lang - * @param value The value to compare. - * @param other The other value to compare. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - isEqualWith( - value: any, - other: any, - customizer?: IsEqualCustomizer - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isEqualWith - */ - isEqualWith( - other: any, - customizer?: IsEqualCustomizer - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isEqualWith - */ - isEqualWith( - other: any, - customizer?: IsEqualCustomizer - ): LoDashExplicitWrapper; - } - - //_.isError - interface LoDashStatic { - /** - * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError - * object. - * - * @param value The value to check. - * @return Returns true if value is an error object, else false. - */ - isError(value: any): value is Error; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isError - */ - isError(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isError - */ - isError(): LoDashExplicitWrapper; - } - - //_.isFinite - interface LoDashStatic { - /** - * Checks if value is a finite primitive number. - * - * Note: This method is based on Number.isFinite. - * - * @param value The value to check. - * @return Returns true if value is a finite number, else false. - */ - isFinite(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isFinite - */ - isFinite(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isFinite - */ - isFinite(): LoDashExplicitWrapper; - } - - //_.isFunction - interface LoDashStatic { - /** - * Checks if value is a callable function. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isFunction(value: any): value is (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isFunction - */ - isFunction(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isFunction - */ - isFunction(): LoDashExplicitWrapper; - } - - //_.isInteger - interface LoDashStatic { - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - isInteger(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isInteger - */ - isInteger(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isInteger - */ - isInteger(): LoDashExplicitWrapper; - } - - //_.isLength - interface LoDashStatic { - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - isLength(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isLength - */ - isLength(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isLength - */ - isLength(): LoDashExplicitWrapper; - } - - //_.isMap - interface LoDashStatic { - /** - * Checks if value is classified as a Map object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isMap(value?: any): value is Map; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isMap - */ - isMap(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isMap - */ - isMap(): LoDashExplicitWrapper; - } - - //_.isMatch - type isMatchCustomizer = (value: any, other: any, indexOrKey?: PropertyName) => boolean; - - interface LoDashStatic { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - isMatch(object: object, source: object): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isMatch - */ - isMatch(source: object): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isMatch - */ - isMatch(source: object): LoDashExplicitWrapper; - } - - //_.isMatchWith - type isMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyName) => boolean; - - interface LoDashStatic { - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @category Lang - * @param object The object to inspect. - * @param source The object of property values to match. - * @param [customizer] The function to customize comparisons. - * @returns Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - isMatchWith(object: object, source: object, customizer: isMatchWithCustomizer): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isMatchWith - */ - isMatchWith(source: object, customizer: isMatchWithCustomizer): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isMatchWith - */ - isMatchWith(source: object, customizer: isMatchWithCustomizer): LoDashExplicitWrapper; - } - - //_.isNaN - interface LoDashStatic { - /** - * Checks if value is NaN. - * - * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. - * - * @param value The value to check. - * @return Returns true if value is NaN, else false. - */ - isNaN(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isNaN - */ - isNaN(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isNaN - */ - isNaN(): LoDashExplicitWrapper; - } - - //_.isNative - interface LoDashStatic { - /** - * Checks if value is a native function. - * @param value The value to check. - * - * @retrun Returns true if value is a native function, else false. - */ - isNative(value: any): value is (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * see _.isNative - */ - isNative(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isNative - */ - isNative(): LoDashExplicitWrapper; - } - - //_.isNil - interface LoDashStatic { - /** - * Checks if `value` is `null` or `undefined`. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - isNil(value: any): value is null | undefined; - } - - interface LoDashImplicitWrapper { - /** - * see _.isNil - */ - isNil(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isNil - */ - isNil(): LoDashExplicitWrapper; - } - - //_.isNull - interface LoDashStatic { - /** - * Checks if value is null. - * - * @param value The value to check. - * @return Returns true if value is null, else false. - */ - isNull(value: any): value is null; - } - - interface LoDashImplicitWrapper { - /** - * see _.isNull - */ - isNull(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isNull - */ - isNull(): LoDashExplicitWrapper; - } - - //_.isNumber - interface LoDashStatic { - /** - * Checks if value is classified as a Number primitive or object. - * - * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isNumber(value?: any): value is number; - } - - interface LoDashImplicitWrapper { - /** - * see _.isNumber - */ - isNumber(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isNumber - */ - isNumber(): LoDashExplicitWrapper; - } - - //_.isObject - interface LoDashStatic { - /** - * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), - * and new String('')) - * - * @param value The value to check. - * @return Returns true if value is an object, else false. - */ - isObject(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isObject - */ - isObject(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isObject - */ - isObject(): LoDashExplicitWrapper; - } - - //_.isObjectLike - interface LoDashStatic { - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - isObjectLike(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isObjectLike - */ - isObjectLike(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isObjectLike - */ - isObjectLike(): LoDashExplicitWrapper; - } - - //_.isPlainObject - interface LoDashStatic { - /** - * Checks if value is a plain object, that is, an object created by the Object constructor or one with a - * [[Prototype]] of null. - * - * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties. - * - * @param value The value to check. - * @return Returns true if value is a plain object, else false. - */ - isPlainObject(value?: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isPlainObject - */ - isPlainObject(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isPlainObject - */ - isPlainObject(): LoDashExplicitWrapper; - } - - //_.isRegExp - interface LoDashStatic { - /** - * Checks if value is classified as a RegExp object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isRegExp(value?: any): value is RegExp; - } - - interface LoDashImplicitWrapper { - /** - * see _.isRegExp - */ - isRegExp(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isRegExp - */ - isRegExp(): LoDashExplicitWrapper; - } - - //_.isSafeInteger - interface LoDashStatic { - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - isSafeInteger(value: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isSafeInteger - */ - isSafeInteger(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isSafeInteger - */ - isSafeInteger(): LoDashExplicitWrapper; - } - - //_.isSet - interface LoDashStatic { - /** - * Checks if value is classified as a Set object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isSet(value?: any): value is Set; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isSet - */ - isSet(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isSet - */ - isSet(): LoDashExplicitWrapper; - } - - //_.isString - interface LoDashStatic { - /** - * Checks if value is classified as a String primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isString(value?: any): value is string; - } - - interface LoDashImplicitWrapper { - /** - * see _.isString - */ - isString(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isString - */ - isString(): LoDashExplicitWrapper; - } - - //_.isSymbol - interface LoDashStatic { - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @category Lang - * @param value The value to check. - * @returns Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - isSymbol(value: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isSymbol - */ - isSymbol(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isSymbol - */ - isSymbol(): LoDashExplicitWrapper; - } - - //_.isTypedArray - interface LoDashStatic { - /** - * Checks if value is classified as a typed array. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isTypedArray(value: any): boolean; - } - - interface LoDashImplicitWrapper { - /** - * see _.isTypedArray - */ - isTypedArray(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isTypedArray - */ - isTypedArray(): LoDashExplicitWrapper; - } - - //_.isUndefined - interface LoDashStatic { - /** - * Checks if value is undefined. - * - * @param value The value to check. - * @return Returns true if value is undefined, else false. - */ - isUndefined(value: any): value is undefined; - } - - interface LoDashImplicitWrapper { - /** - * see _.isUndefined - */ - isUndefined(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * see _.isUndefined - */ - isUndefined(): LoDashExplicitWrapper; - } - - //_.isWeakMap - interface LoDashStatic { - /** - * Checks if value is classified as a WeakMap object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isWeakMap(value?: any): value is WeakMap; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isSet - */ - isWeakMap(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isSet - */ - isWeakMap(): LoDashExplicitWrapper; - } - - //_.isWeakSet - interface LoDashStatic { - /** - * Checks if value is classified as a WeakSet object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isWeakSet(value?: any): value is WeakSet; - } - - interface LoDashImplicitWrapper { - /** - * @see _.isWeakSet - */ - isWeakSet(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.isWeakSet - */ - isWeakSet(): LoDashExplicitWrapper; - } - - //_.lt - interface LoDashStatic { - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - lt( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lt - */ - lt(other: any): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lt - */ - lt(other: any): LoDashExplicitWrapper; - } - - //_.lte - interface LoDashStatic { - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - lte( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lte - */ - lte(other: any): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lte - */ - lte(other: any): LoDashExplicitWrapper; - } - - //_.toArray - interface LoDashStatic { - /** - * Converts value to an array. - * - * @param value The value to convert. - * @return Returns the converted array. - */ - toArray(value: List | Dictionary | NumericDictionary | null | undefined): T[]; - - /** - * @see _.toArray - */ - toArray(value: T): Array; - - /** - * @see _.toArray - */ - toArray(): any[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toArray - */ - toArray(this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.toArray - */ - toArray(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toArray - */ - toArray(this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.toArray - */ - toArray(this: LoDashImplicitWrapper): LoDashExplicitWrapper>; - } - - //_.toPlainObject - interface LoDashStatic { - /** - * Converts value to a plain object flattening inherited enumerable properties of value to own properties - * of the plain object. - * - * @param value The value to convert. - * @return Returns the converted plain object. - */ - toPlainObject(value?: any): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPlainObject - */ - toPlainObject(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPlainObject - */ - toPlainObject(): LoDashExplicitWrapper; - } - - //_.toFinite - interface LoDashStatic { - /** - * Converts `value` to a finite number. - * - * @since 4.12.0 - * @category Lang - * @param value The value to convert. - * @returns Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - toFinite(value: any): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toFinite - */ - toFinite(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toFinite - */ - toFinite(): LoDashExplicitWrapper; - } - - //_.toInteger - interface LoDashStatic { - /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @category Lang - * @param value The value to convert. - * @returns Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 - */ - toInteger(value: any): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toInteger - */ - toInteger(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toInteger - */ - toInteger(): LoDashExplicitWrapper; - } - - //_.toLength - interface LoDashStatic { - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @category Lang - * @param value The value to convert. - * @return Returns the converted integer. - * @example - * - * _.toLength(3); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3'); - * // => 3 - */ - toLength(value: any): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toLength - */ - toLength(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toLength - */ - toLength(): LoDashExplicitWrapper; - } - - //_.toNumber - interface LoDashStatic { - /** - * Converts `value` to a number. - * - * @category Lang - * @param value The value to process. - * @returns Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 - */ - toNumber(value: any): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toNumber - */ - toNumber(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toNumber - */ - toNumber(): LoDashExplicitWrapper; - } - - //_.toSafeInteger - interface LoDashStatic { - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @category Lang - * @param value The value to convert. - * @returns Returns the converted integer. - * @example - * - * _.toSafeInteger(3); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3'); - * // => 3 - */ - toSafeInteger(value: any): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toSafeInteger - */ - toSafeInteger(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toSafeInteger - */ - toSafeInteger(): LoDashExplicitWrapper; - } - - //_.toString - interface LoDashStatic { - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @category Lang - * @param value The value to process. - * @returns Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - toString(value: any): string; - } - - /******** - * Math * - ********/ - - //_.add - interface LoDashStatic { - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - add( - augend: number, - addend: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.add - */ - add(addend: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.add - */ - add(addend: number): LoDashExplicitWrapper; - } - - //_.ceil - interface LoDashStatic { - /** - * Calculates n rounded up to precision. - * - * @param n The number to round up. - * @param precision The precision to round up to. - * @return Returns the rounded up number. - */ - ceil( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.ceil - */ - ceil(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.ceil - */ - ceil(precision?: number): LoDashExplicitWrapper; - } - - //_.divide - interface LoDashStatic { - /** - * Divide two numbers. - * - * @param dividend The first number in a division. - * @param divisor The second number in a division. - * @returns Returns the quotient. - */ - divide( - dividend: number, - divisor: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.divide - */ - divide(divisor: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.divide - */ - divide(divisor: number): LoDashExplicitWrapper; - } - - //_.floor - interface LoDashStatic { - /** - * Calculates n rounded down to precision. - * - * @param n The number to round down. - * @param precision The precision to round down to. - * @return Returns the rounded down number. - */ - floor( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.floor - */ - floor(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.floor - */ - floor(precision?: number): LoDashExplicitWrapper; - } - - //_.max - interface LoDashStatic { - /** - * Computes the maximum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the maximum value. - */ - max( - collection: List | null | undefined - ): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.max - */ - max(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.max - */ - max(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.maxBy - interface LoDashStatic { - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - maxBy( - collection: List | null | undefined, - iteratee?: ListIteratee - ): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.maxBy - */ - maxBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.maxBy - */ - maxBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.mean - interface LoDashStatic { - /** - * Computes the mean of the values in `array`. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the mean. - * @example - * - * _.mean([4, 2, 8, 6]); - * // => 5 - */ - mean( - collection: List | null | undefined - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.mean - */ - mean(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.mean - */ - mean(): LoDashExplicitWrapper; - } - - //_.meanBy - interface LoDashStatic { - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - meanBy( - collection: List | null | undefined, - iteratee?: ListIteratee - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.meanBy - */ - meanBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.meanBy - */ - meanBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.min - interface LoDashStatic { - /** - * Computes the minimum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the minimum value. - */ - min( - collection: List | null | undefined - ): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.min - */ - min(this: LoDashImplicitWrapper | null | undefined>): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.min - */ - min(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; - } - - //_.minBy - interface LoDashStatic { - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - minBy( - collection: List | null | undefined, - iteratee?: ListIteratee - ): T | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.minBy - */ - minBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): T | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.minBy - */ - minBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper; - } - - //_.multiply - interface LoDashStatic { - /** - * Multiply two numbers. - * @param multiplier The first number in a multiplication. - * @param multiplicand The second number in a multiplication. - * @returns Returns the product. - */ - multiply( - multiplier: number, - multiplicand: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.multiply - */ - multiply(multiplicand: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.multiply - */ - multiply(multiplicand: number): LoDashExplicitWrapper; - } - - //_.round - interface LoDashStatic { - /** - * Calculates n rounded to precision. - * - * @param n The number to round. - * @param precision The precision to round to. - * @return Returns the rounded number. - */ - round( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.round - */ - round(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.round - */ - round(precision?: number): LoDashExplicitWrapper; - } - - //_.sum - interface LoDashStatic { - /** - * Computes the sum of the values in `array`. - * - * @category Math - * @param array The array to iterate over. - * @returns Returns the sum. - * @example - * - * _.sum([4, 2, 8, 6]); - * // => 20 - */ - sum(collection: List | null | undefined): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sum - */ - sum(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sum - */ - sum(): LoDashExplicitWrapper; - } - - //_.sumBy - interface LoDashStatic { - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @category Math - * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. - * @returns Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - sumBy( - collection: List | null | undefined, - iteratee?: ((value: T) => number) | string - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sumBy - */ - sumBy( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ((value: T) => number) | string - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sumBy - */ - sumBy( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ((value: T) => number) | string - ): LoDashExplicitWrapper; - } - - /********** - * Number * - **********/ - - //_.subtract - interface LoDashStatic { - /** - * Subtract two numbers. - * - * @category Math - * @param minuend The first number in a subtraction. - * @param subtrahend The second number in a subtraction. - * @returns Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - subtract( - minuend: number, - subtrahend: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.subtract - */ - subtract( - subtrahend: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.subtract - */ - subtract( - subtrahend: number - ): LoDashExplicitWrapper; - } - - //_.clamp - interface LoDashStatic { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @category Number - * @param number The number to clamp. - * @param [lower] The lower bound. - * @param upper The upper bound. - * @returns Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - clamp( - number: number, - lower: number, - upper: number - ): number; - clamp( - number: number, - upper: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.clamp - */ - clamp( - lower: number, - upper: number - ): number; - clamp( - upper: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.clamp - */ - clamp( - lower: number, - upper: number - ): LoDashExplicitWrapper; - clamp( - upper: number - ): LoDashExplicitWrapper; - } - - //_.inRange - interface LoDashStatic { - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - inRange( - n: number, - start: number, - end?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.inRange - */ - inRange( - start: number, - end?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.inRange - */ - inRange( - start: number, - end?: number - ): LoDashExplicitWrapper; - } - - //_.random - interface LoDashStatic { - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - random( - floating?: boolean - ): number; - - /** - * @see _.random - */ - random( - max: number, - floating?: boolean - ): number; - - /** - * @see _.random - */ - random( - min: number, - max: number, - floating?: boolean - ): number; - - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the random number. - */ - random( - min: number, - index: string | number, - guard: object - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.random - */ - random(floating?: boolean): number; - - /** - * @see _.random - */ - random( - max: number, - floating?: boolean - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.random - */ - random(floating?: boolean): LoDashExplicitWrapper; - - /** - * @see _.random - */ - random( - max: number, - floating?: boolean - ): LoDashExplicitWrapper; - } - - /********** - * Object * - **********/ - - //_.assign - interface LoDashStatic { - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - assign( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assign - */ - assign(object: TObject): TObject; - - /** - * @see _.assign - */ - assign( - object: any, - ...otherArgs: any[] - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assign - */ - assign( - source: TSource - ): LoDashImplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitWrapper; - - /** - * @see _.assign - */ - assign(): LoDashImplicitWrapper; - - /** - * @see _.assign - */ - assign(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assign - */ - assign( - source: TSource - ): LoDashExplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitWrapper; - - /** - * @see _.assign - */ - assign(): LoDashExplicitWrapper; - - /** - * @see _.assign - */ - assign(...otherArgs: any[]): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - assignWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TObject & TSource; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignWith - */ - assignWith(object: TObject): TObject; - - /** - * @see _.assignWith - */ - assignWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assignWith - */ - assignWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignWith - */ - assignWith(): LoDashImplicitWrapper; - - /** - * @see _.assignWith - */ - assignWith(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assignWith - */ - assignWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignWith - */ - assignWith(): LoDashExplicitWrapper; - - /** - * @see _.assignWith - */ - assignWith(...otherArgs: any[]): LoDashExplicitWrapper; - } - - //_.assignIn - interface LoDashStatic { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @alias extend - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - assignIn( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignIn - */ - assignIn(object: TObject): TObject; - - /** - * @see _.assignIn - */ - assignIn( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assignIn - */ - assignIn( - source: TSource - ): LoDashImplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - assignIn(): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - assignIn(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assignIn - */ - assignIn( - source: TSource - ): LoDashExplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - assignIn(): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - assignIn(...otherArgs: any[]): LoDashExplicitWrapper; - } - - //_.assignInWith - type AssignCustomizer = (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; - - interface LoDashStatic { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @alias extendWith - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - assignInWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TObject & TSource; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignInWith - */ - assignInWith(object: TObject): TObject; - - /** - * @see _.assignInWith - */ - assignInWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assignInWith - */ - assignInWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assignInWith - */ - assignInWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(...otherArgs: any[]): LoDashExplicitWrapper; - } - - //_.create - interface LoDashStatic { - /** - * Creates an object that inherits from the given prototype object. If a properties object is provided its own - * enumerable properties are assigned to the created object. - * - * @param prototype The object to inherit from. - * @param properties The properties to assign to the object. - * @return Returns the new object. - */ - create( - prototype: T, - properties?: U - ): T & U; - } - - interface LoDashImplicitWrapper { - /** - * @see _.create - */ - create(properties?: U): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.create - */ - create(properties?: U): LoDashExplicitWrapper; - } - - //_.defaults - interface LoDashStatic { - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - defaults( - object: TObject, - source: TSource - ): TSource & TObject; - - /** - * @see _.defaults - */ - defaults( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TSource2 & TSource1 & TObject; - - /** - * @see _.defaults - */ - defaults( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TSource3 & TSource2 & TSource1 & TObject; - - /** - * @see _.defaults - */ - defaults( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TSource4 & TSource3 & TSource2 & TSource1 & TObject; - - /** - * @see _.defaults - */ - defaults(object: TObject): TObject; - - /** - * @see _.defaults - */ - defaults( - object: any, - ...sources: any[] - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.defaults - */ - defaults( - source: TSource - ): LoDashImplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitWrapper; - - /** - * @see _.defaults - */ - defaults(): LoDashImplicitWrapper; - - /** - * @see _.defaults - */ - defaults(...sources: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.defaults - */ - defaults( - source: TSource - ): LoDashExplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitWrapper; - - /** - * @see _.defaults - */ - defaults(): LoDashExplicitWrapper; - - /** - * @see _.defaults - */ - defaults(...sources: any[]): LoDashExplicitWrapper; - } - - //_.defaultsDeep - interface LoDashStatic { - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - defaultsDeep( - object: any, - ...sources: any[]): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.defaultsDeep - **/ - defaultsDeep(...sources: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.defaultsDeep - **/ - defaultsDeep(...sources: any[]): LoDashExplicitWrapper; - } - - //_.entries - interface LoDashStatic { - /** - * @see _.toPairs - */ - entries(object?: Dictionary): Array<[string, T]>; - - /** - * @see _.toPairs - */ - entries(object?: object): Array<[string, any]>; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPairs - */ - entries(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - - /** - * @see _.toPairs - */ - entries(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPairs - */ - entries(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - - /** - * @see _.toPairs - */ - entries(): LoDashExplicitWrapper>; - } - - //_.entriesIn - interface LoDashStatic { - /** - * @see _.toPairsIn - */ - entriesIn(object?: Dictionary): Array<[string, T]>; - - /** - * @see _.toPairsIn - */ - entriesIn(object?: object): Array<[string, any]>; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPairsIn - */ - entriesIn(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - - /** - * @see _.toPairsIn - */ - entriesIn(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPairsIn - */ - entriesIn(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - - /** - * @see _.toPairsIn - */ - entriesIn(): LoDashExplicitWrapper>; - } - - // _.extend - interface LoDashStatic { - /** - * @see _.assignIn - */ - extend( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see _.assignIn - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see _.assignIn - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.assignIn - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignIn - */ - extend(object: TObject): TObject; - - /** - * @see _.assignIn - */ - extend( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assignIn - */ - extend( - source: TSource - ): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - extend(): LoDashImplicitWrapper; - - /** - * @see _.assignIn - */ - extend(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assignIn - */ - extend( - source: TSource - ): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - extend(): LoDashExplicitWrapper; - - /** - * @see _.assignIn - */ - extend(...otherArgs: any[]): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TObject & TSource; - - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignInWith - */ - extendWith(object: TObject): TObject; - - /** - * @see _.assignInWith - */ - extendWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.assignInWith - */ - extendWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith(): LoDashImplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith(...otherArgs: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.assignInWith - */ - extendWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith(): LoDashExplicitWrapper; - - /** - * @see _.assignInWith - */ - extendWith(...otherArgs: any[]): LoDashExplicitWrapper; - } - - //_.findKey - interface LoDashStatic { - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - findKey( - object: T | null | undefined, - predicate?: ObjectIteratee - ): string | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.findKey - */ - findKey( - this: LoDashImplicitWrapper, - predicate?: ObjectIteratee - ): string | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.findKey - */ - findKey( - this: LoDashExplicitWrapper, - predicate?: ObjectIteratee - ): LoDashExplicitWrapper; - } - - //_.findLastKey - interface LoDashStatic { - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - findLastKey( - object: T | null | undefined, - predicate?: ObjectIteratee - ): string | undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.findLastKey - */ - findLastKey( - this: LoDashImplicitWrapper, - predicate?: ObjectIteratee - ): string | undefined; - } - - interface LoDashExplicitWrapper { - /** - * @see _.findLastKey - */ - findLastKey( - this: LoDashExplicitWrapper, - predicate?: ObjectIteratee - ): LoDashExplicitWrapper; - } - - //_.forIn - interface LoDashStatic { - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forIn( - object: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forIn - */ - forIn( - object: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forIn - */ - forIn( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.forInRight - interface LoDashStatic { - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forInRight( - object: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forInRight - */ - forInRight( - object: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forInRight - */ - forInRight( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.forOwn - interface LoDashStatic { - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forOwn( - object: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forOwn - */ - forOwn( - object: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forOwn - */ - forOwn( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.forOwnRight - interface LoDashStatic { - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forOwnRight( - object: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forOwnRight - */ - forOwnRight( - object: T | null | undefined, - iteratee?: ObjectIterator - ): T | null | undefined; - } - - interface LoDashWrapper { - /** - * @see _.forOwnRight - */ - forOwnRight( - this: LoDashWrapper, - iteratee?: ObjectIterator - ): this; - } - - //_.functions - interface LoDashStatic { - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @category Object - * @param object The object to inspect. - * @returns Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - functions(object: any): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.functions - */ - functions(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.functions - */ - functions(): LoDashExplicitWrapper; - } - - //_.functionsIn - interface LoDashStatic { - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @category Object - * @param object The object to inspect. - * @returns Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - functionsIn(object: any): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.functionsIn - */ - functionsIn(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.functionsIn - */ - functionsIn(): LoDashExplicitWrapper; - } - - //_.get - interface LoDashStatic { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - get( - object: TObject, - path: TKey | [TKey] - ): TObject[TKey]; - - /** - * @see _.get - */ - get( - object: TObject | null | undefined, - path: TKey | [TKey] - ): TObject[TKey] | undefined; - - /** - * @see _.get - */ - get( - object: TObject | null | undefined, - path: TKey | [TKey], - defaultValue: TDefault - ): TObject[TKey] | TDefault; - - /** - * @see _.get - */ - get( - object: NumericDictionary, - path: number - ): T; - - /** - * @see _.get - */ - get( - object: NumericDictionary | null | undefined, - path: number - ): T | undefined; - - /** - * @see _.get - */ - get( - object: NumericDictionary | null | undefined, - path: number, - defaultValue: TDefault - ): T | TDefault; - - /** - * @see _.get - */ - get( - object: null | undefined, - path: PropertyPath, - defaultValue: TDefault - ): TDefault; - - /** - * @see _.get - */ - get( - object: null | undefined, - path: PropertyPath - ): undefined; - - /** - * @see _.get - */ - get( - object: any, - path: PropertyPath, - defaultValue?: any - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.get - */ - get( - path: TKey | [TKey] - ): TValue[TKey]; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper, - path: TKey | [TKey], - ): TObject[TKey] | undefined; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper, - path: TKey | [TKey], - defaultValue: TDefault - ): TObject[TKey] | TDefault; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper>, - path: number - ): T; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper | null | undefined>, - path: number - ): T | undefined; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper | null | undefined>, - path: number, - defaultValue: TDefault - ): T | TDefault; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper, - path: PropertyPath, - defaultValue: TDefault - ): TDefault; - - /** - * @see _.get - */ - get( - this: LoDashImplicitWrapper, - path: PropertyPath - ): undefined; - - /** - * @see _.get - */ - get( - path: PropertyPath, - defaultValue?: any - ): any; - } - - interface LoDashExplicitWrapper { - /** - * @see _.get - */ - get( - path: TKey | [TKey] - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper, - path: TKey | [TKey], - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper, - path: TKey | [TKey], - defaultValue: TDefault - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper>, - path: number - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper | null | undefined>, - path: number - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper | null | undefined>, - path: number, - defaultValue: TDefault - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper, - path: PropertyPath, - defaultValue: TDefault - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - this: LoDashExplicitWrapper, - path: PropertyPath - ): LoDashExplicitWrapper; - - /** - * @see _.get - */ - get( - path: PropertyPath, - defaultValue?: any - ): LoDashExplicitWrapper; - } - - //_.has - interface LoDashStatic { - /** - * Checks if `path` is a direct property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - has( - object: T, - path: PropertyPath - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.has - */ - has(path: PropertyPath): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.has - */ - has(path: PropertyPath): LoDashExplicitWrapper; - } - - //_.hasIn - interface LoDashStatic { - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @category Object - * @param object The object to query. - * @param path The path to check. - * @returns Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - hasIn( - object: T, - path: PropertyPath - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.hasIn - */ - hasIn(path: PropertyPath): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.hasIn - */ - hasIn(path: PropertyPath): LoDashExplicitWrapper; - } - - //_.invert - interface LoDashStatic { - /** - * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, - * subsequent values overwrite property assignments of previous values unless multiValue is true. - * - * @param object The object to invert. - * @param multiValue Allow multiple values per key. - * @return Returns the new inverted object. - */ - invert( - object: object - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.invert - */ - invert(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.invert - */ - invert(): LoDashExplicitWrapper>; - } - - //_.invertBy - interface LoDashStatic { - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - invertBy( - object: List | Dictionary | NumericDictionary | null | undefined, - interatee?: ValueIteratee - ): Dictionary; - - /** - * @see _.invertBy - */ - invertBy( - object: T | null | undefined, - interatee?: ValueIteratee - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.invertBy - */ - invertBy( - this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - interatee?: ValueIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - this: LoDashImplicitWrapper, - interatee?: ValueIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.invertBy - */ - invertBy( - this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, - interatee?: ValueIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - this: LoDashExplicitWrapper, - interatee?: ValueIteratee - ): LoDashExplicitWrapper>; - } - - //_.keys - interface LoDashStatic { - /** - * Creates an array of the own enumerable property names of object. - * - * Note: Non-object values are coerced to objects. See the ES spec for more details. - * - * @param object The object to query. - * @return Returns the array of property names. - */ - keys(object?: any): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.keys - */ - keys(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.keys - */ - keys(): LoDashExplicitWrapper; - } - - //_.keysIn - interface LoDashStatic { - /** - * Creates an array of the own and inherited enumerable property names of object. - * - * Note: Non-object values are coerced to objects. - * - * @param object The object to query. - * @return An array of property names. - */ - keysIn(object?: any): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.keysIn - */ - keysIn(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.keysIn - */ - keysIn(): LoDashExplicitWrapper; - } - - //_.mapKeys - interface LoDashStatic { - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - mapKeys( - object: List | null | undefined, - iteratee?: ListIteratee - ): Dictionary; - - /** - * @see _.mapKeys - */ - mapKeys( - object: Dictionary | null | undefined, - iteratee?: DictionaryIteratee - ): Dictionary; - - /** - * @see _.mapKeys - */ - mapKeys( - object: object | null | undefined, - iteratee?: ObjectIteratee - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashImplicitWrapper | null | undefined>, - iteratee?: DictionaryIteratee - ): LoDashImplicitWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashImplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashExplicitWrapper | null | undefined>, - iteratee?: DictionaryIteratee - ): LoDashExplicitWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - this: LoDashExplicitWrapper, - iteratee?: ObjectIteratee - ): LoDashExplicitWrapper>; - } - - //_.mapValues - interface LoDashStatic { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. - * @return Returns the new mapped object. - */ - mapValues(obj: T | null | undefined, callback: ObjectIterator): { [P in keyof T]: TResult }; - - /** - * @see _.mapValues - */ - mapValues(obj: T | null | undefined, iteratee: object): { [P in keyof T]: boolean }; - - /** - * @see _.mapValues - */ - mapValues(obj: Dictionary | null | undefined, iteratee: TKey): Dictionary; - - /** - * @see _.mapValues - */ - mapValues(obj: T | null | undefined, iteratee: string): { [P in keyof T]: any }; - - /** - * @see _.mapValues - */ - mapValues(obj: string | null | undefined, callback: StringIterator): NumericDictionary; - - /** - * @see _.mapValues - */ - mapValues(obj: Dictionary | null | undefined): Dictionary; - - /** - * @see _.mapValues - */ - mapValues(obj: T): T; - - /** - * @see _.mapValues - */ - mapValues(obj: T | null | undefined): T | {}; - - /** - * @see _.mapValues - */ - mapValues(obj: string | null | undefined): NumericDictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.mapValues - */ - mapValues( - this: LoDashImplicitWrapper, - callback: ObjectIterator - ): LoDashImplicitWrapper<{ [P in keyof T]: TResult }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashImplicitWrapper, - iteratee: object - ): LoDashImplicitWrapper<{ [P in keyof T]: boolean }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashImplicitWrapper | null | undefined>, - iteratee: TKey - ): LoDashImplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashImplicitWrapper, - iteratee: string - ): LoDashImplicitWrapper<{ [P in keyof T]: any }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashImplicitWrapper, - callback: StringIterator - ): LoDashImplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.mapValues - */ - mapValues( - this: LoDashExplicitWrapper, - callback: ObjectIterator - ): LoDashExplicitWrapper<{ [P in keyof T]: TResult }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashExplicitWrapper, - iteratee: object - ): LoDashExplicitWrapper<{ [P in keyof T]: boolean }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashExplicitWrapper | null | undefined>, - iteratee: TKey - ): LoDashExplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashExplicitWrapper, - iteratee: string - ): LoDashExplicitWrapper<{ [P in keyof T]: any }>; - - /** - * @see _.mapValues - */ - mapValues( - this: LoDashExplicitWrapper, - callback: StringIterator - ): LoDashExplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper>; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper; - - /** - * @see _.mapValues - */ - mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; - } - - //_.merge - interface LoDashStatic { - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @category Object - * @param object The destination object. - * @param [sources] The source objects. - * @returns Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - merge( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.merge - */ - merge( - object: any, - ...otherArgs: any[] - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.merge - */ - merge( - source: TSource - ): LoDashImplicitWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitWrapper; - - /** - * @see _.merge - */ - merge( - ...otherArgs: any[] - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.merge - */ - merge( - source: TSource - ): LoDashExplicitWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitWrapper; - - /** - * @see _.merge - */ - merge( - ): LoDashExplicitWrapper; - - /** - * @see _.merge - */ - merge( - ...otherArgs: any[] - ): LoDashExplicitWrapper; - } - - //_.mergeWith - type MergeWithCustomizer = { bivariantHack(value: any, srcValue: any, key: string, object: any, source: any): any; }["bivariantHack"] - - interface LoDashStatic { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @category Object - * @param object The destination object. - * @param sources The source objects. - * @param customizer The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - mergeWith( - object: TObject, - source: TSource, - customizer: MergeWithCustomizer - ): TObject & TSource; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.mergeWith - */ - mergeWith( - object: any, - ...otherArgs: any[] - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.mergeWith - */ - mergeWith( - source: TSource, - customizer: MergeWithCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - customizer: MergeWithCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: MergeWithCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: MergeWithCustomizer - ): LoDashImplicitWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - ...otherArgs: any[] - ): LoDashImplicitWrapper; - } - - //_.omit - interface LoDashStatic { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @category Object - * @param object The source object. - * @param [paths] The property names to omit, specified - * individually or in arrays.. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - omit( - object: Dictionary, - ...paths: PropertyPath[] - ): Dictionary; - - /** - * @see _.omit - */ - omit( - object: T | null | undefined, - ...paths: PropertyPath[] - ): PartialObject; - } - - interface LoDashImplicitWrapper { - /** - * @see _.omit - */ - omit( - this: LoDashImplicitWrapper>, - ...paths: PropertyPath[] - ): LoDashImplicitWrapper>; - - /** - * @see _.omit - */ - omit( - this: LoDashImplicitWrapper, - ...paths: PropertyPath[] - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.omit - */ - omit( - this: LoDashExplicitWrapper>, - ...paths: PropertyPath[] - ): LoDashExplicitWrapper>; - - /** - * @see _.omit - */ - omit( - this: LoDashExplicitWrapper, - ...paths: PropertyPath[] - ): LoDashExplicitWrapper>; - } - - //_.omitBy - interface LoDashStatic { - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - omitBy( - object: T | null | undefined, - predicate: ValueKeyIteratee - ): PartialObject; - } - - interface LoDashImplicitWrapper { - /** - * @see _.omitBy - */ - omitBy( - this: LoDashImplicitWrapper, - predicate: ValueKeyIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.omitBy - */ - omitBy( - this: LoDashExplicitWrapper, - predicate: ValueKeyIteratee - ): LoDashExplicitWrapper>; - } - - //_.pick - interface LoDashStatic { - /** - * Creates an object composed of the picked `object` properties. - * - * @category Object - * @param object The source object. - * @param [props] The property names to pick, specified - * individually or in arrays. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - pick( - object: T, - ...props: Array> - ): Pick; - - /** - * @see _.pick - */ - pick( - object: T | null | undefined, - ...props: PropertyPath[] - ): PartialDeep; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pick - */ - pick( - this: LoDashImplicitWrapper, - ...props: Array> - ): LoDashImplicitWrapper>; - - /** - * @see _.pick - */ - pick( - this: LoDashImplicitWrapper, - ...props: PropertyPath[] - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pick - */ - pick( - this: LoDashExplicitWrapper, - ...props: Array> - ): LoDashExplicitWrapper>; - - /** - * @see _.pick - */ - pick( - this: LoDashExplicitWrapper, - ...props: PropertyPath[] - ): LoDashExplicitWrapper>; - } - - //_.pickBy - interface LoDashStatic { - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @category Object - * @param object The source object. - * @param [predicate=_.identity] The function invoked per property. - * @returns Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - pickBy( - object: T | null | undefined, - predicate?: ValueKeyIteratee - ): PartialObject; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pickBy - */ - pickBy( - this: LoDashImplicitWrapper, - predicate?: ValueKeyIteratee - ): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pickBy - */ - pickBy( - this: LoDashExplicitWrapper, - predicate?: ValueKeyIteratee - ): LoDashExplicitWrapper>; - } - - //_.result - interface LoDashStatic { - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - result( - object: any, - path: PropertyPath, - defaultValue?: TResult|((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.result - */ - result( - path: PropertyPath, - defaultValue?: TResult|((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashExplicitWrapper { - /** - * @see _.result - */ - result( - path: PropertyPath, - defaultValue?: TResult|((...args: any[]) => TResult) - ): LoDashExplicitWrapper; - } - - //_.set - interface LoDashStatic { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - set( - object: T, - path: PropertyPath, - value: any - ): T; - - /** - * @see _.set - */ - set( - object: object, - path: PropertyPath, - value: any - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.set - */ - set( - path: PropertyPath, - value: any - ): this; - - /** - * @see _.set - */ - set( - path: PropertyPath, - value: any - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.set - */ - set( - path: PropertyPath, - value: any - ): this; - - /** - * @see _.set - */ - set( - path: PropertyPath, - value: any - ): LoDashExplicitWrapper; - } - - //_.setWith - type SetWithCustomizer = (nsValue: any, key: string, nsObject: T) => any; - - interface LoDashStatic { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - setWith( - object: T, - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): T; - - setWith( - object: T, - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.setWith - */ - setWith( - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): this; - - /** - * @see _.setWith - */ - setWith( - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.setWith - */ - setWith( - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): this; - - /** - * @see _.setWith - */ - setWith( - path: PropertyPath, - value: any, - customizer?: SetWithCustomizer - ): LoDashExplicitWrapper; - } - - //_.toPairs - interface LoDashStatic { - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - toPairs(object?: Dictionary): Array<[string, T]>; - - /** - * @see _.toPairs - */ - toPairs(object?: object): Array<[string, any]>; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPairs - */ - toPairs(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - - /** - * @see _.toPairs - */ - toPairs(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPairs - */ - toPairs(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - - /** - * @see _.toPairs - */ - toPairs(): LoDashExplicitWrapper>; - } - - //_.toPairsIn - interface LoDashStatic { - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - toPairsIn(object?: Dictionary): Array<[string, T]>; - - /** - * @see _.toPairsIn - */ - toPairsIn(object?: object): Array<[string, any]>; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPairsIn - */ - toPairsIn(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; - - /** - * @see _.toPairsIn - */ - toPairsIn(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPairsIn - */ - toPairsIn(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; - - /** - * @see _.toPairsIn - */ - toPairsIn(): LoDashExplicitWrapper>; - } - - //_.transform - interface LoDashStatic { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - transform( - object: T[], - iteratee: MemoVoidArrayIterator, - accumulator?: TResult[] - ): TResult[]; - - /** - * @see _.transform - */ - transform( - object: T[], - iteratee: MemoVoidArrayIterator>, - accumulator: Dictionary - ): Dictionary; - - /** - * @see _.transform - */ - transform( - object: Dictionary, - iteratee: MemoVoidDictionaryIterator>, - accumulator?: Dictionary - ): Dictionary; - - /** - * @see _.transform - */ - transform( - object: Dictionary, - iteratee: MemoVoidDictionaryIterator, - accumulator: TResult[] - ): TResult[]; - - /** - * @see _.transform - */ - transform( - object: any[], - ): any[]; - - /** - * @see _.transform - */ - transform( - object: object, - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.transform - */ - transform( - this: LoDashImplicitWrapper, - iteratee: MemoVoidArrayIterator, - accumulator?: TResult[] - ): LoDashImplicitWrapper; - - /** - * @see _.transform - */ - transform( - this: LoDashImplicitWrapper, - iteratee: MemoVoidArrayIterator>, - accumulator: Dictionary - ): LoDashImplicitWrapper>; - - /** - * @see _.transform - */ - transform( - this: LoDashImplicitWrapper>, - iteratee: MemoVoidDictionaryIterator>, - accumulator?: Dictionary - ): LoDashImplicitWrapper>; - - /** - * @see _.transform - */ - transform( - this: LoDashImplicitWrapper>, - iteratee: MemoVoidDictionaryIterator, - accumulator: TResult[] - ): LoDashImplicitWrapper; - - /** - * @see _.transform - */ - transform( - this: LoDashImplicitWrapper, - ): LoDashImplicitWrapper; - - /** - * @see _.transform - */ - transform(): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.transform - */ - transform( - this: LoDashExplicitWrapper, - iteratee: MemoVoidArrayIterator, - accumulator?: TResult[] - ): LoDashExplicitWrapper; - - /** - * @see _.transform - */ - transform( - this: LoDashExplicitWrapper, - iteratee: MemoVoidArrayIterator>, - accumulator?: Dictionary - ): LoDashExplicitWrapper>; - - /** - * @see _.transform - */ - transform( - this: LoDashExplicitWrapper>, - iteratee: MemoVoidDictionaryIterator>, - accumulator?: Dictionary - ): LoDashExplicitWrapper>; - - /** - * @see _.transform - */ - transform( - this: LoDashExplicitWrapper>, - iteratee: MemoVoidDictionaryIterator, - accumulator?: TResult[] - ): LoDashExplicitWrapper; - - /** - * @see _.transform - */ - transform( - this: LoDashExplicitWrapper, - ): LoDashExplicitWrapper; - - /** - * @see _.transform - */ - transform(): LoDashExplicitWrapper>; - } - - //_.unset - interface LoDashStatic { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - unset( - object: any, - path: PropertyPath - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unset - */ - unset(path: PropertyPath): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unset - */ - unset(path: PropertyPath): LoDashExplicitWrapper; - } - - //_.update - interface LoDashStatic { - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - update( - object: object, - path: PropertyPath, - updater: (value: any) => any - ): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.update - */ - update( - path: PropertyPath, - updater: (value: any) => any - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.update - */ - update( - path: PropertyPath, - updater: (value: any) => any - ): LoDashExplicitWrapper; - } - - //_.updateWith - interface LoDashStatic { - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @since 4.6.0 - * @category Object - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @param [customizer] The function to customize assigned values. - * @returns Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - updateWith( - object: T, - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): T; - - /** - * @see _.updateWith - */ - updateWith( - object: T, - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.updateWith - */ - updateWith( - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): this; - - /** - * @see _.updateWith - */ - updateWith( - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.updateWith - */ - updateWith( - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): this; - - /** - * @see _.updateWith - */ - updateWith( - path: PropertyPath, - updater: (oldValue: any) => any, - customizer?: SetWithCustomizer - ): LoDashExplicitWrapper; - } - - //_.values - interface LoDashStatic { - /** - * Creates an array of the own enumerable property values of object. - * - * @param object The object to query. - * @return Returns an array of property values. - */ - values(object: Dictionary|NumericDictionary|List | null | undefined): T[]; - - /** - * @see _.values - */ - values(object: T | null | undefined): Array; - - /** - * @see _.values - */ - values(object: any): any[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.values - */ - values(this: LoDashImplicitWrapper | NumericDictionary | List | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.values - */ - values(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; - - /** - * @see _.values - */ - values(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.values - */ - values(this: LoDashExplicitWrapper | NumericDictionary | List | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.values - */ - values(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; - - /** - * @see _.values - */ - values(): LoDashExplicitWrapper; - } - - //_.valuesIn - interface LoDashStatic { - /** - * Creates an array of the own and inherited enumerable property values of object. - * - * @param object The object to query. - * @return Returns the array of property values. - */ - valuesIn(object: Dictionary|NumericDictionary|List | null | undefined): T[]; - - /** - * @see _.valuesIn - */ - valuesIn(object: T | null | undefined): Array; - } - - interface LoDashImplicitWrapper { - /** - * @see _.valuesIn - */ - valuesIn(this: LoDashImplicitWrapper | NumericDictionary | List | null | undefined>): LoDashImplicitWrapper; - - /** - * @see _.valuesIn - */ - valuesIn(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.valuesIn - */ - valuesIn(this: LoDashExplicitWrapper | NumericDictionary | List | null | undefined>): LoDashExplicitWrapper; - - /** - * @see _.valuesIn - */ - valuesIn(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; - } - - /********** - * String * - **********/ - - //_.camelCase - interface LoDashStatic { - /** - * Converts string to camel case. - * - * @param string The string to convert. - * @return Returns the camel cased string. - */ - camelCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.camelCase - */ - camelCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.camelCase - */ - camelCase(): LoDashExplicitWrapper; - } - - //_.capitalize - interface LoDashStatic { - /** - * Converts the first character of string to upper case and the remaining to lower case. - * - * @param string The string to capitalize. - * @return Returns the capitalized string. - */ - capitalize(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.capitalize - */ - capitalize(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.capitalize - */ - capitalize(): LoDashExplicitWrapper; - } - - //_.deburr - interface LoDashStatic { - /** - * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining - * diacritical marks. - * - * @param string The string to deburr. - * @return Returns the deburred string. - */ - deburr(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.deburr - */ - deburr(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.deburr - */ - deburr(): LoDashExplicitWrapper; - } - - //_.endsWith - interface LoDashStatic { - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - endsWith( - string?: string, - target?: string, - position?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.endsWith - */ - endsWith( - target?: string, - position?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.endsWith - */ - endsWith( - target?: string, - position?: number - ): LoDashExplicitWrapper; - } - - // _.escape - interface LoDashStatic { - /** - * Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities. - * - * Note: No other characters are escaped. To escape additional characters use a third-party library like he. - * - * hough the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML - * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s - * article (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59, - * #102, #108, and #133 of the HTML5 Security Cheatsheet for more details. - * - * When working with HTML you should always quote attribute values to reduce XSS vectors. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - escape(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.escape - */ - escape(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.escape - */ - escape(): LoDashExplicitWrapper; - } - - // _.escapeRegExp - interface LoDashStatic { - /** - * Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", - * "{", "}", and "|" in string. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - escapeRegExp(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.escapeRegExp - */ - escapeRegExp(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.escapeRegExp - */ - escapeRegExp(): LoDashExplicitWrapper; - } - - //_.kebabCase - interface LoDashStatic { - /** - * Converts string to kebab case. - * - * @param string The string to convert. - * @return Returns the kebab cased string. - */ - kebabCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.kebabCase - */ - kebabCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.kebabCase - */ - kebabCase(): LoDashExplicitWrapper; - } - - //_.lowerCase - interface LoDashStatic { - /** - * Converts `string`, as space separated words, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - lowerCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lowerCase - */ - lowerCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lowerCase - */ - lowerCase(): LoDashExplicitWrapper; - } - - //_.lowerFirst - interface LoDashStatic { - /** - * Converts the first character of `string` to lower case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - lowerFirst(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lowerFirst - */ - lowerFirst(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lowerFirst - */ - lowerFirst(): LoDashExplicitWrapper; - } - - //_.pad - interface LoDashStatic { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - pad( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pad - */ - pad( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pad - */ - pad( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.padEnd - interface LoDashStatic { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - padEnd( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.padEnd - */ - padEnd( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.padEnd - */ - padEnd( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.padStart - interface LoDashStatic { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - padStart( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.padStart - */ - padStart( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.padStart - */ - padStart( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.parseInt - interface LoDashStatic { - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - parseInt( - string: string, - radix?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.parseInt - */ - parseInt(radix?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.parseInt - */ - parseInt(radix?: number): LoDashExplicitWrapper; - } - - //_.repeat - interface LoDashStatic { - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - repeat( - string?: string, - n?: number - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.repeat - */ - repeat(n?: number): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.repeat - */ - repeat(n?: number): LoDashExplicitWrapper; - } - - type ReplaceFunction = (match: string, ...args: any[]) => string; - - //_.replace - interface LoDashStatic { - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @return Returns the modified string. - */ - replace( - string: string, - pattern: RegExp | string, - replacement: ReplaceFunction | string - ): string; - - /** - * @see _.replace - */ - replace( - pattern: RegExp | string, - replacement: ReplaceFunction | string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.replace - */ - replace( - pattern: RegExp|string, - replacement: ReplaceFunction | string - ): string; - - /** - * @see _.replace - */ - replace( - replacement: ReplaceFunction | string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.replace - */ - replace( - pattern: RegExp | string, - replacement: ReplaceFunction | string - ): LoDashExplicitWrapper; - - /** - * @see _.replace - */ - replace( - replacement: ReplaceFunction | string - ): LoDashExplicitWrapper; - } - - //_.snakeCase - interface LoDashStatic { - /** - * Converts string to snake case. - * - * @param string The string to convert. - * @return Returns the snake cased string. - */ - snakeCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.snakeCase - */ - snakeCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.snakeCase - */ - snakeCase(): LoDashExplicitWrapper; - } - - //_.split - interface LoDashStatic { - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param separator The separator pattern to split by. - * @param limit The length to truncate results to. - * @return Returns the new array of string segments. - */ - split( - string: string, - separator?: RegExp|string, - limit?: number - ): string[]; - - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string The string to trim. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the new array of string segments. - */ - split( - string: string, - index: string | number, - guard: object - ): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.split - */ - split( - separator?: RegExp|string, - limit?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.split - */ - split( - separator?: RegExp|string, - limit?: number - ): LoDashExplicitWrapper; - } - - //_.startCase - interface LoDashStatic { - /** - * Converts string to start case. - * - * @param string The string to convert. - * @return Returns the start cased string. - */ - startCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.startCase - */ - startCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.startCase - */ - startCase(): LoDashExplicitWrapper; - } - - //_.startsWith - interface LoDashStatic { - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - startsWith( - string?: string, - target?: string, - position?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.startsWith - */ - startsWith( - target?: string, - position?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.startsWith - */ - startsWith( - target?: string, - position?: number - ): LoDashExplicitWrapper; - } - - //_.template - interface TemplateOptions extends TemplateSettings { - /** - * The sourceURL of the template's compiled source. - */ - sourceURL?: string; - } - - interface TemplateExecutor { - (data?: object): string; - source: string; - } - - interface LoDashStatic { - /** - * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, - * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" - * delimiters. Data properties may be accessed as free variables in the template. If a setting object is - * provided it takes precedence over _.templateSettings values. - * - * Note: In the development build _.template utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier - * debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @param string The template string. - * @param options The options object. - * @param options.escape The HTML "escape" delimiter. - * @param options.evaluate The "evaluate" delimiter. - * @param options.imports An object to import into the template as free variables. - * @param options.interpolate The "interpolate" delimiter. - * @param options.sourceURL The sourceURL of the template's compiled source. - * @param options.variable The data object variable name. - * @return Returns the compiled template function. - */ - template( - string?: string, - options?: TemplateOptions - ): TemplateExecutor; - } - - interface LoDashImplicitWrapper { - /** - * @see _.template - */ - template(options?: TemplateOptions): TemplateExecutor; - } - - interface LoDashExplicitWrapper { - /** - * @see _.template - */ - template(options?: TemplateOptions): LoDashExplicitWrapper; - } - - //_.toLower - interface LoDashStatic { - /** - * Converts `string`, as a whole, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - toLower(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toLower - */ - toLower(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toLower - */ - toLower(): LoDashExplicitWrapper; - } - - //_.toUpper - interface LoDashStatic { - /** - * Converts `string`, as a whole, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - toUpper(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toUpper - */ - toUpper(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toUpper - */ - toUpper(): LoDashExplicitWrapper; - } - - //_.trim - interface LoDashStatic { - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trim( - string?: string, - chars?: string - ): string; - - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the trimmed string. - */ - trim( - string: string, - index: string | number, - guard: object - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trim - */ - trim(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trim - */ - trim(chars?: string): LoDashExplicitWrapper; - } - - //_.trimEnd - interface LoDashStatic { - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trimEnd( - string?: string, - chars?: string - ): string; - - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the trimmed string. - */ - trimEnd( - string: string, - index: string | number, - guard: object - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trimEnd - */ - trimEnd(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trimEnd - */ - trimEnd(chars?: string): LoDashExplicitWrapper; - } - - //_.trimStart - interface LoDashStatic { - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trimStart( - string?: string, - chars?: string - ): string; - - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the trimmed string. - */ - trimStart( - string: string, - index: string | number, - guard: object - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trimStart - */ - trimStart(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trimStart - */ - trimStart(chars?: string): LoDashExplicitWrapper; - } - - //_.truncate - interface TruncateOptions { - /** The maximum string length. */ - length?: number; - /** The string to indicate text is omitted. */ - omission?: string; - /** The separator pattern to truncate to. */ - separator?: string|RegExp; - } - - interface LoDashStatic { - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - truncate( - string?: string, - options?: TruncateOptions - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.truncate - */ - truncate(options?: TruncateOptions): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.truncate - */ - truncate(options?: TruncateOptions): LoDashExplicitWrapper; - } - - //_.unescape - interface LoDashStatic { - /** - * The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` - * in string to their corresponding characters. - * - * Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library - * like he. - * - * @param string The string to unescape. - * @return Returns the unescaped string. - */ - unescape(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unescape - */ - unescape(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unescape - */ - unescape(): LoDashExplicitWrapper; - } - - //_.upperCase - interface LoDashStatic { - /** - * Converts `string`, as space separated words, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - upperCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.upperCase - */ - upperCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.upperCase - */ - upperCase(): LoDashExplicitWrapper; - } - - //_.upperFirst - interface LoDashStatic { - /** - * Converts the first character of `string` to upper case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - upperFirst(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.upperFirst - */ - upperFirst(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.upperFirst - */ - upperFirst(): LoDashExplicitWrapper; - } - - //_.words - interface LoDashStatic { - /** - * Splits `string` into an array of its words. - * - * @param string The string to inspect. - * @param pattern The pattern to match words. - * @return Returns the words of `string`. - */ - words( - string?: string, - pattern?: string|RegExp - ): string[]; - - /** - * Splits `string` into an array of its words. - * - * @param string The string to inspect. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns the words of `string`. - */ - words( - string: string, - index: string | number, - guard: object - ): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.words - */ - words(pattern?: string|RegExp): string[]; - } - - interface LoDashExplicitWrapper { - /** - * @see _.words - */ - words(pattern?: string|RegExp): LoDashExplicitWrapper; - } - - /*********** - * Utility * - ***********/ - - //_.attempt - interface LoDashStatic { - /** - * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments - * are provided to func when it’s invoked. - * - * @param func The function to attempt. - * @return Returns the func result or error object. - */ - attempt(func: (...args: any[]) => TResult, ...args: any[]): TResult|Error; - } - - interface LoDashImplicitWrapper { - /** - * @see _.attempt - */ - attempt(...args: any[]): TResult|Error; - } - - interface LoDashExplicitWrapper { - /** - * @see _.attempt - */ - attempt(...args: any[]): LoDashExplicitWrapper; - } - - //_.constant - interface LoDashStatic { - /** - * Creates a function that returns value. - * - * @param value The value to return from the new function. - * @return Returns the new function. - */ - constant(value: T): () => T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.constant - */ - constant(): LoDashImplicitWrapper<() => TValue>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.constant - */ - constant(): LoDashExplicitWrapper<() => TValue>; - } - - //_.defaultTo - interface LoDashStatic { - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - defaultTo(value: T | null | undefined, defaultValue: T): T; - - /** - * @see _.defaultTo - */ - defaultTo( - value: T | null | undefined, - defaultValue: TDefault - ): T | TDefault; - } - - interface LoDashImplicitWrapper { - /** - * @see _.defaultTo - */ - defaultTo(this: LoDashImplicitWrapper, defaultValue: T): T; - - /** - * @see _.defaultTo - */ - defaultTo( - this: LoDashImplicitWrapper, - defaultValue: TDefault - ): T | TDefault; - } - - interface LoDashExplicitWrapper { - /** - * @see _.defaultTo - */ - defaultTo(this: LoDashExplicitWrapper, defaultValue: T): LoDashExplicitWrapper; - - /** - * @see _.defaultTo - */ - defaultTo( - this: LoDashExplicitWrapper, - defaultValue: TDefault - ): LoDashExplicitWrapper; - } - - //_.identity - interface LoDashStatic { - /** - * This method returns the first argument provided to it. - * - * @param value Any value. - * @return Returns value. - */ - identity(value: T): T; - - /** - * @see _.identity - */ - identity(): undefined; - } - - interface LoDashImplicitWrapper { - /** - * @see _.identity - */ - identity(): TValue; - } - - interface LoDashExplicitWrapper { - /** - * @see _.identity - */ - identity(): this; - } - - //_.iteratee - interface LoDashStatic { - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. - * - * @category Util - * @param [func=_.identity] The value to convert to a callback. - * @returns Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // create custom iteratee shorthands - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ - iteratee any>( - func: TFunction | string | object - ): TFunction; - - /** - * @see _.iteratee - */ - iteratee(): typeof _.identity; // tslint:disable-line:no-unnecessary-qualifier - } - - interface LoDashImplicitWrapper { - /** - * @see _.iteratee - */ - iteratee any>( - this: LoDashImplicitWrapper - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.iteratee - */ - iteratee any>( - this: LoDashExplicitWrapper - ): LoDashExplicitWrapper; - } - - //_.matches - interface LoDashStatic { - /** - * Creates a function that performs a deep comparison between a given object and source, returning true if the - * given object has equivalent property values, else false. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own - * or inherited property value see _.matchesProperty. - * - * @param source The object of property values to match. - * @return Returns the new function. - */ - matches(source: T): (value: any) => boolean; - - /** - * @see _.matches - */ - matches(source: T): (value: V) => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.matches - */ - matches(): LoDashImplicitWrapper<(value: V) => boolean>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.matches - */ - matches(): LoDashExplicitWrapper<(value: V) => boolean>; - } - - //_.matchesProperty - interface LoDashStatic { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - matchesProperty( - path: PropertyPath, - srcValue: T - ): (value: any) => boolean; - - /** - * @see _.matchesProperty - */ - matchesProperty( - path: PropertyPath, - srcValue: T - ): (value: V) => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashImplicitWrapper<(value: any) => boolean>; - - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashImplicitWrapper<(value: Value) => boolean>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashExplicitWrapper<(value: any) => boolean>; - - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashExplicitWrapper<(value: Value) => boolean>; - } - - //_.method - interface LoDashStatic { - /** - * Creates a function that invokes the method at path on a given object. Any additional arguments are provided - * to the invoked method. - * - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - method( - path: PropertyPath, - ...args: any[] - ): (object: any) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashImplicitWrapper<(object: any) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashExplicitWrapper<(object: any) => any>; - } - - //_.methodOf - interface LoDashStatic { - /** - * The opposite of _.method; this method creates a function that invokes the method at a given path on object. - * Any additional arguments are provided to the invoked method. - * - * @param object The object to query. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - methodOf( - object: object, - ...args: any[] - ): (path: PropertyPath) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.methodOf - */ - methodOf( - ...args: any[] - ): LoDashImplicitWrapper<(path: PropertyPath) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.methodOf - */ - methodOf( - ...args: any[] - ): LoDashExplicitWrapper<(path: PropertyPath) => any>; - } - - //_.mixin - interface MixinOptions { - chain?: boolean; - } - - interface LoDashStatic { - /** - * Adds all own enumerable function properties of a source object to the destination object. If object is a - * function then methods are added to its prototype as well. - * - * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying - * the original. - * - * @param object The destination object. - * @param source The object of functions to add. - * @param options The options object. - * @param options.chain Specify whether the functions added are chainable. - * @return Returns object. - */ - mixin( - object: TObject, - source: Dictionary<(...args: any[]) => any>, - options?: MixinOptions - ): TObject; - - /** - * @see _.mixin - */ - mixin( - source: Dictionary<(...args: any[]) => any>, - options?: MixinOptions - ): LoDashStatic; - } - - interface LoDashImplicitWrapper { - /** - * @see _.mixin - */ - mixin( - source: Dictionary<(...args: any[]) => any>, - options?: MixinOptions - ): this; - - /** - * @see _.mixin - */ - mixin( - options?: MixinOptions - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.mixin - */ - mixin( - source: Dictionary<(...args: any[]) => any>, - options?: MixinOptions - ): this; - - /** - * @see _.mixin - */ - mixin( - options?: MixinOptions - ): LoDashExplicitWrapper; - } - - //_.noConflict - interface LoDashStatic { - /** - * Reverts the _ variable to its previous value and returns a reference to the lodash function. - * - * @return Returns the lodash function. - */ - noConflict(): typeof _; - } - - interface LoDashImplicitWrapper { - /** - * @see _.noConflict - */ - noConflict(): typeof _; - } - - interface LoDashExplicitWrapper { - /** - * @see _.noConflict - */ - noConflict(): LoDashExplicitWrapper; - } - - //_.noop - interface LoDashStatic { - /** - * A no-operation function that returns undefined regardless of the arguments it receives. - * - * @return undefined - */ - noop(...args: any[]): void; - } - - interface LoDashImplicitWrapper { - /** - * @see _.noop - */ - noop(...args: any[]): void; - } - - interface LoDashExplicitWrapper { - /** - * @see _.noop - */ - noop(...args: any[]): LoDashExplicitWrapper; - } - - //_.nthArg - interface LoDashStatic { - /** - * Creates a function that returns its nth argument. - * - * @param n The index of the argument to return. - * @return Returns the new function. - */ - nthArg(n?: number): (...args: any[]) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.nthArg - */ - nthArg(): LoDashImplicitWrapper<(...args: any[]) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.nthArg - */ - nthArg(): LoDashExplicitWrapper<(...args: any[]) => any>; - } - - //_.over - interface LoDashStatic { - /** - * Creates a function that invokes iteratees with the arguments provided to the created function and returns - * their results. - * - * @param iteratees The iteratees to invoke. - * @return Returns the new function. - */ - over(...iteratees: Array TResult>>): (...args: any[]) => TResult[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.over - */ - over( - this: LoDashImplicitWrapper TResult>>, - ...iteratees: Array TResult>> - ): LoDashImplicitWrapper<(...args: any[]) => TResult[]>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.over - */ - over( - this: LoDashExplicitWrapper TResult>>, - ...iteratees: Array TResult>> - ): LoDashExplicitWrapper<(...args: any[]) => TResult[]>; - } - - //_.overEvery - interface LoDashStatic { - /** - * Creates a function that checks if all of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - overEvery(...predicates: Array boolean>>): (...args: T[]) => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: Array boolean>>): LoDashImplicitWrapper<(...args: T[]) => boolean>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: Array boolean>>): LoDashExplicitWrapper<(...args: T[]) => boolean>; - } - - //_.overSome - interface LoDashStatic { - /** - * Creates a function that checks if any of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - overSome(...predicates: Array boolean>>): (...args: T[]) => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: Array boolean>>): LoDashImplicitWrapper<(...args: T[]) => boolean>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: Array boolean>>): LoDashExplicitWrapper<(...args: T[]) => boolean>; - } - - //_.property - interface LoDashStatic { - /** - * Creates a function that returns the property value at path on a given object. - * - * @param path The path of the property to get. - * @return Returns the new function. - */ - property(path: PropertyPath): (obj: TObj) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.property - */ - property(): LoDashImplicitWrapper<(obj: TObj) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.property - */ - property(): LoDashExplicitWrapper<(obj: TObj) => TResult>; - } - - //_.propertyOf - interface LoDashStatic { - /** - * The opposite of _.property; this method creates a function that returns the property value at a given path - * on object. - * - * @param object The object to query. - * @return Returns the new function. - */ - propertyOf(object: T): (path: PropertyPath) => any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.propertyOf - */ - propertyOf(): LoDashImplicitWrapper<(path: PropertyPath) => any>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.propertyOf - */ - propertyOf(): LoDashExplicitWrapper<(path: PropertyPath) => any>; - } - - //_.range - interface LoDashStatic { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - range( - start: number, - end?: number, - step?: number - ): number[]; - - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns a new range array. - */ - range( - end: number, - index: string | number, - guard: object - ): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.range - */ - range( - end?: number, - step?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.range - */ - range( - end?: number, - step?: number - ): LoDashExplicitWrapper; - } - - //_.rangeRight - interface LoDashStatic { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @category Util - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @returns Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - rangeRight( - start: number, - end?: number, - step?: number - ): number[]; - - /** - * This method is like _.range except that it populates values in - * descending order. - * - * @param start The start of the range. - * @param index Not used in this overload. - * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. - * @return Returns a new range array. - */ - rangeRight( - end: number, - index: string | number, - guard: object - ): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.rangeRight - */ - rangeRight( - end?: number, - step?: number - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.rangeRight - */ - rangeRight( - end?: number, - step?: number - ): LoDashExplicitWrapper; - } - - //_.runInContext - interface LoDashStatic { - /** - * Create a new pristine lodash function using the given context object. - * - * @param context The context object. - * @return Returns a new lodash function. - */ - runInContext(context?: object): typeof _; - } - - interface LoDashImplicitWrapper { - /** - * @see _.runInContext - */ - runInContext(): typeof _; - } - - // _.stubArray - interface LoDashStatic { - /** - * This method returns a new empty array. - * - * @returns Returns the new empty array. - */ - stubArray(): any[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.stubArray - */ - stubArray(): any[]; - } - - interface LoDashExplicitWrapper { - /** - * @see _.stubArray - */ - stubArray(): LoDashExplicitWrapper; - } - - // _.stubFalse - interface LoDashStatic { - /** - * This method returns `false`. - * - * @returns Returns `false`. - */ - stubFalse(): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.stubFalse - */ - stubFalse(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.stubFalse - */ - stubFalse(): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * This method returns a new empty object. - * - * @returns Returns the new empty object. - */ - stubObject(): any; - } - - interface LoDashImplicitWrapper { - /** - * @see _.stubObject - */ - stubObject(): any; - } - - interface LoDashExplicitWrapper { - /** - * @see _.stubObject - */ - stubObject(): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * This method returns an empty string. - * - * @returns Returns the empty string. - */ - stubString(): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.stubString - */ - stubString(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.stubString - */ - stubString(): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * This method returns `true`. - * - * @returns Returns `true`. - */ - stubTrue(): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.stubTrue - */ - stubTrue(): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.stubTrue - */ - stubTrue(): LoDashExplicitWrapper; - } - - //_.times - interface LoDashStatic { - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - times( - n: number, - iteratee: (num: number) => TResult - ): TResult[]; - - /** - * @see _.times - */ - times(n: number): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.times - */ - times( - iteratee: (num: number) => TResult - ): TResult[]; - - /** - * @see _.times - */ - times(): number[]; - } - - interface LoDashExplicitWrapper { - /** - * @see _.times - */ - times( - iteratee: (num: number) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.times - */ - times(): LoDashExplicitWrapper; - } - - //_.toPath - interface LoDashStatic { - /** - * Converts `value` to a property path array. - * - * @category Util - * @param value The value to convert. - * @returns Returns the new property path array. - * @example - * - * _.toPath('a.b.c'); - * // => ['a', 'b', 'c'] - * - * _.toPath('a[0].b.c'); - * // => ['a', '0', 'b', 'c'] - * - * var path = ['a', 'b', 'c'], - * newPath = _.toPath(path); - * - * console.log(newPath); - * // => ['a', 'b', 'c'] - * - * console.log(path === newPath); - * // => false - */ - toPath(value: any): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toPath - */ - toPath(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toPath - */ - toPath(): LoDashExplicitWrapper; - } - - //_.uniqueId - interface LoDashStatic { - /** - * Generates a unique ID. If prefix is provided the ID is appended to it. - * - * @param prefix The value to prefix the ID with. - * @return Returns the unique ID. - */ - uniqueId(prefix?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniqueId - */ - uniqueId(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniqueId - */ - uniqueId(): LoDashExplicitWrapper; - } - - type NotVoid = {} | null | undefined; - type ArrayIterator = (value: T, index: number, collection: T[]) => TResult; - type ListIterator = (value: T, index: number, collection: List) => TResult; - type ListIteratee = ListIterator | string | [string, any] | PartialDeep; - type ListIterateeCustom = ListIterator | string | object | [string, any] | PartialDeep; - type ListIteratorTypeGuard = (value: T, index: number, collection: List) => value is S; - - // Note: key should be string, not keyof T, because the actual object may contain extra properties that were not specified in the type. - type ObjectIterator = (value: TObject[keyof TObject], key: string, collection: TObject) => TResult; - type ObjectIteratee = ObjectIterator | string | [string, any] | PartialDeep; - type ObjectIterateeCustom = ObjectIterator | string | object | [string, any] | PartialDeep; - type ObjectIteratorTypeGuard = (value: TObject[keyof TObject], key: string, collection: TObject) => value is S; - - type DictionaryIterator = ObjectIterator, TResult>; - type DictionaryIteratee = ObjectIteratee>; - type DictionaryIteratorTypeGuard = ObjectIteratorTypeGuard, S>; - - type NumericDictionaryIterator = (value: T, key: number, collection: NumericDictionary) => TResult; - type NumericDictionaryIteratee = NumericDictionaryIterator | string | [string, any] | PartialDeep; - type NumericDictionaryIterateeCustom = NumericDictionaryIterator | string | [string, any] | PartialDeep; - - type StringIterator = (char: string, index: number, string: string) => TResult; - - type MemoVoidIterator = (prev: TResult, curr: T, indexOrKey: any, list: T[]) => void; - - /** @deprecated Use MemoListIterator or MemoObjectIterator instead. */ - type MemoIterator = (prev: TResult, curr: T, indexOrKey: any, list: T[]) => TResult; - type MemoListIterator = (prev: TResult, curr: T, index: number, list: TList) => TResult; - type MemoObjectIterator = (prev: TResult, curr: T, key: string, list: TList) => TResult; - - type MemoVoidArrayIterator = (acc: TResult, curr: T, index: number, arr: T[]) => void; - type MemoVoidDictionaryIterator = (acc: TResult, curr: T, key: string, dict: Dictionary) => void; - - type ValueIteratee = ((value: T) => NotVoid) | string | [string, any] | PartialDeep; - type ValueKeyIteratee = ((value: T, key: string) => NotVoid) | string | [string, any] | PartialDeep; - type Comparator = (a: T, b: T) => boolean; - type Comparator2 = (a: T1, b: T2) => boolean; - - type PropertyName = string | number | symbol; - type PropertyPath = Many; - - /** Common interface between Arrays and jQuery objects */ - type List = ArrayLike; - - interface Dictionary { - [index: string]: T; - } - - interface NumericDictionary { - [index: number]: T; - } - - interface Cancelable { - cancel(): void; - flush(): void; - } - - type PartialDeep = { - [P in keyof T]?: PartialDeep; - }; - - // For backwards compatibility - type LoDashImplicitArrayWrapper = LoDashImplicitWrapper; - type LoDashImplicitNillableArrayWrapper = LoDashImplicitWrapper; - type LoDashImplicitObjectWrapper = LoDashImplicitWrapper; - type LoDashImplicitNillableObjectWrapper = LoDashImplicitWrapper; - type LoDashImplicitNumberArrayWrapper = LoDashImplicitWrapper; - type LoDashImplicitStringWrapper = LoDashImplicitWrapper; - type LoDashExplicitArrayWrapper = LoDashExplicitWrapper; - type LoDashExplicitNillableArrayWrapper = LoDashExplicitWrapper; - type LoDashExplicitObjectWrapper = LoDashExplicitWrapper; - type LoDashExplicitNillableObjectWrapper = LoDashExplicitWrapper; - type LoDashExplicitNumberArrayWrapper = LoDashExplicitWrapper; - type LoDashExplicitStringWrapper = LoDashExplicitWrapper; -} - // Backward compatibility with --target es5 declare global { // tslint:disable-next-line:no-empty-interface diff --git a/types/lodash/lang/castArray.d.ts b/types/lodash/lang/castArray.d.ts new file mode 100644 index 0000000000..33b7d83771 --- /dev/null +++ b/types/lodash/lang/castArray.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Casts value as an array if it’s not one. + * + * @param value The value to inspect. + * @return Returns the cast array. + */ + castArray(value?: Many): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.castArray + */ + castArray(this: LoDashImplicitWrapper>): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.castArray + */ + castArray(this: LoDashExplicitWrapper>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/clone.d.ts b/types/lodash/lang/clone.d.ts new file mode 100644 index 0000000000..5e3405e68a --- /dev/null +++ b/types/lodash/lang/clone.d.ts @@ -0,0 +1,30 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a shallow clone of value. + * + * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, + * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, + * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty + * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps. + * + * @param value The value to clone. + * @return Returns the cloned value. + */ + clone(value: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.clone + */ + clone(): TValue; + } + + interface LoDashExplicitWrapper { + /** + * @see _.clone + */ + clone(): this; + } +} \ No newline at end of file diff --git a/types/lodash/lang/cloneDeep.d.ts b/types/lodash/lang/cloneDeep.d.ts new file mode 100644 index 0000000000..73099ff92a --- /dev/null +++ b/types/lodash/lang/cloneDeep.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.clone except that it recursively clones value. + * + * @param value The value to recursively clone. + * @return Returns the deep cloned value. + */ + cloneDeep(value: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.cloneDeep + */ + cloneDeep(): TValue; + } + + interface LoDashExplicitWrapper { + /** + * @see _.cloneDeep + */ + cloneDeep(): this; + } +} \ No newline at end of file diff --git a/types/lodash/lang/cloneDeepWith.d.ts b/types/lodash/lang/cloneDeepWith.d.ts new file mode 100644 index 0000000000..7805a598f0 --- /dev/null +++ b/types/lodash/lang/cloneDeepWith.d.ts @@ -0,0 +1,50 @@ +declare namespace _ { + type CloneDeepWithCustomizer = (value: any, key: number | string | undefined, object: TObject | undefined, stack: any) => any; + + interface LoDashStatic { + /** + * This method is like _.cloneWith except that it recursively clones value. + * + * @param value The value to recursively clone. + * @param customizer The function to customize cloning. + * @return Returns the deep cloned value. + */ + cloneDeepWith( + value: T, + customizer: CloneDeepWithCustomizer + ): any; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith(value: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer: CloneDeepWithCustomizer + ): any; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith(): TValue; + } + + interface LoDashExplicitWrapper { + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer: CloneDeepWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith(): this; + } +} \ No newline at end of file diff --git a/types/lodash/lang/cloneWith.d.ts b/types/lodash/lang/cloneWith.d.ts new file mode 100644 index 0000000000..2135d0ed53 --- /dev/null +++ b/types/lodash/lang/cloneWith.d.ts @@ -0,0 +1,73 @@ +declare namespace _ { + type CloneWithCustomizer = (value: TValue, key: number | string | undefined, object: any, stack: any) => TResult; + + interface LoDashStatic { + /** + * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. + * If customizer returns undefined cloning is handled by the method instead. + * + * @param value The value to clone. + * @param customizer The function to customize cloning. + * @return Returns the cloned value. + */ + cloneWith( + value: T, + customizer: CloneWithCustomizer + ): TResult; + + /** + * @see _.cloneWith + */ + cloneWith( + value: T, + customizer: CloneWithCustomizer + ): TResult | T; + + /** + * @see _.cloneWith + */ + cloneWith(value: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.cloneWith + */ + cloneWith( + customizer: CloneWithCustomizer + ): TResult; + + /** + * @see _.cloneWith + */ + cloneWith( + customizer: CloneWithCustomizer + ): TResult | TValue; + + /** + * @see _.cloneWith + */ + cloneWith(): TValue; + } + + interface LoDashExplicitWrapper { + /** + * @see _.cloneWith + */ + cloneWith( + customizer: CloneWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneWith + */ + cloneWith( + customizer: CloneWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneWith + */ + cloneWith(): this; + } +} \ No newline at end of file diff --git a/types/lodash/lang/conformsTo.d.ts b/types/lodash/lang/conformsTo.d.ts new file mode 100644 index 0000000000..859186f97c --- /dev/null +++ b/types/lodash/lang/conformsTo.d.ts @@ -0,0 +1,30 @@ +declare namespace _ { + + interface LoDashStatic { + /** + * Checks if object conforms to source by invoking the predicate properties of source with the + * corresponding property values of object. + * + * Note: This method is equivalent to _.conforms when source is partially applied. + */ + conformsTo(object: T, source: ConformsPredicateObject): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.conformsTo + */ + conformsTo(this: LoDashImplicitWrapper, source: ConformsPredicateObject): boolean; + // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. + } + + interface LoDashExplicitWrapper { + /** + * @see _.conformsTo + */ + conformsTo(this: LoDashImplicitWrapper, source: ConformsPredicateObject): LoDashExplicitWrapper; + // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. + } + + type CondPair = [(val: T) => boolean, (val: T) => R] +} \ No newline at end of file diff --git a/types/lodash/lang/eq.d.ts b/types/lodash/lang/eq.d.ts new file mode 100644 index 0000000000..08d4fb9497 --- /dev/null +++ b/types/lodash/lang/eq.d.ts @@ -0,0 +1,54 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @category Lang + * @param value The value to compare. + * @param other The other value to compare. + * @returns Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + eq( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.eq + */ + eq( + other: any + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.eq + */ + eq( + other: any + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/gt.d.ts b/types/lodash/lang/gt.d.ts new file mode 100644 index 0000000000..6d63801d1e --- /dev/null +++ b/types/lodash/lang/gt.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is greater than other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is greater than other, else false. + */ + gt( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.gt + */ + gt(other: any): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.gt + */ + gt(other: any): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/gte.d.ts b/types/lodash/lang/gte.d.ts new file mode 100644 index 0000000000..43887befcd --- /dev/null +++ b/types/lodash/lang/gte.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is greater than or equal to other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is greater than or equal to other, else false. + */ + gte( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.gte + */ + gte(other: any): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.gte + */ + gte(other: any): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isArguments.d.ts b/types/lodash/lang/isArguments.d.ts new file mode 100644 index 0000000000..e2549b24f6 --- /dev/null +++ b/types/lodash/lang/isArguments.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as an arguments object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isArguments(value?: any): value is IArguments; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isArguments + */ + isArguments(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isArguments + */ + isArguments(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isArray.d.ts b/types/lodash/lang/isArray.d.ts new file mode 100644 index 0000000000..0218c836d8 --- /dev/null +++ b/types/lodash/lang/isArray.d.ts @@ -0,0 +1,30 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as an Array object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isArray(value?: any): value is any[]; + + /** + * DEPRECATED + */ + isArray(value?: any): value is any[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isArray + */ + isArray(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isArray + */ + isArray(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isArrayBuffer.d.ts b/types/lodash/lang/isArrayBuffer.d.ts new file mode 100644 index 0000000000..c6e9d8cd05 --- /dev/null +++ b/types/lodash/lang/isArrayBuffer.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as an ArrayBuffer object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isArrayBuffer(value?: any): value is ArrayBuffer; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isArrayBuffer + */ + isArrayBuffer(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isArrayBuffer + */ + isArrayBuffer(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isArrayLike.d.ts b/types/lodash/lang/isArrayLike.d.ts new file mode 100644 index 0000000000..edf5e419bd --- /dev/null +++ b/types/lodash/lang/isArrayLike.d.ts @@ -0,0 +1,51 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + isArrayLike(value: T & string & number): boolean; // should only match if T = any + + /** + * @see _.isArrayLike + */ + isArrayLike(value: ((...args: any[]) => any) | null | undefined): value is never; + + /** + * @see _.isArrayLike + */ + isArrayLike(value: any): value is { length: number }; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isArrayLike + */ + isArrayLike(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isArrayLike + */ + isArrayLike(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isArrayLikeObject.d.ts b/types/lodash/lang/isArrayLikeObject.d.ts new file mode 100644 index 0000000000..acdc7b9a50 --- /dev/null +++ b/types/lodash/lang/isArrayLikeObject.d.ts @@ -0,0 +1,52 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + isArrayLikeObject(value: T & string & number): boolean; // should only match if T = any + + /** + * @see _.isArrayLike + */ + // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) + isArrayLikeObject(value: ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is never; + + /** + * @see _.isArrayLike + */ + // tslint:disable-next-line:ban-types (type guard doesn't seem to work correctly without the Function type) + isArrayLikeObject(value: T | ((...args: any[]) => any) | Function | string | boolean | number | null | undefined): value is T & { length: number }; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isArrayLikeObject + */ + isArrayLikeObject(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isArrayLikeObject + */ + isArrayLikeObject(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isBoolean.d.ts b/types/lodash/lang/isBoolean.d.ts new file mode 100644 index 0000000000..fea535c696 --- /dev/null +++ b/types/lodash/lang/isBoolean.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as a boolean primitive or object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isBoolean(value?: any): value is boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isBoolean + */ + isBoolean(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isBoolean + */ + isBoolean(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isBuffer.d.ts b/types/lodash/lang/isBuffer.d.ts new file mode 100644 index 0000000000..333fef2a20 --- /dev/null +++ b/types/lodash/lang/isBuffer.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is a buffer. + * + * @param value The value to check. + * @return Returns true if value is a buffer, else false. + */ + isBuffer(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isBuffer + */ + isBuffer(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isBuffer + */ + isBuffer(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isDate.d.ts b/types/lodash/lang/isDate.d.ts new file mode 100644 index 0000000000..f220b1fa66 --- /dev/null +++ b/types/lodash/lang/isDate.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as a Date object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isDate(value?: any): value is Date; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isDate + */ + isDate(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isDate + */ + isDate(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isElement.d.ts b/types/lodash/lang/isElement.d.ts new file mode 100644 index 0000000000..2e0bafd105 --- /dev/null +++ b/types/lodash/lang/isElement.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is a DOM element. + * + * @param value The value to check. + * @return Returns true if value is a DOM element, else false. + */ + isElement(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isElement + */ + isElement(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isElement + */ + isElement(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isEmpty.d.ts b/types/lodash/lang/isEmpty.d.ts new file mode 100644 index 0000000000..c19139b8d3 --- /dev/null +++ b/types/lodash/lang/isEmpty.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or + * jQuery-like collection with a length greater than 0 or an object with own enumerable properties. + * + * @param value The value to inspect. + * @return Returns true if value is empty, else false. + */ + isEmpty(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isEmpty + */ + isEmpty(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isEmpty + */ + isEmpty(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isEqual.d.ts b/types/lodash/lang/isEqual.d.ts new file mode 100644 index 0000000000..c8d9449d45 --- /dev/null +++ b/types/lodash/lang/isEqual.d.ts @@ -0,0 +1,51 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are **not** supported. + * + * @category Lang + * @param value The value to compare. + * @param other The other value to compare. + * @returns Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + isEqual( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isEqual + */ + isEqual( + other: any + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isEqual + */ + isEqual( + other: any + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isEqualWith.d.ts b/types/lodash/lang/isEqualWith.d.ts new file mode 100644 index 0000000000..8e0e41a52c --- /dev/null +++ b/types/lodash/lang/isEqualWith.d.ts @@ -0,0 +1,60 @@ +declare namespace _ { + type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyName | undefined, parent: any, otherParent: any, stack: any) => boolean|undefined; + + interface LoDashStatic { + /** + * This method is like `_.isEqual` except that it accepts `customizer` which is + * invoked to compare values. If `customizer` returns `undefined` comparisons are + * handled by the method instead. The `customizer` is invoked with up to seven arguments: + * (objValue, othValue [, index|key, object, other, stack]). + * + * @category Lang + * @param value The value to compare. + * @param other The other value to compare. + * @param [customizer] The function to customize comparisons. + * @returns Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + isEqualWith( + value: any, + other: any, + customizer?: IsEqualCustomizer + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isEqualWith + */ + isEqualWith( + other: any, + customizer?: IsEqualCustomizer + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isEqualWith + */ + isEqualWith( + other: any, + customizer?: IsEqualCustomizer + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isError.d.ts b/types/lodash/lang/isError.d.ts new file mode 100644 index 0000000000..a33c934906 --- /dev/null +++ b/types/lodash/lang/isError.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError + * object. + * + * @param value The value to check. + * @return Returns true if value is an error object, else false. + */ + isError(value: any): value is Error; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isError + */ + isError(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isError + */ + isError(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isFinite.d.ts b/types/lodash/lang/isFinite.d.ts new file mode 100644 index 0000000000..8fb984b178 --- /dev/null +++ b/types/lodash/lang/isFinite.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is a finite primitive number. + * + * Note: This method is based on Number.isFinite. + * + * @param value The value to check. + * @return Returns true if value is a finite number, else false. + */ + isFinite(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isFinite + */ + isFinite(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isFinite + */ + isFinite(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isFunction.d.ts b/types/lodash/lang/isFunction.d.ts new file mode 100644 index 0000000000..067da708b3 --- /dev/null +++ b/types/lodash/lang/isFunction.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is a callable function. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isFunction(value: any): value is (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isFunction + */ + isFunction(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isFunction + */ + isFunction(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isInteger.d.ts b/types/lodash/lang/isInteger.d.ts new file mode 100644 index 0000000000..125575c051 --- /dev/null +++ b/types/lodash/lang/isInteger.d.ts @@ -0,0 +1,41 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + isInteger(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isInteger + */ + isInteger(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isInteger + */ + isInteger(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isLength.d.ts b/types/lodash/lang/isLength.d.ts new file mode 100644 index 0000000000..a0449ef93c --- /dev/null +++ b/types/lodash/lang/isLength.d.ts @@ -0,0 +1,41 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + isLength(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isLength + */ + isLength(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isLength + */ + isLength(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isMap.d.ts b/types/lodash/lang/isMap.d.ts new file mode 100644 index 0000000000..9ce44582a1 --- /dev/null +++ b/types/lodash/lang/isMap.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as a Map object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isMap(value?: any): value is Map; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isMap + */ + isMap(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isMap + */ + isMap(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isMatch.d.ts b/types/lodash/lang/isMatch.d.ts new file mode 100644 index 0000000000..199a64c2cd --- /dev/null +++ b/types/lodash/lang/isMatch.d.ts @@ -0,0 +1,41 @@ +declare namespace _ { + type isMatchCustomizer = (value: any, other: any, indexOrKey?: PropertyName) => boolean; + + interface LoDashStatic { + /** + * Performs a deep comparison between `object` and `source` to determine if + * `object` contains equivalent property values. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @category Lang + * @param object The object to inspect. + * @param source The object of property values to match. + * @returns Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.isMatch(object, { 'age': 40 }); + * // => true + * + * _.isMatch(object, { 'age': 36 }); + * // => false + */ + isMatch(object: object, source: object): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isMatch + */ + isMatch(source: object): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isMatch + */ + isMatch(source: object): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isMatchWith.d.ts b/types/lodash/lang/isMatchWith.d.ts new file mode 100644 index 0000000000..516b9b9947 --- /dev/null +++ b/types/lodash/lang/isMatchWith.d.ts @@ -0,0 +1,50 @@ +declare namespace _ { + type isMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyName) => boolean; + + interface LoDashStatic { + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined` comparisons + * are handled by the method instead. The `customizer` is invoked with three + * arguments: (objValue, srcValue, index|key, object, source). + * + * @category Lang + * @param object The object to inspect. + * @param source The object of property values to match. + * @param [customizer] The function to customize comparisons. + * @returns Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + isMatchWith(object: object, source: object, customizer: isMatchWithCustomizer): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isMatchWith + */ + isMatchWith(source: object, customizer: isMatchWithCustomizer): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isMatchWith + */ + isMatchWith(source: object, customizer: isMatchWithCustomizer): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isNaN.d.ts b/types/lodash/lang/isNaN.d.ts new file mode 100644 index 0000000000..7ac79bc794 --- /dev/null +++ b/types/lodash/lang/isNaN.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is NaN. + * + * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. + * + * @param value The value to check. + * @return Returns true if value is NaN, else false. + */ + isNaN(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isNaN + */ + isNaN(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isNaN + */ + isNaN(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isNative.d.ts b/types/lodash/lang/isNative.d.ts new file mode 100644 index 0000000000..a1c0e2ff30 --- /dev/null +++ b/types/lodash/lang/isNative.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is a native function. + * @param value The value to check. + * + * @retrun Returns true if value is a native function, else false. + */ + isNative(value: any): value is (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * see _.isNative + */ + isNative(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isNative + */ + isNative(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isNil.d.ts b/types/lodash/lang/isNil.d.ts new file mode 100644 index 0000000000..d44c1f3893 --- /dev/null +++ b/types/lodash/lang/isNil.d.ts @@ -0,0 +1,36 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if `value` is `null` or `undefined`. + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + isNil(value: any): value is null | undefined; + } + + interface LoDashImplicitWrapper { + /** + * see _.isNil + */ + isNil(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isNil + */ + isNil(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isNull.d.ts b/types/lodash/lang/isNull.d.ts new file mode 100644 index 0000000000..7978835f2d --- /dev/null +++ b/types/lodash/lang/isNull.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is null. + * + * @param value The value to check. + * @return Returns true if value is null, else false. + */ + isNull(value: any): value is null; + } + + interface LoDashImplicitWrapper { + /** + * see _.isNull + */ + isNull(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isNull + */ + isNull(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isNumber.d.ts b/types/lodash/lang/isNumber.d.ts new file mode 100644 index 0000000000..1bfd01db46 --- /dev/null +++ b/types/lodash/lang/isNumber.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as a Number primitive or object. + * + * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isNumber(value?: any): value is number; + } + + interface LoDashImplicitWrapper { + /** + * see _.isNumber + */ + isNumber(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isNumber + */ + isNumber(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isObject.d.ts b/types/lodash/lang/isObject.d.ts new file mode 100644 index 0000000000..c9b47124a0 --- /dev/null +++ b/types/lodash/lang/isObject.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), + * and new String('')) + * + * @param value The value to check. + * @return Returns true if value is an object, else false. + */ + isObject(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isObject + */ + isObject(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isObject + */ + isObject(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isObjectLike.d.ts b/types/lodash/lang/isObjectLike.d.ts new file mode 100644 index 0000000000..dfb1d20a1a --- /dev/null +++ b/types/lodash/lang/isObjectLike.d.ts @@ -0,0 +1,40 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + isObjectLike(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isObjectLike + */ + isObjectLike(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isObjectLike + */ + isObjectLike(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isPlainObject.d.ts b/types/lodash/lang/isPlainObject.d.ts new file mode 100644 index 0000000000..e9708075ef --- /dev/null +++ b/types/lodash/lang/isPlainObject.d.ts @@ -0,0 +1,28 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is a plain object, that is, an object created by the Object constructor or one with a + * [[Prototype]] of null. + * + * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties. + * + * @param value The value to check. + * @return Returns true if value is a plain object, else false. + */ + isPlainObject(value?: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isPlainObject + */ + isPlainObject(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isPlainObject + */ + isPlainObject(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isRegExp.d.ts b/types/lodash/lang/isRegExp.d.ts new file mode 100644 index 0000000000..7e60fc4012 --- /dev/null +++ b/types/lodash/lang/isRegExp.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as a RegExp object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isRegExp(value?: any): value is RegExp; + } + + interface LoDashImplicitWrapper { + /** + * see _.isRegExp + */ + isRegExp(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isRegExp + */ + isRegExp(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isSafeInteger.d.ts b/types/lodash/lang/isSafeInteger.d.ts new file mode 100644 index 0000000000..3c51308410 --- /dev/null +++ b/types/lodash/lang/isSafeInteger.d.ts @@ -0,0 +1,42 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + isSafeInteger(value: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isSafeInteger + */ + isSafeInteger(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isSafeInteger + */ + isSafeInteger(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isSet.d.ts b/types/lodash/lang/isSet.d.ts new file mode 100644 index 0000000000..ae92840e4e --- /dev/null +++ b/types/lodash/lang/isSet.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as a Set object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isSet(value?: any): value is Set; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isSet + */ + isSet(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isSet + */ + isSet(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isString.d.ts b/types/lodash/lang/isString.d.ts new file mode 100644 index 0000000000..dff362cde4 --- /dev/null +++ b/types/lodash/lang/isString.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as a String primitive or object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isString(value?: any): value is string; + } + + interface LoDashImplicitWrapper { + /** + * see _.isString + */ + isString(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isString + */ + isString(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isSymbol.d.ts b/types/lodash/lang/isSymbol.d.ts new file mode 100644 index 0000000000..cd6c142ea2 --- /dev/null +++ b/types/lodash/lang/isSymbol.d.ts @@ -0,0 +1,33 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @category Lang + * @param value The value to check. + * @returns Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + isSymbol(value: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isSymbol + */ + isSymbol(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isSymbol + */ + isSymbol(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isTypedArray.d.ts b/types/lodash/lang/isTypedArray.d.ts new file mode 100644 index 0000000000..29309c7ced --- /dev/null +++ b/types/lodash/lang/isTypedArray.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as a typed array. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isTypedArray(value: any): boolean; + } + + interface LoDashImplicitWrapper { + /** + * see _.isTypedArray + */ + isTypedArray(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isTypedArray + */ + isTypedArray(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isUndefined.d.ts b/types/lodash/lang/isUndefined.d.ts new file mode 100644 index 0000000000..02a5697b74 --- /dev/null +++ b/types/lodash/lang/isUndefined.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is undefined. + * + * @param value The value to check. + * @return Returns true if value is undefined, else false. + */ + isUndefined(value: any): value is undefined; + } + + interface LoDashImplicitWrapper { + /** + * see _.isUndefined + */ + isUndefined(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * see _.isUndefined + */ + isUndefined(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isWeakMap.d.ts b/types/lodash/lang/isWeakMap.d.ts new file mode 100644 index 0000000000..b6f009c535 --- /dev/null +++ b/types/lodash/lang/isWeakMap.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as a WeakMap object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isWeakMap(value?: any): value is WeakMap; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isSet + */ + isWeakMap(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isSet + */ + isWeakMap(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/isWeakSet.d.ts b/types/lodash/lang/isWeakSet.d.ts new file mode 100644 index 0000000000..cb06d4c9b5 --- /dev/null +++ b/types/lodash/lang/isWeakSet.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is classified as a WeakSet object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isWeakSet(value?: any): value is WeakSet; + } + + interface LoDashImplicitWrapper { + /** + * @see _.isWeakSet + */ + isWeakSet(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.isWeakSet + */ + isWeakSet(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/lt.d.ts b/types/lodash/lang/lt.d.ts new file mode 100644 index 0000000000..a9ce5e6c4d --- /dev/null +++ b/types/lodash/lang/lt.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is less than other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is less than other, else false. + */ + lt( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lt + */ + lt(other: any): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lt + */ + lt(other: any): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/lte.d.ts b/types/lodash/lang/lte.d.ts new file mode 100644 index 0000000000..b8fac76627 --- /dev/null +++ b/types/lodash/lang/lte.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if value is less than or equal to other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is less than or equal to other, else false. + */ + lte( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lte + */ + lte(other: any): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lte + */ + lte(other: any): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toArray.d.ts b/types/lodash/lang/toArray.d.ts new file mode 100644 index 0000000000..6dd5ef8e27 --- /dev/null +++ b/types/lodash/lang/toArray.d.ts @@ -0,0 +1,45 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts value to an array. + * + * @param value The value to convert. + * @return Returns the converted array. + */ + toArray(value: List | Dictionary | NumericDictionary | null | undefined): T[]; + + /** + * @see _.toArray + */ + toArray(value: T): Array; + + /** + * @see _.toArray + */ + toArray(): any[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toArray + */ + toArray(this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.toArray + */ + toArray(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toArray + */ + toArray(this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.toArray + */ + toArray(this: LoDashImplicitWrapper): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toFinite.d.ts b/types/lodash/lang/toFinite.d.ts new file mode 100644 index 0000000000..0d14f49715 --- /dev/null +++ b/types/lodash/lang/toFinite.d.ts @@ -0,0 +1,40 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `value` to a finite number. + * + * @since 4.12.0 + * @category Lang + * @param value The value to convert. + * @returns Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + toFinite(value: any): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toFinite + */ + toFinite(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toFinite + */ + toFinite(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toInteger.d.ts b/types/lodash/lang/toInteger.d.ts new file mode 100644 index 0000000000..7e0b865078 --- /dev/null +++ b/types/lodash/lang/toInteger.d.ts @@ -0,0 +1,41 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @category Lang + * @param value The value to convert. + * @returns Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ + toInteger(value: any): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toInteger + */ + toInteger(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toInteger + */ + toInteger(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toLength.d.ts b/types/lodash/lang/toLength.d.ts new file mode 100644 index 0000000000..dcc84d78ee --- /dev/null +++ b/types/lodash/lang/toLength.d.ts @@ -0,0 +1,42 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @category Lang + * @param value The value to convert. + * @return Returns the converted integer. + * @example + * + * _.toLength(3); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3'); + * // => 3 + */ + toLength(value: any): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toLength + */ + toLength(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toLength + */ + toLength(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toNumber.d.ts b/types/lodash/lang/toNumber.d.ts new file mode 100644 index 0000000000..76c0032391 --- /dev/null +++ b/types/lodash/lang/toNumber.d.ts @@ -0,0 +1,39 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `value` to a number. + * + * @category Lang + * @param value The value to process. + * @returns Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ + toNumber(value: any): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toNumber + */ + toNumber(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toNumber + */ + toNumber(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toPlainObject.d.ts b/types/lodash/lang/toPlainObject.d.ts new file mode 100644 index 0000000000..9ae43dcf62 --- /dev/null +++ b/types/lodash/lang/toPlainObject.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts value to a plain object flattening inherited enumerable properties of value to own properties + * of the plain object. + * + * @param value The value to convert. + * @return Returns the converted plain object. + */ + toPlainObject(value?: any): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toPlainObject + */ + toPlainObject(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toPlainObject + */ + toPlainObject(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toSafeInteger.d.ts b/types/lodash/lang/toSafeInteger.d.ts new file mode 100644 index 0000000000..88e517d42c --- /dev/null +++ b/types/lodash/lang/toSafeInteger.d.ts @@ -0,0 +1,40 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @category Lang + * @param value The value to convert. + * @returns Returns the converted integer. + * @example + * + * _.toSafeInteger(3); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3'); + * // => 3 + */ + toSafeInteger(value: any): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toSafeInteger + */ + toSafeInteger(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toSafeInteger + */ + toSafeInteger(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/lang/toString.d.ts b/types/lodash/lang/toString.d.ts new file mode 100644 index 0000000000..1b461d1217 --- /dev/null +++ b/types/lodash/lang/toString.d.ts @@ -0,0 +1,23 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @category Lang + * @param value The value to process. + * @returns Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + toString(value: any): string; + } +} \ No newline at end of file diff --git a/types/lodash/math/add.d.ts b/types/lodash/math/add.d.ts new file mode 100644 index 0000000000..5e026fc671 --- /dev/null +++ b/types/lodash/math/add.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Adds two numbers. + * + * @param augend The first number to add. + * @param addend The second number to add. + * @return Returns the sum. + */ + add( + augend: number, + addend: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.add + */ + add(addend: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.add + */ + add(addend: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/ceil.d.ts b/types/lodash/math/ceil.d.ts new file mode 100644 index 0000000000..1977160c4e --- /dev/null +++ b/types/lodash/math/ceil.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Calculates n rounded up to precision. + * + * @param n The number to round up. + * @param precision The precision to round up to. + * @return Returns the rounded up number. + */ + ceil( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.ceil + */ + ceil(precision?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.ceil + */ + ceil(precision?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/divide.d.ts b/types/lodash/math/divide.d.ts new file mode 100644 index 0000000000..5af529f97f --- /dev/null +++ b/types/lodash/math/divide.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Divide two numbers. + * + * @param dividend The first number in a division. + * @param divisor The second number in a division. + * @returns Returns the quotient. + */ + divide( + dividend: number, + divisor: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.divide + */ + divide(divisor: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.divide + */ + divide(divisor: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/floor.d.ts b/types/lodash/math/floor.d.ts new file mode 100644 index 0000000000..db8d35def3 --- /dev/null +++ b/types/lodash/math/floor.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Calculates n rounded down to precision. + * + * @param n The number to round down. + * @param precision The precision to round down to. + * @return Returns the rounded down number. + */ + floor( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.floor + */ + floor(precision?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.floor + */ + floor(precision?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/max.d.ts b/types/lodash/math/max.d.ts new file mode 100644 index 0000000000..8a6108ab16 --- /dev/null +++ b/types/lodash/math/max.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Computes the maximum value of `array`. If `array` is empty or falsey + * `undefined` is returned. + * + * @category Math + * @param array The array to iterate over. + * @returns Returns the maximum value. + */ + max( + collection: List | null | undefined + ): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.max + */ + max(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.max + */ + max(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/maxBy.d.ts b/types/lodash/math/maxBy.d.ts new file mode 100644 index 0000000000..1b57efb78c --- /dev/null +++ b/types/lodash/math/maxBy.d.ts @@ -0,0 +1,48 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.max` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @category Math + * @param array The array to iterate over. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the maximum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.maxBy(objects, function(o) { return o.a; }); + * // => { 'n': 2 } + * + * // using the `_.property` iteratee shorthand + * _.maxBy(objects, 'n'); + * // => { 'n': 2 } + */ + maxBy( + collection: List | null | undefined, + iteratee?: ListIteratee + ): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.maxBy + */ + maxBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.maxBy + */ + maxBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/mean.d.ts b/types/lodash/math/mean.d.ts new file mode 100644 index 0000000000..ea2f39a952 --- /dev/null +++ b/types/lodash/math/mean.d.ts @@ -0,0 +1,32 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Computes the mean of the values in `array`. + * + * @category Math + * @param array The array to iterate over. + * @returns Returns the mean. + * @example + * + * _.mean([4, 2, 8, 6]); + * // => 5 + */ + mean( + collection: List | null | undefined + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.mean + */ + mean(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.mean + */ + mean(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/meanBy.d.ts b/types/lodash/math/meanBy.d.ts new file mode 100644 index 0000000000..c3ff1fded4 --- /dev/null +++ b/types/lodash/math/meanBy.d.ts @@ -0,0 +1,40 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Computes the mean of the provided propties of the objects in the `array` + * + * @category Math + * @param array The array to iterate over. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the mean. + * @example + * + * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); + * // => 5 + */ + meanBy( + collection: List | null | undefined, + iteratee?: ListIteratee + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.meanBy + */ + meanBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.meanBy + */ + meanBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/min.d.ts b/types/lodash/math/min.d.ts new file mode 100644 index 0000000000..6d0bc8ab60 --- /dev/null +++ b/types/lodash/math/min.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Computes the minimum value of `array`. If `array` is empty or falsey + * `undefined` is returned. + * + * @category Math + * @param array The array to iterate over. + * @returns Returns the minimum value. + */ + min( + collection: List | null | undefined + ): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.min + */ + min(this: LoDashImplicitWrapper | null | undefined>): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.min + */ + min(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/minBy.d.ts b/types/lodash/math/minBy.d.ts new file mode 100644 index 0000000000..2e70263af8 --- /dev/null +++ b/types/lodash/math/minBy.d.ts @@ -0,0 +1,48 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.min` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @category Math + * @param array The array to iterate over. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the minimum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.minBy(objects, function(o) { return o.a; }); + * // => { 'n': 1 } + * + * // using the `_.property` iteratee shorthand + * _.minBy(objects, 'n'); + * // => { 'n': 1 } + */ + minBy( + collection: List | null | undefined, + iteratee?: ListIteratee + ): T | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.minBy + */ + minBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): T | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.minBy + */ + minBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/multiply.d.ts b/types/lodash/math/multiply.d.ts new file mode 100644 index 0000000000..6381b4f2d8 --- /dev/null +++ b/types/lodash/math/multiply.d.ts @@ -0,0 +1,28 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Multiply two numbers. + * @param multiplier The first number in a multiplication. + * @param multiplicand The second number in a multiplication. + * @returns Returns the product. + */ + multiply( + multiplier: number, + multiplicand: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.multiply + */ + multiply(multiplicand: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.multiply + */ + multiply(multiplicand: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/round.d.ts b/types/lodash/math/round.d.ts new file mode 100644 index 0000000000..b3bc0dcaa1 --- /dev/null +++ b/types/lodash/math/round.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Calculates n rounded to precision. + * + * @param n The number to round. + * @param precision The precision to round to. + * @return Returns the rounded number. + */ + round( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.round + */ + round(precision?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.round + */ + round(precision?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/subtract.d.ts b/types/lodash/math/subtract.d.ts new file mode 100644 index 0000000000..0c1ddabcca --- /dev/null +++ b/types/lodash/math/subtract.d.ts @@ -0,0 +1,38 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Subtract two numbers. + * + * @category Math + * @param minuend The first number in a subtraction. + * @param subtrahend The second number in a subtraction. + * @returns Returns the difference. + * @example + * + * _.subtract(6, 4); + * // => 2 + */ + subtract( + minuend: number, + subtrahend: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.subtract + */ + subtract( + subtrahend: number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.subtract + */ + subtract( + subtrahend: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/sum.d.ts b/types/lodash/math/sum.d.ts new file mode 100644 index 0000000000..de92ef1f0d --- /dev/null +++ b/types/lodash/math/sum.d.ts @@ -0,0 +1,30 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Computes the sum of the values in `array`. + * + * @category Math + * @param array The array to iterate over. + * @returns Returns the sum. + * @example + * + * _.sum([4, 2, 8, 6]); + * // => 20 + */ + sum(collection: List | null | undefined): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sum + */ + sum(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sum + */ + sum(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/math/sumBy.d.ts b/types/lodash/math/sumBy.d.ts new file mode 100644 index 0000000000..05e836325a --- /dev/null +++ b/types/lodash/math/sumBy.d.ts @@ -0,0 +1,52 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.sum` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the value to be summed. + * The iteratee is invoked with one argument: (value). + * + * @category Math + * @param array The array to iterate over. + * @param [iteratee=_.identity] The iteratee invoked per element. + * @returns Returns the sum. + * @example + * + * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; + * + * _.sumBy(objects, function(o) { return o.n; }); + * // => 20 + * + * // using the `_.property` iteratee shorthand + * _.sumBy(objects, 'n'); + * // => 20 + */ + sumBy( + collection: List | null | undefined, + iteratee?: ((value: T) => number) | string + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sumBy + */ + sumBy( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ((value: T) => number) | string + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sumBy + */ + sumBy( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ((value: T) => number) | string + ): LoDashExplicitWrapper; + } + + /********** + * Number * + **********/ +} \ No newline at end of file diff --git a/types/lodash/methods/templateSettings.imports._.d.ts b/types/lodash/methods/templateSettings.imports._.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/lodash/number/clamp.d.ts b/types/lodash/number/clamp.d.ts new file mode 100644 index 0000000000..e7aff8c4ae --- /dev/null +++ b/types/lodash/number/clamp.d.ts @@ -0,0 +1,55 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @category Number + * @param number The number to clamp. + * @param [lower] The lower bound. + * @param upper The upper bound. + * @returns Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + clamp( + number: number, + lower: number, + upper: number + ): number; + clamp( + number: number, + upper: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.clamp + */ + clamp( + lower: number, + upper: number + ): number; + clamp( + upper: number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.clamp + */ + clamp( + lower: number, + upper: number + ): LoDashExplicitWrapper; + clamp( + upper: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/number/inRange.d.ts b/types/lodash/number/inRange.d.ts new file mode 100644 index 0000000000..0e3fd3ed8e --- /dev/null +++ b/types/lodash/number/inRange.d.ts @@ -0,0 +1,38 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start + * with start then set to 0. + * + * @param n The number to check. + * @param start The start of the range. + * @param end The end of the range. + * @return Returns true if n is in the range, else false. + */ + inRange( + n: number, + start: number, + end?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.inRange + */ + inRange( + start: number, + end?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.inRange + */ + inRange( + start: number, + end?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/number/random.d.ts b/types/lodash/number/random.d.ts new file mode 100644 index 0000000000..112e579896 --- /dev/null +++ b/types/lodash/number/random.d.ts @@ -0,0 +1,84 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Produces a random number between min and max (inclusive). If only one argument is provided a number between + * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point + * number is returned instead of an integer. + * + * @param min The minimum possible value. + * @param max The maximum possible value. + * @param floating Specify returning a floating-point number. + * @return Returns the random number. + */ + random( + floating?: boolean + ): number; + + /** + * @see _.random + */ + random( + max: number, + floating?: boolean + ): number; + + /** + * @see _.random + */ + random( + min: number, + max: number, + floating?: boolean + ): number; + + /** + * Produces a random number between min and max (inclusive). If only one argument is provided a number between + * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point + * number is returned instead of an integer. + * + * @param min The minimum possible value. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the random number. + */ + random( + min: number, + index: string | number, + guard: object + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.random + */ + random(floating?: boolean): number; + + /** + * @see _.random + */ + random( + max: number, + floating?: boolean + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.random + */ + random(floating?: boolean): LoDashExplicitWrapper; + + /** + * @see _.random + */ + random( + max: number, + floating?: boolean + ): LoDashExplicitWrapper; + } + + /********** + * Object * + **********/ +} \ No newline at end of file diff --git a/types/lodash/object/assign.d.ts b/types/lodash/object/assign.d.ts new file mode 100644 index 0000000000..e329c27ab5 --- /dev/null +++ b/types/lodash/object/assign.d.ts @@ -0,0 +1,171 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Assigns own enumerable properties of source objects to the destination + * object. Source objects are applied from left to right. Subsequent sources + * overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @category Object + * @param object The destination object. + * @param [sources] The source objects. + * @returns Returns `object`. + * @example + * + * function Foo() { + * this.c = 3; + * } + * + * function Bar() { + * this.e = 5; + * } + * + * Foo.prototype.d = 4; + * Bar.prototype.f = 6; + * + * _.assign({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3, 'e': 5 } + */ + assign( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assign + */ + assign(object: TObject): TObject; + + /** + * @see _.assign + */ + assign( + object: any, + ...otherArgs: any[] + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.assign + */ + assign( + source: TSource + ): LoDashImplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitWrapper; + + /** + * @see _.assign + */ + assign(): LoDashImplicitWrapper; + + /** + * @see _.assign + */ + assign(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.assign + */ + assign( + source: TSource + ): LoDashExplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitWrapper; + + /** + * @see _.assign + */ + assign(): LoDashExplicitWrapper; + + /** + * @see _.assign + */ + assign(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/assignIn.d.ts b/types/lodash/object/assignIn.d.ts new file mode 100644 index 0000000000..a5981e75a0 --- /dev/null +++ b/types/lodash/object/assignIn.d.ts @@ -0,0 +1,170 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @alias extend + * @category Object + * @param object The destination object. + * @param [sources] The source objects. + * @returns Returns `object`. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * function Bar() { + * this.d = 4; + * } + * + * Foo.prototype.c = 3; + * Bar.prototype.e = 5; + * + * _.assignIn({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + */ + assignIn( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see assignIn + */ + assignIn( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see assignIn + */ + assignIn( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assignIn + */ + assignIn( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignIn + */ + assignIn(object: TObject): TObject; + + /** + * @see _.assignIn + */ + assignIn( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.assignIn + */ + assignIn( + source: TSource + ): LoDashImplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitWrapper; + + /** + * @see _.assignIn + */ + assignIn(): LoDashImplicitWrapper; + + /** + * @see _.assignIn + */ + assignIn(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.assignIn + */ + assignIn( + source: TSource + ): LoDashExplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitWrapper; + + /** + * @see _.assignIn + */ + assignIn(): LoDashExplicitWrapper; + + /** + * @see _.assignIn + */ + assignIn(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/assignInWith.d.ts b/types/lodash/object/assignInWith.d.ts new file mode 100644 index 0000000000..85a6311cda --- /dev/null +++ b/types/lodash/object/assignInWith.d.ts @@ -0,0 +1,182 @@ +declare namespace _ { + type AssignCustomizer = (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; + + interface LoDashStatic { + /** + * This method is like `_.assignIn` except that it accepts `customizer` which + * is invoked to produce the assigned values. If `customizer` returns `undefined` + * assignment is handled by the method instead. The `customizer` is invoked + * with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @alias extendWith + * @category Object + * @param object The destination object. + * @param sources The source objects. + * @param [customizer] The function to customize assigned values. + * @returns Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + assignInWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see assignInWith + */ + assignInWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see assignInWith + */ + assignInWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assignInWith + */ + assignInWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignInWith + */ + assignInWith(object: TObject): TObject; + + /** + * @see _.assignInWith + */ + assignInWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.assignInWith + */ + assignInWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(): LoDashImplicitWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.assignInWith + */ + assignInWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(): LoDashExplicitWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/assignWith.d.ts b/types/lodash/object/assignWith.d.ts new file mode 100644 index 0000000000..e31cd8d9bc --- /dev/null +++ b/types/lodash/object/assignWith.d.ts @@ -0,0 +1,179 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.assign` except that it accepts `customizer` which + * is invoked to produce the assigned values. If `customizer` returns `undefined` + * assignment is handled by the method instead. The `customizer` is invoked + * with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @category Object + * @param object The destination object. + * @param sources The source objects. + * @param [customizer] The function to customize assigned values. + * @returns Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + assignWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see assignWith + */ + assignWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see assignWith + */ + assignWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assignWith + */ + assignWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignWith + */ + assignWith(object: TObject): TObject; + + /** + * @see _.assignWith + */ + assignWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.assignWith + */ + assignWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.assignWith + */ + assignWith(): LoDashImplicitWrapper; + + /** + * @see _.assignWith + */ + assignWith(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.assignWith + */ + assignWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.assignWith + */ + assignWith(): LoDashExplicitWrapper; + + /** + * @see _.assignWith + */ + assignWith(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/at.d.ts b/types/lodash/object/at.d.ts new file mode 100644 index 0000000000..d6046e597d --- /dev/null +++ b/types/lodash/object/at.d.ts @@ -0,0 +1,60 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be + * specified as individual arguments or as arrays of keys. + * + * @param object The object to iterate over. + * @param props The property names or indexes of elements to pick, specified individually or in arrays. + * @return Returns the new array of picked elements. + */ + at( + object: List | Dictionary | null | undefined, + ...props: PropertyPath[] + ): T[]; + + /** + * @see _.at + */ + at( + object: T | null | undefined, + ...props: Array> + ): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.at + */ + at( + this: LoDashImplicitWrapper | Dictionary | null | undefined>, + ...props: PropertyPath[] + ): LoDashImplicitWrapper; + + /** + * @see _.at + */ + at( + this: LoDashImplicitWrapper, + ...props: Array> + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.at + */ + at( + this: LoDashExplicitWrapper | Dictionary | null | undefined>, + ...props: PropertyPath[] + ): LoDashExplicitWrapper; + + /** + * @see _.at + */ + at( + this: LoDashExplicitWrapper, + ...props: Array> + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/create.d.ts b/types/lodash/object/create.d.ts new file mode 100644 index 0000000000..025b4dbe66 --- /dev/null +++ b/types/lodash/object/create.d.ts @@ -0,0 +1,30 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an object that inherits from the given prototype object. If a properties object is provided its own + * enumerable properties are assigned to the created object. + * + * @param prototype The object to inherit from. + * @param properties The properties to assign to the object. + * @return Returns the new object. + */ + create( + prototype: T, + properties?: U + ): T & U; + } + + interface LoDashImplicitWrapper { + /** + * @see _.create + */ + create(properties?: U): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.create + */ + create(properties?: U): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/defaults.d.ts b/types/lodash/object/defaults.d.ts new file mode 100644 index 0000000000..ea53dbddc5 --- /dev/null +++ b/types/lodash/object/defaults.d.ts @@ -0,0 +1,154 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Assigns own enumerable properties of source object(s) to the destination object for all destination + * properties that resolve to undefined. Once a property is set, additional values of the same property are + * ignored. + * + * Note: This method mutates object. + * + * @param object The destination object. + * @param sources The source objects. + * @return The destination object. + */ + defaults( + object: TObject, + source: TSource + ): TSource & TObject; + + /** + * @see _.defaults + */ + defaults( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TSource2 & TSource1 & TObject; + + /** + * @see _.defaults + */ + defaults( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TSource3 & TSource2 & TSource1 & TObject; + + /** + * @see _.defaults + */ + defaults( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TSource4 & TSource3 & TSource2 & TSource1 & TObject; + + /** + * @see _.defaults + */ + defaults(object: TObject): TObject; + + /** + * @see _.defaults + */ + defaults( + object: any, + ...sources: any[] + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.defaults + */ + defaults( + source: TSource + ): LoDashImplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitWrapper; + + /** + * @see _.defaults + */ + defaults(): LoDashImplicitWrapper; + + /** + * @see _.defaults + */ + defaults(...sources: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.defaults + */ + defaults( + source: TSource + ): LoDashExplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitWrapper; + + /** + * @see _.defaults + */ + defaults(): LoDashExplicitWrapper; + + /** + * @see _.defaults + */ + defaults(...sources: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/defaultsDeep.d.ts b/types/lodash/object/defaultsDeep.d.ts new file mode 100644 index 0000000000..89ba6b9b7e --- /dev/null +++ b/types/lodash/object/defaultsDeep.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.defaults except that it recursively assigns default properties. + * @param object The destination object. + * @param sources The source objects. + * @return Returns object. + **/ + defaultsDeep( + object: any, + ...sources: any[]): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.defaultsDeep + **/ + defaultsDeep(...sources: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.defaultsDeep + **/ + defaultsDeep(...sources: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/entries.d.ts b/types/lodash/object/entries.d.ts new file mode 100644 index 0000000000..fee39417ae --- /dev/null +++ b/types/lodash/object/entries.d.ts @@ -0,0 +1,37 @@ +declare namespace _ { + interface LoDashStatic { + /** + * @see _.toPairs + */ + entries(object?: Dictionary): Array<[string, T]>; + + /** + * @see _.toPairs + */ + entries(object?: object): Array<[string, any]>; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toPairs + */ + entries(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + + /** + * @see _.toPairs + */ + entries(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toPairs + */ + entries(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + + /** + * @see _.toPairs + */ + entries(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/entriesIn.d.ts b/types/lodash/object/entriesIn.d.ts new file mode 100644 index 0000000000..8df728058d --- /dev/null +++ b/types/lodash/object/entriesIn.d.ts @@ -0,0 +1,37 @@ +declare namespace _ { + interface LoDashStatic { + /** + * @see _.entriesIn + */ + entriesIn(object?: Dictionary): Array<[string, T]>; + + /** + * @see _.entriesIn + */ + entriesIn(object?: object): Array<[string, any]>; + } + + interface LoDashImplicitWrapper { + /** + * @see _.entriesIn + */ + entriesIn(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + + /** + * @see _.entriesIn + */ + entriesIn(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.entriesIn + */ + entriesIn(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + + /** + * @see _.entriesIn + */ + entriesIn(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/extend.d.ts b/types/lodash/object/extend.d.ts new file mode 100644 index 0000000000..17ce0232fa --- /dev/null +++ b/types/lodash/object/extend.d.ts @@ -0,0 +1,146 @@ +declare namespace _ { + interface LoDashStatic { + /** + * @see _.extend + */ + extend( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see _.extend + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see _.extend + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.extend + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.extend + */ + extend(object: TObject): TObject; + + /** + * @see _.extend + */ + extend( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.extend + */ + extend( + source: TSource + ): LoDashImplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitWrapper; + + /** + * @see _.extend + */ + extend(): LoDashImplicitWrapper; + + /** + * @see _.extend + */ + extend(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.extend + */ + extend( + source: TSource + ): LoDashExplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitWrapper; + + /** + * @see _.extend + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitWrapper; + + /** + * @see _.extend + */ + extend(): LoDashExplicitWrapper; + + /** + * @see _.extend + */ + extend(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/extendWith.d.ts b/types/lodash/object/extendWith.d.ts new file mode 100644 index 0000000000..d02803cf32 --- /dev/null +++ b/types/lodash/object/extendWith.d.ts @@ -0,0 +1,158 @@ +declare namespace _ { + interface LoDashStatic { + /** + * @see _.extendWith + */ + extendWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see _.extendWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see _.extendWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.extendWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.extendWith + */ + extendWith(object: TObject): TObject; + + /** + * @see _.extendWith + */ + extendWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.extendWith + */ + extendWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith(): LoDashImplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith(...otherArgs: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.extendWith + */ + extendWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith(): LoDashExplicitWrapper; + + /** + * @see _.extendWith + */ + extendWith(...otherArgs: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/findKey.d.ts b/types/lodash/object/findKey.d.ts new file mode 100644 index 0000000000..768c8aa3aa --- /dev/null +++ b/types/lodash/object/findKey.d.ts @@ -0,0 +1,46 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.find except that it returns the key of the first element predicate returns truthy for + * instead of the element itself. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param object The object to search. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the key of the matched element, else undefined. + */ + findKey( + object: T | null | undefined, + predicate?: ObjectIteratee + ): string | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.findKey + */ + findKey( + this: LoDashImplicitWrapper, + predicate?: ObjectIteratee + ): string | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.findKey + */ + findKey( + this: LoDashExplicitWrapper, + predicate?: ObjectIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/findLastKey.d.ts b/types/lodash/object/findLastKey.d.ts new file mode 100644 index 0000000000..e772dc3f80 --- /dev/null +++ b/types/lodash/object/findLastKey.d.ts @@ -0,0 +1,45 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param object The object to search. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the key of the matched element, else undefined. + */ + findLastKey( + object: T | null | undefined, + predicate?: ObjectIteratee + ): string | undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.findLastKey + */ + findLastKey( + this: LoDashImplicitWrapper, + predicate?: ObjectIteratee + ): string | undefined; + } + + interface LoDashExplicitWrapper { + /** + * @see _.findLastKey + */ + findLastKey( + this: LoDashExplicitWrapper, + predicate?: ObjectIteratee + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/forIn.d.ts b/types/lodash/object/forIn.d.ts new file mode 100644 index 0000000000..a5e700aa22 --- /dev/null +++ b/types/lodash/object/forIn.d.ts @@ -0,0 +1,36 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The + * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may + * exit iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forIn( + object: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forIn + */ + forIn( + object: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forIn + */ + forIn( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/object/forInRight.d.ts b/types/lodash/object/forInRight.d.ts new file mode 100644 index 0000000000..98506ebc4e --- /dev/null +++ b/types/lodash/object/forInRight.d.ts @@ -0,0 +1,34 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.forIn except that it iterates over properties of object in the opposite order. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forInRight( + object: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forInRight + */ + forInRight( + object: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forInRight + */ + forInRight( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/object/forOwn.d.ts b/types/lodash/object/forOwn.d.ts new file mode 100644 index 0000000000..84b389080f --- /dev/null +++ b/types/lodash/object/forOwn.d.ts @@ -0,0 +1,36 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is + * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forOwn( + object: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forOwn + */ + forOwn( + object: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forOwn + */ + forOwn( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/object/forOwnRight.d.ts b/types/lodash/object/forOwnRight.d.ts new file mode 100644 index 0000000000..fc8160edff --- /dev/null +++ b/types/lodash/object/forOwnRight.d.ts @@ -0,0 +1,34 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.forOwn except that it iterates over properties of object in the opposite order. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forOwnRight( + object: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forOwnRight + */ + forOwnRight( + object: T | null | undefined, + iteratee?: ObjectIterator + ): T | null | undefined; + } + + interface LoDashWrapper { + /** + * @see _.forOwnRight + */ + forOwnRight( + this: LoDashWrapper, + iteratee?: ObjectIterator + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/object/functions.d.ts b/types/lodash/object/functions.d.ts new file mode 100644 index 0000000000..9871ffdc81 --- /dev/null +++ b/types/lodash/object/functions.d.ts @@ -0,0 +1,38 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @category Object + * @param object The object to inspect. + * @returns Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + functions(object: any): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.functions + */ + functions(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.functions + */ + functions(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/functionsIn.d.ts b/types/lodash/object/functionsIn.d.ts new file mode 100644 index 0000000000..959f05743b --- /dev/null +++ b/types/lodash/object/functionsIn.d.ts @@ -0,0 +1,38 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @category Object + * @param object The object to inspect. + * @returns Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + functionsIn(object: any): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.functionsIn + */ + functionsIn(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.functionsIn + */ + functionsIn(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/get.d.ts b/types/lodash/object/get.d.ts new file mode 100644 index 0000000000..957eaf716e --- /dev/null +++ b/types/lodash/object/get.d.ts @@ -0,0 +1,237 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used + * in its place. + * + * @param object The object to query. + * @param path The path of the property to get. + * @param defaultValue The value returned if the resolved value is undefined. + * @return Returns the resolved value. + */ + get( + object: TObject, + path: TKey | [TKey] + ): TObject[TKey]; + + /** + * @see _.get + */ + get( + object: TObject | null | undefined, + path: TKey | [TKey] + ): TObject[TKey] | undefined; + + /** + * @see _.get + */ + get( + object: TObject | null | undefined, + path: TKey | [TKey], + defaultValue: TDefault + ): TObject[TKey] | TDefault; + + /** + * @see _.get + */ + get( + object: NumericDictionary, + path: number + ): T; + + /** + * @see _.get + */ + get( + object: NumericDictionary | null | undefined, + path: number + ): T | undefined; + + /** + * @see _.get + */ + get( + object: NumericDictionary | null | undefined, + path: number, + defaultValue: TDefault + ): T | TDefault; + + /** + * @see _.get + */ + get( + object: null | undefined, + path: PropertyPath, + defaultValue: TDefault + ): TDefault; + + /** + * @see _.get + */ + get( + object: null | undefined, + path: PropertyPath + ): undefined; + + /** + * @see _.get + */ + get( + object: any, + path: PropertyPath, + defaultValue?: any + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.get + */ + get( + path: TKey | [TKey] + ): TValue[TKey]; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper, + path: TKey | [TKey], + ): TObject[TKey] | undefined; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper, + path: TKey | [TKey], + defaultValue: TDefault + ): TObject[TKey] | TDefault; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper>, + path: number + ): T; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper | null | undefined>, + path: number + ): T | undefined; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper | null | undefined>, + path: number, + defaultValue: TDefault + ): T | TDefault; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper, + path: PropertyPath, + defaultValue: TDefault + ): TDefault; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper, + path: PropertyPath + ): undefined; + + /** + * @see _.get + */ + get( + path: PropertyPath, + defaultValue?: any + ): any; + } + + interface LoDashExplicitWrapper { + /** + * @see _.get + */ + get( + path: TKey | [TKey] + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper, + path: TKey | [TKey], + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper, + path: TKey | [TKey], + defaultValue: TDefault + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper>, + path: number + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper | null | undefined>, + path: number + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper | null | undefined>, + path: number, + defaultValue: TDefault + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper, + path: PropertyPath, + defaultValue: TDefault + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper, + path: PropertyPath + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + path: PropertyPath, + defaultValue?: any + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/has.d.ts b/types/lodash/object/has.d.ts new file mode 100644 index 0000000000..b8dc9ffc4d --- /dev/null +++ b/types/lodash/object/has.d.ts @@ -0,0 +1,46 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if `path` is a direct property of `object`. + * + * @category Object + * @param object The object to query. + * @param path The path to check. + * @returns Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': { 'c': 3 } } }; + * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b.c'); + * // => true + * + * _.has(object, ['a', 'b', 'c']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + has( + object: T, + path: PropertyPath + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.has + */ + has(path: PropertyPath): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.has + */ + has(path: PropertyPath): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/hasIn.d.ts b/types/lodash/object/hasIn.d.ts new file mode 100644 index 0000000000..58917bdb19 --- /dev/null +++ b/types/lodash/object/hasIn.d.ts @@ -0,0 +1,45 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @category Object + * @param object The object to query. + * @param path The path to check. + * @returns Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b.c'); + * // => true + * + * _.hasIn(object, ['a', 'b', 'c']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + hasIn( + object: T, + path: PropertyPath + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.hasIn + */ + hasIn(path: PropertyPath): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.hasIn + */ + hasIn(path: PropertyPath): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/invert.d.ts b/types/lodash/object/invert.d.ts new file mode 100644 index 0000000000..8bb5d784ed --- /dev/null +++ b/types/lodash/object/invert.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, + * subsequent values overwrite property assignments of previous values unless multiValue is true. + * + * @param object The object to invert. + * @param multiValue Allow multiple values per key. + * @return Returns the new inverted object. + */ + invert( + object: object + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.invert + */ + invert(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.invert + */ + invert(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/invertBy.d.ts b/types/lodash/object/invertBy.d.ts new file mode 100644 index 0000000000..3feb6ee0b6 --- /dev/null +++ b/types/lodash/object/invertBy.d.ts @@ -0,0 +1,61 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.invert except that the inverted object is generated from the results of running each + * element of object through iteratee. The corresponding inverted value of each inverted key is an array of + * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). + * + * @param object The object to invert. + * @param interatee The iteratee invoked per element. + * @return Returns the new inverted object. + */ + invertBy( + object: List | Dictionary | NumericDictionary | null | undefined, + interatee?: ValueIteratee + ): Dictionary; + + /** + * @see _.invertBy + */ + invertBy( + object: T | null | undefined, + interatee?: ValueIteratee + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.invertBy + */ + invertBy( + this: LoDashImplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + interatee?: ValueIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.invertBy + */ + invertBy( + this: LoDashImplicitWrapper, + interatee?: ValueIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.invertBy + */ + invertBy( + this: LoDashExplicitWrapper | Dictionary | NumericDictionary | null | undefined>, + interatee?: ValueIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.invertBy + */ + invertBy( + this: LoDashExplicitWrapper, + interatee?: ValueIteratee + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/invoke.d.ts b/types/lodash/object/invoke.d.ts new file mode 100644 index 0000000000..2e5f9970c3 --- /dev/null +++ b/types/lodash/object/invoke.d.ts @@ -0,0 +1,32 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Invokes the method at path of object. + * @param object The object to query. + * @param path The path of the method to invoke. + * @param args The arguments to invoke the method with. + **/ + invoke( + object: any, + path: PropertyPath, + ...args: any[]): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.invoke + **/ + invoke( + path: PropertyPath, + ...args: any[]): any; + } + + interface LoDashExplicitWrapper { + /** + * @see _.invoke + **/ + invoke( + path: PropertyPath, + ...args: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/keys.d.ts b/types/lodash/object/keys.d.ts new file mode 100644 index 0000000000..14a5f41b94 --- /dev/null +++ b/types/lodash/object/keys.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of the own enumerable property names of object. + * + * Note: Non-object values are coerced to objects. See the ES spec for more details. + * + * @param object The object to query. + * @return Returns the array of property names. + */ + keys(object?: any): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.keys + */ + keys(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.keys + */ + keys(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/keysIn.d.ts b/types/lodash/object/keysIn.d.ts new file mode 100644 index 0000000000..c0c1210c02 --- /dev/null +++ b/types/lodash/object/keysIn.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of the own and inherited enumerable property names of object. + * + * Note: Non-object values are coerced to objects. + * + * @param object The object to query. + * @return An array of property names. + */ + keysIn(object?: any): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.keysIn + */ + keysIn(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.keysIn + */ + keysIn(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/mapKeys.d.ts b/types/lodash/object/mapKeys.d.ts new file mode 100644 index 0000000000..992b0e3026 --- /dev/null +++ b/types/lodash/object/mapKeys.d.ts @@ -0,0 +1,85 @@ +declare namespace _ { + interface LoDashStatic { + /** + * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated + * by running each own enumerable property of object through iteratee. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the new mapped object. + */ + mapKeys( + object: List | null | undefined, + iteratee?: ListIteratee + ): Dictionary; + + /** + * @see _.mapKeys + */ + mapKeys( + object: Dictionary | null | undefined, + iteratee?: DictionaryIteratee + ): Dictionary; + + /** + * @see _.mapKeys + */ + mapKeys( + object: object | null | undefined, + iteratee?: ObjectIteratee + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashImplicitWrapper | null | undefined>, + iteratee?: DictionaryIteratee + ): LoDashImplicitWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashImplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: ListIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashExplicitWrapper | null | undefined>, + iteratee?: DictionaryIteratee + ): LoDashExplicitWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + this: LoDashExplicitWrapper, + iteratee?: ObjectIteratee + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/mapValues.d.ts b/types/lodash/object/mapValues.d.ts new file mode 100644 index 0000000000..94c97417f4 --- /dev/null +++ b/types/lodash/object/mapValues.d.ts @@ -0,0 +1,188 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an object with the same keys as object and values generated by running each own + * enumerable property of object through iteratee. The iteratee function is bound to thisArg + * and invoked with three arguments: (value, key, object). + * + * If a property name is provided iteratee the created "_.property" style callback returns + * the property value of the given element. + * + * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns + * true for elements that have a matching property value, else false;. + * + * If an object is provided for iteratee the created "_.matches" style callback returns true + * for elements that have the properties of the given object, else false. + * + * @param object The object to iterate over. + * @param [iteratee=_.identity] The function invoked per iteration. + * @param [thisArg] The `this` binding of `iteratee`. + * @return Returns the new mapped object. + */ + mapValues(obj: T | null | undefined, callback: ObjectIterator): { [P in keyof T]: TResult }; + + /** + * @see _.mapValues + */ + mapValues(obj: T | null | undefined, iteratee: object): { [P in keyof T]: boolean }; + + /** + * @see _.mapValues + */ + mapValues(obj: Dictionary | null | undefined, iteratee: TKey): Dictionary; + + /** + * @see _.mapValues + */ + mapValues(obj: T | null | undefined, iteratee: string): { [P in keyof T]: any }; + + /** + * @see _.mapValues + */ + mapValues(obj: string | null | undefined, callback: StringIterator): NumericDictionary; + + /** + * @see _.mapValues + */ + mapValues(obj: Dictionary | null | undefined): Dictionary; + + /** + * @see _.mapValues + */ + mapValues(obj: T): T; + + /** + * @see _.mapValues + */ + mapValues(obj: T | null | undefined): T | {}; + + /** + * @see _.mapValues + */ + mapValues(obj: string | null | undefined): NumericDictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.mapValues + */ + mapValues( + this: LoDashImplicitWrapper, + callback: ObjectIterator + ): LoDashImplicitWrapper<{ [P in keyof T]: TResult }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashImplicitWrapper, + iteratee: object + ): LoDashImplicitWrapper<{ [P in keyof T]: boolean }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashImplicitWrapper | null | undefined>, + iteratee: TKey + ): LoDashImplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashImplicitWrapper, + iteratee: string + ): LoDashImplicitWrapper<{ [P in keyof T]: any }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashImplicitWrapper, + callback: StringIterator + ): LoDashImplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashImplicitWrapper | null | undefined>): LoDashImplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.mapValues + */ + mapValues( + this: LoDashExplicitWrapper, + callback: ObjectIterator + ): LoDashExplicitWrapper<{ [P in keyof T]: TResult }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashExplicitWrapper, + iteratee: object + ): LoDashExplicitWrapper<{ [P in keyof T]: boolean }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashExplicitWrapper | null | undefined>, + iteratee: TKey + ): LoDashExplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashExplicitWrapper, + iteratee: string + ): LoDashExplicitWrapper<{ [P in keyof T]: any }>; + + /** + * @see _.mapValues + */ + mapValues( + this: LoDashExplicitWrapper, + callback: StringIterator + ): LoDashExplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashExplicitWrapper | null | undefined>): LoDashExplicitWrapper>; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper; + + /** + * @see _.mapValues + */ + mapValues(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/merge.d.ts b/types/lodash/object/merge.d.ts new file mode 100644 index 0000000000..1136f2d9bb --- /dev/null +++ b/types/lodash/object/merge.d.ts @@ -0,0 +1,155 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Recursively merges own and inherited enumerable properties of source + * objects into the destination object, skipping source properties that resolve + * to `undefined`. Array and plain object properties are merged recursively. + * Other objects and value types are overridden by assignment. Source objects + * are applied from left to right. Subsequent sources overwrite property + * assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @category Object + * @param object The destination object. + * @param [sources] The source objects. + * @returns Returns `object`. + * @example + * + * var users = { + * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * }; + * + * var ages = { + * 'data': [{ 'age': 36 }, { 'age': 40 }] + * }; + * + * _.merge(users, ages); + * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + */ + merge( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see _.merge + */ + merge( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see _.merge + */ + merge( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.merge + */ + merge( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.merge + */ + merge( + object: any, + ...otherArgs: any[] + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.merge + */ + merge( + source: TSource + ): LoDashImplicitWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitWrapper; + + /** + * @see _.merge + */ + merge( + ...otherArgs: any[] + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.merge + */ + merge( + source: TSource + ): LoDashExplicitWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitWrapper; + + /** + * @see _.merge + */ + merge( + ): LoDashExplicitWrapper; + + /** + * @see _.merge + */ + merge( + ...otherArgs: any[] + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/mergeWith.d.ts b/types/lodash/object/mergeWith.d.ts new file mode 100644 index 0000000000..2f568e67db --- /dev/null +++ b/types/lodash/object/mergeWith.d.ts @@ -0,0 +1,132 @@ +declare namespace _ { + type MergeWithCustomizer = { bivariantHack(value: any, srcValue: any, key: string, object: any, source: any): any; }["bivariantHack"] + + interface LoDashStatic { + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined` merging is handled by the + * method instead. The `customizer` is invoked with seven arguments: + * (objValue, srcValue, key, object, source, stack). + * + * @category Object + * @param object The destination object. + * @param sources The source objects. + * @param customizer The function to customize assigned values. + * @returns Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var other = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(object, other, customizer); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } + */ + mergeWith( + object: TObject, + source: TSource, + customizer: MergeWithCustomizer + ): TObject & TSource; + + /** + * @see _.mergeWith + */ + mergeWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see _.mergeWith + */ + mergeWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.mergeWith + */ + mergeWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.mergeWith + */ + mergeWith( + object: any, + ...otherArgs: any[] + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.mergeWith + */ + mergeWith( + source: TSource, + customizer: MergeWithCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + source1: TSource1, + source2: TSource2, + customizer: MergeWithCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: MergeWithCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: MergeWithCustomizer + ): LoDashImplicitWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + ...otherArgs: any[] + ): LoDashImplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/omit.d.ts b/types/lodash/object/omit.d.ts new file mode 100644 index 0000000000..ae9890f7d9 --- /dev/null +++ b/types/lodash/object/omit.d.ts @@ -0,0 +1,68 @@ +declare namespace _ { + interface LoDashStatic { + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable properties of `object` that are not omitted. + * + * @category Object + * @param object The source object. + * @param [paths] The property names to omit, specified + * individually or in arrays.. + * @returns Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + omit( + object: Dictionary, + ...paths: PropertyPath[] + ): Dictionary; + + /** + * @see _.omit + */ + omit( + object: T | null | undefined, + ...paths: PropertyPath[] + ): PartialObject; + } + + interface LoDashImplicitWrapper { + /** + * @see _.omit + */ + omit( + this: LoDashImplicitWrapper>, + ...paths: PropertyPath[] + ): LoDashImplicitWrapper>; + + /** + * @see _.omit + */ + omit( + this: LoDashImplicitWrapper, + ...paths: PropertyPath[] + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.omit + */ + omit( + this: LoDashExplicitWrapper>, + ...paths: PropertyPath[] + ): LoDashExplicitWrapper>; + + /** + * @see _.omit + */ + omit( + this: LoDashExplicitWrapper, + ...paths: PropertyPath[] + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/omitBy.d.ts b/types/lodash/object/omitBy.d.ts new file mode 100644 index 0000000000..0f5018e32b --- /dev/null +++ b/types/lodash/object/omitBy.d.ts @@ -0,0 +1,44 @@ +declare namespace _ { + interface LoDashStatic { + /** + * The opposite of `_.pickBy`; this method creates an object composed of the + * own and inherited enumerable properties of `object` that `predicate` + * doesn't return truthy for. + * + * @category Object + * @param object The source object. + * @param [predicate=_.identity] The function invoked per property. + * @returns Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + omitBy( + object: T | null | undefined, + predicate: ValueKeyIteratee + ): PartialObject; + } + + interface LoDashImplicitWrapper { + /** + * @see _.omitBy + */ + omitBy( + this: LoDashImplicitWrapper, + predicate: ValueKeyIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.omitBy + */ + omitBy( + this: LoDashExplicitWrapper, + predicate: ValueKeyIteratee + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/pick.d.ts b/types/lodash/object/pick.d.ts new file mode 100644 index 0000000000..d20f7b9ae4 --- /dev/null +++ b/types/lodash/object/pick.d.ts @@ -0,0 +1,67 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an object composed of the picked `object` properties. + * + * @category Object + * @param object The source object. + * @param [props] The property names to pick, specified + * individually or in arrays. + * @returns Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + pick( + object: T, + ...props: Array> + ): Pick; + + /** + * @see _.pick + */ + pick( + object: T | null | undefined, + ...props: PropertyPath[] + ): PartialDeep; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pick + */ + pick( + this: LoDashImplicitWrapper, + ...props: Array> + ): LoDashImplicitWrapper>; + + /** + * @see _.pick + */ + pick( + this: LoDashImplicitWrapper, + ...props: PropertyPath[] + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pick + */ + pick( + this: LoDashExplicitWrapper, + ...props: Array> + ): LoDashExplicitWrapper>; + + /** + * @see _.pick + */ + pick( + this: LoDashExplicitWrapper, + ...props: PropertyPath[] + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/pickBy.d.ts b/types/lodash/object/pickBy.d.ts new file mode 100644 index 0000000000..7e1edefd77 --- /dev/null +++ b/types/lodash/object/pickBy.d.ts @@ -0,0 +1,43 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @category Object + * @param object The source object. + * @param [predicate=_.identity] The function invoked per property. + * @returns Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + pickBy( + object: T | null | undefined, + predicate?: ValueKeyIteratee + ): PartialObject; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pickBy + */ + pickBy( + this: LoDashImplicitWrapper, + predicate?: ValueKeyIteratee + ): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pickBy + */ + pickBy( + this: LoDashExplicitWrapper, + predicate?: ValueKeyIteratee + ): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/result.d.ts b/types/lodash/object/result.d.ts new file mode 100644 index 0000000000..a8ec08387d --- /dev/null +++ b/types/lodash/object/result.d.ts @@ -0,0 +1,38 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding + * of its parent object and its result is returned. + * + * @param object The object to query. + * @param path The path of the property to resolve. + * @param defaultValue The value returned if the resolved value is undefined. + * @return Returns the resolved value. + */ + result( + object: any, + path: PropertyPath, + defaultValue?: TResult|((...args: any[]) => TResult) + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.result + */ + result( + path: PropertyPath, + defaultValue?: TResult|((...args: any[]) => TResult) + ): TResult; + } + + interface LoDashExplicitWrapper { + /** + * @see _.result + */ + result( + path: PropertyPath, + defaultValue?: TResult|((...args: any[]) => TResult) + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/set.d.ts b/types/lodash/object/set.d.ts new file mode 100644 index 0000000000..38a7442807 --- /dev/null +++ b/types/lodash/object/set.d.ts @@ -0,0 +1,64 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for + * missing index properties while objects are created for all other missing properties. Use _.setWith to + * customize path creation. + * + * @param object The object to modify. + * @param path The path of the property to set. + * @param value The value to set. + * @return Returns object. + */ + set( + object: T, + path: PropertyPath, + value: any + ): T; + + /** + * @see _.set + */ + set( + object: object, + path: PropertyPath, + value: any + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.set + */ + set( + path: PropertyPath, + value: any + ): this; + + /** + * @see _.set + */ + set( + path: PropertyPath, + value: any + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.set + */ + set( + path: PropertyPath, + value: any + ): this; + + /** + * @see _.set + */ + set( + path: PropertyPath, + value: any + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/setWith.d.ts b/types/lodash/object/setWith.d.ts new file mode 100644 index 0000000000..b57b8ebcb3 --- /dev/null +++ b/types/lodash/object/setWith.d.ts @@ -0,0 +1,70 @@ +declare namespace _ { + type SetWithCustomizer = (nsValue: any, key: string, nsObject: T) => any; + + interface LoDashStatic { + /** + * This method is like _.set except that it accepts customizer which is invoked to produce the objects of + * path. If customizer returns undefined path creation is handled by the method instead. The customizer is + * invoked with three arguments: (nsValue, key, nsObject). + * + * @param object The object to modify. + * @param path The path of the property to set. + * @param value The value to set. + * @parem customizer The function to customize assigned values. + * @return Returns object. + */ + setWith( + object: T, + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): T; + + setWith( + object: T, + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.setWith + */ + setWith( + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): this; + + /** + * @see _.setWith + */ + setWith( + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.setWith + */ + setWith( + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): this; + + /** + * @see _.setWith + */ + setWith( + path: PropertyPath, + value: any, + customizer?: SetWithCustomizer + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/toPairs.d.ts b/types/lodash/object/toPairs.d.ts new file mode 100644 index 0000000000..d1b6fe86d4 --- /dev/null +++ b/types/lodash/object/toPairs.d.ts @@ -0,0 +1,40 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of own enumerable key-value pairs for object. + * + * @param object The object to query. + * @return Returns the new array of key-value pairs. + */ + toPairs(object?: Dictionary): Array<[string, T]>; + + /** + * @see _.toPairs + */ + toPairs(object?: object): Array<[string, any]>; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toPairs + */ + toPairs(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + + /** + * @see _.toPairs + */ + toPairs(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toPairs + */ + toPairs(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + + /** + * @see _.toPairs + */ + toPairs(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/toPairsIn.d.ts b/types/lodash/object/toPairsIn.d.ts new file mode 100644 index 0000000000..832fab7050 --- /dev/null +++ b/types/lodash/object/toPairsIn.d.ts @@ -0,0 +1,40 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of own and inherited enumerable key-value pairs for object. + * + * @param object The object to query. + * @return Returns the new array of key-value pairs. + */ + toPairsIn(object?: Dictionary): Array<[string, T]>; + + /** + * @see _.toPairsIn + */ + toPairsIn(object?: object): Array<[string, any]>; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toPairsIn + */ + toPairsIn(this: LoDashImplicitWrapper>): LoDashImplicitWrapper>; + + /** + * @see _.toPairsIn + */ + toPairsIn(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toPairsIn + */ + toPairsIn(this: LoDashExplicitWrapper>): LoDashExplicitWrapper>; + + /** + * @see _.toPairsIn + */ + toPairsIn(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/transform.d.ts b/types/lodash/object/transform.d.ts new file mode 100644 index 0000000000..1f8f4e9a48 --- /dev/null +++ b/types/lodash/object/transform.d.ts @@ -0,0 +1,162 @@ +declare namespace _ { + interface LoDashStatic { + /** + * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of + * running each of its own enumerable properties through iteratee, with each invocation potentially mutating + * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, + * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param accumulator The custom accumulator value. + * @param thisArg The this binding of iteratee. + * @return Returns the accumulated value. + */ + transform( + object: T[], + iteratee: MemoVoidArrayIterator, + accumulator?: TResult[] + ): TResult[]; + + /** + * @see _.transform + */ + transform( + object: T[], + iteratee: MemoVoidArrayIterator>, + accumulator: Dictionary + ): Dictionary; + + /** + * @see _.transform + */ + transform( + object: Dictionary, + iteratee: MemoVoidDictionaryIterator>, + accumulator?: Dictionary + ): Dictionary; + + /** + * @see _.transform + */ + transform( + object: Dictionary, + iteratee: MemoVoidDictionaryIterator, + accumulator: TResult[] + ): TResult[]; + + /** + * @see _.transform + */ + transform( + object: any[], + ): any[]; + + /** + * @see _.transform + */ + transform( + object: object, + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.transform + */ + transform( + this: LoDashImplicitWrapper, + iteratee: MemoVoidArrayIterator, + accumulator?: TResult[] + ): LoDashImplicitWrapper; + + /** + * @see _.transform + */ + transform( + this: LoDashImplicitWrapper, + iteratee: MemoVoidArrayIterator>, + accumulator: Dictionary + ): LoDashImplicitWrapper>; + + /** + * @see _.transform + */ + transform( + this: LoDashImplicitWrapper>, + iteratee: MemoVoidDictionaryIterator>, + accumulator?: Dictionary + ): LoDashImplicitWrapper>; + + /** + * @see _.transform + */ + transform( + this: LoDashImplicitWrapper>, + iteratee: MemoVoidDictionaryIterator, + accumulator: TResult[] + ): LoDashImplicitWrapper; + + /** + * @see _.transform + */ + transform( + this: LoDashImplicitWrapper, + ): LoDashImplicitWrapper; + + /** + * @see _.transform + */ + transform(): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.transform + */ + transform( + this: LoDashExplicitWrapper, + iteratee: MemoVoidArrayIterator, + accumulator?: TResult[] + ): LoDashExplicitWrapper; + + /** + * @see _.transform + */ + transform( + this: LoDashExplicitWrapper, + iteratee: MemoVoidArrayIterator>, + accumulator?: Dictionary + ): LoDashExplicitWrapper>; + + /** + * @see _.transform + */ + transform( + this: LoDashExplicitWrapper>, + iteratee: MemoVoidDictionaryIterator>, + accumulator?: Dictionary + ): LoDashExplicitWrapper>; + + /** + * @see _.transform + */ + transform( + this: LoDashExplicitWrapper>, + iteratee: MemoVoidDictionaryIterator, + accumulator?: TResult[] + ): LoDashExplicitWrapper; + + /** + * @see _.transform + */ + transform( + this: LoDashExplicitWrapper, + ): LoDashExplicitWrapper; + + /** + * @see _.transform + */ + transform(): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/object/unset.d.ts b/types/lodash/object/unset.d.ts new file mode 100644 index 0000000000..4bbdc0593b --- /dev/null +++ b/types/lodash/object/unset.d.ts @@ -0,0 +1,31 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Removes the property at path of object. + * + * Note: This method mutates object. + * + * @param object The object to modify. + * @param path The path of the property to unset. + * @return Returns true if the property is deleted, else false. + */ + unset( + object: any, + path: PropertyPath + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unset + */ + unset(path: PropertyPath): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unset + */ + unset(path: PropertyPath): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/update.d.ts b/types/lodash/object/update.d.ts new file mode 100644 index 0000000000..fd612dc970 --- /dev/null +++ b/types/lodash/object/update.d.ts @@ -0,0 +1,38 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to + * customize path creation. The updater is invoked with one argument: (value). + * + * @param object The object to modify. + * @param path The path of the property to set. + * @param updater The function to produce the updated value. + * @return Returns object. + */ + update( + object: object, + path: PropertyPath, + updater: (value: any) => any + ): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.update + */ + update( + path: PropertyPath, + updater: (value: any) => any + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.update + */ + update( + path: PropertyPath, + updater: (value: any) => any + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/updateWith.d.ts b/types/lodash/object/updateWith.d.ts new file mode 100644 index 0000000000..5b51ce4554 --- /dev/null +++ b/types/lodash/object/updateWith.d.ts @@ -0,0 +1,82 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @since 4.6.0 + * @category Object + * @param object The object to modify. + * @param path The path of the property to set. + * @param updater The function to produce the updated value. + * @param [customizer] The function to customize assigned values. + * @returns Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + updateWith( + object: T, + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): T; + + /** + * @see _.updateWith + */ + updateWith( + object: T, + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.updateWith + */ + updateWith( + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): this; + + /** + * @see _.updateWith + */ + updateWith( + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.updateWith + */ + updateWith( + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): this; + + /** + * @see _.updateWith + */ + updateWith( + path: PropertyPath, + updater: (oldValue: any) => any, + customizer?: SetWithCustomizer + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/values.d.ts b/types/lodash/object/values.d.ts new file mode 100644 index 0000000000..743157cdf0 --- /dev/null +++ b/types/lodash/object/values.d.ts @@ -0,0 +1,55 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of the own enumerable property values of object. + * + * @param object The object to query. + * @return Returns an array of property values. + */ + values(object: Dictionary|NumericDictionary|List | null | undefined): T[]; + + /** + * @see _.values + */ + values(object: T | null | undefined): Array; + + /** + * @see _.values + */ + values(object: any): any[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.values + */ + values(this: LoDashImplicitWrapper | NumericDictionary | List | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.values + */ + values(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; + + /** + * @see _.values + */ + values(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.values + */ + values(this: LoDashExplicitWrapper | NumericDictionary | List | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.values + */ + values(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; + + /** + * @see _.values + */ + values(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/object/valuesIn.d.ts b/types/lodash/object/valuesIn.d.ts new file mode 100644 index 0000000000..a5e2bacc57 --- /dev/null +++ b/types/lodash/object/valuesIn.d.ts @@ -0,0 +1,40 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of the own and inherited enumerable property values of object. + * + * @param object The object to query. + * @return Returns the array of property values. + */ + valuesIn(object: Dictionary|NumericDictionary|List | null | undefined): T[]; + + /** + * @see _.valuesIn + */ + valuesIn(object: T | null | undefined): Array; + } + + interface LoDashImplicitWrapper { + /** + * @see _.valuesIn + */ + valuesIn(this: LoDashImplicitWrapper | NumericDictionary | List | null | undefined>): LoDashImplicitWrapper; + + /** + * @see _.valuesIn + */ + valuesIn(this: LoDashImplicitWrapper): LoDashImplicitWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.valuesIn + */ + valuesIn(this: LoDashExplicitWrapper | NumericDictionary | List | null | undefined>): LoDashExplicitWrapper; + + /** + * @see _.valuesIn + */ + valuesIn(this: LoDashExplicitWrapper): LoDashExplicitWrapper>; + } +} \ No newline at end of file diff --git a/types/lodash/properties/VERSION.d.ts b/types/lodash/properties/VERSION.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/lodash/properties/templateSettings.d.ts b/types/lodash/properties/templateSettings.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/lodash/properties/templateSettings.escape.d.ts b/types/lodash/properties/templateSettings.escape.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/lodash/properties/templateSettings.evaluate.d.ts b/types/lodash/properties/templateSettings.evaluate.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/lodash/properties/templateSettings.imports.d.ts b/types/lodash/properties/templateSettings.imports.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/lodash/properties/templateSettings.interpolate.d.ts b/types/lodash/properties/templateSettings.interpolate.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/lodash/properties/templateSettings.variable.d.ts b/types/lodash/properties/templateSettings.variable.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/lodash/seq/chain.d.ts b/types/lodash/seq/chain.d.ts new file mode 100644 index 0000000000..5c45689b0e --- /dev/null +++ b/types/lodash/seq/chain.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a lodash object that wraps value with explicit method chaining enabled. + * + * @param value The value to wrap. + * @return Returns the new lodash wrapper instance. + */ + chain(value: T): LoDashExplicitWrapper; + } + + interface LoDashImplicitWrapper { + /** + * @see _.chain + */ + chain(): LoDashExplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.chain + */ + chain(): this; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.at.d.ts b/types/lodash/seq/prototype.at.d.ts new file mode 100644 index 0000000000..09b4fd5bc2 --- /dev/null +++ b/types/lodash/seq/prototype.at.d.ts @@ -0,0 +1,11 @@ +// declare namespace _ { +// interface LoDashWrapper { +// /** +// * This method is the wrapper version of _.at. +// * +// * @ +// * @return Returns the new lodash wrapper instance. +// */ +// at(paths: string|string[]): this; +// } +// } \ No newline at end of file diff --git a/types/lodash/seq/prototype.chain.d.ts b/types/lodash/seq/prototype.chain.d.ts new file mode 100644 index 0000000000..5c45689b0e --- /dev/null +++ b/types/lodash/seq/prototype.chain.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a lodash object that wraps value with explicit method chaining enabled. + * + * @param value The value to wrap. + * @return Returns the new lodash wrapper instance. + */ + chain(value: T): LoDashExplicitWrapper; + } + + interface LoDashImplicitWrapper { + /** + * @see _.chain + */ + chain(): LoDashExplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.chain + */ + chain(): this; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.commit.d.ts b/types/lodash/seq/prototype.commit.d.ts new file mode 100644 index 0000000000..b8eab97095 --- /dev/null +++ b/types/lodash/seq/prototype.commit.d.ts @@ -0,0 +1,10 @@ +declare namespace _ { + interface LoDashWrapper { + /** + * Executes the chained sequence and returns the wrapped result. + * + * @return Returns the new lodash wrapper instance. + */ + commit(): this; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.next.d.ts b/types/lodash/seq/prototype.next.d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/lodash/seq/prototype.plant.d.ts b/types/lodash/seq/prototype.plant.d.ts new file mode 100644 index 0000000000..a419a750d9 --- /dev/null +++ b/types/lodash/seq/prototype.plant.d.ts @@ -0,0 +1,17 @@ +declare namespace _ { + interface LoDashImplicitWrapper { + /** + * Creates a clone of the chained sequence planting value as the wrapped value. + * @param value The value to plant as the wrapped value. + * @return Returns the new lodash wrapper instance. + */ + plant(value: T): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.plant + */ + plant(value: T): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.reverse.d.ts b/types/lodash/seq/prototype.reverse.d.ts new file mode 100644 index 0000000000..dd72272798 --- /dev/null +++ b/types/lodash/seq/prototype.reverse.d.ts @@ -0,0 +1,13 @@ +declare namespace _ { + interface LoDashWrapper { + /** + * Reverses the wrapped array so the first element becomes the last, the second element becomes the second to + * last, and so on. + * + * Note: This method mutates the wrapped array. + * + * @return Returns the new reversed lodash wrapper instance. + */ + reverse(): this; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.toJSON.d.ts b/types/lodash/seq/prototype.toJSON.d.ts new file mode 100644 index 0000000000..08e39d5558 --- /dev/null +++ b/types/lodash/seq/prototype.toJSON.d.ts @@ -0,0 +1,8 @@ +declare namespace _ { + interface LoDashWrapper { + /** + * @see _.value + */ + toJSON(): TValue; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.toString.d.ts b/types/lodash/seq/prototype.toString.d.ts new file mode 100644 index 0000000000..5672a08667 --- /dev/null +++ b/types/lodash/seq/prototype.toString.d.ts @@ -0,0 +1,10 @@ +declare namespace _ { + interface LoDashWrapper { + /** + * Produces the result of coercing the unwrapped value to a string. + * + * @return Returns the coerced string value. + */ + toString(): string; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.value.d.ts b/types/lodash/seq/prototype.value.d.ts new file mode 100644 index 0000000000..87caa46350 --- /dev/null +++ b/types/lodash/seq/prototype.value.d.ts @@ -0,0 +1,12 @@ +declare namespace _ { + interface LoDashWrapper { + /** + * Executes the chained sequence to extract the unwrapped value. + * + * @alias _.toJSON, _.valueOf + * + * @return Returns the resolved unwrapped value. + */ + value(): TValue; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype.valueOf.d.ts b/types/lodash/seq/prototype.valueOf.d.ts new file mode 100644 index 0000000000..bfb28cbf67 --- /dev/null +++ b/types/lodash/seq/prototype.valueOf.d.ts @@ -0,0 +1,8 @@ +declare namespace _ { + interface LoDashWrapper { + /** + * @see _.value + */ + valueOf(): TValue; + } +} \ No newline at end of file diff --git a/types/lodash/seq/prototype[Symbol.iterator].d.ts b/types/lodash/seq/prototype[Symbol.iterator].d.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/lodash/seq/tap.d.ts b/types/lodash/seq/tap.d.ts new file mode 100644 index 0000000000..82902562ff --- /dev/null +++ b/types/lodash/seq/tap.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one + * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations + * on intermediate results within the chain. + * + * @param value The value to provide to interceptor. + * @param interceptor The function to invoke. + * @parem thisArg The this binding of interceptor. + * @return Returns value. + **/ + tap( + value: T, + interceptor: (value: T) => void + ): T; + } + + interface LoDashWrapper { + /** + * @see _.tap + */ + tap( + interceptor: (value: TValue) => void + ): this; + } +} \ No newline at end of file diff --git a/types/lodash/seq/thru.d.ts b/types/lodash/seq/thru.d.ts new file mode 100644 index 0000000000..3db6385be9 --- /dev/null +++ b/types/lodash/seq/thru.d.ts @@ -0,0 +1,30 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.tap except that it returns the result of interceptor. + * + * @param value The value to provide to interceptor. + * @param interceptor The function to invoke. + * @param thisArg The this binding of interceptor. + * @return Returns the result of interceptor. + */ + thru( + value: T, + interceptor: (value: T) => TResult + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.thru + */ + thru(interceptor: (value: TValue) => TResult): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.thru + */ + thru(interceptor: (value: TValue) => TResult): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/camelCase.d.ts b/types/lodash/string/camelCase.d.ts new file mode 100644 index 0000000000..e6ad01c9c9 --- /dev/null +++ b/types/lodash/string/camelCase.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts string to camel case. + * + * @param string The string to convert. + * @return Returns the camel cased string. + */ + camelCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.camelCase + */ + camelCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.camelCase + */ + camelCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/capitalize.d.ts b/types/lodash/string/capitalize.d.ts new file mode 100644 index 0000000000..41f2a7e935 --- /dev/null +++ b/types/lodash/string/capitalize.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts the first character of string to upper case and the remaining to lower case. + * + * @param string The string to capitalize. + * @return Returns the capitalized string. + */ + capitalize(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.capitalize + */ + capitalize(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.capitalize + */ + capitalize(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/deburr.d.ts b/types/lodash/string/deburr.d.ts new file mode 100644 index 0000000000..a0e89c64e7 --- /dev/null +++ b/types/lodash/string/deburr.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining + * diacritical marks. + * + * @param string The string to deburr. + * @return Returns the deburred string. + */ + deburr(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.deburr + */ + deburr(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.deburr + */ + deburr(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/endsWith.d.ts b/types/lodash/string/endsWith.d.ts new file mode 100644 index 0000000000..d8f76a0178 --- /dev/null +++ b/types/lodash/string/endsWith.d.ts @@ -0,0 +1,37 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if string ends with the given target string. + * + * @param string The string to search. + * @param target The string to search for. + * @param position The position to search from. + * @return Returns true if string ends with target, else false. + */ + endsWith( + string?: string, + target?: string, + position?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.endsWith + */ + endsWith( + target?: string, + position?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.endsWith + */ + endsWith( + target?: string, + position?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/escape.d.ts b/types/lodash/string/escape.d.ts new file mode 100644 index 0000000000..e18f0675be --- /dev/null +++ b/types/lodash/string/escape.d.ts @@ -0,0 +1,36 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities. + * + * Note: No other characters are escaped. To escape additional characters use a third-party library like he. + * + * hough the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML + * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s + * article (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59, + * #102, #108, and #133 of the HTML5 Security Cheatsheet for more details. + * + * When working with HTML you should always quote attribute values to reduce XSS vectors. + * + * @param string The string to escape. + * @return Returns the escaped string. + */ + escape(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.escape + */ + escape(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.escape + */ + escape(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/escapeRegExp.d.ts b/types/lodash/string/escapeRegExp.d.ts new file mode 100644 index 0000000000..f8e3790952 --- /dev/null +++ b/types/lodash/string/escapeRegExp.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", + * "{", "}", and "|" in string. + * + * @param string The string to escape. + * @return Returns the escaped string. + */ + escapeRegExp(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.escapeRegExp + */ + escapeRegExp(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.escapeRegExp + */ + escapeRegExp(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/kebabCase.d.ts b/types/lodash/string/kebabCase.d.ts new file mode 100644 index 0000000000..00b9fd8421 --- /dev/null +++ b/types/lodash/string/kebabCase.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts string to kebab case. + * + * @param string The string to convert. + * @return Returns the kebab cased string. + */ + kebabCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.kebabCase + */ + kebabCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.kebabCase + */ + kebabCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/lowerCase.d.ts b/types/lodash/string/lowerCase.d.ts new file mode 100644 index 0000000000..f71af2638b --- /dev/null +++ b/types/lodash/string/lowerCase.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `string`, as space separated words, to lower case. + * + * @param string The string to convert. + * @return Returns the lower cased string. + */ + lowerCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lowerCase + */ + lowerCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lowerCase + */ + lowerCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/lowerFirst.d.ts b/types/lodash/string/lowerFirst.d.ts new file mode 100644 index 0000000000..323367c7ef --- /dev/null +++ b/types/lodash/string/lowerFirst.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts the first character of `string` to lower case. + * + * @param string The string to convert. + * @return Returns the converted string. + */ + lowerFirst(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lowerFirst + */ + lowerFirst(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lowerFirst + */ + lowerFirst(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/pad.d.ts b/types/lodash/string/pad.d.ts new file mode 100644 index 0000000000..97b2cef838 --- /dev/null +++ b/types/lodash/string/pad.d.ts @@ -0,0 +1,38 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if + * they can’t be evenly divided by length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + pad( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pad + */ + pad( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pad + */ + pad( + length?: number, + chars?: string + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/padEnd.d.ts b/types/lodash/string/padEnd.d.ts new file mode 100644 index 0000000000..c9072bb59c --- /dev/null +++ b/types/lodash/string/padEnd.d.ts @@ -0,0 +1,38 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed + * length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + padEnd( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.padEnd + */ + padEnd( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.padEnd + */ + padEnd( + length?: number, + chars?: string + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/padStart.d.ts b/types/lodash/string/padStart.d.ts new file mode 100644 index 0000000000..fff4aaf566 --- /dev/null +++ b/types/lodash/string/padStart.d.ts @@ -0,0 +1,38 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed + * length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + padStart( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.padStart + */ + padStart( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.padStart + */ + padStart( + length?: number, + chars?: string + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/parseInt.d.ts b/types/lodash/string/parseInt.d.ts new file mode 100644 index 0000000000..d481c1d750 --- /dev/null +++ b/types/lodash/string/parseInt.d.ts @@ -0,0 +1,32 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used + * unless value is a hexadecimal, in which case a radix of 16 is used. + * + * Note: This method aligns with the ES5 implementation of parseInt. + * + * @param string The string to convert. + * @param radix The radix to interpret value by. + * @return Returns the converted integer. + */ + parseInt( + string: string, + radix?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.parseInt + */ + parseInt(radix?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.parseInt + */ + parseInt(radix?: number): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/repeat.d.ts b/types/lodash/string/repeat.d.ts new file mode 100644 index 0000000000..ae965cf86b --- /dev/null +++ b/types/lodash/string/repeat.d.ts @@ -0,0 +1,31 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Repeats the given string n times. + * + * @param string The string to repeat. + * @param n The number of times to repeat the string. + * @return Returns the repeated string. + */ + repeat( + string?: string, + n?: number + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.repeat + */ + repeat(n?: number): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.repeat + */ + repeat(n?: number): LoDashExplicitWrapper; + } + + type ReplaceFunction = (match: string, ...args: any[]) => string; +} \ No newline at end of file diff --git a/types/lodash/string/replace.d.ts b/types/lodash/string/replace.d.ts new file mode 100644 index 0000000000..d980e59b1d --- /dev/null +++ b/types/lodash/string/replace.d.ts @@ -0,0 +1,58 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Replaces matches for pattern in string with replacement. + * + * Note: This method is based on String#replace. + * + * @return Returns the modified string. + */ + replace( + string: string, + pattern: RegExp | string, + replacement: ReplaceFunction | string + ): string; + + /** + * @see _.replace + */ + replace( + pattern: RegExp | string, + replacement: ReplaceFunction | string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.replace + */ + replace( + pattern: RegExp|string, + replacement: ReplaceFunction | string + ): string; + + /** + * @see _.replace + */ + replace( + replacement: ReplaceFunction | string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.replace + */ + replace( + pattern: RegExp | string, + replacement: ReplaceFunction | string + ): LoDashExplicitWrapper; + + /** + * @see _.replace + */ + replace( + replacement: ReplaceFunction | string + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/snakeCase.d.ts b/types/lodash/string/snakeCase.d.ts new file mode 100644 index 0000000000..a38f964fa0 --- /dev/null +++ b/types/lodash/string/snakeCase.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts string to snake case. + * + * @param string The string to convert. + * @return Returns the snake cased string. + */ + snakeCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.snakeCase + */ + snakeCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.snakeCase + */ + snakeCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/split.d.ts b/types/lodash/string/split.d.ts new file mode 100644 index 0000000000..43416dcf87 --- /dev/null +++ b/types/lodash/string/split.d.ts @@ -0,0 +1,55 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Splits string by separator. + * + * Note: This method is based on String#split. + * + * @param string The string to trim. + * @param separator The separator pattern to split by. + * @param limit The length to truncate results to. + * @return Returns the new array of string segments. + */ + split( + string: string, + separator?: RegExp|string, + limit?: number + ): string[]; + + /** + * Splits string by separator. + * + * Note: This method is based on String#split. + * + * @param string The string to trim. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the new array of string segments. + */ + split( + string: string, + index: string | number, + guard: object + ): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.split + */ + split( + separator?: RegExp|string, + limit?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.split + */ + split( + separator?: RegExp|string, + limit?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/startCase.d.ts b/types/lodash/string/startCase.d.ts new file mode 100644 index 0000000000..6b053c48bd --- /dev/null +++ b/types/lodash/string/startCase.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts string to start case. + * + * @param string The string to convert. + * @return Returns the start cased string. + */ + startCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.startCase + */ + startCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.startCase + */ + startCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/startsWith.d.ts b/types/lodash/string/startsWith.d.ts new file mode 100644 index 0000000000..8bd9a63d13 --- /dev/null +++ b/types/lodash/string/startsWith.d.ts @@ -0,0 +1,37 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks if string starts with the given target string. + * + * @param string The string to search. + * @param target The string to search for. + * @param position The position to search from. + * @return Returns true if string starts with target, else false. + */ + startsWith( + string?: string, + target?: string, + position?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.startsWith + */ + startsWith( + target?: string, + position?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.startsWith + */ + startsWith( + target?: string, + position?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/template.d.ts b/types/lodash/string/template.d.ts new file mode 100644 index 0000000000..5ad7c00921 --- /dev/null +++ b/types/lodash/string/template.d.ts @@ -0,0 +1,60 @@ +declare namespace _ { + interface TemplateOptions extends TemplateSettings { + /** + * The sourceURL of the template's compiled source. + */ + sourceURL?: string; + } + + interface TemplateExecutor { + (data?: object): string; + source: string; + } + + interface LoDashStatic { + /** + * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, + * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" + * delimiters. Data properties may be accessed as free variables in the template. If a setting object is + * provided it takes precedence over _.templateSettings values. + * + * Note: In the development build _.template utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier + * debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @param string The template string. + * @param options The options object. + * @param options.escape The HTML "escape" delimiter. + * @param options.evaluate The "evaluate" delimiter. + * @param options.imports An object to import into the template as free variables. + * @param options.interpolate The "interpolate" delimiter. + * @param options.sourceURL The sourceURL of the template's compiled source. + * @param options.variable The data object variable name. + * @return Returns the compiled template function. + */ + template( + string?: string, + options?: TemplateOptions + ): TemplateExecutor; + } + + interface LoDashImplicitWrapper { + /** + * @see _.template + */ + template(options?: TemplateOptions): TemplateExecutor; + } + + interface LoDashExplicitWrapper { + /** + * @see _.template + */ + template(options?: TemplateOptions): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/toLower.d.ts b/types/lodash/string/toLower.d.ts new file mode 100644 index 0000000000..4db3f2f585 --- /dev/null +++ b/types/lodash/string/toLower.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `string`, as a whole, to lower case. + * + * @param string The string to convert. + * @return Returns the lower cased string. + */ + toLower(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toLower + */ + toLower(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toLower + */ + toLower(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/toUpper.d.ts b/types/lodash/string/toUpper.d.ts new file mode 100644 index 0000000000..6ebd95081f --- /dev/null +++ b/types/lodash/string/toUpper.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `string`, as a whole, to upper case. + * + * @param string The string to convert. + * @return Returns the upper cased string. + */ + toUpper(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toUpper + */ + toUpper(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toUpper + */ + toUpper(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/trim.d.ts b/types/lodash/string/trim.d.ts new file mode 100644 index 0000000000..f154162543 --- /dev/null +++ b/types/lodash/string/trim.d.ts @@ -0,0 +1,43 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Removes leading and trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trim( + string?: string, + chars?: string + ): string; + + /** + * Removes leading and trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the trimmed string. + */ + trim( + string: string, + index: string | number, + guard: object + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.trim + */ + trim(chars?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.trim + */ + trim(chars?: string): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/trimEnd.d.ts b/types/lodash/string/trimEnd.d.ts new file mode 100644 index 0000000000..ae83e6641d --- /dev/null +++ b/types/lodash/string/trimEnd.d.ts @@ -0,0 +1,43 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Removes trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trimEnd( + string?: string, + chars?: string + ): string; + + /** + * Removes trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the trimmed string. + */ + trimEnd( + string: string, + index: string | number, + guard: object + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.trimEnd + */ + trimEnd(chars?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.trimEnd + */ + trimEnd(chars?: string): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/trimStart.d.ts b/types/lodash/string/trimStart.d.ts new file mode 100644 index 0000000000..3ce788f055 --- /dev/null +++ b/types/lodash/string/trimStart.d.ts @@ -0,0 +1,43 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Removes leading whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trimStart( + string?: string, + chars?: string + ): string; + + /** + * Removes leading whitespace or specified characters from string. + * + * @param string The string to trim. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the trimmed string. + */ + trimStart( + string: string, + index: string | number, + guard: object + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.trimStart + */ + trimStart(chars?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.trimStart + */ + trimStart(chars?: string): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/truncate.d.ts b/types/lodash/string/truncate.d.ts new file mode 100644 index 0000000000..041ee6223b --- /dev/null +++ b/types/lodash/string/truncate.d.ts @@ -0,0 +1,39 @@ +declare namespace _ { + interface TruncateOptions { + /** The maximum string length. */ + length?: number; + /** The string to indicate text is omitted. */ + omission?: string; + /** The separator pattern to truncate to. */ + separator?: string|RegExp; + } + + interface LoDashStatic { + /** + * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated + * string are replaced with the omission string which defaults to "…". + * + * @param string The string to truncate. + * @param options The options object or maximum string length. + * @return Returns the truncated string. + */ + truncate( + string?: string, + options?: TruncateOptions + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.truncate + */ + truncate(options?: TruncateOptions): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.truncate + */ + truncate(options?: TruncateOptions): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/unescape.d.ts b/types/lodash/string/unescape.d.ts new file mode 100644 index 0000000000..f8f77bacd0 --- /dev/null +++ b/types/lodash/string/unescape.d.ts @@ -0,0 +1,29 @@ +declare namespace _ { + interface LoDashStatic { + /** + * The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` + * in string to their corresponding characters. + * + * Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library + * like he. + * + * @param string The string to unescape. + * @return Returns the unescaped string. + */ + unescape(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unescape + */ + unescape(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unescape + */ + unescape(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/upperCase.d.ts b/types/lodash/string/upperCase.d.ts new file mode 100644 index 0000000000..5377337f0e --- /dev/null +++ b/types/lodash/string/upperCase.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `string`, as space separated words, to upper case. + * + * @param string The string to convert. + * @return Returns the upper cased string. + */ + upperCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.upperCase + */ + upperCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.upperCase + */ + upperCase(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/upperFirst.d.ts b/types/lodash/string/upperFirst.d.ts new file mode 100644 index 0000000000..38f88a7e94 --- /dev/null +++ b/types/lodash/string/upperFirst.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts the first character of `string` to upper case. + * + * @param string The string to convert. + * @return Returns the converted string. + */ + upperFirst(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.upperFirst + */ + upperFirst(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.upperFirst + */ + upperFirst(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/string/words.d.ts b/types/lodash/string/words.d.ts new file mode 100644 index 0000000000..11fa80ee62 --- /dev/null +++ b/types/lodash/string/words.d.ts @@ -0,0 +1,43 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Splits `string` into an array of its words. + * + * @param string The string to inspect. + * @param pattern The pattern to match words. + * @return Returns the words of `string`. + */ + words( + string?: string, + pattern?: string|RegExp + ): string[]; + + /** + * Splits `string` into an array of its words. + * + * @param string The string to inspect. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns the words of `string`. + */ + words( + string: string, + index: string | number, + guard: object + ): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.words + */ + words(pattern?: string|RegExp): string[]; + } + + interface LoDashExplicitWrapper { + /** + * @see _.words + */ + words(pattern?: string|RegExp): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/attempt.d.ts b/types/lodash/util/attempt.d.ts new file mode 100644 index 0000000000..70651b722d --- /dev/null +++ b/types/lodash/util/attempt.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments + * are provided to func when it’s invoked. + * + * @param func The function to attempt. + * @return Returns the func result or error object. + */ + attempt(func: (...args: any[]) => TResult, ...args: any[]): TResult|Error; + } + + interface LoDashImplicitWrapper { + /** + * @see _.attempt + */ + attempt(...args: any[]): TResult|Error; + } + + interface LoDashExplicitWrapper { + /** + * @see _.attempt + */ + attempt(...args: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/bindAll.d.ts b/types/lodash/util/bindAll.d.ts new file mode 100644 index 0000000000..78b9726e63 --- /dev/null +++ b/types/lodash/util/bindAll.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Binds methods of an object to the object itself, overwriting the existing method. Method names may be + * specified as individual arguments or as arrays of method names. If no method names are provided all + * enumerable function properties, own and inherited, of object are bound. + * + * Note: This method does not set the "length" property of bound functions. + * + * @param object The object to bind and assign the bound methods to. + * @param methodNames The object method names to bind, specified as individual method names or arrays of + * method names. + * @return Returns object. + */ + bindAll( + object: T, + ...methodNames: Array> + ): T; + } + + interface LoDashWrapper { + /** + * @see _.bindAll + */ + bindAll(...methodNames: Array>): this; + } +} \ No newline at end of file diff --git a/types/lodash/util/cond.d.ts b/types/lodash/util/cond.d.ts new file mode 100644 index 0000000000..92f5285d43 --- /dev/null +++ b/types/lodash/util/cond.d.ts @@ -0,0 +1,32 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that iterates over `pairs` and invokes the corresponding + * function of the first predicate to return truthy. The predicate-function + * pairs are invoked with the `this` binding and arguments of the created + * function. + * + * @since 4.0.0 + * @category Util + * @param pairs The predicate-function pairs. + * @returns Returns the new composite function. + * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.stubTrue, _.constant('no match')] + * ]); + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' + */ + cond(pairs: Array>): (Target: T) => R; + } +} \ No newline at end of file diff --git a/types/lodash/util/conforms.d.ts b/types/lodash/util/conforms.d.ts new file mode 100644 index 0000000000..60887c45ad --- /dev/null +++ b/types/lodash/util/conforms.d.ts @@ -0,0 +1,27 @@ +declare namespace _ { + type ConformsPredicateObject = { + [P in keyof T]?: (val: T[P]) => boolean; + }; + + interface LoDashStatic { + /** + * Creates a function that invokes the predicate properties of `source` with the corresponding + * property values of a given object, returning true if all predicates return truthy, else false. + */ + conforms(source: ConformsPredicateObject): (value: T) => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.conforms + */ + conforms(this: LoDashImplicitWrapper>): LoDashImplicitWrapper<(value: T) => boolean>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.conforms + */ + conforms(this: LoDashExplicitWrapper>): LoDashExplicitWrapper<(value: T) => boolean>; + } +} \ No newline at end of file diff --git a/types/lodash/util/constant.d.ts b/types/lodash/util/constant.d.ts new file mode 100644 index 0000000000..1083d4e460 --- /dev/null +++ b/types/lodash/util/constant.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that returns value. + * + * @param value The value to return from the new function. + * @return Returns the new function. + */ + constant(value: T): () => T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.constant + */ + constant(): LoDashImplicitWrapper<() => TValue>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.constant + */ + constant(): LoDashExplicitWrapper<() => TValue>; + } +} \ No newline at end of file diff --git a/types/lodash/util/defaultTo.d.ts b/types/lodash/util/defaultTo.d.ts new file mode 100644 index 0000000000..3bc4810f1b --- /dev/null +++ b/types/lodash/util/defaultTo.d.ts @@ -0,0 +1,52 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @param value The value to check. + * @param defaultValue The default value. + * @returns Returns the resolved value. + */ + defaultTo(value: T | null | undefined, defaultValue: T): T; + + /** + * @see _.defaultTo + */ + defaultTo( + value: T | null | undefined, + defaultValue: TDefault + ): T | TDefault; + } + + interface LoDashImplicitWrapper { + /** + * @see _.defaultTo + */ + defaultTo(this: LoDashImplicitWrapper, defaultValue: T): T; + + /** + * @see _.defaultTo + */ + defaultTo( + this: LoDashImplicitWrapper, + defaultValue: TDefault + ): T | TDefault; + } + + interface LoDashExplicitWrapper { + /** + * @see _.defaultTo + */ + defaultTo(this: LoDashExplicitWrapper, defaultValue: T): LoDashExplicitWrapper; + + /** + * @see _.defaultTo + */ + defaultTo( + this: LoDashExplicitWrapper, + defaultValue: TDefault + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/flow.d.ts b/types/lodash/util/flow.d.ts new file mode 100644 index 0000000000..90837be794 --- /dev/null +++ b/types/lodash/util/flow.d.ts @@ -0,0 +1,170 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that returns the result of invoking the provided functions with the this binding of the + * created function, where each successive invocation is supplied the return value of the previous. + * + * @param funcs Functions to invoke. + * @return Returns the new function. + */ + // 0-argument first function + flow(f1: () => R1, f2: (a: R1) => R2): () => R2; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): () => any; + // 1-argument first function + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1) => any; + // 2-argument first function + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2) => any; + // 3-argument first function + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3) => any; + // 4-argument first function + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4) => any; + // any-argument first function + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): (a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any; + flow(funcs: Array any>>): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flow + */ + // 0-argument first function + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<() => R2>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<() => R3>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<() => R4>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<() => R5>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<() => R6>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<() => R7>; + flow(this: LoDashImplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<() => any>; + // 1-argument first function + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1) => R2>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1) => R3>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1) => R4>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1) => R5>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1) => R6>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1) => R7>; + flow(this: LoDashImplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1) => any>; + // 2-argument first function + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2) => R2>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2) => R3>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2) => R4>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2) => R5>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2) => R6>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2) => R7>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2) => any>; + // 3-argument first function + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => any>; + // 4-argument first function + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; + // any-argument first function + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; + flow(this: LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; + flow(this: LoDashImplicitWrapper<(...args: any[]) => any>, funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flow + */ + // 0-argument first function + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<() => R2>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<() => R3>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<() => R4>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<() => R5>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<() => R6>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<() => R7>; + flow(this: LoDashExplicitWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<() => any>; + // 1-argument first function + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1) => R2>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1) => R3>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1) => R4>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1) => R5>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1) => R6>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1) => R7>; + flow(this: LoDashExplicitWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1) => any>; + // 2-argument first function + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2) => R2>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2) => R3>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2) => R4>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2) => R5>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2) => R6>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2) => R7>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2) => any>; + // 3-argument first function + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => any>; + // 4-argument first function + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; + // any-argument first function + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; + flow(this: LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array any>>): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; + flow(this: LoDashExplicitWrapper<(...args: any[]) => any>, funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/flowRight.d.ts b/types/lodash/util/flowRight.d.ts new file mode 100644 index 0000000000..d0a2faaa9f --- /dev/null +++ b/types/lodash/util/flowRight.d.ts @@ -0,0 +1,155 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like _.flow except that it creates a function that invokes the provided functions from right + * to left. + * + * @param funcs Functions to invoke. + * @return Returns the new function. + */ + // 0-argument first function + flowRight(f2: (a: R1) => R2, f1: () => R1): () => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): () => R7; + // 1-argument first function + flowRight(f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): (a1: A1) => R7; + // 2-argument first function + flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): (a1: A1, a2: A2) => R7; + // 3-argument first function + flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): (a1: A1, a2: A2, a3: A3) => R7; + // 4-argument first function + flowRight(f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; + // any-argument first function + flowRight(f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R2; + flowRight(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R3; + flowRight(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R4; + flowRight(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R5; + flowRight(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R6; + flowRight(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): (...args: any[]) => R7; + flowRight(f7: (a: any) => any, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): (...args: any[]) => any; + flowRight(funcs: Array any>>): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flowRight + */ + // 0-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: () => R1): LoDashImplicitWrapper<() => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashImplicitWrapper<() => R7>; + // 1-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashImplicitWrapper<(a1: A1) => R7>; + // 2-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2) => R7>; + // 3-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + // 4-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashImplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + // any-argument first function + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R2>; + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R3>; + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R4>; + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R5>; + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R6>; + flowRight(this: LoDashImplicitWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashImplicitWrapper<(...args: any[]) => R7>; + flowRight(this: LoDashImplicitWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; + flowRight(this: LoDashImplicitWrapper<(a: any) => any>, funcs: Array any>>): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flowRight + */ + // 0-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: () => R1): LoDashExplicitWrapper<() => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitWrapper<() => R7>; + // 1-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitWrapper<(a1: A1) => R7>; + // 2-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2) => R7>; + // 3-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + // 4-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + // any-argument first function + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R2>; + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R3>; + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R4>; + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R5>; + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R6>; + flowRight(this: LoDashExplicitWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitWrapper<(...args: any[]) => R7>; + flowRight(this: LoDashExplicitWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; + flowRight(this: LoDashExplicitWrapper<(a: any) => any>, funcs: Array any>>): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/identity.d.ts b/types/lodash/util/identity.d.ts new file mode 100644 index 0000000000..18ade4c0cf --- /dev/null +++ b/types/lodash/util/identity.d.ts @@ -0,0 +1,30 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method returns the first argument provided to it. + * + * @param value Any value. + * @return Returns value. + */ + identity(value: T): T; + + /** + * @see _.identity + */ + identity(): undefined; + } + + interface LoDashImplicitWrapper { + /** + * @see _.identity + */ + identity(): TValue; + } + + interface LoDashExplicitWrapper { + /** + * @see _.identity + */ + identity(): this; + } +} \ No newline at end of file diff --git a/types/lodash/util/iteratee.d.ts b/types/lodash/util/iteratee.d.ts new file mode 100644 index 0000000000..1777690492 --- /dev/null +++ b/types/lodash/util/iteratee.d.ts @@ -0,0 +1,57 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name the created callback returns the + * property value for a given element. If `func` is an object the created + * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. + * + * @category Util + * @param [func=_.identity] The value to convert to a callback. + * @returns Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // create custom iteratee shorthands + * _.iteratee = _.wrap(_.iteratee, function(callback, func) { + * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); + * return !p ? callback(func) : function(object) { + * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); + * }; + * }); + * + * _.filter(users, 'age > 36'); + * // => [{ 'user': 'fred', 'age': 40 }] + */ + iteratee any>( + func: TFunction | string | object + ): TFunction; + + /** + * @see _.iteratee + */ + iteratee(): typeof _.identity; // tslint:disable-line:no-unnecessary-qualifier + } + + interface LoDashImplicitWrapper { + /** + * @see _.iteratee + */ + iteratee any>( + this: LoDashImplicitWrapper + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.iteratee + */ + iteratee any>( + this: LoDashExplicitWrapper + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/matches.d.ts b/types/lodash/util/matches.d.ts new file mode 100644 index 0000000000..fb69121a13 --- /dev/null +++ b/types/lodash/util/matches.d.ts @@ -0,0 +1,35 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that performs a deep comparison between a given object and source, returning true if the + * given object has equivalent property values, else false. + * + * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and + * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own + * or inherited property value see _.matchesProperty. + * + * @param source The object of property values to match. + * @return Returns the new function. + */ + matches(source: T): (value: any) => boolean; + + /** + * @see _.matches + */ + matches(source: T): (value: V) => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.matches + */ + matches(): LoDashImplicitWrapper<(value: V) => boolean>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.matches + */ + matches(): LoDashExplicitWrapper<(value: V) => boolean>; + } +} \ No newline at end of file diff --git a/types/lodash/util/matchesProperty.d.ts b/types/lodash/util/matchesProperty.d.ts new file mode 100644 index 0000000000..36c64e4d7e --- /dev/null +++ b/types/lodash/util/matchesProperty.d.ts @@ -0,0 +1,58 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that compares the property value of path on a given object to value. + * + * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and + * strings. Objects are compared by their own, not inherited, enumerable properties. + * + * @param path The path of the property to get. + * @param srcValue The value to match. + * @return Returns the new function. + */ + matchesProperty( + path: PropertyPath, + srcValue: T + ): (value: any) => boolean; + + /** + * @see _.matchesProperty + */ + matchesProperty( + path: PropertyPath, + srcValue: T + ): (value: V) => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashImplicitWrapper<(value: any) => boolean>; + + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashImplicitWrapper<(value: Value) => boolean>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitWrapper<(value: any) => boolean>; + + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitWrapper<(value: Value) => boolean>; + } +} \ No newline at end of file diff --git a/types/lodash/util/method.d.ts b/types/lodash/util/method.d.ts new file mode 100644 index 0000000000..7377b17a60 --- /dev/null +++ b/types/lodash/util/method.d.ts @@ -0,0 +1,30 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that invokes the method at path on a given object. Any additional arguments are provided + * to the invoked method. + * + * @param path The path of the method to invoke. + * @param args The arguments to invoke the method with. + * @return Returns the new function. + */ + method( + path: PropertyPath, + ...args: any[] + ): (object: any) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.method + */ + method(...args: any[]): LoDashImplicitWrapper<(object: any) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.method + */ + method(...args: any[]): LoDashExplicitWrapper<(object: any) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/methodOf.d.ts b/types/lodash/util/methodOf.d.ts new file mode 100644 index 0000000000..52d7343be5 --- /dev/null +++ b/types/lodash/util/methodOf.d.ts @@ -0,0 +1,34 @@ +declare namespace _ { + interface LoDashStatic { + /** + * The opposite of _.method; this method creates a function that invokes the method at a given path on object. + * Any additional arguments are provided to the invoked method. + * + * @param object The object to query. + * @param args The arguments to invoke the method with. + * @return Returns the new function. + */ + methodOf( + object: object, + ...args: any[] + ): (path: PropertyPath) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.methodOf + */ + methodOf( + ...args: any[] + ): LoDashImplicitWrapper<(path: PropertyPath) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.methodOf + */ + methodOf( + ...args: any[] + ): LoDashExplicitWrapper<(path: PropertyPath) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/mixin.d.ts b/types/lodash/util/mixin.d.ts new file mode 100644 index 0000000000..01590b1929 --- /dev/null +++ b/types/lodash/util/mixin.d.ts @@ -0,0 +1,68 @@ +declare namespace _ { + interface MixinOptions { + chain?: boolean; + } + + interface LoDashStatic { + /** + * Adds all own enumerable function properties of a source object to the destination object. If object is a + * function then methods are added to its prototype as well. + * + * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying + * the original. + * + * @param object The destination object. + * @param source The object of functions to add. + * @param options The options object. + * @param options.chain Specify whether the functions added are chainable. + * @return Returns object. + */ + mixin( + object: TObject, + source: Dictionary<(...args: any[]) => any>, + options?: MixinOptions + ): TObject; + + /** + * @see _.mixin + */ + mixin( + source: Dictionary<(...args: any[]) => any>, + options?: MixinOptions + ): LoDashStatic; + } + + interface LoDashImplicitWrapper { + /** + * @see _.mixin + */ + mixin( + source: Dictionary<(...args: any[]) => any>, + options?: MixinOptions + ): this; + + /** + * @see _.mixin + */ + mixin( + options?: MixinOptions + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.mixin + */ + mixin( + source: Dictionary<(...args: any[]) => any>, + options?: MixinOptions + ): this; + + /** + * @see _.mixin + */ + mixin( + options?: MixinOptions + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/noConflict.d.ts b/types/lodash/util/noConflict.d.ts new file mode 100644 index 0000000000..d27b76819d --- /dev/null +++ b/types/lodash/util/noConflict.d.ts @@ -0,0 +1,24 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Reverts the _ variable to its previous value and returns a reference to the lodash function. + * + * @return Returns the lodash function. + */ + noConflict(): typeof _; + } + + interface LoDashImplicitWrapper { + /** + * @see _.noConflict + */ + noConflict(): typeof _; + } + + interface LoDashExplicitWrapper { + /** + * @see _.noConflict + */ + noConflict(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/noop.d.ts b/types/lodash/util/noop.d.ts new file mode 100644 index 0000000000..a17e537d98 --- /dev/null +++ b/types/lodash/util/noop.d.ts @@ -0,0 +1,24 @@ +declare namespace _ { + interface LoDashStatic { + /** + * A no-operation function that returns undefined regardless of the arguments it receives. + * + * @return undefined + */ + noop(...args: any[]): void; + } + + interface LoDashImplicitWrapper { + /** + * @see _.noop + */ + noop(...args: any[]): void; + } + + interface LoDashExplicitWrapper { + /** + * @see _.noop + */ + noop(...args: any[]): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/nthArg.d.ts b/types/lodash/util/nthArg.d.ts new file mode 100644 index 0000000000..d6b7b5a026 --- /dev/null +++ b/types/lodash/util/nthArg.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that returns its nth argument. + * + * @param n The index of the argument to return. + * @return Returns the new function. + */ + nthArg(n?: number): (...args: any[]) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.nthArg + */ + nthArg(): LoDashImplicitWrapper<(...args: any[]) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.nthArg + */ + nthArg(): LoDashExplicitWrapper<(...args: any[]) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/over.d.ts b/types/lodash/util/over.d.ts new file mode 100644 index 0000000000..87b323c4b4 --- /dev/null +++ b/types/lodash/util/over.d.ts @@ -0,0 +1,32 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that invokes iteratees with the arguments provided to the created function and returns + * their results. + * + * @param iteratees The iteratees to invoke. + * @return Returns the new function. + */ + over(...iteratees: Array TResult>>): (...args: any[]) => TResult[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.over + */ + over( + this: LoDashImplicitWrapper TResult>>, + ...iteratees: Array TResult>> + ): LoDashImplicitWrapper<(...args: any[]) => TResult[]>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.over + */ + over( + this: LoDashExplicitWrapper TResult>>, + ...iteratees: Array TResult>> + ): LoDashExplicitWrapper<(...args: any[]) => TResult[]>; + } +} \ No newline at end of file diff --git a/types/lodash/util/overEvery.d.ts b/types/lodash/util/overEvery.d.ts new file mode 100644 index 0000000000..b0f6275b4e --- /dev/null +++ b/types/lodash/util/overEvery.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that checks if all of the predicates return truthy when invoked with the arguments + * provided to the created function. + * + * @param predicates The predicates to check. + * @return Returns the new function. + */ + overEvery(...predicates: Array boolean>>): (...args: T[]) => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.overEvery + */ + overEvery(...predicates: Array boolean>>): LoDashImplicitWrapper<(...args: T[]) => boolean>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.overEvery + */ + overEvery(...predicates: Array boolean>>): LoDashExplicitWrapper<(...args: T[]) => boolean>; + } +} \ No newline at end of file diff --git a/types/lodash/util/overSome.d.ts b/types/lodash/util/overSome.d.ts new file mode 100644 index 0000000000..8574eb8f49 --- /dev/null +++ b/types/lodash/util/overSome.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that checks if any of the predicates return truthy when invoked with the arguments + * provided to the created function. + * + * @param predicates The predicates to check. + * @return Returns the new function. + */ + overSome(...predicates: Array boolean>>): (...args: T[]) => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.overSome + */ + overSome(...predicates: Array boolean>>): LoDashImplicitWrapper<(...args: T[]) => boolean>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.overSome + */ + overSome(...predicates: Array boolean>>): LoDashExplicitWrapper<(...args: T[]) => boolean>; + } +} \ No newline at end of file diff --git a/types/lodash/util/property.d.ts b/types/lodash/util/property.d.ts new file mode 100644 index 0000000000..72d1d8511b --- /dev/null +++ b/types/lodash/util/property.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates a function that returns the property value at path on a given object. + * + * @param path The path of the property to get. + * @return Returns the new function. + */ + property(path: PropertyPath): (obj: TObj) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.property + */ + property(): LoDashImplicitWrapper<(obj: TObj) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.property + */ + property(): LoDashExplicitWrapper<(obj: TObj) => TResult>; + } +} \ No newline at end of file diff --git a/types/lodash/util/propertyOf.d.ts b/types/lodash/util/propertyOf.d.ts new file mode 100644 index 0000000000..a904424d70 --- /dev/null +++ b/types/lodash/util/propertyOf.d.ts @@ -0,0 +1,26 @@ +declare namespace _ { + interface LoDashStatic { + /** + * The opposite of _.property; this method creates a function that returns the property value at a given path + * on object. + * + * @param object The object to query. + * @return Returns the new function. + */ + propertyOf(object: T): (path: PropertyPath) => any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.propertyOf + */ + propertyOf(): LoDashImplicitWrapper<(path: PropertyPath) => any>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.propertyOf + */ + propertyOf(): LoDashExplicitWrapper<(path: PropertyPath) => any>; + } +} \ No newline at end of file diff --git a/types/lodash/util/range.d.ts b/types/lodash/util/range.d.ts new file mode 100644 index 0000000000..ebd8266e4c --- /dev/null +++ b/types/lodash/util/range.d.ts @@ -0,0 +1,55 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. + * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length + * range is created unless a negative step is specified. + * + * @param start The start of the range. + * @param end The end of the range. + * @param step The value to increment or decrement by. + * @return Returns a new range array. + */ + range( + start: number, + end?: number, + step?: number + ): number[]; + + /** + * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. + * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length + * range is created unless a negative step is specified. + * + * @param start The start of the range. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns a new range array. + */ + range( + end: number, + index: string | number, + guard: object + ): number[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/rangeRight.d.ts b/types/lodash/util/rangeRight.d.ts new file mode 100644 index 0000000000..119aa7d7aa --- /dev/null +++ b/types/lodash/util/rangeRight.d.ts @@ -0,0 +1,76 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method is like `_.range` except that it populates values in + * descending order. + * + * @category Util + * @param start The start of the range. + * @param end The end of the range. + * @param step The value to increment or decrement by. + * @returns Returns the new array of numbers. + * @example + * + * _.rangeRight(4); + * // => [3, 2, 1, 0] + * + * _.rangeRight(-4); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 5); + * // => [4, 3, 2, 1] + * + * _.rangeRight(0, 20, 5); + * // => [15, 10, 5, 0] + * + * _.rangeRight(0, -4, -1); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 4, 0); + * // => [1, 1, 1] + * + * _.rangeRight(0); + * // => [] + */ + rangeRight( + start: number, + end?: number, + step?: number + ): number[]; + + /** + * This method is like _.range except that it populates values in + * descending order. + * + * @param start The start of the range. + * @param index Not used in this overload. + * @param guard Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code. + * @return Returns a new range array. + */ + rangeRight( + end: number, + index: string | number, + guard: object + ): number[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.rangeRight + */ + rangeRight( + end?: number, + step?: number + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.rangeRight + */ + rangeRight( + end?: number, + step?: number + ): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/runInContext.d.ts b/types/lodash/util/runInContext.d.ts new file mode 100644 index 0000000000..5c8acfb592 --- /dev/null +++ b/types/lodash/util/runInContext.d.ts @@ -0,0 +1,18 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Create a new pristine lodash function using the given context object. + * + * @param context The context object. + * @return Returns a new lodash function. + */ + runInContext(context?: object): typeof _; + } + + interface LoDashImplicitWrapper { + /** + * @see _.runInContext + */ + runInContext(): typeof _; + } +} \ No newline at end of file diff --git a/types/lodash/util/stubArray.d.ts b/types/lodash/util/stubArray.d.ts new file mode 100644 index 0000000000..ef5f8d32a1 --- /dev/null +++ b/types/lodash/util/stubArray.d.ts @@ -0,0 +1,24 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method returns a new empty array. + * + * @returns Returns the new empty array. + */ + stubArray(): any[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.stubArray + */ + stubArray(): any[]; + } + + interface LoDashExplicitWrapper { + /** + * @see _.stubArray + */ + stubArray(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/stubFalse.d.ts b/types/lodash/util/stubFalse.d.ts new file mode 100644 index 0000000000..eaea1c9a48 --- /dev/null +++ b/types/lodash/util/stubFalse.d.ts @@ -0,0 +1,24 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method returns `false`. + * + * @returns Returns `false`. + */ + stubFalse(): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.stubFalse + */ + stubFalse(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.stubFalse + */ + stubFalse(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/stubObject.d.ts b/types/lodash/util/stubObject.d.ts new file mode 100644 index 0000000000..b8de585c96 --- /dev/null +++ b/types/lodash/util/stubObject.d.ts @@ -0,0 +1,24 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method returns a new empty object. + * + * @returns Returns the new empty object. + */ + stubObject(): any; + } + + interface LoDashImplicitWrapper { + /** + * @see _.stubObject + */ + stubObject(): any; + } + + interface LoDashExplicitWrapper { + /** + * @see _.stubObject + */ + stubObject(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/stubString.d.ts b/types/lodash/util/stubString.d.ts new file mode 100644 index 0000000000..8b4363f458 --- /dev/null +++ b/types/lodash/util/stubString.d.ts @@ -0,0 +1,24 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method returns an empty string. + * + * @returns Returns the empty string. + */ + stubString(): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.stubString + */ + stubString(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.stubString + */ + stubString(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/stubTrue.d.ts b/types/lodash/util/stubTrue.d.ts new file mode 100644 index 0000000000..1c008fd0b7 --- /dev/null +++ b/types/lodash/util/stubTrue.d.ts @@ -0,0 +1,24 @@ +declare namespace _ { + interface LoDashStatic { + /** + * This method returns `true`. + * + * @returns Returns `true`. + */ + stubTrue(): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.stubTrue + */ + stubTrue(): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.stubTrue + */ + stubTrue(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/times.d.ts b/types/lodash/util/times.d.ts new file mode 100644 index 0000000000..e059c588f4 --- /dev/null +++ b/types/lodash/util/times.d.ts @@ -0,0 +1,49 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee + * is invoked with one argument; (index). + * + * @param n The number of times to invoke iteratee. + * @param iteratee The function invoked per iteration. + * @return Returns the array of results. + */ + times( + n: number, + iteratee: (num: number) => TResult + ): TResult[]; + + /** + * @see _.times + */ + times(n: number): number[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.times + */ + times( + iteratee: (num: number) => TResult + ): TResult[]; + + /** + * @see _.times + */ + times(): number[]; + } + + interface LoDashExplicitWrapper { + /** + * @see _.times + */ + times( + iteratee: (num: number) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.times + */ + times(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/toPath.d.ts b/types/lodash/util/toPath.d.ts new file mode 100644 index 0000000000..4c5129a461 --- /dev/null +++ b/types/lodash/util/toPath.d.ts @@ -0,0 +1,42 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Converts `value` to a property path array. + * + * @category Util + * @param value The value to convert. + * @returns Returns the new property path array. + * @example + * + * _.toPath('a.b.c'); + * // => ['a', 'b', 'c'] + * + * _.toPath('a[0].b.c'); + * // => ['a', '0', 'b', 'c'] + * + * var path = ['a', 'b', 'c'], + * newPath = _.toPath(path); + * + * console.log(newPath); + * // => ['a', 'b', 'c'] + * + * console.log(path === newPath); + * // => false + */ + toPath(value: any): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toPath + */ + toPath(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toPath + */ + toPath(): LoDashExplicitWrapper; + } +} \ No newline at end of file diff --git a/types/lodash/util/uniqueId.d.ts b/types/lodash/util/uniqueId.d.ts new file mode 100644 index 0000000000..49691cab85 --- /dev/null +++ b/types/lodash/util/uniqueId.d.ts @@ -0,0 +1,25 @@ +declare namespace _ { + interface LoDashStatic { + /** + * Generates a unique ID. If prefix is provided the ID is appended to it. + * + * @param prefix The value to prefix the ID with. + * @return Returns the unique ID. + */ + uniqueId(prefix?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniqueId + */ + uniqueId(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniqueId + */ + uniqueId(): LoDashExplicitWrapper; + } +} \ No newline at end of file From e626e99df914982b7a2e67ad4de4bf9926d6041a Mon Sep 17 00:00:00 2001 From: Hyeonsu Lee Date: Wed, 24 Jan 2018 03:23:55 +0900 Subject: [PATCH 039/357] Add @expo/vector-icons definitions (#23093) * Add @expo/vector-icons definitions * Rename the test file --- .../expo__vector-icons-tests.tsx | 111 ++++++++++++++++++ types/expo__vector-icons/index.d.ts | 21 ++++ types/expo__vector-icons/tsconfig.json | 25 ++++ types/expo__vector-icons/tslint.json | 1 + 4 files changed, 158 insertions(+) create mode 100644 types/expo__vector-icons/expo__vector-icons-tests.tsx create mode 100644 types/expo__vector-icons/index.d.ts create mode 100644 types/expo__vector-icons/tsconfig.json create mode 100644 types/expo__vector-icons/tslint.json diff --git a/types/expo__vector-icons/expo__vector-icons-tests.tsx b/types/expo__vector-icons/expo__vector-icons-tests.tsx new file mode 100644 index 0000000000..14ccbc7aa4 --- /dev/null +++ b/types/expo__vector-icons/expo__vector-icons-tests.tsx @@ -0,0 +1,111 @@ +import * as React from 'react'; +import { View, Text, TabBarIOS } from 'react-native'; +import { createIconSet, MaterialIcons, FontAwesome, Ionicons } from 'expo__vector-icons'; + +const glyphMap = { + custom: 58918 +}; + +const CustomIcon = createIconSet(glyphMap, 'FontCustom', 'FontCustom.ttf'); + +const CustomIconButton = CustomIcon.Button; +const CustomIconTabBarItem = CustomIcon.TabBarItem; +const CustomIconTabBarItemIOS = CustomIcon.TabBarItemIOS; +const CustomIconToolbarAndroid = CustomIcon.ToolbarAndroid; +const CustomIcongetImageSource = CustomIcon.getImageSource; + +class Example extends React.Component { + handleButton() { + console.log('You pressed me'); + } + + render() { + return ( + + {/* Normal Icon */} + + + {/* Icon button */} + this.handleButton()} + > + + Login with Facebook + + + + ); + } +} + +class TabTest extends React.Component<{}, { selectedTab: string }> { + constructor() { + super({}); + + this.state = { + selectedTab: 'tab1' + }; + } + + render() { + return ( + + this.setState({ selectedTab: 'tab1' })} + > + + + + this.setState({ selectedTab: 'tab2' })} + > + + + + ); + } +} + +class TestCustomIcon extends React.Component { + constructor() { + super({}); + } + + handleButton() { + console.log('You pressed me'); + } + + render() { + return ( + + {/* Custom Icon */} + + + {/* Custom Icon button */} + this.handleButton()} + > + + Hello CustomIcon! + + + + ); + } +} diff --git a/types/expo__vector-icons/index.d.ts b/types/expo__vector-icons/index.d.ts new file mode 100644 index 0000000000..ccc71fc93e --- /dev/null +++ b/types/expo__vector-icons/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for @expo/vector-icons 6.2 +// Project: https://github.com/expo/vector-icons +// Definitions by: Hyeonsu Lee +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as React from 'react'; +import { TextProperties } from 'react-native'; + +export { createIconSet, createIconSetFromFontello, createIconSetFromIcoMoon } from 'react-native-vector-icons'; +export { default as Entypo } from 'react-native-vector-icons/Entypo'; +export { default as EvilIcons } from 'react-native-vector-icons/EvilIcons'; +export { default as Feather } from 'react-native-vector-icons/Feather'; +export { default as FontAwesome } from 'react-native-vector-icons/FontAwesome'; +export { default as Foundation } from 'react-native-vector-icons/Foundation'; +export { default as Ionicons } from 'react-native-vector-icons/Ionicons'; +export { default as MaterialCommunityIcons } from 'react-native-vector-icons/MaterialCommunityIcons'; +export { default as MaterialIcons } from 'react-native-vector-icons/MaterialIcons'; +export { default as Octicons } from 'react-native-vector-icons/Octicons'; +export { default as SimpleLineIcons } from 'react-native-vector-icons/SimpleLineIcons'; +export { default as Zocial } from 'react-native-vector-icons/Zocial'; diff --git a/types/expo__vector-icons/tsconfig.json b/types/expo__vector-icons/tsconfig.json new file mode 100644 index 0000000000..9eb44c222f --- /dev/null +++ b/types/expo__vector-icons/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "expo__vector-icons-tests.tsx" + ] +} diff --git a/types/expo__vector-icons/tslint.json b/types/expo__vector-icons/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/expo__vector-icons/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 09f0e72b83ce370f1de8064aa61fa5f02ceb9e0b Mon Sep 17 00:00:00 2001 From: Ika Date: Wed, 24 Jan 2018 02:27:49 +0800 Subject: [PATCH 040/357] feat(vfile-location): initial commit (#23088) * feat(vfile-location): initial commit * fix: strings are allowed * docs: add descriptions --- types/vfile-location/index.d.ts | 25 ++++++++++++++++++++ types/vfile-location/tsconfig.json | 16 +++++++++++++ types/vfile-location/tslint.json | 3 +++ types/vfile-location/vfile-location-tests.ts | 7 ++++++ 4 files changed, 51 insertions(+) create mode 100644 types/vfile-location/index.d.ts create mode 100644 types/vfile-location/tsconfig.json create mode 100644 types/vfile-location/tslint.json create mode 100644 types/vfile-location/vfile-location-tests.ts diff --git a/types/vfile-location/index.d.ts b/types/vfile-location/index.d.ts new file mode 100644 index 0000000000..e8ad37bc32 --- /dev/null +++ b/types/vfile-location/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for vfile-location 2.0 +// Project: https://github.com/vfile/vfile-location +// Definitions by: Ika +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import * as VFile from "vfile"; + +declare function vfileLocation(vfile: string | VFile.VFile<{}>): vfileLocation.Location; + +declare namespace vfileLocation { + interface Location { + /** + * Get the `offset` (`number`) for a line and column-based `position` in the bound file. + * Returns `-1` when given invalid or out of bounds input. + */ + toOffset(position: { line: number; column: number }): number; + /** + * Get the line and column-based `position` for `offset` in the bound file. + */ + toPosition(offset: number): { line: number; column: number; offset: number }; + } +} + +export = vfileLocation; diff --git a/types/vfile-location/tsconfig.json b/types/vfile-location/tsconfig.json new file mode 100644 index 0000000000..92cec7ddc0 --- /dev/null +++ b/types/vfile-location/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "vfile-location-tests.ts"] +} diff --git a/types/vfile-location/tslint.json b/types/vfile-location/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/vfile-location/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/vfile-location/vfile-location-tests.ts b/types/vfile-location/vfile-location-tests.ts new file mode 100644 index 0000000000..7419cbf069 --- /dev/null +++ b/types/vfile-location/vfile-location-tests.ts @@ -0,0 +1,7 @@ +import vfile = require("vfile"); +import vfileLocation = require("vfile-location"); + +const location = vfileLocation(vfile("foo\nbar\nbaz")); + +const position = location.toPosition(10); +const offset: number = location.toOffset(position); From 861b87f6baa8527fb7bcd73f241355b6444053a2 Mon Sep 17 00:00:00 2001 From: "Junyoung Choi (Sai)" Date: Wed, 24 Jan 2018 03:28:25 +0900 Subject: [PATCH 041/357] Add dashify (#23092) * Add dashify * Use 4 spaces --- types/dashify/dashify-tests.ts | 7 +++++++ types/dashify/index.d.ts | 14 ++++++++++++++ types/dashify/tsconfig.json | 23 +++++++++++++++++++++++ types/dashify/tslint.json | 3 +++ 4 files changed, 47 insertions(+) create mode 100644 types/dashify/dashify-tests.ts create mode 100644 types/dashify/index.d.ts create mode 100644 types/dashify/tsconfig.json create mode 100644 types/dashify/tslint.json diff --git a/types/dashify/dashify-tests.ts b/types/dashify/dashify-tests.ts new file mode 100644 index 0000000000..3ff76d8628 --- /dev/null +++ b/types/dashify/dashify-tests.ts @@ -0,0 +1,7 @@ +import dashify = require('dashify'); + +const output: string = dashify('Foo----Bar'); +// => 'foo----bar' + +const output2: string = dashify('Foo----Bar', {condense: true}); +// => 'foo-bar' diff --git a/types/dashify/index.d.ts b/types/dashify/index.d.ts new file mode 100644 index 0000000000..54894f9e59 --- /dev/null +++ b/types/dashify/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for dashify 1.0 +// Project: https://github.com/jonschlinkert/dashify +// Definitions by: Junyoung Choi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function dashify(input: string, options?: dashify.Options): string; + +declare namespace dashify { + interface Options { + condense?: boolean; + } +} + +export = dashify; diff --git a/types/dashify/tsconfig.json b/types/dashify/tsconfig.json new file mode 100644 index 0000000000..81e84c030c --- /dev/null +++ b/types/dashify/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dashify-tests.ts" + ] +} \ No newline at end of file diff --git a/types/dashify/tslint.json b/types/dashify/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/dashify/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 745b78c0b2aac91479ef740ff430dd4254628e30 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Tue, 23 Jan 2018 16:30:47 -0200 Subject: [PATCH 042/357] [react-native] Add locale prop on DatePickerIOS (#23080) --- types/react-native/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 87a092a11e..72cb9512d3 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -2461,6 +2461,11 @@ export interface DatePickerIOSProperties extends ViewProperties { */ date: Date; + /** + * The date picker locale. + */ + locale?: string; + /** * Maximum date. * Restricts the range of possible date/time values. From 29a649e6aba6011e99b1a6a17d48500a73a24291 Mon Sep 17 00:00:00 2001 From: Ahn Date: Tue, 23 Jan 2018 19:31:06 +0100 Subject: [PATCH 043/357] Add accessType to jest.spyOn as supported in Jest 22.1.0+ for types/jest (#23082) * Add accessType to jest.spyOn * Adjust version * Adjust accessType to be more accurate on expected type value --- types/jest/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index 0ba1762485..e0d73d5c9e 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Jest 22.0 +// Type definitions for Jest 22.1 // Project: http://facebook.github.io/jest/ // Definitions by: Asana // Ivo Stratev @@ -10,6 +10,7 @@ // Waseem Dahman // Jamie Mason // Douglas Duteil +// Ahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -169,7 +170,7 @@ declare namespace jest { /** * Creates a mock function similar to jest.fn but also tracks calls to object[methodName] */ - function spyOn(object: T, method: M): SpyInstance; + function spyOn(object: T, method: M, accessType?: 'get' | 'set'): SpyInstance; /** * Indicates that the module system should never return a mocked version of * the specified module from require() (e.g. that it should always return the real module). From ec91c51a728f7f866a83d25d9ddfd0f9473e962b Mon Sep 17 00:00:00 2001 From: smhxx Date: Tue, 23 Jan 2018 12:32:16 -0600 Subject: [PATCH 044/357] chai, chai-dom, chai-jquery: fix signature of match()/matches() methods (#23077) * chai: fix signature of match()/matches() methods * chai-dom: add missing assertions from recent minor versions * chai-jquery: add missing declaration caused by changes to @types/chai --- types/chai-dom/index.d.ts | 18 ++++++++++++++++++ types/chai-jquery/index.d.ts | 4 ++++ types/chai/index.d.ts | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/types/chai-dom/index.d.ts b/types/chai-dom/index.d.ts index 4338de92e2..8650ebca1d 100644 --- a/types/chai-dom/index.d.ts +++ b/types/chai-dom/index.d.ts @@ -23,6 +23,18 @@ declare namespace Chai { value(text: string): Assertion; + empty: Assertion; + + // exist, length, and contain are already defined in @types/chai and have the + // same type or a more general type, so don't need to be re-declared even though + // the implementation is different + + descendant(element: string|HTMLElement): Assertion; + + descendants(selector: string): Assertion; + + displayed: Assertion; + } interface Include { @@ -33,6 +45,12 @@ declare namespace Chai { } + interface Match { + + (selector: string): Assertion; + + } + } declare module "chai-dom" { diff --git a/types/chai-jquery/index.d.ts b/types/chai-jquery/index.d.ts index e84a1ec272..bd6826ca08 100644 --- a/types/chai-jquery/index.d.ts +++ b/types/chai-jquery/index.d.ts @@ -27,6 +27,10 @@ declare namespace Chai { disabled(): Assertion; (selector: string): Assertion; } + + interface Match { + (selector: string): Assertion; + } } /** diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index 925c7198f0..02bca8909f 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -226,7 +226,7 @@ declare namespace Chai { } interface Match { - (regexp: RegExp|string, message?: string): Assertion; + (regexp: RegExp, message?: string): Assertion; } interface Keys { From 27b74af5a22cdd2275ccc2e56ec0ba077c048dda Mon Sep 17 00:00:00 2001 From: Niall Date: Wed, 24 Jan 2018 05:32:48 +1100 Subject: [PATCH 045/357] Update googlemaps fitbounds method to include padding (#23071) fitbounds has an optional second argument: padding. reference: https://developers.google.com/maps/documentation/javascript/reference (see Methods section, first method). --- types/googlemaps/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/googlemaps/index.d.ts b/types/googlemaps/index.d.ts index 83190d3e28..4519a50eab 100644 --- a/types/googlemaps/index.d.ts +++ b/types/googlemaps/index.d.ts @@ -31,7 +31,7 @@ declare namespace google.maps { /***** Map *****/ export class Map extends MVCObject { constructor(mapDiv: Element|null, opts?: MapOptions); - fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; + fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral, padding?: number): void; getBounds(): LatLngBounds|null|undefined; getCenter(): LatLng; getDiv(): Element; From 7a3a2f77d5635283c5a497e882dc01c1d4673c65 Mon Sep 17 00:00:00 2001 From: York Yao Date: Wed, 24 Jan 2018 02:35:45 +0800 Subject: [PATCH 046/357] feat: add types of geetest (#23069) --- types/geetest/geetest-tests.ts | 41 ++++++++++++++++++++++++++++++++++ types/geetest/index.d.ts | 37 ++++++++++++++++++++++++++++++ types/geetest/tsconfig.json | 23 +++++++++++++++++++ types/geetest/tslint.json | 1 + 4 files changed, 102 insertions(+) create mode 100644 types/geetest/geetest-tests.ts create mode 100644 types/geetest/index.d.ts create mode 100644 types/geetest/tsconfig.json create mode 100644 types/geetest/tslint.json diff --git a/types/geetest/geetest-tests.ts b/types/geetest/geetest-tests.ts new file mode 100644 index 0000000000..f9e3403713 --- /dev/null +++ b/types/geetest/geetest-tests.ts @@ -0,0 +1,41 @@ +import Geetest = require('geetest'); + +const captcha = new Geetest({ + geetest_id: 'xxx', + geetest_key: 'xxx', +}); + +captcha.register((err, data) => { + if (err) { + return; + } + const body = { + gt: data.geetest_id, + challenge: data.challenge, + success: data.success, + }; +}); + +captcha.register().then((data) => { + const body = { + gt: data.geetest_id, + challenge: data.challenge, + success: data.success, + }; +}, (err) => { +}); + +captcha.validate({ + challenge: 'xxx', + validate: 'xxx', + seccode: 'xxx', +}, (err, success) => { +}); + +captcha.validate({ + challenge: 'xxx', + validate: 'xxx', + seccode: 'xxx', +}).then((success) => { +}, (err) => { +}); diff --git a/types/geetest/index.d.ts b/types/geetest/index.d.ts new file mode 100644 index 0000000000..c6ed9bb7e7 --- /dev/null +++ b/types/geetest/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for geetest 4.1 +// Project: https://github.com/GeeTeam/gt-node-sdk#readme +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Options { + geetest_id: string; + geetest_key: string; + protocol?: string; + api_server?: string; +} + +type Success = 0 | 1; + +interface Data { + geetest_id: string; + gt: string; + challenge: string; + success: Success; + new_captcha: string; +} + +interface Result { + challenge: string; + validate: string; + seccode: string; +} + +declare class Geetest { + constructor(options: Options); + register(callback: (error: Error, data: Data) => void): void; + register(): Promise; + validate(result: Result, callback: (error: Error, success: Success) => void): void; + validate(result: Result): Promise; +} + +export = Geetest; diff --git a/types/geetest/tsconfig.json b/types/geetest/tsconfig.json new file mode 100644 index 0000000000..e1eabe6427 --- /dev/null +++ b/types/geetest/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "geetest-tests.ts" + ] +} diff --git a/types/geetest/tslint.json b/types/geetest/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/geetest/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8abd412a024d5993273914f685fa6695756aceb4 Mon Sep 17 00:00:00 2001 From: Qibang Date: Wed, 24 Jan 2018 02:36:05 +0800 Subject: [PATCH 047/357] feat: add `tabBarOnPress` (#23068) --- types/react-navigation/index.d.ts | 12 +++++++++++- types/react-navigation/react-navigation-tests.tsx | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 30aa2c1ff8..37d6360688 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -327,7 +327,12 @@ export interface NavigationTabRouterConfig { // Does the back button cause the router to switch to the initial tab backBehavior?: 'none' | 'initialRoute'; // defaults `initialRoute` } - +export interface TabScene { + route: NavigationRoute; + focused: boolean; + index: number; + tintColor?: string; +} export interface NavigationTabScreenOptions extends NavigationScreenOptions { tabBarIcon?: React.ReactElement @@ -341,6 +346,11 @@ export interface NavigationTabScreenOptions extends NavigationScreenOptions { any > | string | null)); tabBarVisible?: boolean; + tabBarTestIDProps?: { testID?: string, accessibilityLabel?: string }; + tabBarOnPress?: ( + scene: TabScene, + jumpToIndex: (index: number) => void + ) => void; } export interface NavigationDrawerScreenOptions extends NavigationScreenOptions { diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index aca3f1bcf6..40d19f0fee 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -138,6 +138,7 @@ const tabNavigatorScreenOptions: NavigationTabScreenOptions = { tabBarVisible: true, tabBarIcon: , tabBarLabel: 'label', + tabBarOnPress: (scene, index) => {} }; const tabNavigatorConfig: TabNavigatorConfig = { From 398ebb9d762c3a3218819b193d0e2ce7f2fe3247 Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Tue, 23 Jan 2018 13:39:09 -0500 Subject: [PATCH 048/357] knex: default batchInsert chunkSize arg (#23064) * knex: optional batchInsert chunkSize arg * knex: add test for optional batchInsert --- types/knex/index.d.ts | 2 +- types/knex/knex-tests.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 6354773142..72b9c828a4 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -29,7 +29,7 @@ interface Knex extends Knex.QueryInterface { transaction(transactionScope: (trx: Knex.Transaction) => Promise | Bluebird | void): Bluebird; destroy(callback: Function): void; destroy(): Bluebird; - batchInsert(tableName: TableName, data: any[], chunkSize: number): Knex.QueryBuilder; + batchInsert(tableName: TableName, data: any[], chunkSize?: number): Knex.QueryBuilder; schema: Knex.SchemaBuilder; queryBuilder(): Knex.QueryBuilder; diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index 2aab8c30de..f85168d552 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -487,6 +487,7 @@ knex('books') .insert([{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}]); knex.batchInsert('books', [{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}], 200); +knex.batchInsert('books', [{title: 'Catcher In The Rye'}, {title: 'Pride And Prejudice'}]); knex.queryBuilder().table('books'); knex('books').where('published_date', '<', 2000).update({status: 'archived'}); From c6a22f77ba5facd9be54cc66b08fb36d7001d67d Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 23 Jan 2018 21:42:43 +0300 Subject: [PATCH 049/357] Add missed carousel definition variant (#23063) https://getbootstrap.com/docs/3.3/javascript/#carousel-number --- types/bootstrap/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 9fa10bcdbb..a3117596af 100644 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -115,6 +115,7 @@ interface JQuery { carousel(options?: CarouselOptions): JQuery; carousel(command: string): JQuery; + carousel(index: number): JQuery; typeahead(options?: TypeaheadOptions): JQuery; From f69b0ea7b61be400e3dd0209380141bbaffbee4e Mon Sep 17 00:00:00 2001 From: maximelkin Date: Tue, 23 Jan 2018 21:43:37 +0300 Subject: [PATCH 050/357] add @types/node-cron (#23062) * add node-cron * Update tslint.json Remove lint rule --- types/node-cron/index.d.ts | 15 ++++++++++ types/node-cron/node-cron-tests.ts | 47 ++++++++++++++++++++++++++++++ types/node-cron/tsconfig.json | 25 ++++++++++++++++ types/node-cron/tslint.json | 3 ++ 4 files changed, 90 insertions(+) create mode 100644 types/node-cron/index.d.ts create mode 100644 types/node-cron/node-cron-tests.ts create mode 100644 types/node-cron/tsconfig.json create mode 100644 types/node-cron/tslint.json diff --git a/types/node-cron/index.d.ts b/types/node-cron/index.d.ts new file mode 100644 index 0000000000..75ddaefdde --- /dev/null +++ b/types/node-cron/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for node-cron 1.2 +// Project: http://merencia.com/node-cron/ +// Definitions by: morsic +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// immediateStart - default true +export function schedule(a: string, func: () => void, immediateStart?: boolean): ScheduledTask; + +export function validate(a: string): boolean; + +export interface ScheduledTask { + start: () => this; + stop: () => this; + destroy: () => void; +} diff --git a/types/node-cron/node-cron-tests.ts b/types/node-cron/node-cron-tests.ts new file mode 100644 index 0000000000..c670924d27 --- /dev/null +++ b/types/node-cron/node-cron-tests.ts @@ -0,0 +1,47 @@ +/// + +import cron = require('node-cron'); + +// tslint:disable-next-line no-console +const log = console.log; + +cron.schedule('* * * * *', () => { + log('running a task every minute'); +}); + +cron.schedule('1-5 * * * *', () => { + log('running every minute to 1 from 5'); +}); + +// tslint:disable-next-line rule +const task = cron.schedule('* * * * *', () => { + log('immediately started'); + // because of manual call start method +}, false); + +task.start(); + +const task1 = cron.schedule('* * * * *', () => { + log('will execute every minute until stopped'); +}); + +task1.start(); + +const task2 = cron.schedule('* * * * *', () => { + log('will execute every minute until stopped'); +}); + +task2.stop(); + +const task3 = cron.schedule('* * * * *', () => { + log('will execute every minute until stopped'); +}); + +task3.destroy(); + +const valid = cron.validate('59 * * * *'); +const invalid = cron.validate('60 * * * *'); + +if (valid && !invalid) { + log('validator works'); +} diff --git a/types/node-cron/tsconfig.json b/types/node-cron/tsconfig.json new file mode 100644 index 0000000000..e1ec63395b --- /dev/null +++ b/types/node-cron/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "strictNullChecks": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "strictFunctionTypes": true, + "noUnusedParameters": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "node-cron-tests.ts" + ] +} diff --git a/types/node-cron/tslint.json b/types/node-cron/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/node-cron/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 1d84357470bbd4dfe962a10ee59e582aebee9a11 Mon Sep 17 00:00:00 2001 From: Ankit Tyagi Date: Tue, 23 Jan 2018 10:44:30 -0800 Subject: [PATCH 051/357] @types/mongodb - add appname to MongoClientOptions (#23060) - Based on https://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#.connect --- types/mongodb/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 8bd069dcd6..08aeceb5d8 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -92,6 +92,8 @@ export interface MongoClientOptions extends logger?: Object; // Default: false; validateOptions?: Object; + // The name of the application that created this MongoClient instance. + appname?: string; } export interface SSLOptions { From 00865c52ee6d2dbc323c1a44a49591ac6bc03830 Mon Sep 17 00:00:00 2001 From: Sriram Thiagarajan Date: Wed, 24 Jan 2018 00:15:40 +0530 Subject: [PATCH 052/357] added id prop for react-select input (#23054) * added id prop * jsdoc in right place * default value for id to be undefined --- types/react-select/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/react-select/index.d.ts b/types/react-select/index.d.ts index f4a0db94dc..8eade27abc 100644 --- a/types/react-select/index.d.ts +++ b/types/react-select/index.d.ts @@ -229,6 +229,11 @@ export interface ReactSelectProps extends React.Props; + /** + * id for the underlying HTML input element + * @default undefined + */ + id?: string; /** * whether to strip diacritics when filtering * @default true From cc49e97d504bfc88f3e86ed4713f9337d98cd393 Mon Sep 17 00:00:00 2001 From: Kim Joar Bekkelund Date: Tue, 23 Jan 2018 19:46:47 +0100 Subject: [PATCH 053/357] Use 'export =' for type-detect (#23049) --- types/type-detect/index.d.ts | 3 ++- types/type-detect/type-detect-tests.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/type-detect/index.d.ts b/types/type-detect/index.d.ts index 957300c7a1..7844361f61 100644 --- a/types/type-detect/index.d.ts +++ b/types/type-detect/index.d.ts @@ -3,4 +3,5 @@ // Definitions by: Bart van der Schoor // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export default function typeDetect(obj: any): string; +declare function typeDetect(obj: any): string; +export = typeDetect; diff --git a/types/type-detect/type-detect-tests.ts b/types/type-detect/type-detect-tests.ts index 65b52c8bca..4f6e3af706 100644 --- a/types/type-detect/type-detect-tests.ts +++ b/types/type-detect/type-detect-tests.ts @@ -1,4 +1,4 @@ -import type from 'type-detect'; +import type = require('type-detect'); // $ExpectType string type(123); From f009df31d0b1a604f4ebdda34e7f3bcf4f327791 Mon Sep 17 00:00:00 2001 From: Edward Woolhouse Date: Tue, 23 Jan 2018 18:47:15 +0000 Subject: [PATCH 054/357] [bytebuffer] Add missing 'readBytes' and 'writeBytes' functions (#23044) --- types/bytebuffer/index.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/types/bytebuffer/index.d.ts b/types/bytebuffer/index.d.ts index fca26b439f..0ed98f54c6 100644 --- a/types/bytebuffer/index.d.ts +++ b/types/bytebuffer/index.d.ts @@ -307,6 +307,11 @@ declare class ByteBuffer */ readByte( offset?: number ): number; + /** + * Reads the specified number of bytes + */ + readBytes( length: number, offset?: number): ByteBuffer; + /** * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters itself. */ @@ -508,6 +513,11 @@ declare class ByteBuffer */ writeByte( value: number, offset?: number ): ByteBuffer; + /** + * Writes an array of bytes. This is an alias for append + */ + writeBytes( source: ByteBuffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; + /** * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL characters itself. */ From 22c68afd73dedcdd287722238bfdda95566a67fe Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Tue, 23 Jan 2018 10:48:56 -0800 Subject: [PATCH 055/357] Fix indent --- types/sinon-chrome/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sinon-chrome/index.d.ts b/types/sinon-chrome/index.d.ts index f4834bc527..67614ff6bc 100644 --- a/types/sinon-chrome/index.d.ts +++ b/types/sinon-chrome/index.d.ts @@ -22,7 +22,7 @@ export = SinonChrome; export as namespace SinonChrome; interface SinonChromeStub extends Sinon.SinonStub { - flush(): void; + flush(): void; } declare namespace SinonChrome { From 22afda5072f60a6738999163dbb469e726f21f16 Mon Sep 17 00:00:00 2001 From: Pavlina Hadjieva Date: Tue, 23 Jan 2018 20:51:12 +0200 Subject: [PATCH 056/357] Upgrade Kendo UI definitions to 2018.1.117 (#23034) * Update GridColumnCommandItem to match types/example from documentation. - GridColumnCommandItem has been changed from only accepting GridColumnCommandItemText to accepting both string or GridColumnCommandItemText. * feat: upgrade Kendo UI definitions to 2018.1.117 --- types/kendo-ui/index.d.ts | 765 +++++++++++++++++++++----------------- 1 file changed, 422 insertions(+), 343 deletions(-) diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index 7c81634f27..97b840e2cf 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kendo UI Professional v2017.3.913 +// Type definitions for Kendo UI Professional v2018.1.117 // Project: http://www.telerik.com/kendo-ui // Definitions by: Telerik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -91,8 +91,39 @@ declare namespace kendo { }; var cultures: {[culture: string] : { - name?: string; - calendar?: { + name?: string; + calendar?: { + AM: string[]; + PM: string[]; + days: { + names: string[]; + namesAbbr: string[]; + namesShort: string[]; + firstDay: number; + }; + months: { + names: string[]; + namesAbbr: string[]; + }; + patterns: { + D: string; + F: string; + G: string; + M: string; + T: string; + Y: string; + d: string; + g: string; + m: string; + s: string; + t: string; + u: string; + y: string; + }; + twoDigitYearMax: number; + }; + calendars?: { + standard: { AM: string[]; PM: string[]; days: { @@ -122,57 +153,25 @@ declare namespace kendo { }; twoDigitYearMax: number; }; - calendars?: { - standard: { - AM: string[]; - PM: string[]; - days: { - names: string[]; - namesAbbr: string[]; - namesShort: string[]; - firstDay: number; - }; - months: { - names: string[]; - namesAbbr: string[]; - }; - patterns: { - D: string; - F: string; - G: string; - M: string; - T: string; - Y: string; - d: string; - g: string; - m: string; - s: string; - t: string; - u: string; - y: string; - }; - twoDigitYearMax: number; - }; - }; - numberFormat?: { - currency: { - decimals: number; - groupSize: number[]; - pattern: string[]; - symbol: string; - }; + }; + numberFormat?: { + currency: { decimals: number; groupSize: number[]; pattern: string[]; - percent: { - decimals: number; - groupSize: number[]; - pattern: string[]; - symbol: string; - }; + symbol: string; }; - } - }; + decimals: number; + groupSize: number[]; + pattern: string[]; + percent: { + decimals: number; + groupSize: number[]; + pattern: string[]; + symbol: string; + }; + }; + }}; function format(format: string, ...values: any[]): string; @@ -307,7 +306,7 @@ declare namespace kendo { } class ViewContainer extends Observable { - view: View; + view: View; } class Layout extends View { @@ -959,7 +958,7 @@ declare namespace kendo.data { } interface DataSourceSchemaWithConstructorModel extends DataSourceSchema { - model?: typeof Model; + model?: typeof Model; } interface DataSourceSchemaModel { @@ -997,7 +996,7 @@ declare namespace kendo.data { max?: any; minLength?: any; maxLength?: any; - [rule: string]: any; + [rule: string]: any; } class ObservableArray extends Observable { @@ -1010,7 +1009,7 @@ declare namespace kendo.data { every(callback: (item: Object, index: number, source: ObservableArray) => boolean): boolean; filter(callback: (item: Object, index: number, source: ObservableArray) => boolean): any[]; find(callback: (item: Object, index: number, source: ObservableArray) => boolean): any; - forEach(callback: (item: Object, index: number, source: ObservableArray) => void): void; + forEach(callback: (item: Object, index: number, source: ObservableArray) => void ): void; indexOf(item: any): number; join(separator: string): string; map(callback: (item: Object, index: number, source: ObservableArray) => any): any[]; @@ -1258,7 +1257,7 @@ declare namespace kendo.data { type?: string; change? (e: DataSourceChangeEvent): void; error?(e: DataSourceErrorEvent): void; - push?(e: DataSourcePushEvent): void; + push?(e: DataSourcePushEvent): void; sync?(e: DataSourceEvent): void; requestStart?(e: DataSourceRequestStartEvent): void; requestEnd?(e: DataSourceRequestEndEvent): void; @@ -1288,9 +1287,9 @@ declare namespace kendo.data { node?: any; } - interface DataSourcePushEvent extends DataSourceEvent { + interface DataSourcePushEvent extends DataSourceEvent { items?: DataSourceItemOrGroup[]; - type?: string; + type?: string; } @@ -1371,22 +1370,19 @@ declare namespace kendo.ui { drop?(e: DropTargetDropEvent): void; } - interface DropTargetEvent { + interface DropTargetEvent extends JQueryEventObject { sender?: DropTarget; - dropTarget?: JQuery; - target?: Element; + draggable?: kendo.ui.Draggable; + dropTarget?: JQuery } interface DropTargetDragenterEvent extends DropTargetEvent { - draggable?: kendo.ui.Draggable; } interface DropTargetDragleaveEvent extends DropTargetEvent { - draggable?: kendo.ui.Draggable; } interface DropTargetDropEvent extends DropTargetEvent { - draggable?: kendo.ui.Draggable; } class DropTargetArea extends kendo.ui.Widget{ @@ -1501,7 +1497,7 @@ declare namespace kendo.mobile { statusBarStyle?: string; transition?: string; useNativeScrolling?: boolean; - init?(e: ApplicationEvent): void; + init?(e: ApplicationEvent): void; } interface ApplicationEvent { @@ -1547,7 +1543,7 @@ declare namespace kendo.dataviz.map.layer { declare namespace kendo.drawing.pdf { function saveAs(group: kendo.drawing.Group, fileName: string, - proxyUrl?: string, callback?: Function): void; + proxyUrl?: string, callback?: Function): void; } declare namespace kendo.ui { @@ -1644,7 +1640,7 @@ declare namespace kendo.ui { interface AutoCompleteOptions { name?: string; - animation?: boolean|AutoCompleteAnimation; + animation?: boolean | AutoCompleteAnimation; autoWidth?: boolean; dataSource?: any|any|kendo.data.DataSource; clearButton?: boolean; @@ -1669,7 +1665,7 @@ declare namespace kendo.ui { template?: string|Function; value?: string; valuePrimitive?: boolean; - virtual?: boolean|AutoCompleteVirtual; + virtual?: boolean | AutoCompleteVirtual; change?(e: AutoCompleteChangeEvent): void; close?(e: AutoCompleteCloseEvent): void; dataBound?(e: AutoCompleteDataBoundEvent): void; @@ -1743,6 +1739,62 @@ declare namespace kendo.ui { } + class ButtonGroup extends kendo.ui.Widget { + + static fn: ButtonGroup; + + options: ButtonGroupOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ButtonGroup; + + constructor(element: Element, options?: ButtonGroupOptions); + + + badge(button: string, value: string): string; + badge(button: string, value: boolean): string; + badge(button: number, value: string): string; + badge(button: number, value: boolean): string; + current(): JQuery; + destroy(): void; + enable(enable: boolean): void; + select(li: JQuery): void; + select(li: number): void; + + } + + interface ButtonGroupItem { + attributes?: any; + badge?: string; + enabled?: boolean; + icon?: string; + imageUrl?: string; + selected?: boolean; + text?: string; + } + + interface ButtonGroupOptions { + name?: string; + enable?: boolean; + index?: number; + selection?: string; + items?: ButtonGroupItem[]; + select?(e: ButtonGroupSelectEvent): void; + } + interface ButtonGroupEvent { + sender: ButtonGroup; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ButtonGroupSelectEvent extends ButtonGroupEvent { + index?: number; + } + + class Calendar extends kendo.ui.Widget { static fn: Calendar; @@ -2032,7 +2084,7 @@ declare namespace kendo.ui { text?: string; value?: string; valuePrimitive?: boolean; - virtual?: boolean|ComboBoxVirtual; + virtual?: boolean | ComboBoxVirtual; change?(e: ComboBoxChangeEvent): void; close?(e: ComboBoxCloseEvent): void; dataBound?(e: ComboBoxDataBoundEvent): void; @@ -2163,7 +2215,7 @@ declare namespace kendo.ui { interface ContextMenuOptions { name?: string; alignToAnchor?: boolean; - animation?: boolean|ContextMenuAnimation; + animation?: boolean | ContextMenuAnimation; appendTo?: string|JQuery; closeOnClick?: boolean; copyAnchorStyles?: boolean; @@ -2337,7 +2389,7 @@ declare namespace kendo.ui { interface DatePickerOptions { name?: string; - animation?: boolean|DatePickerAnimation; + animation?: boolean | DatePickerAnimation; ARIATemplate?: string; culture?: string; dateInput?: boolean; @@ -2430,7 +2482,7 @@ declare namespace kendo.ui { interface DateTimePickerOptions { name?: string; - animation?: boolean|DateTimePickerAnimation; + animation?: boolean | DateTimePickerAnimation; ARIATemplate?: string; culture?: string; dateInput?: boolean; @@ -2526,7 +2578,7 @@ declare namespace kendo.ui { interface DialogOptions { name?: string; actions?: DialogAction[]; - animation?: boolean|DialogAnimation; + animation?: boolean | DialogAnimation; buttonLayout?: string; closable?: boolean; content?: string; @@ -2630,7 +2682,7 @@ declare namespace kendo.ui { interface DropDownListOptions { name?: string; - animation?: boolean|DropDownListAnimation; + animation?: boolean | DropDownListAnimation; autoBind?: boolean; autoWidth?: boolean; cascadeFrom?: string; @@ -2659,7 +2711,7 @@ declare namespace kendo.ui { text?: string; value?: string; valuePrimitive?: boolean; - virtual?: boolean|DropDownListVirtual; + virtual?: boolean | DropDownListVirtual; change?(e: DropDownListChangeEvent): void; close?(e: DropDownListCloseEvent): void; dataBound?(e: DropDownListDataBoundEvent): void; @@ -2767,9 +2819,9 @@ declare namespace kendo.ui { } interface EditorFileBrowserSchemaModelFields { - name?: EditorFileBrowserSchemaModelFieldsName; - type?: EditorFileBrowserSchemaModelFieldsType; - size?: EditorFileBrowserSchemaModelFieldsSize; + name?: string | EditorFileBrowserSchemaModelFieldsName; + type?: string | EditorFileBrowserSchemaModelFieldsType; + size?: string | EditorFileBrowserSchemaModelFieldsSize; } interface EditorFileBrowserSchemaModel { @@ -2805,11 +2857,11 @@ declare namespace kendo.ui { } interface EditorFileBrowserTransport { - read?: EditorFileBrowserTransportRead; + read?: string | Function | EditorFileBrowserTransportRead; uploadUrl?: string; fileUrl?: string|Function; - destroy?: EditorFileBrowserTransportDestroy; - create?: EditorFileBrowserTransportCreate; + destroy?: string | EditorFileBrowserTransportDestroy; + create?: string | EditorFileBrowserTransportCreate; } interface EditorFileBrowser { @@ -2849,9 +2901,9 @@ declare namespace kendo.ui { } interface EditorImageBrowserSchemaModelFields { - name?: EditorImageBrowserSchemaModelFieldsName; - type?: EditorImageBrowserSchemaModelFieldsType; - size?: EditorImageBrowserSchemaModelFieldsSize; + name?: string | EditorImageBrowserSchemaModelFieldsName; + type?: string | EditorImageBrowserSchemaModelFieldsType; + size?: string | EditorImageBrowserSchemaModelFieldsSize; } interface EditorImageBrowserSchemaModel { @@ -2887,12 +2939,12 @@ declare namespace kendo.ui { } interface EditorImageBrowserTransport { - read?: EditorImageBrowserTransportRead; + read?: string | Function | EditorImageBrowserTransportRead; thumbnailUrl?: string|Function; uploadUrl?: string; imageUrl?: string|Function; - destroy?: EditorImageBrowserTransportDestroy; - create?: EditorImageBrowserTransportCreate; + destroy?: string | EditorImageBrowserTransportDestroy; + create?: string | EditorImageBrowserTransportCreate; } interface EditorImageBrowser { @@ -3081,11 +3133,11 @@ declare namespace kendo.ui { deserialization?: EditorDeserialization; domain?: string; encoded?: boolean; - immutables?: boolean|EditorImmutables; + immutables?: boolean | EditorImmutables; messages?: EditorMessages; pasteCleanup?: EditorPasteCleanup; pdf?: EditorPdf; - resizable?: boolean|EditorResizable; + resizable?: boolean | EditorResizable; serialization?: EditorSerialization; stylesheets?: any; tools?: EditorTool[]; @@ -3144,6 +3196,7 @@ declare namespace kendo.ui { clear?: string; filter?: string; info?: string; + title?: string; additionalValue?: string; additionalOperator?: string; logic?: string; @@ -3459,11 +3512,11 @@ declare namespace kendo.ui { autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GanttColumn[]; - currentTimeMarker?: boolean|GanttCurrentTimeMarker; + currentTimeMarker?: boolean | GanttCurrentTimeMarker; dataSource?: any|any|kendo.data.GanttDataSource; date?: Date; dependencies?: any|any|kendo.data.GanttDependencyDataSource; - editable?: boolean|GanttEditable; + editable?: boolean | GanttEditable; navigatable?: boolean; workDayStart?: Date; workDayEnd?: Date; @@ -3701,6 +3754,12 @@ declare namespace kendo.ui { messages?: GridColumnMenuMessages; } + interface GridColumnCommandItemIconClass { + edit?: string; + update?: string; + cancel?: string; + } + interface GridColumnCommandItemText { edit?: string; cancel?: string; @@ -3710,10 +3769,10 @@ declare namespace kendo.ui { interface GridColumnCommandItem { visible?: Function; name?: string; - text?: GridColumnCommandItemText; + text?: string | GridColumnCommandItemText; className?: string; click?: Function; - iconClass?: string; + iconClass?: string | GridColumnCommandItemIconClass; } interface GridColumnFilterableCell { @@ -3731,6 +3790,7 @@ declare namespace kendo.ui { interface GridColumnFilterable { cell?: GridColumnFilterableCell; + extra?: boolean; multi?: boolean; dataSource?: any|any|kendo.data.DataSource; checkAll?: boolean; @@ -3750,11 +3810,11 @@ declare namespace kendo.ui { aggregates?: any; attributes?: any; columns?: any; - command?: string|(string|GridColumnCommandItem)[]; + command?: GridColumnCommandItem[]; editable?: Function; encoded?: boolean; field?: string; - filterable?: boolean|GridColumnFilterable; + filterable?: boolean | GridColumnFilterable; footerAttributes?: any; footerTemplate?: string|Function; format?: string; @@ -3769,7 +3829,7 @@ declare namespace kendo.ui { minResizableWidth?: number; minScreenWidth?: number; selectable?: boolean; - sortable?: boolean|GridColumnSortable; + sortable?: boolean | GridColumnSortable; template?: string|Function; title?: string; width?: string|number; @@ -3802,6 +3862,7 @@ declare namespace kendo.ui { clear?: string; filter?: string; info?: string; + title?: string; isFalse?: string; isTrue?: string; or?: string; @@ -3977,43 +4038,45 @@ declare namespace kendo.ui { interface GridOptions { name?: string; - allowCopy?: boolean|GridAllowCopy; + allowCopy?: boolean | GridAllowCopy; altRowTemplate?: string|Function; autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GridColumn[]; - columnMenu?: boolean|GridColumnMenu; + columnMenu?: boolean | GridColumnMenu; dataSource?: any|any|kendo.data.DataSource; detailTemplate?: string|Function; - editable?: boolean|GridEditable; + editable?: boolean | GridEditable; excel?: GridExcel; - filterable?: boolean|GridFilterable; - groupable?: boolean|GridGroupable; + filterable?: boolean | GridFilterable; + groupable?: boolean | GridGroupable; height?: number|string; messages?: GridMessages; mobile?: boolean|string; navigatable?: boolean; - noRecords?: boolean|GridNoRecords; - pageable?: boolean|GridPageable; + noRecords?: boolean | GridNoRecords; + pageable?: boolean | GridPageable; pdf?: GridPdf; persistSelection?: boolean; reorderable?: boolean; resizable?: boolean; rowTemplate?: string|Function; - scrollable?: boolean|GridScrollable; + scrollable?: boolean | GridScrollable; selectable?: boolean|string; - sortable?: boolean|GridSortable; + sortable?: boolean | GridSortable; toolbar?: GridToolbarItem[] | any; beforeEdit?(e: GridBeforeEditEvent): void; cancel?(e: GridCancelEvent): void; cellClose?(e: GridCellCloseEvent): void; change?(e: GridChangeEvent): void; columnHide?(e: GridColumnHideEvent): void; + columnLock?(e: GridColumnLockEvent): void; columnMenuInit?(e: GridColumnMenuInitEvent): void; columnMenuOpen?(e: GridColumnMenuOpenEvent): void; columnReorder?(e: GridColumnReorderEvent): void; columnResize?(e: GridColumnResizeEvent): void; columnShow?(e: GridColumnShowEvent): void; + columnUnlock?(e: GridColumnUnlockEvent): void; dataBinding?(e: GridDataBindingEvent): void; dataBound?(e: GridDataBoundEvent): void; detailCollapse?(e: GridDetailCollapseEvent): void; @@ -4022,20 +4085,18 @@ declare namespace kendo.ui { edit?(e: GridEditEvent): void; excelExport?(e: GridExcelExportEvent): void; filter?(e: GridFilterEvent): void; + filterMenuInit?(e: GridFilterMenuInitEvent): void; + filterMenuOpen?(e: GridFilterMenuOpenEvent): void; group?(e: GridGroupEvent): void; groupCollapse?(e: GridGroupCollapseEvent): void; groupExpand?(e: GridGroupExpandEvent): void; + navigate?(e: GridNavigateEvent): void; page?(e: GridPageEvent): void; pdfExport?(e: GridPdfExportEvent): void; - filterMenuInit?(e: GridFilterMenuInitEvent): void; - filterMenuOpen?(e: GridFilterMenuOpenEvent): void; remove?(e: GridRemoveEvent): void; save?(e: GridSaveEvent): void; saveChanges?(e: GridSaveChangesEvent): void; sort?(e: GridSortEvent): void; - columnLock?(e: GridColumnLockEvent): void; - columnUnlock?(e: GridColumnUnlockEvent): void; - navigate?(e: GridNavigateEvent): void; } interface GridEvent { sender: Grid; @@ -4065,6 +4126,10 @@ declare namespace kendo.ui { column?: any; } + interface GridColumnLockEvent extends GridEvent { + column?: any; + } + interface GridColumnMenuInitEvent extends GridEvent { container?: JQuery; field?: string; @@ -4091,6 +4156,10 @@ declare namespace kendo.ui { column?: any; } + interface GridColumnUnlockEvent extends GridEvent { + column?: any; + } + interface GridDataBindingEvent extends GridEvent { action?: string; index?: number; @@ -4132,6 +4201,16 @@ declare namespace kendo.ui { field?: string; } + interface GridFilterMenuInitEvent extends GridEvent { + container?: JQuery; + field?: string; + } + + interface GridFilterMenuOpenEvent extends GridEvent { + container?: JQuery; + field?: string; + } + interface GridGroupEvent extends GridEvent { groups?: any; } @@ -4146,6 +4225,10 @@ declare namespace kendo.ui { group?: any; } + interface GridNavigateEvent extends GridEvent { + element?: JQuery; + } + interface GridPageEvent extends GridEvent { page?: number; } @@ -4154,16 +4237,6 @@ declare namespace kendo.ui { promise?: JQueryPromise; } - interface GridFilterMenuInitEvent extends GridEvent { - container?: JQuery; - field?: string; - } - - interface GridFilterMenuOpenEvent extends GridEvent { - container?: JQuery; - field?: string; - } - interface GridRemoveEvent extends GridEvent { model?: kendo.data.Model; row?: JQuery; @@ -4182,18 +4255,6 @@ declare namespace kendo.ui { sort?: any; } - interface GridColumnLockEvent extends GridEvent { - column?: any; - } - - interface GridColumnUnlockEvent extends GridEvent { - column?: any; - } - - interface GridNavigateEvent extends GridEvent { - element?: JQuery; - } - class ListBox extends kendo.ui.Widget { @@ -4268,7 +4329,7 @@ declare namespace kendo.ui { dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; dataValueField?: string; - draggable?: boolean|ListBoxDraggable; + draggable?: boolean | ListBoxDraggable; dropSources?: any; navigatable?: boolean; messages?: ListBoxMessages; @@ -4591,15 +4652,15 @@ declare namespace kendo.ui { interface MenuOptions { name?: string; - animation?: boolean|MenuAnimation; + animation?: boolean | MenuAnimation; closeOnClick?: boolean; dataSource?: any|any; direction?: string; hoverDelay?: number; - openOnClick?: boolean|MenuOpenOnClick; + openOnClick?: boolean | MenuOpenOnClick; orientation?: string; popupCollision?: string; - scrollable?: boolean|MenuScrollable; + scrollable?: boolean | MenuScrollable; close?(e: MenuCloseEvent): void; open?(e: MenuOpenEvent): void; activate?(e: MenuActivateEvent): void; @@ -4700,7 +4761,7 @@ declare namespace kendo.ui { interface MultiSelectOptions { name?: string; - animation?: boolean|MultiSelectAnimation; + animation?: boolean | MultiSelectAnimation; autoBind?: boolean; autoClose?: boolean; autoWidth?: boolean; @@ -4729,7 +4790,7 @@ declare namespace kendo.ui { tagMode?: string; value?: any; valuePrimitive?: boolean; - virtual?: boolean|MultiSelectVirtual; + virtual?: boolean | MultiSelectVirtual; change?(e: MultiSelectChangeEvent): void; close?(e: MultiSelectCloseEvent): void; dataBound?(e: MultiSelectDataBoundEvent): void; @@ -5082,7 +5143,7 @@ declare namespace kendo.ui { interface PanelBarOptions { name?: string; - animation?: boolean|PanelBarAnimation; + animation?: boolean | PanelBarAnimation; autoBind?: boolean; contentUrls?: any; dataImageUrlField?: string; @@ -5203,7 +5264,7 @@ declare namespace kendo.ui { name?: string; dataSource?: any|kendo.data.PivotDataSource; filterable?: boolean; - sortable?: boolean|PivotConfiguratorSortable; + sortable?: boolean | PivotConfiguratorSortable; height?: number|string; messages?: PivotConfiguratorMessages; } @@ -5315,7 +5376,7 @@ declare namespace kendo.ui { excel?: PivotGridExcel; pdf?: PivotGridPdf; filterable?: boolean; - sortable?: boolean|PivotGridSortable; + sortable?: boolean | PivotGridSortable; columnWidth?: number; height?: number|string; columnHeaderTemplate?: string|Function; @@ -5404,7 +5465,7 @@ declare namespace kendo.ui { interface PopupOptions { name?: string; adjustSize?: any; - animation?: boolean|PopupAnimation; + animation?: boolean | PopupAnimation; anchor?: string|JQuery; appendTo?: string|JQuery; collision?: string; @@ -5544,7 +5605,9 @@ declare namespace kendo.ui { destroy(): void; enable(enable: boolean): void; value(): any; - value(selectionStart: number, selectionEnd: number): void; + value(startEndArray: any): void; + values(): any; + values(selectionStart: number, selectionEnd: number): void; resize(): void; } @@ -5630,6 +5693,8 @@ declare namespace kendo.ui { options: SchedulerOptions; dataSource: kendo.data.DataSource; + resources: any; + calendar: kendo.ui.Calendar; element: JQuery; wrapper: JQuery; @@ -5884,7 +5949,7 @@ declare namespace kendo.ui { columnWidth?: number; dateHeaderTemplate?: string|Function; dayTemplate?: string|Function; - editable?: boolean|SchedulerViewEditable; + editable?: boolean | SchedulerViewEditable; endTime?: Date; eventHeight?: number; eventTemplate?: string|Function; @@ -5894,6 +5959,7 @@ declare namespace kendo.ui { majorTimeHeaderTemplate?: string|Function; minorTickCount?: number; minorTimeHeaderTemplate?: string|Function; + name?: string; selected?: boolean; selectedDateFormat?: string; selectedShortDateFormat?: string; @@ -5919,14 +5985,14 @@ declare namespace kendo.ui { allDayEventTemplate?: string|Function; allDaySlot?: boolean; autoBind?: boolean; - currentTimeMarker?: boolean|SchedulerCurrentTimeMarker; + currentTimeMarker?: boolean | SchedulerCurrentTimeMarker; dataSource?: any|any|kendo.data.SchedulerDataSource; date?: Date; dateHeaderTemplate?: string|Function; - editable?: boolean|SchedulerEditable; + editable?: boolean | SchedulerEditable; endTime?: Date; eventTemplate?: string|Function; - footer?: boolean|SchedulerFooter; + footer?: boolean | SchedulerFooter; group?: SchedulerGroup; groupHeaderTemplate?: string|Function; height?: number|string; @@ -6044,6 +6110,8 @@ declare namespace kendo.ui { } interface SchedulerResizeEndEvent extends SchedulerEvent { + start?: Date; + end?: Date; event?: kendo.data.SchedulerEvent; slot?: any; } @@ -6538,7 +6606,7 @@ declare namespace kendo.ui { rows?: number; sheets?: SpreadsheetSheet[]; sheetsbar?: boolean; - toolbar?: boolean|SpreadsheetToolbar; + toolbar?: boolean | SpreadsheetToolbar; insertSheet?(e: SpreadsheetInsertSheetEvent): void; removeSheet?(e: SpreadsheetRemoveSheetEvent): void; renameSheet?(e: SpreadsheetRenameSheetEvent): void; @@ -6742,7 +6810,7 @@ declare namespace kendo.ui { interface TabStripOptions { name?: string; - animation?: boolean|TabStripAnimation; + animation?: boolean | TabStripAnimation; collapsible?: boolean; contentUrls?: any; dataContentField?: string; @@ -6753,7 +6821,7 @@ declare namespace kendo.ui { dataTextField?: string; dataUrlField?: string; navigatable?: boolean; - scrollable?: boolean|TabStripScrollable; + scrollable?: boolean | TabStripScrollable; tabPosition?: string; value?: string; activate?(e: TabStripActivateEvent): void; @@ -6844,7 +6912,7 @@ declare namespace kendo.ui { interface TimePickerOptions { name?: string; - animation?: boolean|TimePickerAnimation; + animation?: boolean | TimePickerAnimation; culture?: string; dateInput?: boolean; dates?: any; @@ -7055,8 +7123,8 @@ declare namespace kendo.ui { interface TooltipOptions { name?: string; autoHide?: boolean; - animation?: boolean|TooltipAnimation; - content?: string | TooltipContent | ((e: any) => string); + animation?: boolean | TooltipAnimation; + content?: string | Function | TooltipContent; callout?: boolean; filter?: string; iframe?: boolean; @@ -7298,13 +7366,13 @@ declare namespace kendo.ui { encoded?: boolean; expandable?: boolean; field?: string; - filterable?: boolean|TreeListColumnFilterable; + filterable?: boolean | TreeListColumnFilterable; footerTemplate?: string|Function; format?: string; headerAttributes?: any; headerTemplate?: string|Function; minScreenWidth?: number; - sortable?: boolean|TreeListColumnSortable; + sortable?: boolean | TreeListColumnSortable; template?: string|Function; title?: string; width?: string|number; @@ -7333,6 +7401,7 @@ declare namespace kendo.ui { clear?: string; filter?: string; info?: string; + title?: string; isFalse?: string; isTrue?: string; or?: string; @@ -7406,19 +7475,19 @@ declare namespace kendo.ui { columns?: TreeListColumn[]; resizable?: boolean; reorderable?: boolean; - columnMenu?: boolean|TreeListColumnMenu; + columnMenu?: boolean | TreeListColumnMenu; dataSource?: any|any|kendo.data.TreeListDataSource; - editable?: boolean|TreeListEditable; + editable?: boolean | TreeListEditable; excel?: TreeListExcel; - filterable?: boolean|TreeListFilterable; + filterable?: boolean | TreeListFilterable; height?: number|string; messages?: TreeListMessages; navigatable?: boolean; pdf?: TreeListPdf; scrollable?: boolean|any; selectable?: boolean|string; - sortable?: boolean|TreeListSortable; - toolbar?: TreeListToolbarItem[]|any; + sortable?: boolean | TreeListSortable; + toolbar?: TreeListToolbarItem[] | any; cancel?(e: TreeListCancelEvent): void; change?(e: TreeListChangeEvent): void; collapse?(e: TreeListCollapseEvent): void; @@ -7634,8 +7703,8 @@ declare namespace kendo.ui { } interface TreeViewAnimation { - collapse?: boolean|TreeViewAnimationCollapse; - expand?: boolean|TreeViewAnimationExpand; + collapse?: boolean | TreeViewAnimationCollapse; + expand?: boolean | TreeViewAnimationExpand; } interface TreeViewCheckboxes { @@ -7652,10 +7721,10 @@ declare namespace kendo.ui { interface TreeViewOptions { name?: string; - animation?: boolean|TreeViewAnimation; + animation?: boolean | TreeViewAnimation; autoBind?: boolean; autoScroll?: boolean; - checkboxes?: boolean|TreeViewCheckboxes; + checkboxes?: boolean | TreeViewCheckboxes; dataImageUrlField?: string; dataSource?: any|any|kendo.data.HierarchicalDataSource; dataSpriteCssClassField?: string; @@ -8018,10 +8087,10 @@ declare namespace kendo.ui { interface WindowOptions { name?: string; actions?: any; - animation?: boolean|WindowAnimation; + animation?: boolean | WindowAnimation; appendTo?: any|string; autoFocus?: boolean; - content?: WindowContent; + content?: string | WindowContent; draggable?: boolean; iframe?: boolean; height?: number|string; @@ -8464,7 +8533,7 @@ declare namespace kendo.drawing { } - interface FillOptions { + interface FillOptions { @@ -8763,12 +8832,13 @@ declare namespace kendo.drawing { } - interface PDFOptions { + interface PDFOptions { creator?: string; date?: Date; + imgDPI?: number; keywords?: string; landscape?: boolean; margin?: any; @@ -8952,7 +9022,7 @@ declare namespace kendo.drawing { } - interface StrokeOptions { + interface StrokeOptions { @@ -9006,7 +9076,7 @@ declare namespace kendo.drawing { } interface SurfaceTooltip { - animation?: boolean|SurfaceTooltipAnimation; + animation?: boolean | SurfaceTooltipAnimation; appendTo?: string|JQuery; } @@ -9102,7 +9172,7 @@ declare namespace kendo.drawing { } - interface TooltipOptions { + interface TooltipOptions { @@ -9315,7 +9385,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartAxisDefaultsLabelsMargin; mirror?: boolean; padding?: ChartAxisDefaultsLabelsPadding; - rotation?: ChartAxisDefaultsLabelsRotation; + rotation?: string | ChartAxisDefaultsLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -9514,7 +9584,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartCategoryAxisItemLabelsMargin; mirror?: boolean; padding?: ChartCategoryAxisItemLabelsPadding; - rotation?: ChartCategoryAxisItemLabelsRotation; + rotation?: string | ChartCategoryAxisItemLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -9840,6 +9910,7 @@ declare namespace kendo.dataviz.ui { padding?: ChartLegendPadding; position?: string; reverse?: boolean; + spacing?: number; visible?: boolean; width?: number; } @@ -9897,7 +9968,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartPaneMargin; name?: string; padding?: ChartPanePadding; - title?: ChartPaneTitle; + title?: string | ChartPaneTitle; } interface ChartPannable { @@ -9991,7 +10062,7 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesItemExtremes { background?: string|Function; - border?: ChartSeriesItemExtremesBorder; + border?: Function | ChartSeriesItemExtremesBorder; size?: number|Function; type?: string|Function; rotation?: number|Function; @@ -10151,7 +10222,7 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesItemMarkersFrom { background?: string|Function; - border?: ChartSeriesItemMarkersFromBorder; + border?: Function | ChartSeriesItemMarkersFromBorder; size?: number|Function; type?: string|Function; visible?: boolean|Function; @@ -10166,7 +10237,7 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesItemMarkersTo { background?: string|Function; - border?: ChartSeriesItemMarkersToBorder; + border?: Function | ChartSeriesItemMarkersToBorder; size?: number|Function; type?: string|Function; visible?: boolean|Function; @@ -10176,7 +10247,7 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesItemMarkers { background?: string|Function; - border?: ChartSeriesItemMarkersBorder; + border?: Function | ChartSeriesItemMarkersBorder; from?: ChartSeriesItemMarkersFrom; size?: number|Function; to?: ChartSeriesItemMarkersTo; @@ -10244,7 +10315,7 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesItemOutliers { background?: string|Function; - border?: ChartSeriesItemOutliersBorder; + border?: Function | ChartSeriesItemOutliersBorder; size?: number|Function; type?: string|Function; rotation?: number|Function; @@ -10270,7 +10341,7 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemTarget { - border?: ChartSeriesItemTargetBorder; + border?: Function | ChartSeriesItemTargetBorder; color?: string|Function; line?: ChartSeriesItemTargetLine; } @@ -10342,7 +10413,7 @@ declare namespace kendo.dataviz.ui { highlight?: ChartSeriesItemHighlight; holeSize?: number; labels?: ChartSeriesItemLabels; - line?: ChartSeriesItemLine; + line?: string | ChartSeriesItemLine; lowField?: string; margin?: ChartSeriesItemMargin; markers?: ChartSeriesItemMarkers; @@ -10362,7 +10433,7 @@ declare namespace kendo.dataviz.ui { size?: number; sizeField?: string; spacing?: number; - stack?: boolean|ChartSeriesItemStack; + stack?: boolean | string | ChartSeriesItemStack; startAngle?: number; target?: ChartSeriesItemTarget; targetField?: string; @@ -10581,7 +10652,7 @@ declare namespace kendo.dataviz.ui { scatter?: any; scatterLine?: any; spacing?: number; - stack?: boolean|ChartSeriesDefaultsStack; + stack?: boolean | ChartSeriesDefaultsStack; type?: string; tooltip?: ChartSeriesDefaultsTooltip; verticalArea?: any; @@ -10676,6 +10747,7 @@ declare namespace kendo.dataviz.ui { interface ChartValueAxisItemCrosshair { color?: string; + dashType?: string; opacity?: number; tooltip?: ChartValueAxisItemCrosshairTooltip; visible?: boolean; @@ -10716,7 +10788,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartValueAxisItemLabelsMargin; mirror?: boolean; padding?: ChartValueAxisItemLabelsPadding; - rotation?: ChartValueAxisItemLabelsRotation; + rotation?: string | ChartValueAxisItemLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -10954,6 +11026,7 @@ declare namespace kendo.dataviz.ui { interface ChartXAxisItemCrosshair { color?: string; + dashType?: string; opacity?: number; tooltip?: ChartXAxisItemCrosshairTooltip; visible?: boolean; @@ -11004,7 +11077,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartXAxisItemLabelsMargin; mirror?: boolean; padding?: ChartXAxisItemLabelsPadding; - rotation?: ChartXAxisItemLabelsRotation; + rotation?: string | ChartXAxisItemLabelsRotation; skip?: number; step?: number; template?: string|Function; @@ -11180,8 +11253,8 @@ declare namespace kendo.dataviz.ui { border?: ChartXAxisItemTitleBorder; color?: string; font?: string; - margin?: ChartXAxisItemTitleMargin | number; - padding?: ChartXAxisItemTitlePadding | number; + margin?: ChartXAxisItemTitleMargin; + padding?: ChartXAxisItemTitlePadding; position?: string; rotation?: number; text?: string; @@ -11243,6 +11316,7 @@ declare namespace kendo.dataviz.ui { interface ChartYAxisItemCrosshair { color?: string; + dashType?: string; opacity?: number; tooltip?: ChartYAxisItemCrosshairTooltip; visible?: boolean; @@ -11515,8 +11589,8 @@ declare namespace kendo.dataviz.ui { } interface ChartZoomable { - mousewheel?: boolean|ChartZoomableMousewheel; - selection?: boolean|ChartZoomableSelection; + mousewheel?: boolean | ChartZoomableMousewheel; + selection?: boolean | ChartZoomableSelection; } interface ChartExportImageOptions { @@ -11555,7 +11629,7 @@ declare namespace kendo.dataviz.ui { dataSource?: any|any|kendo.data.DataSource; legend?: ChartLegend; panes?: ChartPane[]; - pannable?: boolean|ChartPannable; + pannable?: boolean | ChartPannable; pdf?: ChartPdf; plotArea?: ChartPlotArea; renderAs?: string; @@ -11563,13 +11637,13 @@ declare namespace kendo.dataviz.ui { seriesColors?: any; seriesDefaults?: ChartSeriesDefaults; theme?: string; - title?: ChartTitle; + title?: string | ChartTitle; tooltip?: ChartTooltip; transitions?: boolean; valueAxis?: ChartValueAxisItem[]; xAxis?: ChartXAxisItem[]; yAxis?: ChartYAxisItem[]; - zoomable?: boolean|ChartZoomable; + zoomable?: boolean | ChartZoomable; axisLabelClick?(e: ChartAxisLabelClickEvent): void; dataBound?(e: ChartDataBoundEvent): void; drag?(e: ChartDragEvent): void; @@ -11850,8 +11924,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionDefaultsEndCap { - fill?: DiagramConnectionDefaultsEndCapFill; - stroke?: DiagramConnectionDefaultsEndCapStroke; + fill?: string | DiagramConnectionDefaultsEndCapFill; + stroke?: string | DiagramConnectionDefaultsEndCapStroke; type?: string; } @@ -11872,7 +11946,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionDefaultsSelectionHandles { - fill?: DiagramConnectionDefaultsSelectionHandlesFill; + fill?: string | DiagramConnectionDefaultsSelectionHandlesFill; stroke?: DiagramConnectionDefaultsSelectionHandlesStroke; width?: number; height?: number; @@ -11893,8 +11967,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionDefaultsStartCap { - fill?: DiagramConnectionDefaultsStartCapFill; - stroke?: DiagramConnectionDefaultsStartCapStroke; + fill?: string | DiagramConnectionDefaultsStartCapFill; + stroke?: string | DiagramConnectionDefaultsStartCapStroke; type?: string; } @@ -11905,13 +11979,13 @@ declare namespace kendo.dataviz.ui { interface DiagramConnectionDefaults { content?: DiagramConnectionDefaultsContent; - editable?: boolean|DiagramConnectionDefaultsEditable; - endCap?: DiagramConnectionDefaultsEndCap; + editable?: boolean | DiagramConnectionDefaultsEditable; + endCap?: string | DiagramConnectionDefaultsEndCap; fromConnector?: string; hover?: DiagramConnectionDefaultsHover; selectable?: boolean; selection?: DiagramConnectionDefaultsSelection; - startCap?: DiagramConnectionDefaultsStartCap; + startCap?: string | DiagramConnectionDefaultsStartCap; stroke?: DiagramConnectionDefaultsStroke; toConnector?: string; type?: string; @@ -11947,8 +12021,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionEndCap { - fill?: DiagramConnectionEndCapFill; - stroke?: DiagramConnectionEndCapStroke; + fill?: string | DiagramConnectionEndCapFill; + stroke?: string | DiagramConnectionEndCapStroke; type?: string; } @@ -11979,7 +12053,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionSelectionHandles { - fill?: DiagramConnectionSelectionHandlesFill; + fill?: string | DiagramConnectionSelectionHandlesFill; stroke?: DiagramConnectionSelectionHandlesStroke; width?: number; height?: number; @@ -12000,8 +12074,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionStartCap { - fill?: DiagramConnectionStartCapFill; - stroke?: DiagramConnectionStartCapStroke; + fill?: string | DiagramConnectionStartCapFill; + stroke?: string | DiagramConnectionStartCapStroke; type?: string; } @@ -12017,16 +12091,16 @@ declare namespace kendo.dataviz.ui { interface DiagramConnection { content?: DiagramConnectionContent; - editable?: boolean|DiagramConnectionEditable; - endCap?: DiagramConnectionEndCap; - from?: DiagramConnectionFrom; + editable?: boolean | DiagramConnectionEditable; + endCap?: string | DiagramConnectionEndCap; + from?: string | DiagramConnectionFrom; fromConnector?: string; hover?: DiagramConnectionHover; points?: DiagramConnectionPoint[]; selection?: DiagramConnectionSelection; - startCap?: DiagramConnectionStartCap; + startCap?: string | DiagramConnectionStartCap; stroke?: DiagramConnectionStroke; - to?: DiagramConnectionTo; + to?: string | DiagramConnectionTo; toConnector?: string; type?: string; } @@ -12036,7 +12110,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditableDrag { - snap?: boolean|DiagramEditableDragSnap; + snap?: boolean | DiagramEditableDragSnap; } interface DiagramEditableResizeHandlesFill { @@ -12056,7 +12130,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditableResizeHandlesHover { - fill?: DiagramEditableResizeHandlesHoverFill; + fill?: string | DiagramEditableResizeHandlesHoverFill; stroke?: DiagramEditableResizeHandlesHoverStroke; } @@ -12067,7 +12141,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditableResizeHandles { - fill?: DiagramEditableResizeHandlesFill; + fill?: string | DiagramEditableResizeHandlesFill; height?: number; hover?: DiagramEditableResizeHandlesHover; stroke?: DiagramEditableResizeHandlesStroke; @@ -12100,10 +12174,10 @@ declare namespace kendo.dataviz.ui { interface DiagramEditable { connectionTemplate?: string|Function; - drag?: boolean|DiagramEditableDrag; + drag?: boolean | DiagramEditableDrag; remove?: boolean; - resize?: boolean|DiagramEditableResize; - rotate?: boolean|DiagramEditableRotate; + resize?: boolean | DiagramEditableResize; + rotate?: boolean | DiagramEditableRotate; shapeTemplate?: string|Function; tools?: DiagramEditableTool[]; } @@ -12191,8 +12265,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeDefaultsConnectorDefaultsHover { - fill?: DiagramShapeDefaultsConnectorDefaultsHoverFill; - stroke?: DiagramShapeDefaultsConnectorDefaultsHoverStroke; + fill?: string | DiagramShapeDefaultsConnectorDefaultsHoverFill; + stroke?: string | DiagramShapeDefaultsConnectorDefaultsHoverStroke; } interface DiagramShapeDefaultsConnectorDefaultsStroke { @@ -12205,8 +12279,8 @@ declare namespace kendo.dataviz.ui { width?: number; height?: number; hover?: DiagramShapeDefaultsConnectorDefaultsHover; - fill?: DiagramShapeDefaultsConnectorDefaultsFill; - stroke?: DiagramShapeDefaultsConnectorDefaultsStroke; + fill?: string | DiagramShapeDefaultsConnectorDefaultsFill; + stroke?: string | DiagramShapeDefaultsConnectorDefaultsStroke; } interface DiagramShapeDefaultsConnectorFill { @@ -12226,8 +12300,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeDefaultsConnectorHover { - fill?: DiagramShapeDefaultsConnectorHoverFill; - stroke?: DiagramShapeDefaultsConnectorHoverStroke; + fill?: string | DiagramShapeDefaultsConnectorHoverFill; + stroke?: string | DiagramShapeDefaultsConnectorHoverStroke; } interface DiagramShapeDefaultsConnectorStroke { @@ -12242,8 +12316,8 @@ declare namespace kendo.dataviz.ui { width?: number; height?: number; hover?: DiagramShapeDefaultsConnectorHover; - fill?: DiagramShapeDefaultsConnectorFill; - stroke?: DiagramShapeDefaultsConnectorStroke; + fill?: string | DiagramShapeDefaultsConnectorFill; + stroke?: string | DiagramShapeDefaultsConnectorStroke; } interface DiagramShapeDefaultsContent { @@ -12296,7 +12370,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeDefaultsHover { - fill?: DiagramShapeDefaultsHoverFill; + fill?: string | DiagramShapeDefaultsHoverFill; } interface DiagramShapeDefaultsRotation { @@ -12313,8 +12387,8 @@ declare namespace kendo.dataviz.ui { connectors?: DiagramShapeDefaultsConnector[]; connectorDefaults?: DiagramShapeDefaultsConnectorDefaults; content?: DiagramShapeDefaultsContent; - editable?: boolean|DiagramShapeDefaultsEditable; - fill?: DiagramShapeDefaultsFill; + editable?: boolean | DiagramShapeDefaultsEditable; + fill?: string | DiagramShapeDefaultsFill; height?: number; hover?: DiagramShapeDefaultsHover; minHeight?: number; @@ -12348,8 +12422,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeConnectorDefaultsHover { - fill?: DiagramShapeConnectorDefaultsHoverFill; - stroke?: DiagramShapeConnectorDefaultsHoverStroke; + fill?: string | DiagramShapeConnectorDefaultsHoverFill; + stroke?: string | DiagramShapeConnectorDefaultsHoverStroke; } interface DiagramShapeConnectorDefaultsStroke { @@ -12362,8 +12436,8 @@ declare namespace kendo.dataviz.ui { width?: number; height?: number; hover?: DiagramShapeConnectorDefaultsHover; - fill?: DiagramShapeConnectorDefaultsFill; - stroke?: DiagramShapeConnectorDefaultsStroke; + fill?: string | DiagramShapeConnectorDefaultsFill; + stroke?: string | DiagramShapeConnectorDefaultsStroke; } interface DiagramShapeConnectorFill { @@ -12383,8 +12457,8 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeConnectorHover { - fill?: DiagramShapeConnectorHoverFill; - stroke?: DiagramShapeConnectorHoverStroke; + fill?: string | DiagramShapeConnectorHoverFill; + stroke?: string | DiagramShapeConnectorHoverStroke; } interface DiagramShapeConnectorStroke { @@ -12400,8 +12474,8 @@ declare namespace kendo.dataviz.ui { width?: number; height?: number; hover?: DiagramShapeConnectorHover; - fill?: DiagramShapeConnectorFill; - stroke?: DiagramShapeConnectorStroke; + fill?: string | DiagramShapeConnectorFill; + stroke?: string | DiagramShapeConnectorStroke; } interface DiagramShapeContent { @@ -12452,7 +12526,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramShapeHover { - fill?: DiagramShapeHoverFill; + fill?: string | DiagramShapeHoverFill; } interface DiagramShapeRotation { @@ -12469,8 +12543,8 @@ declare namespace kendo.dataviz.ui { connectors?: DiagramShapeConnector[]; connectorDefaults?: DiagramShapeConnectorDefaults; content?: DiagramShapeContent; - editable?: boolean|DiagramShapeEditable; - fill?: DiagramShapeFill; + editable?: boolean | DiagramShapeEditable; + fill?: string | DiagramShapeFill; height?: number; hover?: DiagramShapeHover; id?: string; @@ -12508,11 +12582,11 @@ declare namespace kendo.dataviz.ui { connections?: DiagramConnection[]; connectionsDataSource?: any|any|kendo.data.DataSource; dataSource?: any|any|kendo.data.DataSource; - editable?: boolean|DiagramEditable; + editable?: boolean | DiagramEditable; layout?: DiagramLayout; - pannable?: boolean|DiagramPannable; + pannable?: boolean | DiagramPannable; pdf?: DiagramPdf; - selectable?: boolean|DiagramSelectable; + selectable?: boolean | DiagramSelectable; shapeDefaults?: DiagramShapeDefaults; shapes?: DiagramShape[]; template?: string|Function; @@ -12694,7 +12768,7 @@ declare namespace kendo.dataviz.ui { } interface LinearGaugeGaugeArea { - background?: any; + background?: string; border?: LinearGaugeGaugeAreaBorder; height?: number; margin?: LinearGaugeGaugeAreaMargin; @@ -12892,9 +12966,9 @@ declare namespace kendo.dataviz.ui { } interface MapControls { - attribution?: boolean|MapControlsAttribution; - navigator?: boolean|MapControlsNavigator; - zoom?: boolean|MapControlsZoom; + attribution?: boolean | MapControlsAttribution; + navigator?: boolean | MapControlsNavigator; + zoom?: boolean | MapControlsZoom; } interface MapLayerDefaultsBing { @@ -12953,7 +13027,7 @@ declare namespace kendo.dataviz.ui { interface MapLayerDefaultsMarkerTooltip { autoHide?: boolean; animation?: MapLayerDefaultsMarkerTooltipAnimation; - content?: MapLayerDefaultsMarkerTooltipContent; + content?: string | Function | MapLayerDefaultsMarkerTooltipContent; template?: string; callout?: boolean; iframe?: boolean; @@ -13048,7 +13122,7 @@ declare namespace kendo.dataviz.ui { interface MapLayerTooltip { autoHide?: boolean; animation?: MapLayerTooltipAnimation; - content?: MapLayerTooltipContent; + content?: string | Function | MapLayerTooltipContent; template?: string; callout?: boolean; iframe?: boolean; @@ -13106,7 +13180,7 @@ declare namespace kendo.dataviz.ui { interface MapMarkerDefaultsTooltip { autoHide?: boolean; animation?: MapMarkerDefaultsTooltipAnimation; - content?: MapMarkerDefaultsTooltipContent; + content?: string | Function | MapMarkerDefaultsTooltipContent; template?: string; callout?: boolean; iframe?: boolean; @@ -13144,7 +13218,7 @@ declare namespace kendo.dataviz.ui { interface MapMarkerTooltip { autoHide?: boolean; animation?: MapMarkerTooltipAnimation; - content?: MapMarkerTooltipContent; + content?: string | Function | MapMarkerTooltipContent; template?: string; callout?: boolean; iframe?: boolean; @@ -13382,7 +13456,7 @@ declare namespace kendo.dataviz.ui { } interface RadialGaugeGaugeArea { - background?: any; + background?: string; border?: RadialGaugeGaugeAreaBorder; height?: number; margin?: RadialGaugeGaugeAreaMargin; @@ -13851,7 +13925,7 @@ declare namespace kendo.dataviz.ui { interface SparklineSeriesItemMarkers { background?: string|Function; - border?: SparklineSeriesItemMarkersBorder; + border?: Function | SparklineSeriesItemMarkersBorder; size?: number|Function; type?: string|Function; visible?: boolean|Function; @@ -13924,7 +13998,7 @@ declare namespace kendo.dataviz.ui { interface SparklineSeriesItemTarget { line?: SparklineSeriesItemTargetLine; color?: string|Function; - border?: SparklineSeriesItemTargetBorder; + border?: Function | SparklineSeriesItemTargetBorder; } interface SparklineSeriesItemTooltipBorder { @@ -13962,7 +14036,7 @@ declare namespace kendo.dataviz.ui { connectors?: SparklineSeriesItemConnectors; gap?: number; labels?: SparklineSeriesItemLabels; - line?: SparklineSeriesItemLine; + line?: string | SparklineSeriesItemLine; markers?: SparklineSeriesItemMarkers; missingValues?: string; style?: string; @@ -13973,7 +14047,7 @@ declare namespace kendo.dataviz.ui { size?: number; startAngle?: number; spacing?: number; - stack?: boolean|SparklineSeriesItemStack; + stack?: boolean | string | SparklineSeriesItemStack; tooltip?: SparklineSeriesItemTooltip; width?: number; target?: SparklineSeriesItemTarget; @@ -14036,7 +14110,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: boolean|SparklineSeriesDefaultsStack; + stack?: boolean | SparklineSeriesDefaultsStack; type?: string; tooltip?: SparklineSeriesDefaultsTooltip; } @@ -15117,7 +15191,7 @@ declare namespace kendo.dataviz.ui { margin?: StockChartNavigatorPaneMargin; name?: string; padding?: StockChartNavigatorPanePadding; - title?: StockChartNavigatorPaneTitle; + title?: string | StockChartNavigatorPaneTitle; } interface StockChartNavigatorSelectMousewheel { @@ -15127,7 +15201,7 @@ declare namespace kendo.dataviz.ui { interface StockChartNavigatorSelect { from?: Date; - mousewheel?: boolean|StockChartNavigatorSelectMousewheel; + mousewheel?: boolean | StockChartNavigatorSelectMousewheel; to?: Date; } @@ -15240,7 +15314,7 @@ declare namespace kendo.dataviz.ui { downColorField?: string; gap?: number; labels?: StockChartNavigatorSeriesItemLabels; - line?: StockChartNavigatorSeriesItemLine; + line?: string | StockChartNavigatorSeriesItemLine; lowField?: string; markers?: StockChartNavigatorSeriesItemMarkers; missingValues?: string; @@ -15249,7 +15323,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartNavigatorSeriesItemOverlay; spacing?: number; - stack?: boolean|StockChartNavigatorSeriesItemStack; + stack?: boolean | string | StockChartNavigatorSeriesItemStack; tooltip?: StockChartNavigatorSeriesItemTooltip; width?: number; } @@ -15297,7 +15371,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartPaneBorder; clip?: boolean; height?: number; - title?: StockChartPaneTitle; + title?: string | StockChartPaneTitle; } interface StockChartPdfMargin { @@ -15396,7 +15470,7 @@ declare namespace kendo.dataviz.ui { interface StockChartSeriesItemMarkers { background?: string|Function; - border?: StockChartSeriesItemMarkersBorder; + border?: Function | StockChartSeriesItemMarkersBorder; size?: number|Function; rotation?: number|Function; type?: string|Function; @@ -15469,7 +15543,7 @@ declare namespace kendo.dataviz.ui { interface StockChartSeriesItemTarget { line?: StockChartSeriesItemTargetLine; color?: string|Function; - border?: StockChartSeriesItemTargetBorder; + border?: Function | StockChartSeriesItemTargetBorder; } interface StockChartSeriesItemTooltipBorder { @@ -15509,7 +15583,7 @@ declare namespace kendo.dataviz.ui { downColorField?: string; gap?: number; labels?: StockChartSeriesItemLabels; - line?: StockChartSeriesItemLine; + line?: string | StockChartSeriesItemLine; lowField?: string; markers?: StockChartSeriesItemMarkers; missingValues?: string; @@ -15519,7 +15593,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartSeriesItemOverlay; spacing?: number; - stack?: boolean|StockChartSeriesItemStack; + stack?: boolean | string | StockChartSeriesItemStack; tooltip?: StockChartSeriesItemTooltip; visibleInLegend?: boolean; width?: number; @@ -15584,7 +15658,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: boolean|StockChartSeriesDefaultsStack; + stack?: boolean | StockChartSeriesDefaultsStack; type?: string; tooltip?: StockChartSeriesDefaultsTooltip; } @@ -16268,7 +16342,7 @@ declare namespace kendo.dataviz.map { interface MarkerTooltip { autoHide?: boolean; animation?: MarkerTooltipAnimation; - content?: MarkerTooltipContent; + content?: string | Function | MarkerTooltipContent; template?: string; callout?: boolean; iframe?: boolean; @@ -16587,7 +16661,7 @@ declare namespace kendo.dataviz.diagram { interface CircleOptions { name?: string; - fill?: CircleFill; + fill?: string | CircleFill; stroke?: CircleStroke; center?: any; radius?: number; @@ -16654,8 +16728,8 @@ declare namespace kendo.dataviz.diagram { } interface ConnectionEndCap { - fill?: ConnectionEndCapFill; - stroke?: ConnectionEndCapStroke; + fill?: string | ConnectionEndCapFill; + stroke?: string | ConnectionEndCapStroke; type?: string; } @@ -16683,8 +16757,8 @@ declare namespace kendo.dataviz.diagram { } interface ConnectionStartCap { - fill?: ConnectionStartCapFill; - stroke?: ConnectionStartCapStroke; + fill?: string | ConnectionStartCapFill; + stroke?: string | ConnectionStartCapStroke; type?: string; } @@ -16700,8 +16774,8 @@ declare namespace kendo.dataviz.diagram { fromY?: number; stroke?: ConnectionStroke; hover?: ConnectionHover; - startCap?: ConnectionStartCap; - endCap?: ConnectionEndCap; + startCap?: string | ConnectionStartCap; + endCap?: string | ConnectionEndCap; points?: ConnectionPoint[]; selectable?: boolean; toConnector?: string; @@ -16748,8 +16822,8 @@ declare namespace kendo.dataviz.diagram { } interface ConnectorHover { - fill?: ConnectorHoverFill; - stroke?: ConnectorHoverStroke; + fill?: string | ConnectorHoverFill; + stroke?: string | ConnectorHoverStroke; } interface ConnectorStroke { @@ -16763,8 +16837,8 @@ declare namespace kendo.dataviz.diagram { width?: number; height?: number; hover?: ConnectorHover; - fill?: ConnectorFill; - stroke?: ConnectorStroke; + fill?: string | ConnectorFill; + stroke?: string | ConnectorStroke; } interface ConnectorEvent { sender: Connector; @@ -16942,8 +17016,8 @@ declare namespace kendo.dataviz.diagram { } interface PathEndCap { - fill?: PathEndCapFill; - stroke?: PathEndCapStroke; + fill?: string | PathEndCapFill; + stroke?: string | PathEndCapStroke; type?: string; } @@ -16980,8 +17054,8 @@ declare namespace kendo.dataviz.diagram { } interface PathStartCap { - fill?: PathStartCapFill; - stroke?: PathStartCapStroke; + fill?: string | PathStartCapFill; + stroke?: string | PathStartCapStroke; type?: string; } @@ -16993,10 +17067,10 @@ declare namespace kendo.dataviz.diagram { interface PathOptions { name?: string; data?: string; - endCap?: PathEndCap; - fill?: PathFill; + endCap?: string | PathEndCap; + fill?: string | PathFill; height?: number; - startCap?: PathStartCap; + startCap?: string | PathStartCap; stroke?: PathStroke; width?: number; x?: number; @@ -17062,8 +17136,8 @@ declare namespace kendo.dataviz.diagram { } interface PolylineEndCap { - fill?: PolylineEndCapFill; - stroke?: PolylineEndCapStroke; + fill?: string | PolylineEndCapFill; + stroke?: string | PolylineEndCapStroke; type?: string; } @@ -17100,8 +17174,8 @@ declare namespace kendo.dataviz.diagram { } interface PolylineStartCap { - fill?: PolylineStartCapFill; - stroke?: PolylineStartCapStroke; + fill?: string | PolylineStartCapFill; + stroke?: string | PolylineStartCapStroke; type?: string; } @@ -17112,9 +17186,9 @@ declare namespace kendo.dataviz.diagram { interface PolylineOptions { name?: string; - endCap?: PolylineEndCap; - fill?: PolylineFill; - startCap?: PolylineStartCap; + endCap?: string | PolylineEndCap; + fill?: string | PolylineFill; + startCap?: string | PolylineStartCap; stroke?: PolylineStroke; } interface PolylineEvent { @@ -17198,7 +17272,7 @@ declare namespace kendo.dataviz.diagram { interface RectangleOptions { name?: string; - fill?: RectangleFill; + fill?: string | RectangleFill; height?: number; stroke?: RectangleStroke; width?: number; @@ -17254,8 +17328,8 @@ declare namespace kendo.dataviz.diagram { } interface ShapeConnectorDefaultsHover { - fill?: ShapeConnectorDefaultsHoverFill; - stroke?: ShapeConnectorDefaultsHoverStroke; + fill?: string | ShapeConnectorDefaultsHoverFill; + stroke?: string | ShapeConnectorDefaultsHoverStroke; } interface ShapeConnectorDefaultsStroke { @@ -17268,8 +17342,8 @@ declare namespace kendo.dataviz.diagram { width?: number; height?: number; hover?: ShapeConnectorDefaultsHover; - fill?: ShapeConnectorDefaultsFill; - stroke?: ShapeConnectorDefaultsStroke; + fill?: string | ShapeConnectorDefaultsFill; + stroke?: string | ShapeConnectorDefaultsStroke; } interface ShapeConnector { @@ -17319,7 +17393,7 @@ declare namespace kendo.dataviz.diagram { } interface ShapeHover { - fill?: ShapeHoverFill; + fill?: string | ShapeHoverFill; } interface ShapeRotation { @@ -17335,7 +17409,7 @@ declare namespace kendo.dataviz.diagram { interface ShapeOptions { name?: string; id?: string; - editable?: boolean|ShapeEditable; + editable?: boolean | ShapeEditable; path?: string; stroke?: ShapeStroke; type?: string; @@ -17345,7 +17419,7 @@ declare namespace kendo.dataviz.diagram { minHeight?: number; width?: number; height?: number; - fill?: ShapeFill; + fill?: string | ShapeFill; hover?: ShapeHover; connectors?: ShapeConnector[]; rotation?: ShapeRotation; @@ -17436,7 +17510,7 @@ declare namespace kendo { namespace date { function setDayOfWeek(targetDate: Date, dayOfWeek: number, direction: number): void; function dayOfWeek(targetDate: Date, dayOfWeek: number, direction: number): Date; - function weekInYear(date: Date, weekStart?: Date): number; + function weekInYear(date: Date, weekStart?: number): number; function getDate(date: Date): Date; function isInDateRange(targetDate: Date, lowerLimitDate: Date, upperLimitDate: Date): boolean; function isInTimeRange(targetDate: Date, lowerLimitDate: Date, upperLimitDate: Date): boolean; @@ -17475,43 +17549,43 @@ declare namespace kendo { function transformOrigin(firstElement: HTMLElement, secondElement: HTMLElement): any; } - function alert(text: string): void; - function antiForgeryTokens(): any; - function bind(element: string, viewModel: any, namespace?: any): void; - function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function bind(element: JQuery, viewModel: any, namespace?: any): void; - function bind(element: JQuery, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function bind(element: Element, viewModel: any, namespace?: any): void; - function bind(element: Element, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function observableHierarchy(array: any): void; - function confirm(text: string): JQueryPromise; - function culture(culture: string): void; - function destroy(element: string): void; - function destroy(element: JQuery): void; - function destroy(element: Element): void; - function htmlEncode(value: string): string; - function parseDate(value: string, formats?: string, culture?: string): Date; - function parseDate(value: string, formats?: any, culture?: string): Date; - function parseFloat(value: string, culture?: string): number; - function parseInt(value: string, culture?: string): number; - function parseColor(color: string, noerror: boolean): kendo.Color; - function prompt(text: string, defaultValue: string): JQueryPromise; - function proxyModelSetters(): void; - function proxyModelSetters(data: kendo.data.Model): void; - function resize(element: string, force: boolean): void; - function resize(element: JQuery, force: boolean): void; - function resize(element: Element, force: boolean): void; - function saveAs(options: any): void; - function stringify(value: any): string; - function throttle(fn: Function, timeout: number): Function; - function touchScroller(element: string): void; - function touchScroller(element: JQuery): void; - function touchScroller(element: Element): void; - function toString(value: Date, format: string, culture?: string): string; - function toString(value: number, format: string, culture?: string): string; - function unbind(element: string): void; - function unbind(element: JQuery): void; - function unbind(element: Element): void; + function alert(text: string): void; + function antiForgeryTokens(): any; + function bind(element: string, viewModel: any, namespace?: any): void; + function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function bind(element: JQuery, viewModel: any, namespace?: any): void; + function bind(element: JQuery, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function bind(element: Element, viewModel: any, namespace?: any): void; + function bind(element: Element, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function observableHierarchy(array: any): void; + function confirm(text: string): JQueryPromise; + function culture(culture: string): void; + function destroy(element: string): void; + function destroy(element: JQuery): void; + function destroy(element: Element): void; + function htmlEncode(value: string): string; + function parseDate(value: string, formats?: string, culture?: string): Date; + function parseDate(value: string, formats?: any, culture?: string): Date; + function parseFloat(value: string, culture?: string): number; + function parseInt(value: string, culture?: string): number; + function parseColor(color: string, noerror: boolean): kendo.Color; + function prompt(text: string, defaultValue: string): JQueryPromise; + function proxyModelSetters(): void; + function proxyModelSetters(data: kendo.data.Model): void; + function resize(element: string, force: boolean): void; + function resize(element: JQuery, force: boolean): void; + function resize(element: Element, force: boolean): void; + function saveAs(options: any): void; + function stringify(value: any): string; + function throttle(fn: Function, timeout: number): Function; + function touchScroller(element: string): void; + function touchScroller(element: JQuery): void; + function touchScroller(element: Element): void; + function toString(value: Date, format: string, culture?: string): string; + function toString(value: number, format: string, culture?: string): string; + function unbind(element: string): void; + function unbind(element: JQuery): void; + function unbind(element: Element): void; namespace pdf { function defineFont(map: any): void; @@ -18163,7 +18237,7 @@ declare namespace kendo.mobile.ui { style?: string; template?: string|Function; type?: string; - filterable?: boolean|ListViewFilterable; + filterable?: boolean | ListViewFilterable; virtualViewSize?: number; click?(e: ListViewClickEvent): void; dataBound?(e: ListViewEvent): void; @@ -19247,7 +19321,7 @@ declare namespace kendo.dataviz.drawing { } - interface FillOptions { + interface FillOptions { @@ -19546,12 +19620,13 @@ declare namespace kendo.dataviz.drawing { } - interface PDFOptions { + interface PDFOptions { creator?: string; date?: Date; + imgDPI?: number; keywords?: string; landscape?: boolean; margin?: any; @@ -19735,7 +19810,7 @@ declare namespace kendo.dataviz.drawing { } - interface StrokeOptions { + interface StrokeOptions { @@ -19789,7 +19864,7 @@ declare namespace kendo.dataviz.drawing { } interface SurfaceTooltip { - animation?: boolean|SurfaceTooltipAnimation; + animation?: boolean | SurfaceTooltipAnimation; appendTo?: string|JQuery; } @@ -19885,7 +19960,7 @@ declare namespace kendo.dataviz.drawing { } - interface TooltipOptions { + interface TooltipOptions { @@ -19954,6 +20029,10 @@ interface JQuery { kendoButton(options: kendo.ui.ButtonOptions): JQuery; data(key: "kendoButton"): kendo.ui.Button; + kendoButtonGroup(): JQuery; + kendoButtonGroup(options: kendo.ui.ButtonGroupOptions): JQuery; + data(key: "kendoButtonGroup"): kendo.ui.ButtonGroup; + kendoCalendar(): JQuery; kendoCalendar(options: kendo.ui.CalendarOptions): JQuery; data(key: "kendoCalendar"): kendo.ui.Calendar; @@ -20262,4 +20341,4 @@ interface JQuery { kendoWindow(options: kendo.ui.WindowOptions): JQuery; data(key: "kendoWindow"): kendo.ui.Window; -} +} \ No newline at end of file From f08ddbb734c8223d089d4b7571b40569fe8592f0 Mon Sep 17 00:00:00 2001 From: jwbay Date: Tue, 23 Jan 2018 13:53:59 -0500 Subject: [PATCH 057/357] puppeteer 1.0 (#23014) --- types/puppeteer/index.d.ts | 155 +++- types/puppeteer/puppeteer-tests.ts | 37 +- types/puppeteer/v0/index.d.ts | 1197 +++++++++++++++++++++++++ types/puppeteer/v0/puppeteer-tests.ts | 283 ++++++ types/puppeteer/v0/tsconfig.json | 34 + types/puppeteer/v0/tslint.json | 1 + 6 files changed, 1679 insertions(+), 28 deletions(-) create mode 100644 types/puppeteer/v0/index.d.ts create mode 100644 types/puppeteer/v0/puppeteer-tests.ts create mode 100644 types/puppeteer/v0/tsconfig.json create mode 100644 types/puppeteer/v0/tslint.json diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index d0958706e9..a325a871be 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -1,13 +1,15 @@ -// Type definitions for puppeteer 0.13 +// Type definitions for puppeteer 1.0 // Project: https://github.com/GoogleChrome/puppeteer#readme // Definitions by: Marvin Hagemeister // Christopher Deutsch +// jwbay // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// import { EventEmitter } from "events"; +import { ChildProcess } from "child_process"; /** Keyboard provides an api for managing a virtual keyboard. */ export interface Keyboard { @@ -91,10 +93,16 @@ export interface Touchscreen { * You can use `tracing.start` and `tracing.stop` to create a trace file which can be opened in Chrome DevTools or timeline viewer. */ export interface Tracing { - start(options: { path: string; screenshots?: boolean }): Promise; + start(options: TracingStartOptions): Promise; stop(): Promise; } +export interface TracingStartOptions { + path: string; + screenshots?: boolean; + categories?: string[]; +} + /** Dialog objects are dispatched by page via the 'dialog' event. */ export interface Dialog { /** @@ -113,16 +121,16 @@ export interface Dialog { message(): string; /** The dialog type. Dialog's type, can be one of `alert`, `beforeunload`, `confirm` or `prompt`. */ - type: "alert" | "beforeunload" | "confirm" | "prompt"; + type(): "alert" | "beforeunload" | "confirm" | "prompt"; } /** ConsoleMessage objects are dispatched by page via the 'console' event. */ export interface ConsoleMessage { /** The message arguments. */ - args: JSHandle[]; + args(): JSHandle[]; /** The message text. */ - text: string; - type: 'log' | 'debug' | 'info' | 'error' | 'warning' | 'dir' | 'dirxml' | 'table' | + text(): string; + type(): 'log' | 'debug' | 'info' | 'error' | 'warning' | 'dir' | 'dirxml' | 'table' | 'trace' | 'clear' | 'startGroup' | 'startGroupCollapsed' | 'endGroup' | 'assert' | 'profile' | 'profileEnd' | 'count' | 'timeEnd'; } @@ -302,6 +310,24 @@ export interface PDFOptions { * @default false */ displayHeaderFooter?: boolean; + /** + * HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: + * - `date` formatted print date + * - `title` document title + * - `url` document location + * - `pageNumber` current page number + * - `totalPages` total pages in the document + */ + headerTemplate?: string; + /** + * HTML template for the print footer. Should be valid HTML markup with following classes used to inject printing values into them: + * - `date` formatted print date + * - `title` document title + * - `url` document location + * - `pageNumber` current page number + * - `totalPages` total pages in the document + */ + footerTemplate?: string; /** * Print background graphics. * @default false @@ -418,6 +444,10 @@ export interface ElementHandle extends JSHandle { * @since 0.13.0 */ $$(selector: string): Promise; + /** + * @param selector XPath expression to evaluate. + */ + $x(expression: string): Promise; /** * This method returns the value resolve to the bounding box of the element (relative to the main frame), or null if the element is not visible. */ @@ -590,20 +620,25 @@ export interface Request { */ continue(overrides?: Overrides): Promise; + /** + * @returns The `Frame` object that initiated the request, or `null` if navigating to error pages + */ + frame(): Promise; + /** * An object with HTTP headers associated with the request. * All header names are lower-case. */ - headers: Headers; + headers(): Headers; /** Returns the request's method (GET, POST, etc.) */ - method: HttpMethod; + method(): HttpMethod; /** Contains the request's post body, if any. */ - postData: string | undefined; + postData(): string | undefined; /** Contains the request's resource type as it was perceived by the rendering engine. */ - resourceType: ResourceType; + resourceType(): ResourceType; /** * Fulfills request with given response. @@ -617,7 +652,7 @@ export interface Request { response(): Response | null; /** Contains the URL of the request. */ - url: string; + url(): string; } /** Options for `Request.respond` method */ export interface RespondOptions { @@ -639,22 +674,22 @@ export interface Response { /** Promise which resolves to a buffer with response body. */ buffer(): Promise; /** An object with HTTP headers associated with the response. All header names are lower-case. */ - headers: Headers; + headers(): Headers; /** * Promise which resolves to a JSON representation of response body. * @throws This method will throw if the response body is not parsable via `JSON.parse`. */ json(): Promise; /** Contains a boolean stating whether the response was successful (status in the range 200-299) or not. */ - ok: boolean; + ok(): boolean; /** A matching Request object. */ request(): Request; /** Contains the status code of the response (e.g., 200 for a success). */ - status: number; + status(): number; /** Promise which resolves to a text representation of response body. */ text(): Promise; /** Contains the URL of the response. */ - url: string; + url(): string; } export interface FrameBase { @@ -667,6 +702,10 @@ export interface FrameBase { * The method runs document.querySelectorAll within the page. If no elements match the selector, the return value resolve to []. */ $$(selector: string): Promise; + /** + * @param expression XPath expression to evaluate. + */ + $x(expression: string): Promise; /** * This method runs document.querySelector within the page and passes it as the first argument to `fn`. @@ -699,6 +738,9 @@ export interface FrameBase { /** Adds a `` tag into the page with the desired url or a `