diff --git a/README.md b/README.md index 854cae7e40..c50d026338 100644 --- a/README.md +++ b/README.md @@ -256,7 +256,7 @@ When it graduates draft mode, we may remove it from DefinitelyTyped and deprecat #### I want to update a package to a new major version -Before making your change, please create a new subfolder with the current version e.g. `v2`, and copy existing files to it. You will need to: +If you intend to continue updating the older version of the package, you may create a new subfolder with the current version e.g. `v2`, and copy existing files to it. If so, you will need to: 1. Update the relative paths in `tsconfig.json` as well as `tslint.json`. 2. Add path mapping rules to ensure that tests are running against the intended version. @@ -279,7 +279,8 @@ For example [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/Defi } ``` -Please note that unless upgrading something backwards-compatible like `node`, all packages depending of the updated package need a path mapping to it, as well as packages depending on *those*. +If there are other packages on DefinitelyTyped that are incompatible with the new version, you will need to add path mappings to the old version. You will also need to do this for packages depending on packages depending on the old version. + For example, `react-router` depends on `history@2`, so [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) has a path mapping to `"history": [ "history/v2" ]`; transitively `react-router-bootstrap` (which depends on `react-router`) also adds a path mapping in its [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json). diff --git a/notNeededPackages.json b/notNeededPackages.json index fd7868f2ae..7683c07522 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1590,6 +1590,12 @@ "sourceRepoURL": "https://github.com/sourcelair/xterm.js/", "asOfVersion": "3.0.0" }, + { + "libraryName": "yFiles for HTML", + "typingsPackageName": "yfiles", + "sourceRepoURL": "none", + "asOfVersion": "2.1.0" + }, { "libraryName": "zetapush-js", "typingsPackageName": "zetapush-js", diff --git a/scripts/generate-tsconfigs.ts b/scripts/generate-tsconfigs.ts index 0115067e34..e1e1998950 100644 --- a/scripts/generate-tsconfigs.ts +++ b/scripts/generate-tsconfigs.ts @@ -5,7 +5,7 @@ import * as fs from 'fs'; import * as path from 'path'; -const home = path.join(__dirname, '..'); +const home = path.join(__dirname, "..", "types"); for (const dirName of fs.readdirSync(home)) { if (dirName.startsWith(".") || dirName === "node_modules" || dirName === "scripts") { diff --git a/types/abbrev/tsconfig.json b/types/abbrev/tsconfig.json index 0755c19fe1..b33fbb06bc 100644 --- a/types/abbrev/tsconfig.json +++ b/types/abbrev/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/abs/tsconfig.json b/types/abs/tsconfig.json index 2bcb3f7094..be1e00e9b9 100644 --- a/types/abs/tsconfig.json +++ b/types/abs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/absolute/tsconfig.json b/types/absolute/tsconfig.json index ba18df791e..9932020aa3 100644 --- a/types/absolute/tsconfig.json +++ b/types/absolute/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/acc-wizard/tsconfig.json b/types/acc-wizard/tsconfig.json index a20aeba97b..f63878ba9b 100644 --- a/types/acc-wizard/tsconfig.json +++ b/types/acc-wizard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/accept-language-parser/tsconfig.json b/types/accept-language-parser/tsconfig.json index 11532082db..86f839c4be 100644 --- a/types/accept-language-parser/tsconfig.json +++ b/types/accept-language-parser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/accepts/tsconfig.json b/types/accepts/tsconfig.json index 35b618292d..9d62081738 100644 --- a/types/accepts/tsconfig.json +++ b/types/accepts/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/accounting/tsconfig.json b/types/accounting/tsconfig.json index f815c5b01e..7ec0b3a159 100644 --- a/types/accounting/tsconfig.json +++ b/types/accounting/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ace/tsconfig.json b/types/ace/tsconfig.json index eb52fff185..97c51e2bf9 100644 --- a/types/ace/tsconfig.json +++ b/types/ace/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/acl/tsconfig.json b/types/acl/tsconfig.json index 9f5c6a01ef..ada20a1b2c 100644 --- a/types/acl/tsconfig.json +++ b/types/acl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/acorn/tsconfig.json b/types/acorn/tsconfig.json index 0b4760b0fc..9a9bbdd763 100644 --- a/types/acorn/tsconfig.json +++ b/types/acorn/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/actioncable/tsconfig.json b/types/actioncable/tsconfig.json index cb137a8982..544fc4d502 100644 --- a/types/actioncable/tsconfig.json +++ b/types/actioncable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/actions-on-google/actions-on-google-tests.ts b/types/actions-on-google/actions-on-google-tests.ts index e57e1e8d98..d24c3093b4 100644 --- a/types/actions-on-google/actions-on-google-tests.ts +++ b/types/actions-on-google/actions-on-google-tests.ts @@ -1,6 +1,6 @@ import { ActionsSdkApp, ActionsSdkAppOptions, DialogflowApp, DialogflowAppOptions, AssistantApp, Responses, Transactions } from 'actions-on-google'; -import * as express from 'express'; +import express = require('express'); function testActionsSdk(request: express.Request, response: express.Response) { const app = new ActionsSdkApp({request, response}); diff --git a/types/actions-on-google/tsconfig.json b/types/actions-on-google/tsconfig.json index 6682b5c194..82fc80a44f 100644 --- a/types/actions-on-google/tsconfig.json +++ b/types/actions-on-google/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -25,4 +26,4 @@ "transactions.d.ts", "actions-on-google-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/activex-access/tsconfig.json b/types/activex-access/tsconfig.json index a376fcb722..d1fac56caa 100644 --- a/types/activex-access/tsconfig.json +++ b/types/activex-access/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-adodb/tsconfig.json index 5cb32f94c9..7a5b6e8f13 100644 --- a/types/activex-adodb/tsconfig.json +++ b/types/activex-adodb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-dao/tsconfig.json index 2ddea247b9..da7ac77da9 100644 --- a/types/activex-dao/tsconfig.json +++ b/types/activex-dao/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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-diskquota/activex-diskquota-tests.ts b/types/activex-diskquota/activex-diskquota-tests.ts new file mode 100644 index 0000000000..2672b590ca --- /dev/null +++ b/types/activex-diskquota/activex-diskquota-tests.ts @@ -0,0 +1,44 @@ +const collectionToArray = (col: any) => { // tslint:disable-line no-unnecessary-generics + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787925(v=vs.85).aspx +(() => { + const enumUsers = (label: string) => { + const volume = new ActiveXObject('Microsoft.DiskQuota'); + volume.Initialize(label, true); + collectionToArray(volume).forEach(x => { + // Use the QuotaUser object to retrieve or set one or more of the user's disk quota properties + }); + }; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787916(v=vs.85).aspx +(() => { + const volume = new ActiveXObject('Microsoft.DiskQuota'); + volume.Initialize('MYDISK', true); + ActiveXObject.on(volume, 'OnUserNameChanged', ['pUser'], p => { + // Code to handle the event. + }); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787904(v=vs.85).aspx +(() => { + const dqc = new ActiveXObject('Microsoft.DiskQuota'); + dqc.Initialize('MYDISK', true); + const findName = (name: string) => { + try { + return dqc.FindUser(name); + } catch { } + try { + return dqc.FindUser(dqc.TranslateLogonNameToSID(name)); + } catch { } + }; +})(); diff --git a/types/activex-diskquota/index.d.ts b/types/activex-diskquota/index.d.ts new file mode 100644 index 0000000000..d27863de3c --- /dev/null +++ b/types/activex-diskquota/index.d.ts @@ -0,0 +1,152 @@ +// Type definitions for DiskQuotaTypeLibrary 1.0 +// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773938(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 + +declare namespace DiskQuotaTypeLibrary { + // tslint:disable-next-line no-const-enum + const enum AccountStatusConstants { + dqAcctDeleted = 2, + dqAcctInvalid = 3, + dqAcctResolved = 0, + dqAcctUnavailable = 1, + dqAcctUnknown = 4, + dqAcctUnresolved = 5, + } + + // tslint:disable-next-line no-const-enum + const enum QuotaStateConstants { + dqStateDisable = 0, + dqStateEnforce = 2, + dqStateTrack = 1, + } + + // tslint:disable-next-line no-const-enum + const enum UserNameResolutionConstants { + dqResolveAsync = 2, + dqResolveNone = 0, + dqResolveSync = 1, + } + + /** Automation interface for DiskQuotaUser */ + class DIDiskQuotaUser { + private 'DiskQuotaTypeLibrary.DIDiskQuotaUser_typekey': DIDiskQuotaUser; + private constructor(); + + /** Name of user's account container */ + readonly AccountContainerName: string; + + /** Status of user's account */ + readonly AccountStatus: AccountStatusConstants; + + /** User's display name */ + readonly DisplayName: string; + + /** Unique ID number */ + readonly ID: number; + + /** Invalidate data cached in user object */ + Invalidate(): void; + + /** User's logon account name */ + readonly LogonName: string; + + /** User's quota limit (bytes) */ + QuotaLimit: number; + + /** User's quota limit (text) */ + readonly QuotaLimitText: string; + + /** User's quota warning threshold (bytes) */ + QuotaThreshold: number; + + /** User's quota warning threshold (text) */ + readonly QuotaThresholdText: string; + + /** Quota charged to user (bytes) */ + readonly QuotaUsed: number; + + /** Quota charged to user (text) */ + readonly QuotaUsedText: string; + } + + /** Microsoft Disk Quota */ + class DiskQuotaControl { + private 'DiskQuotaTypeLibrary.DiskQuotaControl_typekey': DiskQuotaControl; + private constructor(); + + /** Add a user quota entry by Name */ + AddUser(LogonName: string): DIDiskQuotaUser; + + /** Default quota limit applied to new volume users (byte value) */ + DefaultQuotaLimit: number; + + /** Default quota limit applied to new volume users (text string) */ + readonly DefaultQuotaLimitText: string; + + /** Default warning threshold applied to new volume users (byte value) */ + DefaultQuotaThreshold: number; + + /** Default warning threshold applied to new volume users (text string) */ + readonly DefaultQuotaThresholdText: string; + + /** Delete a user quota entry */ + DeleteUser(pUser: DIDiskQuotaUser): void; + + /** Find a user quota entry by Name */ + FindUser(LogonName: string): DIDiskQuotaUser; + + /** Promote a user quota entry to the head of the name resolution queue */ + GiveUserNameResolutionPriority(pUser: DIDiskQuotaUser): void; + + /** Initialize the quota control object for a specified volume */ + Initialize(path: string, bReadWrite: boolean): void; + + /** Invalidate the cache of user name information */ + InvalidateSidNameCache(): void; + + /** Write event log entry when user exceeds quota limit */ + LogQuotaLimit: boolean; + + /** Write event log entry when user exceeds quota warning threshold */ + LogQuotaThreshold: boolean; + + /** Indicates if quota information is out of date */ + readonly QuotaFileIncomplete: boolean; + + /** Indicates if quota information is being rebuilt */ + readonly QuotaFileRebuilding: boolean; + + /** State of the volume's disk quota system */ + QuotaState: QuotaStateConstants; + + /** Terminate the user name resolution thread */ + ShutdownNameResolution(): void; + + /** Translates a user logon name to a security ID */ + TranslateLogonNameToSID(LogonName: string): string; + + /** Control the resolution of user Security IDs to user Names */ + UserNameResolution: UserNameResolutionConstants; + } +} + +interface ActiveXObject { + on( + obj: DiskQuotaTypeLibrary.DiskQuotaControl, event: 'OnUserNameChanged', argNames: ['pUser'], handler: ( + this: DiskQuotaTypeLibrary.DiskQuotaControl, parameter: {readonly pUser: DiskQuotaTypeLibrary.DIDiskQuotaUser}) => void): void; + new(progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'Microsoft.DiskQuota': DiskQuotaTypeLibrary.DiskQuotaControl; +} + +interface EnumeratorConstructor { + new(col: DiskQuotaTypeLibrary.DiskQuotaControl): Enumerator; +} + +interface SafeArray { + _brand: SafeArray; +} diff --git a/types/activex-diskquota/package.json b/types/activex-diskquota/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-diskquota/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-diskquota/tsconfig.json b/types/activex-diskquota/tsconfig.json new file mode 100644 index 0000000000..61686bd769 --- /dev/null +++ b/types/activex-diskquota/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5", + "scripthost" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "activex-diskquota-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-diskquota/tslint.json b/types/activex-diskquota/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-diskquota/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-excel/tsconfig.json b/types/activex-excel/tsconfig.json index 244ab1d0ef..a9599850ef 100644 --- a/types/activex-excel/tsconfig.json +++ b/types/activex-excel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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-faxcomexlib/activex-faxcomexlib-tests.ts b/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts new file mode 100644 index 0000000000..9ae8c7641d --- /dev/null +++ b/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts @@ -0,0 +1,730 @@ +/// + +const collectionToArray = (col: { Item(index: any): T } | SafeArray) => { + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +const toSafeArray = (...items: T[]): SafeArray => { + const dict = new ActiveXObject('Scripting.Dictionary'); + items.forEach((x, index) => dict.Add(index, x)); + return dict.Items() as SafeArray; +}; + +const VB = { + InputBox: (prompt: string): string => '' +}; + +const getServer = () => { + const server = new ActiveXObject('FaxComEx.FaxServer'); + server.Connect(''); + return server; +}; + +(() => { + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms693376(v=vs.85).aspx + const server = new ActiveXObject('FaxComEx.FaxServer'); + const document = new ActiveXObject('FaxComEx.FaxDocument'); + + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms692919(v=vs.85).aspx + server.Connect(''); + server.Connect('computername'); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693502(v=vs.85).aspx +(() => { + const getInitializedDevice = () => { + const ret = getServer().GetDevices().ItemById(1); + ret.ReceiveMode = FAXCOMEXLib.FAX_DEVICE_RECEIVE_MODE_ENUM.fdrmAUTO_ANSWER; + ret.RingsBeforeAnswer = 5; + ret.SendEnabled = true; + return ret; + }; + + // saving configuration + let device = getInitializedDevice(); + device.Save(); + + // abandoning changes to configuration, using the Refresh method + device = getInitializedDevice(); + device.Refresh(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693502(v=vs.85).aspx +(() => { + const incomingJob = getServer().Folders.IncomingQueue.GetJobs().Item(1); + incomingJob.Refresh(); + const currentPage = incomingJob.CurrentPage; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692922(v=vs.85).aspx +(() => { + const server = getServer(); + + WScript.Echo(`Server information: +API Version: ${server.APIVersion} +Debug: ${server.Debug} +Build and version: ${server.MajorBuild}.${server.MinorBuild}.${server.MajorVersion}.${server.MinorVersion} +Server name: ${server.ServerName}`); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693455(v=vs.85).aspx +(() => { + const activity = getServer().Activity; + activity.Refresh(); + + WScript.Echo(` +${activity.IncomingMessages} incoming messages +${activity.OutgoingMessages} outgoing messages +${activity.RoutingMessages} routing messages +${activity.QueuedMessages} queued messages`); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693400(v=vs.85).aspx +(() => { + const device = getServer().GetDevices().Item(1); + device.CSID = 'Accounts payable'; + device.Description = 'Primary fax device'; + device.ReceiveMode = FAXCOMEXLib.FAX_DEVICE_RECEIVE_MODE_ENUM.fdrmAUTO_ANSWER; + device.RingsBeforeAnswer = 5; + device.SendEnabled = true; + device.TSID = 'Accounts payable'; + device.Save(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692985(v=vs.85).aspx +(() => { + const devices = getServer().GetDevices(); + WScript.Echo(`This server has ${devices.Count} fax devices`); + for (let i = 1; i <= devices.Count; i++) { + WScript.Echo(`Device ID for device number ${i} is ${devices.Item(i).Id}`); + } + + collectionToArray(devices).forEach(device => { + device.Refresh(); + WScript.Echo(` +Device name: ${device.DeviceName} +Provider unique name: ${device.ProviderUniqueName} +Powered off: ${device.PoweredOff} +Receiving now: ${device.ReceivingNow} +Ringing now: ${device.RingingNow} +Sending now: ${device.SendingNow}`); + + const routingMethods = new VBArray(device.UsedRoutingMethods).toArray(); + routingMethods.forEach((guid, index) => { + WScript.Echo(`Method number ${index} = ${guid}`); + }); + + device.UseRoutingMethod(routingMethods[0], false); + device.Save(); + }); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693486(v=vs.85).aspx +(() => { + const outputRuleInfo = (rule: FAXCOMEXLib.FaxOutboundRoutingRule, index?: number) => { + WScript.Echo(` +Outbound routing rule number: ${index || 'unknown'} +Area code: ${rule.AreaCode} +Country/region code: ${rule.CountryCode} +Device ID: ${rule.DeviceId} +Group name: ${rule.GroupName} +Status: ${rule.Status} +Is device used: ${rule.UseDevice}` + .trim()); + }; + + const server = getServer(); + const device = server.GetDevices().Item(1); + const id = device.Id; + const rules = server.OutboundRouting.GetRules(); + const outboundRoutingRules = server.OutboundRouting.GetRules(); + WScript.Echo(`There are ${outboundRoutingRules.Count} outbound routing rules on this server.`); + + collectionToArray(outboundRoutingRules).forEach((rule, index) => { + rule.Refresh(); + outputRuleInfo(rule, index); + + if (!rule.UseDevice) { return; } + if (VB.InputBox('Do you want to change the device for this rule (Y/N)?') === 'Y') { + const newDeviceID = parseInt(VB.InputBox('Enter new device ID'), 10); + rule.DeviceId = newDeviceID; + rule.Save(); + } + }); + + const msg = ` +Do you want to: +1) display an item based on its country/region and area code, +2) remove an item based on its country/region and area code, +3) remove an item based on its item number, or +4) add a rule? +Input 1, 2, 3, 4, or 0 to exit +`.trim(); + const result = parseInt(VB.InputBox(msg), 10); + let countryCode: number; + let areaCode: number; + let itemNumber: number; + let rule: FAXCOMEXLib.FaxOutboundRoutingRule; + switch (result) { + case 1: + countryCode = parseInt(VB.InputBox('Enter the country/region code'), 10); + areaCode = parseInt(VB.InputBox('Enter the area code'), 10); + rule = outboundRoutingRules.ItemByCountryAndArea(countryCode, areaCode); + outputRuleInfo(rule); + break; + case 2: + countryCode = parseInt(VB.InputBox('Enter the country/region code'), 10); + areaCode = parseInt(VB.InputBox('Enter the area code'), 10); + outboundRoutingRules.RemoveByCountryAndArea(countryCode, areaCode); + break; + case 3: + itemNumber = parseInt(VB.InputBox('Enter the item number'), 10); + outboundRoutingRules.Remove(itemNumber); + break; + case 4: + countryCode = parseInt(VB.InputBox('Enter the country/region code'), 10); + areaCode = parseInt(VB.InputBox('Enter the area code'), 10); + rule = outboundRoutingRules.Add(countryCode, areaCode, true, '', id); + break; + default: + return; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693408(v=vs.85).aspx +(() => { + const server = getServer(); + const outboundRouting = server.OutboundRouting; + const outboundRoutingGroups = outboundRouting.GetGroups(); + const groupName = VB.InputBox('Provide a name for the outbound routing group'); + const outboundRoutingGroup = outboundRoutingGroups.Add(groupName); + const devices = collectionToArray(server.GetDevices()); + + // add the devices to the routing group + devices.forEach(device => outboundRoutingGroup.DeviceIds.Add(device.Id)); + // move the last device to the top of the order + outboundRoutingGroup.DeviceIds.SetOrder(devices[devices.length - 1].Id, 1); + + // display the number of devices, and the device ID of the first device,to confirm its location in the order + const msg = ` +Number of devices: ${outboundRoutingGroup.DeviceIds.Count} +ID of first device: ${outboundRoutingGroup.DeviceIds.Item(1)} +`.trim(); + WScript.Echo(msg); + + // remove the first device + outboundRoutingGroup.DeviceIds.Remove(1); + + WScript.Echo(`There are now ${outboundRoutingGroups.Count} routing groups on the server`); + + collectionToArray(outboundRoutingGroups).forEach((routingGroup, index) => { + const msg = ` +Routing group number: ${index} +Outbound routing group name: ${routingGroup.Name} +Device status: ${routingGroup.Status} +`.trim(); + }); + + // allow user to remove a routing group + if (VB.InputBox('Do you want to remove a routing group (Y/N)?') === 'N') { return; } + const itemNumber = VB.InputBox('Enter the item number for the group you want to remove'); + outboundRoutingGroups.Remove(itemNumber); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/aa964960(v=vs.85).aspx +(() => { + const accountSet = getServer().FaxAccountSet; + const accounts = collectionToArray(accountSet.GetAccounts()); + WScript.Echo(`Number of accounts: ${accounts.length}`); + accounts.forEach(account => WScript.Echo(account.AccountName)); + + const accountName = VB.InputBox('Enter an account name'); + accountSet.AddAccount(accountName); + accountSet.RemoveAccount(accountName); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692952(v=vs.85).aspx +(() => { + const incomingJobs = collectionToArray(getServer().Folders.IncomingQueue.GetJobs()); + WScript.Echo(`There are ${incomingJobs.length} jobs in the incoming queue.`); + const n = parseInt(VB.InputBox('Input the number of a job for which you want information'), 10); + const job = incomingJobs[n - 1]; + WScript.Echo(` +Available operations: ${job.AvailableOperations} +Caller ID: ${job.CallerId} +CSID: ${job.CSID} +Current page: ${job.CurrentPage} +Device ID: ${job.DeviceId} +Extended status: ${job.ExtendedStatus} +Extended status code: ${job.ExtendedStatusCode} +Job ID: ${job.Id} +Job type: ${job.JobType} +Retries: ${job.Retries} +Routing information: ${job.RoutingInformation} +Size: ${job.Size} +Status: ${job.Status} +Transmission start: ${new Date(job.TransmissionStart)} +Transmission end: ${new Date(job.TransmissionEnd)} +TSID: ${job.TSID} +`.trim()); + + if (VB.InputBox('Cancel this fax (Y/N)?') === 'Y') { + job.Cancel(); + } + + if (VB.InputBox('Open this fax (Y/N)?') === 'Y') { + const fileName = VB.InputBox('Enter path to save'); + job.CopyTiff(fileName); + new ActiveXObject('WScript.Shell').Run(fileName); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692914(v=vs.85).aspx +(() => { + const server = new ActiveXObject('FaxComEx.FaxServer'); + server.Connect(''); + const outgoingQueue = server.Folders.OutgoingQueue; + outgoingQueue.AgeLimit = 2; + outgoingQueue.AllowPersonalCoverPages = true; + outgoingQueue.Blocked = false; + outgoingQueue.Paused = false; + outgoingQueue.Branding = true; + outgoingQueue.DiscountRateStart = new Date(0, 0, 0, 0).getVarDate(); + outgoingQueue.DiscountRateStart = new Date(0, 0, 0, 1).getVarDate(); + outgoingQueue.UseDeviceTSID = true; + outgoingQueue.Save(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693393(v=vs.85).aspx +(() => { + const outgoingQueue = getServer().Folders.OutgoingQueue; + outgoingQueue.Refresh(); + WScript.Echo(`There are ${outgoingQueue.GetJobs().Count} faxes in the outgoing queue`); + const inputResult = VB.InputBox('Which fax should be displayed (item number or job name)?'); + const itemNumber = parseInt(inputResult, 10); + const job = + isNaN(itemNumber) ? + outgoingQueue.GetJob(inputResult) : + outgoingQueue.GetJobs().Item(itemNumber); + + WScript.Echo(` +Available operations: ${job.AvailableOperations} +Broadcast receipts grouped? ${job.GroupBroadcastReceipts} +CSID: ${job.CSID} +Current page: ${job.CurrentPage} +Device ID: ${job.DeviceId} +Document name: ${job.DocumentName} +Extended status: ${job.ExtendedStatus} +Extended status code: ${job.ExtendedStatusCode} +Job ID: ${job.Id} +Original scheduled time: ${new Date(job.OriginalScheduledTime)} +Pages: ${job.Pages} +Priority: ${job.Priority} +Receipt type: ${job.ReceiptType} +`.trim()); + + const fileName = VB.InputBox('Enter path to save'); + job.CopyTiff(fileName); + new ActiveXObject('WScript.Shell').Run(fileName); + + const answer = VB.InputBox(` +Do you want to: +(C) cancel +(P) pause +(R) restart +(E) resume +the job? +`.trim()); + + switch (answer) { + case 'C': + job.Cancel(); + break; + case 'P': + job.Pause(); + break; + case 'R': + job.Restart(); + break; + case 'E': + job.Resume(); + break; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692936(v=vs.85).aspx +(() => { + const document = new ActiveXObject('FaxComEx.FaxDocument'); + document.Body = 'C:\\docs\\body.txt'; + document.DocumentName = 'My First Fax'; + document.Priority = FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM.fptHIGH; + document.Recipients.Add('12225550100', 'Bud'); + document.AttachFaxToReceipt = true; + document.CoverPageType = FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptSERVER; + document.Note = 'Here is the info you requested'; + document.ReceiptAddress = 'someone@example.com'; + document.ReceiptType = FAXCOMEXLib.FAX_RECEIPT_TYPE_ENUM.frtMAIL; + document.ScheduleType = FAXCOMEXLib.FAX_SCHEDULE_TYPE_ENUM.fstSPECIFIC_TIME; + document.ScheduleTime = new Date(0, 0, 0, 16, 35, 47).getVarDate(); + document.Subject = 'Today\'s fax'; + + // set sender properties + const sender = document.Sender; + sender.Title = 'Mr.'; + sender.Name = 'Bob'; + sender.City = 'Cleveland Heights'; + sender.State = 'Ohio'; + sender.Company = 'Microsoft'; + sender.Country = 'USA'; + sender.Email = 'someone@microsoft.com'; + sender.FaxNumber = '12165555554'; + sender.HomePhone = '12165555555'; + sender.OfficeLocation = 'Downtown'; + sender.OfficePhone = '12165555553'; + sender.StreetAddress = '123 Main Street'; + sender.TSID = 'Office fax machine'; + sender.ZipCode = '44118'; + sender.BillingCode = '23A54'; + sender.Department = 'Accts Payable'; + sender.SaveDefaultSender(); + + const server = getServer(); + + const jobID = document.ConnectedSubmit(server); + WScript.Echo(`The job ID is ${jobID}`); + + server.Disconnect(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693479(v=vs.85).aspx +(() => { + const document = new ActiveXObject('FaxComEx.FaxDocument'); + document.Body = 'C:\\docs\\body.txt'; + document.DocumentName = 'My First Fax'; + + const recipients = document.Recipients; + recipients.Add('12225550105', 'H'); + recipients.Add('12225550104', 'N'); + recipients.Add('12225550103', 'G'); + + WScript.Echo(`Number of recipients: ${recipients.Count}`); + collectionToArray(recipients).forEach((recipient, index) => + WScript.Echo(`Recipient number ${index}: ${recipient.Name}, ${recipient.FaxNumber}`) + ); + + document.Sender.LoadDefaultSender(); + document.GroupBroadcastReceipts = true; + + const jobIDs = document.Submit(''); + collectionToArray(jobIDs).forEach(jobID => WScript.Echo(`The job ID is ${jobID}`)); + + while (recipients.Count > 0) { + recipients.Remove(1); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/aa964962(v=vs.85).aspx +(() => { + const server = getServer(); + const prefetchCount = parseInt(VB.InputBox('How many messages should be prefetched?'), 10); + server.CurrentAccount.Folders.IncomingArchive.Refresh(); + const messageIterator = server.Folders.IncomingArchive.GetMessages(prefetchCount); + messageIterator.MoveFirst(); + for (let i = 1; i <= prefetchCount; i++) { + if (i > 1 && VB.InputBox('View next message? (Y/N)') !== 'Y') { break; } + const message = messageIterator.Message as FAXCOMEXLib.FaxIncomingMessage; + if (messageIterator.AtEOF) { + WScript.Echo(`End of file reached`); + return; + } + if (!message.WasReAssigned) { + if (VB.InputBox('Message not reassigned. Reassign (Y/N)?') === 'Y') { + message.Subject = 'Reassigning message'; + message.SenderName = 'Test user'; + message.Recipients = VB.InputBox('Enter username, e.g. Domain\\UserName'); + message.SenderFaxNumber = '1234'; + message.ReAssign(); + } + } + messageIterator.MoveNext(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693402(v=vs.85).aspx +(() => { + const server = getServer(); + const prefetchCount = parseInt(VB.InputBox('How many messages should be prefetched?'), 10); + server.Folders.OutgoingArchive.Refresh(); + const messageIterator = server.Folders.OutgoingArchive.GetMessages(prefetchCount); + messageIterator.MoveFirst(); + for (let i = 1; i <= prefetchCount; i++) { + if (i > 1 && VB.InputBox('View next message? (Y/N)') !== 'Y') { break; } + if (messageIterator.AtEOF) { + WScript.Echo(`End of file reached`); + return; + } + const message = messageIterator.Message as FAXCOMEXLib.FaxOutgoingMessage; + + const fileName = VB.InputBox('Enter path to save'); + message.CopyTiff(fileName); + new ActiveXObject('WScript.Shell').Run(fileName); + + WScript.Echo(`Message information: +CSID: ${message.CSID} +Device name: ${message.DeviceName} +Document name: ${message.DocumentName} +Message ID: ${message.Id} +Original scheduled time: ${new Date(message.OriginalScheduledTime)} +Pages: ${message.Pages} +Recipient fax number: ${message.Recipient.FaxNumber} +Retries: ${message.Retries} +Sender name: ${message.Sender.Name} +Size: ${message.Size} +Subject: ${message.Subject} +Submission ID: ${message.SubmissionId} +Submission time: ${new Date(message.SubmissionTime)} +Transmission end time: ${new Date(message.TransmissionEnd)} +Transmission start time: ${new Date(message.TransmissionStart)} +TSID: ${message.TSID}`); + + if (VB.InputBox('Delete this fax from the archive (Y/N)?') === 'Y') { + message.Delete(); + } + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693472(v=vs.85).aspx +(() => { + const server = getServer(); + const outgoingArchive = server.Folders.OutgoingArchive; + WScript.Echo(` +Age limit: ${outgoingArchive.AgeLimit} +Archive folder: ${outgoingArchive.ArchiveFolder} +High quota mark: ${outgoingArchive.HighQuotaWaterMark} +Low quota water mark: ${outgoingArchive.LowQuotaWaterMark} +Size high: ${outgoingArchive.SizeHigh} +Size low: ${outgoingArchive.SizeLow} +Size quota warning: ${outgoingArchive.SizeQuotaWarning} +Is archive used? ${outgoingArchive.UseArchive}`.trim() + ); + + const newLimit = VB.InputBox('Set new age limit (enter empty value or Cancel to leave unchanged'); + if (newLimit) { + outgoingArchive.AgeLimit = parseInt(newLimit, 10); + } + + const messageID = VB.InputBox('Retrieve a message by ID (enter an empty value or press Cancel to exit'); + if (messageID) { + const fileName = VB.InputBox('Enter path to save'); + outgoingArchive.GetMessage(messageID).CopyTiff(fileName); + new ActiveXObject('WScript.Shell').Run(fileName); + } +})(); + +(() => { + const server = getServer(); + const messageIterator = server.Folders.OutgoingArchive.GetMessages(); + if (messageIterator.AtEOF) { return; } + messageIterator.MoveFirst(); + while (!messageIterator.AtEOF) { + const message = messageIterator.Message; + WScript.Echo(` +Document name: ${message.DocumentName} +ID: ${message.Id} +Transmission end: ${new Date(message.TransmissionEnd)} +Transmission start: ${new Date(message.TransmissionStart)} +`.trim()); + messageIterator.MoveNext(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms692976(v=vs.85).aspx +(() => { + const server = getServer(); + const prefetchCount = parseInt(VB.InputBox('How many messages should be prefetched?'), 10); + server.Folders.IncomingArchive.Refresh(); + const messageIterator = server.Folders.IncomingArchive.GetMessages(prefetchCount); + messageIterator.MoveFirst(); + for (let i = 1; i <= prefetchCount; i++) { + if (i > 1 && VB.InputBox('View next message? (Y/N)') !== 'Y') { break; } + const message = messageIterator.Message as FAXCOMEXLib.FaxIncomingMessage; + if (messageIterator.AtEOF) { + WScript.Echo(`End of file reached`); + return; + } + const fileName = VB.InputBox('Enter path to save TIFF file'); + message.CopyTiff(fileName); + new ActiveXObject('WScript.Shell').Run(fileName); + + messageIterator.MoveNext(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693406(v=vs.85).aspx +(() => { + const server = getServer(); + const incomingArchive = server.Folders.IncomingArchive; + incomingArchive.Refresh(); + WScript.Echo(` +High quota water mark: ${incomingArchive.HighQuotaWaterMark} +Low quota water mark: ${incomingArchive.LowQuotaWaterMark} +Archive folder: ${incomingArchive.ArchiveFolder} +Age limit: ${incomingArchive.AgeLimit} +Size high: ${incomingArchive.SizeHigh} +Size low: ${incomingArchive.SizeLow} +Is size quota warning on? ${incomingArchive.SizeQuotaWarning} +Is archive used? ${incomingArchive.UseArchive} +`.trim()); + + incomingArchive.AgeLimit = 4; + incomingArchive.Save(); + + const messageID = VB.InputBox('Message ID to retrieve information? (Leave empty, or Cancel, to exit)'); + if (messageID === '') { return; } + const message = incomingArchive.GetMessage(messageID); + WScript.Echo(` +Caller ID: ${message.CallerId} +CSID: ${message.CSID} +Device name: ${message.DeviceName} +Message ID: ${message.Id} +Number of pages: ${message.Pages} +Retries: ${message.Retries} +Routing information: ${message.RoutingInformation} +Size: ${message.Size} +Transmission start: ${new Date(message.TransmissionStart)} +Transmission end: ${new Date(message.TransmissionEnd)} +TSID: ${message.TSID} +`.trim()); + + if (VB.InputBox('Delete this message from the archive (Y/N)?') === 'Y') { + message.Delete(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693401(v=vs.85).aspx +(() => { + const server = getServer(); + const loggingOptions = server.LoggingOptions; + const activityLogging = loggingOptions.ActivityLogging; + const eventLogging = loggingOptions.EventLogging; + + activityLogging.Refresh(); + activityLogging.LogIncoming = true; + activityLogging.LogOutgoing = true; + activityLogging.Save(); + + eventLogging.Refresh(); + eventLogging.GeneralEventsLevel = FAXCOMEXLib.FAX_LOG_LEVEL_ENUM.fllMED; + eventLogging.InboundEventsLevel = FAXCOMEXLib.FAX_LOG_LEVEL_ENUM.fllMAX; + eventLogging.InitEventsLevel = FAXCOMEXLib.FAX_LOG_LEVEL_ENUM.fllMAX; + eventLogging.OutboundEventsLevel = FAXCOMEXLib.FAX_LOG_LEVEL_ENUM.fllNONE; + eventLogging.Save(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693387(v=vs.85).aspx +(() => { + const server = getServer(); + const receiptOptions = server.ReceiptOptions; + receiptOptions.Refresh(); + WScript.Echo(` +Allowed receipt types: ${receiptOptions.AllowedReceipts} +Authentication types: ${receiptOptions.AuthenticationType} +SMTP port: ${receiptOptions.SMTPPort} +SMTP sender: ${receiptOptions.SMTPSender} +SMTP server: ${receiptOptions.SMTPSender} +Use for inbound routing? ${receiptOptions.UseForInboundRouting} +`.trim()); + + receiptOptions.AllowedReceipts = FAXCOMEXLib.FAX_RECEIPT_TYPE_ENUM.frtMAIL; + receiptOptions.AuthenticationType = FAXCOMEXLib.FAX_SMTP_AUTHENTICATION_TYPE_ENUM.fsatBASIC; + receiptOptions.SMTPPort = 25; + receiptOptions.SMTPSender = 'someone@example.com'; + receiptOptions.SMTPServer = 'My SMTP Server'; + receiptOptions.UseForInboundRouting = true; + receiptOptions.Save(); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693462(v=vs.85).aspx +(() => { + const server = getServer(); + collectionToArray(server.GetDeviceProviders()).forEach((provider, index) => { + WScript.Echo(` +Debug: ${provider.Debug} +Name: ${provider.FriendlyName} +Image name: ${provider.ImageName} +Init error code: ${provider.InitErrorCode} +Build and version: ${provider.MajorBuild}.${provider.MajorVersion}.${provider.MinorBuild}.${provider.MinorVersion} +Status: ${provider.Status} +TAPI provider: ${provider.TapiProviderName} +Unique name: ${provider.UniqueName} +`.trim()); + + new VBArray(provider.DeviceIds).toArray().forEach(id => WScript.Echo(id)); + }); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693437(v=vs.85).aspx -- for a fax device +(() => { + const server = getServer(); + const device = server.GetDevices().Item(1); + const deviceProperty = toSafeArray(1, 2, 3); + const propertyName = '{B1F944B9-9A16-45d1-933A-4060A4871AB0}'; + device.SetExtensionProperty(propertyName, deviceProperty); + new VBArray(device.GetExtensionProperty(propertyName)).toArray().forEach(x => WScript.Echo(x)); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693437(v=vs.85).aspx -- for a fax device +(() => { + const server = getServer(); + const serverProperty = toSafeArray(4, 2, 3); + const propertyName = `{AC7D0DEE-B6E5-4a44-AF45-835C58CB44D2}`; + server.SetExtensionProperty(propertyName, serverProperty); + new VBArray(server.GetExtensionProperty(propertyName)).toArray().forEach(x => WScript.Echo(x)); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/ms693013(v=vs.85).aspx +(() => { + const server = getServer(); + + ActiveXObject.on(server, 'OnOutgoingJobAdded', ['pFaxServer', 'bstrJobId'], prm => WScript.Echo('New job added to queue')); + + ActiveXObject.on(server, 'OnOutgoingJobChanged', ['pFaxServer', 'bstrJobId', 'pJobStatus'], prm => { + const status = prm.pJobStatus; + WScript.Echo(` +Available operations: ${status.AvailableOperations} +Caller ID: ${status.CallerId} +CSID: ${status.CSID} +Current page: ${status.CurrentPage} +Device ID: ${status.DeviceId} +Extended status: ${status.ExtendedStatus} +Extended status code: ${status.ExtendedStatusCode} +Job type: ${status.JobType} +Pages: ${status.Pages} +Retries: ${status.Retries} +Routing information: ${status.RoutingInformation} +Scheduled time: ${new Date(status.ScheduledTime)} +Size: ${status.Size} +Status: ${status.Status} +Transmission start: ${new Date(status.TransmissionStart)} +TSID: ${status.TSID} +`.trim()); + + try { + WScript.Echo(`Transmission end: ${new Date(status.TransmissionEnd)}`); + } catch {} + }); + + ActiveXObject.on(server, 'OnServerShutDown', ['pFaxServer'], prm => WScript.Echo('The local fax server has been shut down')); + + server.ListenToServerEvents( + FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetFXSSVC_ENDED + + FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_QUEUE + ); +})(); diff --git a/types/activex-faxcomexlib/index.d.ts b/types/activex-faxcomexlib/index.d.ts new file mode 100644 index 0000000000..237c841fda --- /dev/null +++ b/types/activex-faxcomexlib/index.d.ts @@ -0,0 +1,2053 @@ +// Type definitions for Microsoft Fax Service Extended COM Type Library - FAXCOMEXLib 1.0 +// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684513(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +declare namespace FAXCOMEXLib { + // tslint:disable-next-line no-const-enum + const enum FAX_ACCESS_RIGHTS_ENUM { + farMANAGE_CONFIG = 64, + farMANAGE_IN_ARCHIVE = 256, + farMANAGE_JOBS = 16, + farMANAGE_OUT_ARCHIVE = 1024, + farQUERY_CONFIG = 32, + farQUERY_IN_ARCHIVE = 128, + farQUERY_JOBS = 8, + farQUERY_OUT_ARCHIVE = 512, + farSUBMIT_HIGH = 4, + farSUBMIT_LOW = 1, + farSUBMIT_NORMAL = 2, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_ACCESS_RIGHTS_ENUM_2 { + far2MANAGE_ARCHIVES = 256, + far2MANAGE_CONFIG = 64, + far2MANAGE_OUT_JOBS = 16, + far2MANAGE_RECEIVE_FOLDER = 512, + far2QUERY_ARCHIVES = 128, + far2QUERY_CONFIG = 32, + far2QUERY_OUT_JOBS = 8, + far2SUBMIT_HIGH = 4, + far2SUBMIT_LOW = 1, + far2SUBMIT_NORMAL = 2, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_ACCOUNT_EVENTS_TYPE_ENUM { + faetFXSSVC_ENDED = 16, + faetIN_ARCHIVE = 4, + faetIN_QUEUE = 1, + faetNONE = 0, + faetOUT_ARCHIVE = 8, + faetOUT_QUEUE = 2, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_COVERPAGE_TYPE_ENUM { + fcptLOCAL = 1, + fcptNONE = 0, + fcptSERVER = 2, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_DEVICE_RECEIVE_MODE_ENUM { + fdrmAUTO_ANSWER = 1, + fdrmMANUAL_ANSWER = 2, + fdrmNO_ANSWER = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_GROUP_STATUS_ENUM { + fgsALL_DEV_NOT_VALID = 2, + fgsALL_DEV_VALID = 0, + fgsEMPTY = 1, + fgsSOME_DEV_NOT_VALID = 3, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_JOB_EXTENDED_STATUS_ENUM { + fjesANSWERED = 5, + fjesBAD_ADDRESS = 10, + fjesBUSY = 8, + fjesCALL_ABORTED = 19, + fjesCALL_BLACKLISTED = 14, + fjesCALL_COMPLETED = 18, + fjesCALL_DELAYED = 13, + fjesDIALING = 3, + fjesDISCONNECTED = 1, + fjesFATAL_ERROR = 12, + fjesHANDLED = 17, + fjesINITIALIZING = 2, + fjesLINE_UNAVAILABLE = 7, + fjesNO_ANSWER = 9, + fjesNO_DIAL_TONE = 11, + fjesNONE = 0, + fjesNOT_FAX_CALL = 15, + fjesPARTIALLY_RECEIVED = 16, + fjesPROPRIETARY = 16777216, + fjesRECEIVING = 6, + fjesTRANSMITTING = 4, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_JOB_OPERATIONS_ENUM { + fjoDELETE = 16, + fjoPAUSE = 2, + fjoRECIPIENT_INFO = 32, + fjoRESTART = 8, + fjoRESUME = 4, + fjoSENDER_INFO = 64, + fjoVIEW = 1, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_JOB_STATUS_ENUM { + fjsCANCELED = 512, + fjsCANCELING = 1024, + fjsCOMPLETED = 256, + fjsFAILED = 8, + fjsINPROGRESS = 2, + fjsNOLINE = 32, + fjsPAUSED = 16, + fjsPENDING = 1, + fjsRETRIES_EXCEEDED = 128, + fjsRETRYING = 64, + fjsROUTING = 2048, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_JOB_TYPE_ENUM { + fjtRECEIVE = 1, + fjtROUTING = 2, + fjtSEND = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_LOG_LEVEL_ENUM { + fllMAX = 3, + fllMED = 2, + fllMIN = 1, + fllNONE = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_PRIORITY_TYPE_ENUM { + fptHIGH = 2, + fptLOW = 0, + fptNORMAL = 1, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_PROVIDER_STATUS_ENUM { + fpsBAD_GUID = 2, + fpsBAD_VERSION = 3, + fpsCANT_INIT = 6, + fpsCANT_LINK = 5, + fpsCANT_LOAD = 4, + fpsSERVER_ERROR = 1, + fpsSUCCESS = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_RECEIPT_TYPE_ENUM { + frtMAIL = 1, + frtMSGBOX = 4, + frtNONE = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_ROUTING_RULE_CODE_ENUM { + frrcANY_CODE = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_RULE_STATUS_ENUM { + frsALL_GROUP_DEV_NOT_VALID = 2, + frsBAD_DEVICE = 4, + frsEMPTY_GROUP = 1, + frsSOME_GROUP_DEV_NOT_VALID = 3, + frsVALID = 0, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_SCHEDULE_TYPE_ENUM { + fstDISCOUNT_PERIOD = 2, + fstNOW = 0, + fstSPECIFIC_TIME = 1, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_SERVER_APIVERSION_ENUM { + fsAPI_VERSION_0 = 0, + fsAPI_VERSION_1 = 65536, + fsAPI_VERSION_2 = 131072, + fsAPI_VERSION_3 = 196608, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_SERVER_EVENTS_TYPE_ENUM { + fsetACTIVITY = 8, + fsetCONFIG = 4, + fsetDEVICE_STATUS = 256, + fsetFXSSVC_ENDED = 128, + fsetIN_ARCHIVE = 32, + fsetIN_QUEUE = 1, + fsetINCOMING_CALL = 512, + fsetNONE = 0, + fsetOUT_ARCHIVE = 64, + fsetOUT_QUEUE = 2, + fsetQUEUE_STATE = 16, + } + + // tslint:disable-next-line no-const-enum + const enum FAX_SMTP_AUTHENTICATION_TYPE_ENUM { + fsatANONYMOUS = 0, + fsatBASIC = 1, + fsatNTLM = 2, + } + + // tslint:disable-next-line no-const-enum + const enum FaxConstants { + bstrGROUPNAME_ALLDEVICES = '', + lDEFAULT_PREFETCH_SIZE = 100, + wcharREASSIGN_RECIPIENTS_DELIMITER = 59, + } + + /** FaxAccount Class */ + class FaxAccount { + private 'FAXCOMEXLib.FaxAccount_typekey': FaxAccount; + private constructor(); + + /** Name of the fax account */ + readonly AccountName: string; + + /** Folders belonging to the account */ + readonly Folders: FaxAccountFolders; + + /** Set bit-wise combination of events the fax account listens to */ + ListenToAccountEvents(EventTypes: FAX_ACCOUNT_EVENTS_TYPE_ENUM): void; + + /** Events the fax account is listening to */ + readonly RegisteredEvents: FAX_ACCOUNT_EVENTS_TYPE_ENUM; + } + + /** FaxAccountFolders Class */ + class FaxAccountFolders { + private 'FAXCOMEXLib.FaxAccountFolders_typekey': FaxAccountFolders; + private constructor(); + + /** Incoming archive */ + readonly IncomingArchive: FaxAccountIncomingArchive; + + /** Incoming queue */ + readonly IncomingQueue: FaxAccountIncomingQueue; + + /** Outgoing archive */ + readonly OutgoingArchive: FaxAccountOutgoingArchive; + + /** Outgoing queue */ + readonly OutgoingQueue: FaxAccountOutgoingQueue; + } + + /** FaxAccountIncomingArchive Class */ + class FaxAccountIncomingArchive { + private 'FAXCOMEXLib.FaxAccountIncomingArchive_typekey': FaxAccountIncomingArchive; + private constructor(); + + /** Get an archived message by its ID */ + GetMessage(bstrMessageId: string): IFaxIncomingMessage; + + /** + * Iterator on the archived messages + * @param number [lPrefetchSize=100] + */ + GetMessages(lPrefetchSize?: number): FaxIncomingMessageIterator; + + /** Refresh the object */ + Refresh(): void; + + /** The high 32-bit value of the archive size */ + readonly SizeHigh: number; + + /** The low 32-bit value of the archive size */ + readonly SizeLow: number; + } + + /** FaxAccountIncomingQueue Class */ + class FaxAccountIncomingQueue { + private 'FAXCOMEXLib.FaxAccountIncomingQueue_typekey': FaxAccountIncomingQueue; + private constructor(); + + /** Get incoming job by ID */ + GetJob(bstrJobId: string): FaxIncomingJob; + + /** Collection of incoming jobs */ + GetJobs(): FaxIncomingJobs; + } + + /** FaxAccountOutgoingArchive Class */ + class FaxAccountOutgoingArchive { + private 'FAXCOMEXLib.FaxAccountOutgoingArchive_typekey': FaxAccountOutgoingArchive; + private constructor(); + + /** Get an archived message by its ID */ + GetMessage(bstrMessageId: string): IFaxOutgoingMessage; + + /** + * Iterator on the archived messages + * @param number [lPrefetchSize=100] + */ + GetMessages(lPrefetchSize?: number): FaxOutgoingMessageIterator; + + /** Refresh the object */ + Refresh(): void; + + /** The high 32-bit value of the archive size */ + readonly SizeHigh: number; + + /** The low 32-bit value of the archive size */ + readonly SizeLow: number; + } + + /** FaxAccountOutgoingQueue Class */ + class FaxAccountOutgoingQueue { + private 'FAXCOMEXLib.FaxAccountOutgoingQueue_typekey': FaxAccountOutgoingQueue; + private constructor(); + + /** Get outgoing job by ID */ + GetJob(bstrJobId: string): IFaxOutgoingJob; + + /** Collection of outgoing jobs */ + GetJobs(): FaxOutgoingJobs; + } + + /** FaxAccounts Class */ + class FaxAccounts { + private 'FAXCOMEXLib.FaxAccounts_typekey': FaxAccounts; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxAccount; + } + + /** FaxAccountSet Class */ + class FaxAccountSet { + private 'FAXCOMEXLib.FaxAccountSet_typekey': FaxAccountSet; + private constructor(); + + /** Adds a fax account */ + AddAccount(bstrAccountName: string): FaxAccount; + + /** Get fax account by name */ + GetAccount(bstrAccountName: string): FaxAccount; + + /** Collection of fax accounts */ + GetAccounts(): FaxAccounts; + + /** Removes a fax account by name */ + RemoveAccount(bstrAccountName: string): void; + } + + /** FaxActivity Class */ + class FaxActivity { + private 'FAXCOMEXLib.FaxActivity_typekey': FaxActivity; + private constructor(); + + /** Number of incoming messages */ + readonly IncomingMessages: number; + + /** Number of outgoing messages */ + readonly OutgoingMessages: number; + + /** Number of queued messages */ + readonly QueuedMessages: number; + + /** Refresh the object */ + Refresh(): void; + + /** Number of routed incoming messages */ + readonly RoutingMessages: number; + } + + /** FaxActivityLogging Class */ + class FaxActivityLogging { + private 'FAXCOMEXLib.FaxActivityLogging_typekey': FaxActivityLogging; + private constructor(); + + /** Activity log database files path */ + DatabasePath: string; + + /** Does the server log incoming fax activity */ + LogIncoming: boolean; + + /** Does the server log outgoing fax activity */ + LogOutgoing: boolean; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxConfiguration Class */ + class FaxConfiguration { + private 'FAXCOMEXLib.FaxConfiguration_typekey': FaxConfiguration; + private constructor(); + + /** Are personal cover pages allowed */ + AllowPersonalCoverPages: boolean; + + /** Indicates how long the fax message is kept on the server */ + ArchiveAgeLimit: number; + + /** Location of the archive on the server */ + ArchiveLocation: string; + + /** The high 32-bit value of the archive size */ + readonly ArchiveSizeHigh: number; + + /** The low 32-bit value of the archive size */ + readonly ArchiveSizeLow: number; + + /** Does the server auto-create fax account on connect */ + AutoCreateAccountOnConnect: boolean; + + /** Does the server generate a brand */ + Branding: boolean; + + /** End of the discount rate period */ + DiscountRateEnd: VarDate; + + /** Start of the discount rate period */ + DiscountRateStart: VarDate; + + /** High quota water mark */ + HighQuotaWaterMark: number; + + /** Are incoming faxes viewable by everyone */ + IncomingFaxesArePublic: boolean; + + /** Is queue blocked for incoming faxes */ + IncomingQueueBlocked: boolean; + + /** Low quota water mark */ + LowQuotaWaterMark: number; + + /** How long the failed fax job is kept on the server */ + OutgoingQueueAgeLimit: number; + + /** Is queue blocked for outgoing faxes */ + OutgoingQueueBlocked: boolean; + + /** Is queue paused for outgoing faxes */ + OutgoingQueuePaused: boolean; + + /** Refresh the object */ + Refresh(): void; + + /** Number of retries */ + Retries: number; + + /** Retry delay */ + RetryDelay: number; + + /** Save the object */ + Save(): void; + + /** Is size quota warning on */ + SizeQuotaWarning: boolean; + + /** Whether faxes should be archived */ + UseArchive: boolean; + + /** Is device Transmitting Station ID used */ + UseDeviceTSID: boolean; + } + + /** FaxDevice Class */ + class FaxDevice { + private 'FAXCOMEXLib.FaxDevice_typekey': FaxDevice; + private constructor(); + + /** Answer the call */ + AnswerCall(): void; + + /** Device's Called Station ID */ + CSID: string; + + /** Description of the device */ + Description: string; + + /** Device name */ + readonly DeviceName: string; + + /** Get the device level extention property */ + GetExtensionProperty(bstrGUID: string): SafeArray; + + /** Unique device ID */ + readonly Id: number; + + /** Is the device is turned off */ + readonly PoweredOff: boolean; + + /** Device provider */ + readonly ProviderUniqueName: string; + + /** The receive mode of the device */ + ReceiveMode: FAX_DEVICE_RECEIVE_MODE_ENUM; + + /** Is the device receiving now */ + readonly ReceivingNow: boolean; + + /** Refresh the object */ + Refresh(): void; + + /** Is the device ringing now */ + readonly RingingNow: boolean; + + /** Number of rings before the device answers */ + RingsBeforeAnswer: number; + + /** Save the object */ + Save(): void; + + /** Is the device is enabled to send */ + SendEnabled: boolean; + + /** Is the device sending now */ + readonly SendingNow: boolean; + + /** Set the device level extention property */ + SetExtensionProperty(bstrGUID: string, vProperty: SafeArray): void; + + /** Device's Transmitting Station ID */ + TSID: string; + + /** Array of routing methods GUIDs */ + readonly UsedRoutingMethods: SafeArray; + + /** Adds or removes routing method */ + UseRoutingMethod(bstrMethodGUID: string, bUse: boolean): void; + } + + /** FaxDeviceIds Class */ + class FaxDeviceIds { + private 'FAXCOMEXLib.FaxDeviceIds_typekey': FaxDeviceIds; + private constructor(); + + /** Add a device */ + Add(lDeviceId: number): void; + readonly Count: number; + Item(lIndex: number): number; + + /** Remove a device */ + Remove(lIndex: number): void; + + /** Set order of the device */ + SetOrder(lDeviceId: number, lNewOrder: number): void; + } + + /** FaxDeviceProvider Class */ + class FaxDeviceProvider { + private 'FAXCOMEXLib.FaxDeviceProvider_typekey': FaxDeviceProvider; + private constructor(); + + /** Is device provider built in debug environment */ + readonly Debug: boolean; + + /** Array of device IDs exposed by the provider */ + readonly DeviceIds: SafeArray; + + /** Provider's friendly name */ + readonly FriendlyName: string; + + /** Full path and file name of the provider DLL */ + readonly ImageName: string; + + /** Last error code at load or initialization */ + readonly InitErrorCode: number; + + /** The major part of the device provider's build number */ + readonly MajorBuild: number; + + /** The major part of the device provider's version number */ + readonly MajorVersion: number; + + /** The minor part of the device provider's build number */ + readonly MinorBuild: number; + + /** The minor part of the device provider's version number */ + readonly MinorVersion: number; + + /** Status of the device provider */ + readonly Status: FAX_PROVIDER_STATUS_ENUM; + + /** TSP name used by the provider */ + readonly TapiProviderName: string; + + /** Unique name of the provider */ + readonly UniqueName: string; + } + + /** FaxDeviceProviders Class */ + class FaxDeviceProviders { + private 'FAXCOMEXLib.FaxDeviceProviders_typekey': FaxDeviceProviders; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxDeviceProvider; + } + + /** FaxDevices Class */ + class FaxDevices { + private 'FAXCOMEXLib.FaxDevices_typekey': FaxDevices; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxDevice; + + /** Get device by its ID */ + ItemById(lId: number): FaxDevice; + } + + /** FaxDocument Class */ + class FaxDocument { + private 'FAXCOMEXLib.FaxDocument_typekey': FaxDocument; + private constructor(); + + /** Whether to attach a fax to the receipt */ + AttachFaxToReceipt: boolean; + + /** Full paths to the fax document body files */ + Bodies: any; + + /** Full path to the fax document body file */ + Body: string; + + /** Call handle */ + CallHandle: number; + + /** Submit the fax document on the already connected server */ + ConnectedSubmit(pFaxServer: IFaxServer): any; + + /** Submit the fax document on the already connected server */ + ConnectedSubmit2(pFaxServer: IFaxServer, pvFaxOutgoingJobIDs: any): number; + + /** Cover page file path */ + CoverPage: string; + + /** Is server, local, or no cover page used */ + CoverPageType: FAX_COVERPAGE_TYPE_ENUM; + + /** The document name */ + DocumentName: string; + + /** Whether to group the broadcast receipts */ + GroupBroadcastReceipts: boolean; + + /** Contents of cover page note field */ + Note: string; + + /** Priority of the fax */ + Priority: FAX_PRIORITY_TYPE_ENUM; + + /** Address of the receipt */ + ReceiptAddress: string; + + /** Type of the receipt */ + ReceiptType: FAX_RECEIPT_TYPE_ENUM; + + /** Collection of recipients */ + readonly Recipients: FaxRecipients; + + /** Time to send the fax */ + ScheduleTime: VarDate; + + /** When to send the fax */ + ScheduleType: FAX_SCHEDULE_TYPE_ENUM; + + /** Sender information object */ + readonly Sender: FaxSender; + + /** Contents of cover page subject field */ + Subject: string; + + /** Submission Id for the Fax document */ + readonly SubmissionId: string; + + /** Connect to server, submit the fax document, disconnect */ + Submit(bstrFaxServerName: string): SafeArray; + + /** Connect to server, submit the fax document, disconnect */ + Submit2(bstrFaxServerName: string, pvFaxOutgoingJobIDs: any): number; + + /** Tapi connection */ + TapiConnection: any; + } + + /** FaxEventLogging Class */ + class FaxEventLogging { + private 'FAXCOMEXLib.FaxEventLogging_typekey': FaxEventLogging; + private constructor(); + + /** Detail level of event logs for general (other) events */ + GeneralEventsLevel: FAX_LOG_LEVEL_ENUM; + + /** Detail level of event logs for inbound fax events */ + InboundEventsLevel: FAX_LOG_LEVEL_ENUM; + + /** Detail level of event logs for initialization events */ + InitEventsLevel: FAX_LOG_LEVEL_ENUM; + + /** Detail level of event logs for outbound fax events */ + OutboundEventsLevel: FAX_LOG_LEVEL_ENUM; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxFolders Class */ + class FaxFolders { + private 'FAXCOMEXLib.FaxFolders_typekey': FaxFolders; + private constructor(); + + /** Incoming archive */ + readonly IncomingArchive: FaxIncomingArchive; + + /** Incoming queue */ + readonly IncomingQueue: FaxIncomingQueue; + + /** Outgoing archive */ + readonly OutgoingArchive: FaxOutgoingArchive; + + /** Outgoing queue */ + readonly OutgoingQueue: FaxOutgoingQueue; + } + + /** FaxInboundRouting Class */ + class FaxInboundRouting { + private 'FAXCOMEXLib.FaxInboundRouting_typekey': FaxInboundRouting; + private constructor(); + + /** Registered inbound routing extensions collection */ + GetExtensions(): FaxInboundRoutingExtensions; + + /** Ordered collection of all the registered methods */ + GetMethods(): FaxInboundRoutingMethods; + } + + /** FaxInboundRoutingExtension Class */ + class FaxInboundRoutingExtension { + private 'FAXCOMEXLib.FaxInboundRoutingExtension_typekey': FaxInboundRoutingExtension; + private constructor(); + + /** Is extension built in debug environment */ + readonly Debug: boolean; + + /** Extension's friendly name */ + readonly FriendlyName: string; + + /** Full path and file name of the extension DLL */ + readonly ImageName: string; + + /** Last error code at load or initialization */ + readonly InitErrorCode: number; + + /** The major part of extension's build number */ + readonly MajorBuild: number; + + /** The major part of extension's version number */ + readonly MajorVersion: number; + + /** Array of methods exposed by extension */ + readonly Methods: any; + + /** The minor part of extension's build number */ + readonly MinorBuild: number; + + /** The minor part of extension's version number */ + readonly MinorVersion: number; + + /** Load and initialization status of the extension */ + readonly Status: FAX_PROVIDER_STATUS_ENUM; + + /** Extension's unique name */ + readonly UniqueName: string; + } + + /** FaxInboundRoutingExtensions Class */ + class FaxInboundRoutingExtensions { + private 'FAXCOMEXLib.FaxInboundRoutingExtensions_typekey': FaxInboundRoutingExtensions; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxInboundRoutingExtension; + } + + /** FaxInboundRoutingMethod Class */ + class FaxInboundRoutingMethod { + private 'FAXCOMEXLib.FaxInboundRoutingMethod_typekey': FaxInboundRoutingMethod; + private constructor(); + + /** Friendly name of the extension exposing this method */ + readonly ExtensionFriendlyName: string; + + /** Image name of the extension exposing this method */ + readonly ExtensionImageName: string; + + /** Internal function name */ + readonly FunctionName: string; + + /** GUID of the method */ + readonly GUID: string; + + /** The name of the method */ + readonly Name: string; + + /** Priority of the method */ + Priority: number; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxInboundRoutingMethods Class */ + class FaxInboundRoutingMethods { + private 'FAXCOMEXLib.FaxInboundRoutingMethods_typekey': FaxInboundRoutingMethods; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxInboundRoutingMethod; + } + + /** FaxIncomingArchive Class */ + class FaxIncomingArchive { + private 'FAXCOMEXLib.FaxIncomingArchive_typekey': FaxIncomingArchive; + private constructor(); + + /** How long the fax message is kept on the Server */ + AgeLimit: number; + + /** Location of the archive folder on the server */ + ArchiveFolder: string; + + /** Get archived message by its ID */ + GetMessage(bstrMessageId: string): IFaxIncomingMessage; + + /** + * Iterator on the archived messages + * @param number [lPrefetchSize=100] + */ + GetMessages(lPrefetchSize?: number): FaxIncomingMessageIterator; + + /** High quota water mark */ + HighQuotaWaterMark: number; + + /** Low quota water mark */ + LowQuotaWaterMark: number; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + + /** The high 32-bit value of the archive size */ + readonly SizeHigh: number; + + /** The low 32-bit value of the archive size */ + readonly SizeLow: number; + + /** Is size quota warning on */ + SizeQuotaWarning: boolean; + + /** Whether received faxes should be archived */ + UseArchive: boolean; + } + + /** FaxIncomingJob Class */ + class FaxIncomingJob { + private 'FAXCOMEXLib.FaxIncomingJob_typekey': FaxIncomingJob; + private constructor(); + + /** Available operations, a bit-wise combination of FAX_JOB_OPERATIONS values */ + readonly AvailableOperations: FAX_JOB_OPERATIONS_ENUM; + + /** Caller ID */ + readonly CallerId: string; + + /** Cancel the incoming job */ + Cancel(): void; + + /** Copy TIFF image to the local file */ + CopyTiff(bstrTiffPath: string): void; + + /** Called Station ID */ + readonly CSID: string; + + /** Page currently in transmision */ + readonly CurrentPage: number; + + /** Device ID that transmits the job */ + readonly DeviceId: number; + + /** Extended status description */ + readonly ExtendedStatus: string; + + /** Code of the job's extended status */ + readonly ExtendedStatusCode: FAX_JOB_EXTENDED_STATUS_ENUM; + + /** Unique message ID */ + readonly Id: string; + + /** Job type */ + readonly JobType: FAX_JOB_TYPE_ENUM; + + /** Refresh the object */ + Refresh(): void; + + /** Number of failed transmission retries */ + readonly Retries: number; + + /** Routing information */ + readonly RoutingInformation: string; + + /** Size in bytes of the message's TIFF file */ + readonly Size: number; + + /** Current queue status of the job, a bit-wise combination of FAX_JOB_STATUS values */ + readonly Status: FAX_JOB_STATUS_ENUM; + + /** Transmission end time */ + readonly TransmissionEnd: VarDate; + + /** Transmission start time */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** FaxIncomingJobs Class */ + class FaxIncomingJobs { + private 'FAXCOMEXLib.FaxIncomingJobs_typekey': FaxIncomingJobs; + private constructor(); + readonly Count: number; + Item(vIndex: any): FaxIncomingJob; + } + + /** FaxIncomingMessage Class */ + class FaxIncomingMessage extends IFaxIncomingMessage { + private 'FAXCOMEXLib.FaxIncomingMessage_typekey': FaxIncomingMessage; + private constructor(); + + /** Has Cover page */ + HasCoverPage: boolean; + + /** Read flag on the message */ + Read: boolean; + + /** Reassigns the message */ + ReAssign(): void; + + /** Set of recipient names */ + Recipients: string; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + + /** Sender's fax number */ + SenderFaxNumber: string; + + /** Sender's name */ + SenderName: string; + + /** Contents of cover page subject field */ + Subject: string; + + /** Is message reassigned? */ + readonly WasReAssigned: boolean; + } + + /** FaxIncomingMessageIterator Class */ + class FaxIncomingMessageIterator { + private 'FAXCOMEXLib.FaxIncomingMessageIterator_typekey': FaxIncomingMessageIterator; + private constructor(); + + /** End of archive marker */ + readonly AtEOF: boolean; + + /** The current message */ + readonly Message: IFaxIncomingMessage; + + /** Move to the first message in the archive */ + MoveFirst(): void; + + /** Move to the next message in the archive */ + MoveNext(): void; + + /** Size of the prefetch buffer */ + PrefetchSize: number; + } + + /** FaxIncomingQueue Class */ + class FaxIncomingQueue { + private 'FAXCOMEXLib.FaxIncomingQueue_typekey': FaxIncomingQueue; + private constructor(); + + /** Is queue blocked */ + Blocked: boolean; + + /** Get incoming job by ID */ + GetJob(bstrJobId: string): FaxIncomingJob; + + /** Collection of incoming jobs */ + GetJobs(): FaxIncomingJobs; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxJobStatus Class */ + class FaxJobStatus { + private 'FAXCOMEXLib.FaxJobStatus_typekey': FaxJobStatus; + private constructor(); + + /** Available operations, a bit-wise combination of FAX_JOB_OPERATIONS values */ + readonly AvailableOperations: FAX_JOB_OPERATIONS_ENUM; + + /** Caller ID */ + readonly CallerId: string; + + /** Called Station ID */ + readonly CSID: string; + + /** Page currently in transmision */ + readonly CurrentPage: number; + + /** Device ID of device that transmits the job */ + readonly DeviceId: number; + + /** Extended status description */ + readonly ExtendedStatus: string; + + /** Code of the job's extended status */ + readonly ExtendedStatusCode: FAX_JOB_EXTENDED_STATUS_ENUM; + + /** Job type */ + readonly JobType: FAX_JOB_TYPE_ENUM; + + /** Total number of pages */ + readonly Pages: number; + + /** Number of failed transmission retries */ + readonly Retries: number; + + /** Routing information */ + readonly RoutingInformation: string; + + /** The time the fax job is scheduled to be transmitted */ + readonly ScheduledTime: VarDate; + + /** Size in bytes of TIFF file */ + readonly Size: number; + + /** Current queue status of the job, a bit-wise combination of FAX_JOB_STATUS values */ + readonly Status: FAX_JOB_STATUS_ENUM; + + /** The time the fax job finished its transmission */ + readonly TransmissionEnd: VarDate; + + /** The time the fax job started its transmission */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** FaxLoggingOptions Class */ + class FaxLoggingOptions { + private 'FAXCOMEXLib.FaxLoggingOptions_typekey': FaxLoggingOptions; + private constructor(); + + /** Activity logging configuration object */ + readonly ActivityLogging: FaxActivityLogging; + + /** Event logging configuration object */ + readonly EventLogging: FaxEventLogging; + } + + /** FaxOutboundRouting Class */ + class FaxOutboundRouting { + private 'FAXCOMEXLib.FaxOutboundRouting_typekey': FaxOutboundRouting; + private constructor(); + + /** Configuration of the outbound routing groups */ + GetGroups(): FaxOutboundRoutingGroups; + + /** Configuration of the outbound routing rules */ + GetRules(): FaxOutboundRoutingRules; + } + + /** FaxOutboundRoutingGroup Class */ + class FaxOutboundRoutingGroup { + private 'FAXCOMEXLib.FaxOutboundRoutingGroup_typekey': FaxOutboundRoutingGroup; + private constructor(); + + /** Ordered collection of device IDs */ + readonly DeviceIds: FaxDeviceIds; + + /** Name of the group */ + readonly Name: string; + + /** Status of the group */ + readonly Status: FAX_GROUP_STATUS_ENUM; + } + + /** FaxOutboundRoutingGroups Class */ + class FaxOutboundRoutingGroups { + private 'FAXCOMEXLib.FaxOutboundRoutingGroups_typekey': FaxOutboundRoutingGroups; + private constructor(); + + /** Add a group */ + Add(bstrName: string): FaxOutboundRoutingGroup; + readonly Count: number; + Item(vIndex: number | string): FaxOutboundRoutingGroup; + + /** Remove a group */ + Remove(vIndex: number | string): void; + } + + /** FaxOutboundRoutingRule Class */ + class FaxOutboundRoutingRule { + private 'FAXCOMEXLib.FaxOutboundRoutingRule_typekey': FaxOutboundRoutingRule; + private constructor(); + + /** Area code */ + readonly AreaCode: number; + + /** Country code */ + readonly CountryCode: number; + + /** Destination device */ + DeviceId: number; + + /** Group name */ + GroupName: string; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + + /** Status */ + readonly Status: FAX_RULE_STATUS_ENUM; + + /** Uses single device or group */ + UseDevice: boolean; + } + + /** FaxOutboundRoutingRules Class */ + class FaxOutboundRoutingRules { + private 'FAXCOMEXLib.FaxOutboundRoutingRules_typekey': FaxOutboundRoutingRules; + private constructor(); + + /** Add a rule */ + Add(lCountryCode: number, lAreaCode: number, bUseDevice: boolean, bstrGroupName: string, lDeviceId: number): FaxOutboundRoutingRule; + readonly Count: number; + Item(lIndex: number): FaxOutboundRoutingRule; + + /** Get a rule by criteria */ + ItemByCountryAndArea(lCountryCode: number, lAreaCode: number): FaxOutboundRoutingRule; + + /** Remove a rule */ + Remove(lIndex: number): void; + + /** Remove a rule by criteria */ + RemoveByCountryAndArea(lCountryCode: number, lAreaCode: number): void; + } + + /** FaxOutgoingArchive Class */ + class FaxOutgoingArchive { + private 'FAXCOMEXLib.FaxOutgoingArchive_typekey': FaxOutgoingArchive; + private constructor(); + + /** Indicates how long the fax message is kept on the server */ + AgeLimit: number; + + /** Location of the outgoing archive on the server */ + ArchiveFolder: string; + + /** Get an archived message by its ID */ + GetMessage(bstrMessageId: string): IFaxOutgoingMessage; + + /** + * Iterator on the archived messages + * @param number [lPrefetchSize=100] + */ + GetMessages(lPrefetchSize?: number): FaxOutgoingMessageIterator; + + /** High quota water mark */ + HighQuotaWaterMark: number; + + /** Low quota water mark */ + LowQuotaWaterMark: number; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + + /** The high 32-bit value of the archive size */ + readonly SizeHigh: number; + + /** The low 32-bit value of the archive size */ + readonly SizeLow: number; + + /** Is the size quota warning on or off */ + SizeQuotaWarning: boolean; + + /** Whether sent faxes should be archived */ + UseArchive: boolean; + } + + /** FaxOutgoingJob Class */ + class FaxOutgoingJob { + private 'FAXCOMEXLib.FaxOutgoingJob_typekey': FaxOutgoingJob; + private constructor(); + + /** Available operations, a bit-wise combination of FAX_JOB_OPERATIONS values */ + readonly AvailableOperations: FAX_JOB_OPERATIONS_ENUM; + + /** Cancel the outbound job */ + Cancel(): void; + + /** Copy the job's TIFF image */ + CopyTiff(bstrTiffPath: string): void; + + /** Called Station ID */ + readonly CSID: string; + + /** Page currently in transmision */ + readonly CurrentPage: number; + + /** Device ID that transmits the job */ + readonly DeviceId: number; + + /** Document's friendly name */ + readonly DocumentName: string; + + /** Extended status description */ + readonly ExtendedStatus: string; + + /** Code of the job's extended status */ + readonly ExtendedStatusCode: FAX_JOB_EXTENDED_STATUS_ENUM; + + /** Whether to group broadcast receipts */ + readonly GroupBroadcastReceipts: boolean; + + /** Has Cover page */ + readonly HasCoverPage: boolean; + + /** Unique job ID */ + readonly Id: string; + + /** Time the job was originally scheduled to be transmitted */ + readonly OriginalScheduledTime: VarDate; + + /** Total number of pages */ + readonly Pages: number; + + /** Pause the outbound job */ + Pause(): void; + + /** Priority of the fax */ + readonly Priority: FAX_PRIORITY_TYPE_ENUM; + + /** Address of the receipt */ + readonly ReceiptAddress: string; + + /** Type of receipt */ + readonly ReceiptType: FAX_RECEIPT_TYPE_ENUM; + + /** Recipient information object */ + readonly Recipient: FaxRecipient; + + /** Refresh the object */ + Refresh(): void; + + /** Restart the outbound job */ + Restart(): void; + + /** Resume the outbound job */ + Resume(): void; + + /** Number of failed transmission retries */ + readonly Retries: number; + + /** The time the fax job is scheduled to be transmitted */ + readonly ScheduledTime: VarDate; + + /** When to send the fax */ + readonly ScheduleType: FAX_SCHEDULE_TYPE_ENUM; + + /** Sender information object */ + readonly Sender: FaxSender; + + /** Size in bytes of TIFF file */ + readonly Size: number; + + /** Current queue status of the job */ + readonly Status: FAX_JOB_STATUS_ENUM; + + /** Cover page's subject field */ + readonly Subject: string; + + /** Unique ID the submission process created for the Job */ + readonly SubmissionId: string; + + /** Time the job was submitted */ + readonly SubmissionTime: VarDate; + + /** The time the fax job finished its transmission */ + readonly TransmissionEnd: VarDate; + + /** The time the fax job started its transmission */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** FaxOutgoingJobs Class */ + class FaxOutgoingJobs { + private 'FAXCOMEXLib.FaxOutgoingJobs_typekey': FaxOutgoingJobs; + private constructor(); + readonly Count: number; + Item(vIndex: any): IFaxOutgoingJob; + } + + /** FaxOutgoingMessage Class */ + class FaxOutgoingMessage extends IFaxOutgoingMessage { + private 'FAXCOMEXLib.FaxOutgoingMessage_typekey': FaxOutgoingMessage; + private constructor(); + + /** Copy Tiff image to the local file */ + CopyTiff(bstrTiffPath: string): void; + + /** Has Cover page */ + readonly HasCoverPage: boolean; + + /** Read flag on the message */ + Read: boolean; + + /** Address of the receipt */ + readonly ReceiptAddress: string; + + /** Type of the receipt */ + readonly ReceiptType: FAX_RECEIPT_TYPE_ENUM; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxOutgoingMessageIterator Class */ + class FaxOutgoingMessageIterator { + private 'FAXCOMEXLib.FaxOutgoingMessageIterator_typekey': FaxOutgoingMessageIterator; + private constructor(); + + /** End of archive marker */ + readonly AtEOF: boolean; + + /** Current message */ + readonly Message: IFaxOutgoingMessage; + + /** Move to the first message */ + MoveFirst(): void; + + /** Move to the next message */ + MoveNext(): void; + + /** Size of prefetch buffer */ + PrefetchSize: number; + } + + /** FaxOutgoingQueue Class */ + class FaxOutgoingQueue { + private 'FAXCOMEXLib.FaxOutgoingQueue_typekey': FaxOutgoingQueue; + private constructor(); + + /** How long the failed fax message is kept on the server */ + AgeLimit: number; + + /** Are personal cover pages allowed */ + AllowPersonalCoverPages: boolean; + + /** Is the queue blocked */ + Blocked: boolean; + + /** Does the server generate a brand */ + Branding: boolean; + + /** End of the discount rate period */ + DiscountRateEnd: VarDate; + + /** Start of the discount rate period */ + DiscountRateStart: VarDate; + + /** Outgoing job by ID */ + GetJob(bstrJobId: string): IFaxOutgoingJob; + + /** Collection of outgoing jobs */ + GetJobs(): FaxOutgoingJobs; + + /** Is the queue paused */ + Paused: boolean; + + /** Refresh the object */ + Refresh(): void; + + /** Number of retries */ + Retries: number; + + /** Retry delay */ + RetryDelay: number; + + /** Save the object */ + Save(): void; + + /** Is device Transmitting Station ID used */ + UseDeviceTSID: boolean; + } + + /** FaxReceiptOptions Class */ + class FaxReceiptOptions { + private 'FAXCOMEXLib.FaxReceiptOptions_typekey': FaxReceiptOptions; + private constructor(); + + /** Allowed receipt types, a bit-wise combination of FAX_RECEIPT_TYPE values */ + AllowedReceipts: FAX_RECEIPT_TYPE_ENUM; + + /** Authentication type used by server */ + AuthenticationType: FAX_SMTP_AUTHENTICATION_TYPE_ENUM; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + + /** SMTP password */ + SMTPPassword: string; + + /** SMTP port number */ + SMTPPort: number; + + /** SMTP sender e-mail address */ + SMTPSender: string; + + /** Name of the SMTP server */ + SMTPServer: string; + + /** SMTP user name */ + SMTPUser: string; + + /** Whether to use the IFaxReceiptOptions settings for MS routing extension */ + UseForInboundRouting: boolean; + } + + /** FaxRecipient Class */ + class FaxRecipient { + private 'FAXCOMEXLib.FaxRecipient_typekey': FaxRecipient; + private constructor(); + + /** Recipient's fax number */ + FaxNumber: string; + + /** Recipient's name */ + Name: string; + } + + /** FaxRecipients Class */ + class FaxRecipients { + private 'FAXCOMEXLib.FaxRecipients_typekey': FaxRecipients; + private constructor(); + + /** + * Add a recipient + * @param string [bstrRecipientName=''] + */ + Add(bstrFaxNumber: string, bstrRecipientName?: string): FaxRecipient; + readonly Count: number; + Item(lIndex: number): FaxRecipient; + + /** Remove a recipient */ + Remove(lIndex: number): void; + } + + /** FaxSecurity Class */ + class FaxSecurity { + private 'FAXCOMEXLib.FaxSecurity_typekey': FaxSecurity; + private constructor(); + + /** Security descriptor */ + Descriptor: any; + + /** Granted rights, a bit-wise combination of FAX_ACCESS_RIGHTS values */ + readonly GrantedRights: FAX_ACCESS_RIGHTS_ENUM; + + /** Security Information Type */ + InformationType: number; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxSecurity2 Class */ + class FaxSecurity2 { + private 'FAXCOMEXLib.FaxSecurity2_typekey': FaxSecurity2; + private constructor(); + + /** Security descriptor */ + Descriptor: any; + + /** Granted rights, a bit-wise combination */ + readonly GrantedRights: FAX_ACCESS_RIGHTS_ENUM_2; + + /** Security Information Type */ + InformationType: number; + + /** Refresh the object */ + Refresh(): void; + + /** Save the object */ + Save(): void; + } + + /** FaxSender Class */ + class FaxSender { + private 'FAXCOMEXLib.FaxSender_typekey': FaxSender; + private constructor(); + + /** Sender's billing code */ + BillingCode: string; + + /** City */ + City: string; + + /** Sender's company */ + Company: string; + + /** Sender's country or region */ + Country: string; + + /** Sender's department */ + Department: string; + + /** Sender's e-mail address */ + Email: string; + + /** Sender's fax number */ + FaxNumber: string; + + /** Sender's home phone */ + HomePhone: string; + + /** Load default sender */ + LoadDefaultSender(): void; + + /** Sender's name */ + Name: string; + + /** Sender's office location */ + OfficeLocation: string; + + /** Sender's office phone */ + OfficePhone: string; + + /** Save default sender */ + SaveDefaultSender(): void; + + /** Sender's state */ + State: string; + + /** Sender's street address */ + StreetAddress: string; + + /** Sender's title */ + Title: string; + + /** Transmitting Station ID */ + TSID: string; + + /** Sender's zip code */ + ZipCode: string; + } + + /** FaxServer Class */ + class FaxServer extends IFaxServer { + private 'FAXCOMEXLib.FaxServer_typekey': FaxServer; + private constructor(); + + /** Fax server configuration */ + readonly Configuration: FaxConfiguration; + + /** FaxAccount for the current connection */ + readonly CurrentAccount: FaxAccount; + + /** The FaxAccountSet configuration object */ + readonly FaxAccountSet: FaxAccountSet; + + /** The security configuration object */ + readonly Security2: FaxSecurity2; + } + + /** IFaxIncomingMessage interface */ + class IFaxIncomingMessage { + /** Caller ID */ + readonly CallerId: string; + + /** Copy Tiff image to the local file */ + CopyTiff(bstrTiffPath: string): void; + + /** Called Station ID */ + readonly CSID: string; + + /** Delete the message from the archive */ + Delete(): void; + + /** Name of the device that received the message */ + readonly DeviceName: string; + + /** Unique message ID */ + readonly Id: string; + + /** Total number of pages */ + readonly Pages: number; + + /** Number of failed routing retries */ + readonly Retries: number; + + /** Routing information */ + readonly RoutingInformation: string; + + /** Size in bytes of the message's TIFF file */ + readonly Size: number; + + /** Transmission end time */ + readonly TransmissionEnd: VarDate; + + /** Transmission start time */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** IFaxOutgoingJob interface */ + class IFaxOutgoingJob { + private 'FAXCOMEXLib.IFaxOutgoingJob_typekey': IFaxOutgoingJob; + private constructor(); + + /** Available operations, a bit-wise combination of FAX_JOB_OPERATIONS values */ + readonly AvailableOperations: FAX_JOB_OPERATIONS_ENUM; + + /** Cancel the outbound job */ + Cancel(): void; + + /** Copy the job's TIFF image */ + CopyTiff(bstrTiffPath: string): void; + + /** Called Station ID */ + readonly CSID: string; + + /** Page currently in transmision */ + readonly CurrentPage: number; + + /** Device ID that transmits the job */ + readonly DeviceId: number; + + /** Document's friendly name */ + readonly DocumentName: string; + + /** Extended status description */ + readonly ExtendedStatus: string; + + /** Code of the job's extended status */ + readonly ExtendedStatusCode: FAX_JOB_EXTENDED_STATUS_ENUM; + + /** Whether to group broadcast receipts */ + readonly GroupBroadcastReceipts: boolean; + + /** Unique job ID */ + readonly Id: string; + + /** Time the job was originally scheduled to be transmitted */ + readonly OriginalScheduledTime: VarDate; + + /** Total number of pages */ + readonly Pages: number; + + /** Pause the outbound job */ + Pause(): void; + + /** Priority of the fax */ + readonly Priority: FAX_PRIORITY_TYPE_ENUM; + + /** Type of receipt */ + readonly ReceiptType: FAX_RECEIPT_TYPE_ENUM; + + /** Recipient information object */ + readonly Recipient: FaxRecipient; + + /** Refresh the object */ + Refresh(): void; + + /** Restart the outbound job */ + Restart(): void; + + /** Resume the outbound job */ + Resume(): void; + + /** Number of failed transmission retries */ + readonly Retries: number; + + /** The time the fax job is scheduled to be transmitted */ + readonly ScheduledTime: VarDate; + + /** Sender information object */ + readonly Sender: FaxSender; + + /** Size in bytes of TIFF file */ + readonly Size: number; + + /** Current queue status of the job */ + readonly Status: FAX_JOB_STATUS_ENUM; + + /** Cover page's subject field */ + readonly Subject: string; + + /** Unique ID the submission process created for the Job */ + readonly SubmissionId: string; + + /** Time the job was submitted */ + readonly SubmissionTime: VarDate; + + /** The time the fax job finished its transmission */ + readonly TransmissionEnd: VarDate; + + /** The time the fax job started its transmission */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** IFaxOutgoingMessage interface */ + class IFaxOutgoingMessage { + /** Copy Tiff image to the local file */ + CopyTiff(bstrTiffPath: string): void; + + /** Called Station ID */ + readonly CSID: string; + + /** Delete the message from the archive */ + Delete(): void; + + /** Name of the device transmitting the message */ + readonly DeviceName: string; + + /** Document's friendly name */ + readonly DocumentName: string; + + /** Unique message ID */ + readonly Id: string; + + /** Time the job was originally scheduled to be transmitted */ + readonly OriginalScheduledTime: VarDate; + + /** Total number of pages */ + readonly Pages: number; + + /** Priority of the fax */ + readonly Priority: FAX_PRIORITY_TYPE_ENUM; + + /** Recipient information object */ + readonly Recipient: FaxRecipient; + + /** Number of failed routing retries */ + readonly Retries: number; + + /** Sender information object */ + readonly Sender: FaxSender; + + /** Size in bytes of TIFF file */ + readonly Size: number; + + /** Cover page's subject field */ + readonly Subject: string; + + /** Unique ID the submission process created for the job */ + readonly SubmissionId: string; + + /** Time the job was submitted */ + readonly SubmissionTime: VarDate; + + /** Transmission end time */ + readonly TransmissionEnd: VarDate; + + /** Transmission start time */ + readonly TransmissionStart: VarDate; + + /** Transmitting Station ID */ + readonly TSID: string; + } + + /** IFaxServer interface */ + class IFaxServer { + /** The fax server activity status object */ + readonly Activity: FaxActivity; + + /** Version of the fax server API */ + readonly APIVersion: FAX_SERVER_APIVERSION_ENUM; + + /** Connect to the fax server */ + Connect(bstrServerName: string): void; + + /** Is fax server built in debug environment */ + readonly Debug: boolean; + + /** Disconnect from the fax server */ + Disconnect(): void; + + /** The fax folders object */ + readonly Folders: FaxFolders; + + /** The collection of device providers */ + GetDeviceProviders(): FaxDeviceProviders; + + /** The collection of all available devices */ + GetDevices(): FaxDevices; + + /** Return server level extention property */ + GetExtensionProperty(bstrGUID: string): any; + + /** The inbound routing configuration object */ + readonly InboundRouting: FaxInboundRouting; + + /** Set bit-wise combination of events the fax server listens to */ + ListenToServerEvents(EventTypes: FAX_SERVER_EVENTS_TYPE_ENUM): void; + + /** The logging options configuration object */ + readonly LoggingOptions: FaxLoggingOptions; + + /** The major part of the fax server's build number */ + readonly MajorBuild: number; + + /** The major part of the fax server's version number */ + readonly MajorVersion: number; + + /** The minor part of the fax server's build number */ + readonly MinorBuild: number; + + /** The minor part of the fax server's version number */ + readonly MinorVersion: number; + + /** The outbound routing configuration object */ + readonly OutboundRouting: FaxOutboundRouting; + + /** The receipt options configuration object */ + readonly ReceiptOptions: FaxReceiptOptions; + + /** Register device provider */ + RegisterDeviceProvider(bstrGUID: string, bstrFriendlyName: string, bstrImageName: string, TspName: string, lFSPIVersion: number): void; + + /** Events the fax Server is listening to */ + readonly RegisteredEvents: FAX_SERVER_EVENTS_TYPE_ENUM; + + /** Register inbound routing extension */ + RegisterInboundRoutingExtension(bstrExtensionName: string, bstrFriendlyName: string, bstrImageName: string, vMethods: any): void; + + /** The security configuration object */ + readonly Security: FaxSecurity; + + /** The name of the fax server */ + readonly ServerName: string; + + /** Set server level extention property */ + SetExtensionProperty(bstrGUID: string, vProperty: SafeArray): void; + + /** Unregister device provider */ + UnregisterDeviceProvider(bstrUniqueName: string): void; + + /** Unregister inbound routing extension */ + UnregisterInboundRoutingExtension(bstrExtensionUniqueName: string): void; + } + + namespace EventHelperTypes { + type FaxAccount_Invoke_ArgNames = ['dispidMember', 'riid', 'lcid', 'wFlags', 'pdispparams', 'pvarResult', 'pexcepinfo', 'puArgErr']; + + type FaxServer_Invoke_ArgNames = ['dispidMember', 'riid', 'lcid', 'wFlags', 'pdispparams', 'pvarResult', 'pexcepinfo', 'puArgErr']; + + type FaxServer_OnDeviceStatusChange_ArgNames = ['pFaxServer', 'lDeviceId', 'bPoweredOff', 'bSending', 'bReceiving', 'bRinging']; + + interface FaxAccount_Invoke_Parameter { + readonly dispidMember: number; + readonly lcid: number; + readonly pdispparams: stdole.DISPPARAMS; + pexcepinfo: stdole.EXCEPINFO; + puArgErr: number; + pvarResult: any; + readonly riid: stdole.GUID; + readonly wFlags: number; + } + + interface FaxServer_Invoke_Parameter { + readonly dispidMember: number; + readonly lcid: number; + readonly pdispparams: stdole.DISPPARAMS; + pexcepinfo: stdole.EXCEPINFO; + puArgErr: number; + pvarResult: any; + readonly riid: stdole.GUID; + readonly wFlags: number; + } + + interface FaxServer_OnDeviceStatusChange_Parameter { + readonly bPoweredOff: boolean; + readonly bReceiving: boolean; + readonly bRinging: boolean; + readonly bSending: boolean; + readonly lDeviceId: number; + readonly pFaxServer: FaxServer; + } + } +} + +interface ActiveXObject { + on( + obj: FAXCOMEXLib.FaxAccount, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( + this: FAXCOMEXLib.FaxAccount, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( + this: FAXCOMEXLib.FaxAccount, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: FAXCOMEXLib.FaxAccount, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: FAXCOMEXLib.FaxAccount, parameter: {pctinfo: number}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'Invoke', argNames: FAXCOMEXLib.EventHelperTypes.FaxAccount_Invoke_ArgNames, handler: ( + this: FAXCOMEXLib.FaxAccount, parameter: FAXCOMEXLib.EventHelperTypes.FaxAccount_Invoke_Parameter) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnIncomingJobAdded' | 'OnIncomingJobRemoved' | 'OnOutgoingJobAdded' | 'OnOutgoingJobRemoved', + argNames: ['pFaxAccount', 'bstrJobId'], handler: (this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxAccount: FAXCOMEXLib.FaxAccount, readonly bstrJobId: string}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnIncomingJobChanged' | 'OnOutgoingJobChanged', argNames: ['pFaxAccount', 'bstrJobId', 'pJobStatus'], + handler: (this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxAccount: FAXCOMEXLib.FaxAccount, readonly bstrJobId: string, readonly pJobStatus: FAXCOMEXLib.FaxJobStatus}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnIncomingMessageAdded', argNames: ['pFaxAccount', 'bstrMessageId', 'fAddedToReceiveFolder'], + handler: (this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxAccount: FAXCOMEXLib.FaxAccount, readonly bstrMessageId: string, readonly fAddedToReceiveFolder: boolean}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnIncomingMessageRemoved', argNames: ['pFaxAccount', 'bstrMessageId', 'fRemovedFromReceiveFolder'], + handler: (this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxAccount: FAXCOMEXLib.FaxAccount, readonly bstrMessageId: string, readonly fRemovedFromReceiveFolder: boolean}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnOutgoingMessageAdded' | 'OnOutgoingMessageRemoved', argNames: ['pFaxAccount', 'bstrMessageId'], + handler: (this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxAccount: FAXCOMEXLib.FaxAccount, readonly bstrMessageId: string}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'OnServerShutDown', argNames: ['pFaxServer'], handler: ( + this: FAXCOMEXLib.FaxAccount, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer}) => void): void; + on( + obj: FAXCOMEXLib.FaxAccount, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( + this: FAXCOMEXLib.FaxAccount, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( + this: FAXCOMEXLib.FaxServer, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( + this: FAXCOMEXLib.FaxServer, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: FAXCOMEXLib.FaxServer, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: FAXCOMEXLib.FaxServer, parameter: {pctinfo: number}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'Invoke', argNames: FAXCOMEXLib.EventHelperTypes.FaxServer_Invoke_ArgNames, handler: ( + this: FAXCOMEXLib.FaxServer, parameter: FAXCOMEXLib.EventHelperTypes.FaxServer_Invoke_Parameter) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnActivityLoggingConfigChange' | 'OnDevicesConfigChange' | 'OnEventLoggingConfigChange' | 'OnGeneralServerConfigChanged' | + 'OnIncomingArchiveConfigChange' | 'OnOutboundRoutingGroupsConfigChange' | 'OnOutboundRoutingRulesConfigChange' | 'OnOutgoingArchiveConfigChange' | + 'OnOutgoingQueueConfigChange' | 'OnReceiptOptionsChange' | 'OnSecurityConfigChange' | 'OnServerShutDown', + argNames: ['pFaxServer'], + handler: (this: FAXCOMEXLib.FaxServer, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnDeviceStatusChange', argNames: FAXCOMEXLib.EventHelperTypes.FaxServer_OnDeviceStatusChange_ArgNames, + handler: (this: FAXCOMEXLib.FaxServer, parameter: FAXCOMEXLib.EventHelperTypes.FaxServer_OnDeviceStatusChange_Parameter) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnIncomingJobAdded' | 'OnIncomingJobRemoved' | 'OnOutgoingJobAdded' | 'OnOutgoingJobRemoved', + argNames: ['pFaxServer', 'bstrJobId'], handler: (this: FAXCOMEXLib.FaxServer, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly bstrJobId: string}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnIncomingJobChanged' | 'OnOutgoingJobChanged', argNames: ['pFaxServer', 'bstrJobId', 'pJobStatus'], + handler: (this: FAXCOMEXLib.FaxServer, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly bstrJobId: string, readonly pJobStatus: FAXCOMEXLib.FaxJobStatus}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnIncomingMessageAdded' | 'OnIncomingMessageRemoved' | 'OnOutgoingMessageAdded' | 'OnOutgoingMessageRemoved', + argNames: ['pFaxServer', 'bstrMessageId'], handler: (this: FAXCOMEXLib.FaxServer, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly bstrMessageId: string}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnNewCall', argNames: ['pFaxServer', 'lCallId', 'lDeviceId', 'bstrCallerId'], handler: ( + this: FAXCOMEXLib.FaxServer, parameter: {readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly lCallId: number, readonly lDeviceId: number, readonly bstrCallerId: string}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnQueuesStatusChange', argNames: ['pFaxServer', 'bOutgoingQueueBlocked', 'bOutgoingQueuePaused', 'bIncomingQueueBlocked'], + handler: ( + this: FAXCOMEXLib.FaxServer, + parameter: { + readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly bOutgoingQueueBlocked: boolean, readonly bOutgoingQueuePaused: boolean, readonly bIncomingQueueBlocked: boolean}) => void): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'OnServerActivityChange', + argNames: ['pFaxServer', 'lIncomingMessages', 'lRoutingMessages', 'lOutgoingMessages', 'lQueuedMessages'], handler: ( + this: FAXCOMEXLib.FaxServer, + parameter: { + readonly pFaxServer: FAXCOMEXLib.FaxServer, readonly lIncomingMessages: number, readonly lRoutingMessages: number, readonly lOutgoingMessages: number, readonly lQueuedMessages: number + }) => void + ): void; + on( + obj: FAXCOMEXLib.FaxServer, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( + this: FAXCOMEXLib.FaxServer, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: FAXCOMEXLib.FaxAccount, event: 'AddRef' | 'Release', handler: (this: FAXCOMEXLib.FaxAccount, parameter: {}) => void): void; + on(obj: FAXCOMEXLib.FaxServer, event: 'AddRef' | 'Release', handler: (this: FAXCOMEXLib.FaxServer, parameter: {}) => void): void; + new(progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'FaxComEx.FaxDocument': FAXCOMEXLib.FaxDocument; + 'FaxComEx.FaxServer': FAXCOMEXLib.FaxServer; +} + +interface EnumeratorConstructor { + new(col: FAXCOMEXLib.FaxAccounts): Enumerator; + new(col: FAXCOMEXLib.FaxDeviceIds): Enumerator; + new(col: FAXCOMEXLib.FaxDeviceProviders): Enumerator; + new(col: FAXCOMEXLib.FaxDevices): Enumerator; + new(col: FAXCOMEXLib.FaxInboundRoutingExtensions): Enumerator; + new(col: FAXCOMEXLib.FaxInboundRoutingMethods): Enumerator; + new(col: FAXCOMEXLib.FaxIncomingJobs): Enumerator; + new(col: FAXCOMEXLib.FaxOutboundRoutingGroups): Enumerator; + new(col: FAXCOMEXLib.FaxOutboundRoutingRules): Enumerator; + new(col: FAXCOMEXLib.FaxOutgoingJobs): Enumerator; + new(col: FAXCOMEXLib.FaxRecipients): Enumerator; +} + +interface SafeArray { + _brand: SafeArray; +} diff --git a/types/activex-faxcomexlib/package.json b/types/activex-faxcomexlib/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-faxcomexlib/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-faxcomexlib/tsconfig.json b/types/activex-faxcomexlib/tsconfig.json new file mode 100644 index 0000000000..673e3f49ea --- /dev/null +++ b/types/activex-faxcomexlib/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5", + "scripthost" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "activex-faxcomexlib-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-faxcomexlib/tslint.json b/types/activex-faxcomexlib/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-faxcomexlib/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-infopath/tsconfig.json b/types/activex-infopath/tsconfig.json index 6feef8496c..e6479e5c7c 100644 --- a/types/activex-infopath/tsconfig.json +++ b/types/activex-infopath/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts b/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts new file mode 100644 index 0000000000..f39627cc1a --- /dev/null +++ b/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts @@ -0,0 +1,49 @@ +const wshn = new ActiveXObject('WScript.Network'); + +// https://msdn.microsoft.com/en-us/library/s6wt333f(v=vs.84).aspx +// https://msdn.microsoft.com/en-us/library/wck0hkd7(v=vs.84).aspx +// https://msdn.microsoft.com/en-us/library/tte130y1(v=vs.84).aspx +// https://msdn.microsoft.com/en-us/library/3fxhka75(v=vs.84).aspx +(() => { + WScript.Echo('Domain = ' + wshn.UserDomain); + WScript.Echo('Computer Name = ' + wshn.ComputerName); + WScript.Echo('User Name = ' + wshn.UserName); +})(); + +// https://msdn.microsoft.com/en-us/library/zsdh7hkb(v=vs.84).aspx +wshn.AddWindowsPrinterConnection('\\\\printserv\\DefaultPrinter'); + +// https://msdn.microsoft.com/en-us/library/kxsdca3c(v=vs.84).aspx +wshn.AddPrinterConnection("LPT1", "\\\\Server\\Print1"); + +// https://msdn.microsoft.com/en-us/library/t9zt39at(v=vs.84).aspx +// https://msdn.microsoft.com/en-us/library/zhds6k80(v=vs.84).aspx +(() => { + const drives = wshn.EnumNetworkDrives(); + const printers = wshn.EnumPrinterConnections(); + WScript.Echo("Network drive mappings:"); + for (let i = 0; i < drives.length; i += 2) { + WScript.Echo(`Drive ${drives.Item(i)} = ${drives.Item(i + 1)}`); + } + WScript.Echo(''); + WScript.Echo("Network printer mappings:"); + for (let i = 0; i < printers.length; i += 2) { + WScript.Echo(`Port ${printers.Item(i)} = ${printers.Item(i + 1)}`); + } +})(); + +// https://msdn.microsoft.com/en-us/library/8kst88h6(v=vs.84).aspx +wshn.MapNetworkDrive('E:', '\\\\Server\\Public'); + +// https://msdn.microsoft.com/en-us/library/d16d7wbf(v=vs.84).aspx +wshn.RemoveNetworkDrive('E:'); + +// https://msdn.microsoft.com/en-us/library/tsbh2yy7(v=vs.84).aspx +wshn.RemovePrinterConnection('\\\\PRN-CORP1\\B41-4523-A', true, true); + +// https://msdn.microsoft.com/en-us/library/2ccwwdct(v=vs.84).aspx +(() => { + const printerPath = "\\\\research\\library1"; + wshn.AddWindowsPrinterConnection(printerPath); + wshn.SetDefaultPrinter(printerPath); +})(); diff --git a/types/activex-iwshruntimelibrary/index.d.ts b/types/activex-iwshruntimelibrary/index.d.ts new file mode 100644 index 0000000000..c50c9670a2 --- /dev/null +++ b/types/activex-iwshruntimelibrary/index.d.ts @@ -0,0 +1,247 @@ +// Type definitions for Windows Script Host Object Model - IWshRuntimeLibrary 1.0 +// Project: https://msdn.microsoft.com/en-us/library/9bbdkx3k(v=vs.84).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +declare namespace IWshRuntimeLibrary { + // tslint:disable-next-line no-const-enum + const enum ButtonType { + OK, + OKCancel, + AbortRetryIgnore, + YesNoCancel, + YesNo, + RetryCancel, + CancelTryagainContinue + } + + // tslint:disable-next-line no-const-enum + const enum IconType { + Stop = 16, + QuestionMark = 32, + ExclamationMakr = 48, + InformationMark = 64, + } + + // tslint:disable-next-line no-const-enum + const enum PopupType { + SecondButtonDefault = 256, + ThirdButtonDefault = 512, + Modal = 4096, + RightJustified = 524288, + RTL = 1048576, + } + + // tslint:disable-next-line no-const-enum + const enum PopupSelection { + NoButton = -1, + OK = 1, + Cancel = 2, + Abort = 3, + Retry = 4, + Ignore = 5, + Yes = 6, + No = 7, + TryAgain = 10, + Continue = 11, + } + + // tslint:disable-next-line no-const-enum + const enum WshExecStatus { + WshFailed = 2, + WshFinished = 1, + WshRunning = 0, + } + + // tslint:disable-next-line no-const-enum + const enum WshWindowStyle { + WshHide = 0, + WshMaximizedFocus = 3, + WshMinimizedFocus = 2, + WshMinimizedNoFocus = 6, + WshNormalFocus = 1, + WshNormalNoFocus = 4, + } + + class TextStream { + private 'IWshRuntimeLibrary.TextStream_typekey': TextStream; + private constructor(); + readonly AtEndOfLine: boolean; + readonly AtEndOfStream: boolean; + Close(): void; + readonly Column: number; + readonly Line: number; + Read(Characters: number): string; + ReadAll(): string; + ReadLine(): string; + Skip(Characters: number): void; + SkipLine(): void; + Write(Text: string): void; + WriteBlankLines(Lines: number): void; + + /** @param string [Text=''] */ + WriteLine(Text?: string): void; + } + + /** Generic Collection Object */ + class WshCollection { + private 'IWshRuntimeLibrary.WshCollection_typekey': WshCollection; + private constructor(); + Count(): number; + Item(Index: any): any; + readonly length: number; + } + + /** Environment Variables Collection Object */ + class WshEnvironment { + private 'IWshRuntimeLibrary.WshEnvironment_typekey': WshEnvironment; + private constructor(); + Count(): number; + Item(Name: string): string; + readonly length: number; + Remove(Name: string): void; + } + + /** WSHExec object */ + class WshExec { + private 'IWshRuntimeLibrary.WshExec_typekey': WshExec; + private constructor(); + readonly ExitCode: number; + readonly ProcessID: number; + readonly Status: WshExecStatus; + readonly StdErr: TextStream; + readonly StdIn: TextStream; + readonly StdOut: TextStream; + Terminate(): void; + } + + /** Network Object */ + class WshNetwork { + private 'IWshRuntimeLibrary.WshNetwork_typekey': WshNetwork; + private constructor(); + + /** + * Adds a remote MS-DOS-based printer connection to your computer system. + * @param LocalName Local name to assign to the connected printer. + * @param RemoteName Name of the remote printer. + * @param UpdateProfile [false] Whether the printer mapping is stored in the current user's profile. + * + * If you are mapping a remote printer using the profile of someone other than current user, you can specify _UserName_ and _Password_. + */ + AddPrinterConnection(LocalName: string, RemoteName: string, UpdateProfile?: boolean, UserName?: string, Password?: string): void; + + /** + * @param string Path to printer connection + * @param string [DriverName=''] + * @param string [Port='LPT1'] + * + * Unlike the **AddPrinterConnection** method, this method allows you to create a printer connection without directing it to a specific port, such as LPT1. + */ + AddWindowsPrinterConnection(PrinterName: string, DriverName?: string, Port?: string): void; + readonly ComputerName: string; + EnumNetworkDrives(): WshCollection; + EnumPrinterConnections(): WshCollection; + + /** + * Adds a remote MS-DOS-based printer connection to your computer system. + * @param LocalName Name by which the mapped drive will be known locally + * @param RemoteName Share's UNC name (\\xxx\yyy) + * @param UpdateProfile [false] Whether the printer mapping is stored in the current user's profile. + * + * If you are mapping a network drive using the profile of someone other than current user, you can specify _UserName_ and _Password_. + */ + MapNetworkDrive(LocalName: string, RemoteName: string, UpdateProfile?: boolean, UserName?: string, Password?: string): void; + readonly Organization: string; + + /** + * Removes a shared network drive from your computer system + * @param Name Name of the mapped drive you want to remove. This will be the drive letter if the drive has a mapping between a local name (drive letter) and a remote name (UNC name); + * it will be the UNC path if there is no such mapping + * @param Force [false] Remove the connections even if the resource is in use + * @param UpdateProfile [false] Remove the mapping from the user's profile + */ + RemoveNetworkDrive(Name: string, Force?: any, UpdateProfile?: any): void; + + /** + * Removes a shared network printer connection from your computer system + * @param Name Name that identifies the printer. Can be a UNC name (in the form `\\xxx\yyy`) or a local name (such as `LPT1`) + * @param Force [false] Remove printer connection even if a user is still connected + * @param UpdateProfile [false] Remove the printer connection from the user's profile + * + * The **RemovePrinterConnection** method removes both Windows and MS-DOS based printer connections. If the printer was connected using the method **AddPrinterConnection**, + * _Name_ must be the printer's local name. If the printer was connected using the **AddWindowsPrinterConnection** method or was added manually (using the Add Printer wizard), + * then _Name_ must be the printer's UNC name. + */ + RemovePrinterConnection(Name: string, Force?: any, UpdateProfile?: any): void; + SetDefaultPrinter(Name: string): void; + readonly Site: string; + readonly UserDomain: string; + readonly UserName: string; + readonly UserProfile: string; + } + + /** Shell Object */ + class WshShell { + private 'IWshRuntimeLibrary.WshShell_typekey': WshShell; + private constructor(); + AppActivate(App: any, Wait?: any): boolean; + CreateShortcut(PathLink: string): any; + CurrentDirectory: string; + Environment(Type?: any): WshEnvironment; + Exec(Command: string): WshExec; + ExpandEnvironmentStrings(Src: string): string; + + /** @param string [Target=''] */ + LogEvent(Type: any, Message: string, Target?: string): boolean; + Popup(Text: any, SecondsToWait?: number, Title?: string, Type?: ButtonType | IconType | PopupType): PopupSelection; + RegDelete(Name: string): void; + RegRead(Name: string): any; + RegWrite(Name: string, Value: any, Type?: any): void; + Run(Command: string, WindowStyle?: any, WaitOnReturn?: any): number; + SendKeys(Keys: string, Wait?: any): void; + readonly SpecialFolders: WshCollection; + } + + /** Shortcut Object */ + class WshShortcut { + private 'IWshRuntimeLibrary.WshShortcut_typekey': WshShortcut; + private constructor(); + Arguments: string; + Description: string; + readonly FullName: string; + Hotkey: string; + IconLocation: string; + Load(PathLink: string): void; + readonly RelativePath: string; + Save(): void; + TargetPath: string; + WindowStyle: number; + WorkingDirectory: string; + } + + /** URLShortcut Object */ + class WshURLShortcut { + private 'IWshRuntimeLibrary.WshURLShortcut_typekey': WshURLShortcut; + private constructor(); + readonly FullName: string; + Load(PathLink: string): void; + Save(): void; + TargetPath: string; + } +} + +interface ActiveXObject { + set(obj: IWshRuntimeLibrary.WshEnvironment, propertyName: 'Item', parameterTypes: [string], newValue: string): void; + new (progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'WScript.Network': IWshRuntimeLibrary.WshNetwork; + 'WScript.Shell': IWshRuntimeLibrary.WshShell; +} + +interface EnumeratorConstructor { + new(col: IWshRuntimeLibrary.WshCollection): Enumerator; + new(col: IWshRuntimeLibrary.WshEnvironment): Enumerator; +} diff --git a/types/activex-iwshruntimelibrary/package.json b/types/activex-iwshruntimelibrary/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-iwshruntimelibrary/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-iwshruntimelibrary/tsconfig.json b/types/activex-iwshruntimelibrary/tsconfig.json new file mode 100644 index 0000000000..0c79715db6 --- /dev/null +++ b/types/activex-iwshruntimelibrary/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5", + "scripthost" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "activex-iwshruntimelibrary-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-iwshruntimelibrary/tslint.json b/types/activex-iwshruntimelibrary/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-iwshruntimelibrary/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-libreoffice/tsconfig.json b/types/activex-libreoffice/tsconfig.json index 712ea46ca1..c72038c18a 100644 --- a/types/activex-libreoffice/tsconfig.json +++ b/types/activex-libreoffice/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-msforms/tsconfig.json index 38f907552d..ee18e776a1 100644 --- a/types/activex-msforms/tsconfig.json +++ b/types/activex-msforms/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-mshtml/tsconfig.json index deba2b6ba3..9f0594a26d 100644 --- a/types/activex-mshtml/tsconfig.json +++ b/types/activex-mshtml/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-msxml2/tsconfig.json index 49c53f71ca..5d1cee05aa 100644 --- a/types/activex-msxml2/tsconfig.json +++ b/types/activex-msxml2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-office/tsconfig.json index 729657e813..4c8b5ce9e5 100644 --- a/types/activex-office/tsconfig.json +++ b/types/activex-office/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-outlook/tsconfig.json index 1a9fddc714..5d2f6c157b 100644 --- a/types/activex-outlook/tsconfig.json +++ b/types/activex-outlook/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-powerpoint/tsconfig.json index 8a0392da3f..4ecc0048fb 100644 --- a/types/activex-powerpoint/tsconfig.json +++ b/types/activex-powerpoint/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-scripting/tsconfig.json index e2008551fd..1d660ed39c 100644 --- a/types/activex-scripting/tsconfig.json +++ b/types/activex-scripting/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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-shdocvw/activex-shdocvw-tests.ts b/types/activex-shdocvw/activex-shdocvw-tests.ts new file mode 100644 index 0000000000..713578fb06 --- /dev/null +++ b/types/activex-shdocvw/activex-shdocvw-tests.ts @@ -0,0 +1,12 @@ +// https://msdn.microsoft.com/en-us/library/aa752044(v=vs.85).aspx +(() => { + const ie = new ActiveXObject('InternetExplorer.Application'); + ie.Navigate('http://contoso.com'); + ie.Visible = true; +})(); + +let obj1 = new ActiveXObject('ShellNameSpace.ShellNameSpace'); + +let obj2 = new ActiveXObject('Shell.UIHelper'); + +let obj3 = new ActiveXObject('Shell.Explorer'); diff --git a/types/activex-shdocvw/index.d.ts b/types/activex-shdocvw/index.d.ts new file mode 100644 index 0000000000..86568f6c5d --- /dev/null +++ b/types/activex-shdocvw/index.d.ts @@ -0,0 +1,1577 @@ +// Type definitions for Microsoft Internet Controls - SHDocVw 1.1 +// Project: https://msdn.microsoft.com/en-us/library/aa752040(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +declare namespace SHDocVw { + // tslint:disable-next-line no-const-enum + const enum BrowserBarConstants { + AddressBar = 0x0009, + Tools = 0x000A, + Links = 0x000B, + Search = '{30D02401-6A81-11D0-8274-00C04FD5AE38}', + Favorites = '{EFA24E61-B078-11D0-89E4-00C04FC9E26E}', + History = '{EFA24E62-B078-11D0-89E4-00C04FC9E26E}', + Channels = '{EFA24E63-B078-11D0-89E4-00C04FC9E26E}' + } + + // tslint:disable-next-line no-const-enum + const enum BrowserNavConstants { + /** Open the resource or file in a new window. */ + OpenInNewWindow = 1, + + /** Do not add the resource or file to the history list. The new page replaces the current page in the list. */ + NoHistory = 2, + + /** If the navigation fails, the autosearch functionality attempts to navigate common root domains (.com, .edu, and so on). If this also fails, the URL is passed to a search engine. */ + AllowAutosearch = 16, + + /** Causes the current Explorer Bar to navigate to the given item, if possible. */ + BrowserBar = 32, + + /** + * Internet Explorer 6 for Windows XP SP2 and later. If the navigation fails when a hyperlink is being followed, this constant specifies that the resource should then be bound to the + * moniker using the [**BINDF_HYPERLINK**](https://msdn.microsoft.com/en-us/library/ms775130(v=vs.85).aspx) flag. + */ + Hyperlink = 64, + + /** Internet Explorer 6 for Windows XP SP2 and later. Force the URL into the restricted zone. */ + EnforceRestricted = 128, + + /** Internet Explorer 6 for Windows XP SP2 and later. Use the default Popup Manager to block pop-up windows. */ + NewWindowsManaged = 256, + + /** Internet Explorer 6 for Windows XP SP2 and later. Block files that normally trigger a file download dialog box. */ + UntrustedForDownload = 512, + + /** Internet Explorer 6 for Windows XP SP2 and later. Prompt for the installation of ActiveX controls. */ + TrustedForActiveX = 1024, + + /** Internet Explorer 7. Open the resource or file in a new tab. Allow the destination window to come to the foreground, if necessary. */ + OpenInNewTab = 2048, + + /** Internet Explorer 7. Open the resource or file in a new background tab; the currently active window and/or tab remains open on top. */ + OpenInBackgroundTab = 4096, + + /** + * Internet Explorer 7. Maintain state for dynamic navigation based on the filter string entered in the search band text box (wordwheel). Restore the wordwheel text when the navigation + * completes. + */ + KeepWordWheelText = 8192, + + /** + * Internet Explorer 8. Open the resource as a replacement for the current or target tab. The existing tab is closed while the new tab takes its place in the tab bar and replaces it in the + * tab group, if any. Browser history is copied forward to the new tab. On Windows Vista, this flag is implied if the navigation would cross integrity levels and **navOpenInNewTab**, + * **navOpenInBackgroundTab**, or **navOpenInNewWindow**> is not specified. + */ + VirtualTab = 16384, + + /** + * Internet Explorer 8. Block cross-domain redirect requests. The navigation triggers the + * [**DWebBrowserEvents2::RedirectXDomainBlocked**](https://msdn.microsoft.com/en-us/library/dd565686(v=vs.85).aspx) event if blocked. + */ + BlockRedirectsXDomain = 32768, + + /** Internet Explorer 8 and later. Open the resource in a new tab that becomes the foreground tab. */ + OpenNewForegroundTab = 65536 + } + + /** Constants for WebBrowser CommandStateChange */ + // tslint:disable-next-line no-const-enum + const enum CommandStateChangeConstants { + CSC_NAVIGATEBACK = 2, + CSC_NAVIGATEFORWARD = 1, + CSC_UPDATECOMMANDS = -1, + } + + /** Constants for WebBrowser NewProcess notification */ + // tslint:disable-next-line no-const-enum + const enum NewProcessCauseConstants { + ProtectedModeRedirect = 1, + } + + // tslint:disable-next-line no-const-enum + const enum OLECMDEXECOPT { + OLECMDEXECOPT_DODEFAULT = 0, + OLECMDEXECOPT_DONTPROMPTUSER = 2, + OLECMDEXECOPT_PROMPTUSER = 1, + OLECMDEXECOPT_SHOWHELP = 3, + } + + // tslint:disable-next-line no-const-enum + const enum OLECMDF { + OLECMDF_DEFHIDEONCTXTMENU = 32, + OLECMDF_ENABLED = 2, + OLECMDF_INVISIBLE = 16, + OLECMDF_LATCHED = 4, + OLECMDF_NINCHED = 8, + OLECMDF_SUPPORTED = 1, + } + + // tslint:disable-next-line no-const-enum + const enum OLECMDID { + OLECMDID_ACTIVEXINSTALLSCOPE = 66, + OLECMDID_ADDTRAVELENTRY = 60, + OLECMDID_ALLOWUILESSSAVEAS = 46, + OLECMDID_CLEARSELECTION = 18, + OLECMDID_CLOSE = 45, + OLECMDID_COPY = 12, + OLECMDID_CUT = 11, + OLECMDID_DELETE = 33, + OLECMDID_DONTDOWNLOADCSS = 47, + OLECMDID_ENABLE_INTERACTION = 36, + OLECMDID_ENABLE_VISIBILITY = 77, + OLECMDID_EXITFULLSCREEN = 81, + OLECMDID_FIND = 32, + OLECMDID_FOCUSVIEWCONTROLS = 57, + OLECMDID_FOCUSVIEWCONTROLSQUERY = 58, + OLECMDID_GETPRINTTEMPLATE = 52, + OLECMDID_GETUSERSCALABLE = 75, + OLECMDID_GETZOOMRANGE = 20, + OLECMDID_HIDETOOLBARS = 24, + OLECMDID_HTTPEQUIV = 34, + OLECMDID_HTTPEQUIV_DONE = 35, + OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71, + OLECMDID_MEDIA_PLAYBACK = 78, + OLECMDID_NEW = 2, + OLECMDID_ONBEFOREUNLOAD = 83, + OLECMDID_ONTOOLBARACTIVATED = 31, + OLECMDID_ONUNLOAD = 37, + OLECMDID_OPEN = 1, + OLECMDID_OPTICAL_GETZOOMRANGE = 64, + OLECMDID_OPTICAL_ZOOM = 63, + OLECMDID_PAGEACTIONBLOCKED = 55, + OLECMDID_PAGEACTIONUIQUERY = 56, + OLECMDID_PAGEAVAILABLE = 74, + OLECMDID_PAGESETUP = 8, + OLECMDID_PASTE = 13, + OLECMDID_PASTESPECIAL = 14, + OLECMDID_POPSTATEEVENT = 69, + OLECMDID_PREREFRESH = 39, + OLECMDID_PRINT = 6, + OLECMDID_PRINT2 = 49, + OLECMDID_PRINTPREVIEW = 7, + OLECMDID_PRINTPREVIEW2 = 50, + OLECMDID_PROPERTIES = 10, + OLECMDID_PROPERTYBAG2 = 38, + OLECMDID_REDO = 16, + OLECMDID_REFRESH = 22, + OLECMDID_SAVE = 3, + OLECMDID_SAVEAS = 4, + OLECMDID_SAVECOPYAS = 5, + OLECMDID_SCROLLCOMPLETE = 82, + OLECMDID_SELECTALL = 17, + OLECMDID_SET_HOST_FULLSCREENMODE = 80, + OLECMDID_SETDOWNLOADSTATE = 29, + OLECMDID_SETFAVICON = 79, + OLECMDID_SETPRINTTEMPLATE = 51, + OLECMDID_SETPROGRESSMAX = 25, + OLECMDID_SETPROGRESSPOS = 26, + OLECMDID_SETPROGRESSTEXT = 27, + OLECMDID_SETTITLE = 28, + OLECMDID_SHOWFIND = 42, + OLECMDID_SHOWMESSAGE = 41, + OLECMDID_SHOWMESSAGE_BLOCKABLE = 84, + OLECMDID_SHOWPAGEACTIONMENU = 59, + OLECMDID_SHOWPAGESETUP = 43, + OLECMDID_SHOWPRINT = 44, + OLECMDID_SHOWSCRIPTERROR = 40, + OLECMDID_SHOWTASKDLG = 68, + OLECMDID_SHOWTASKDLG_BLOCKABLE = 85, + OLECMDID_SPELL = 9, + OLECMDID_STOP = 23, + OLECMDID_STOPDOWNLOAD = 30, + OLECMDID_UNDO = 15, + OLECMDID_UPDATE_CARET = 76, + OLECMDID_UPDATEBACKFORWARDSTATE = 62, + OLECMDID_UPDATECOMMANDS = 21, + OLECMDID_UPDATEPAGESTATUS = 48, + OLECMDID_UPDATETRAVELENTRY = 61, + OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67, + OLECMDID_USER_OPTICAL_ZOOM = 73, + OLECMDID_VIEWPORT_MODE = 70, + OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72, + OLECMDID_WINDOWSTATECHANGED = 65, + OLECMDID_ZOOM = 19, + } + + // tslint:disable-next-line no-const-enum + const enum RefreshConstants { + Normal = 0, + IfExpired = 1, + Completely = 3 + } + + /** Constants for WebBrowser security icon notification */ + // tslint:disable-next-line no-const-enum + const enum SecureLockIconConstants { + secureLockIconMixed = 1, + secureLockIconSecure128Bit = 6, + secureLockIconSecure40Bit = 3, + secureLockIconSecure56Bit = 4, + secureLockIconSecureFortezza = 5, + secureLockIconSecureUnknownBits = 2, + secureLockIconUnsecure = 0, + } + + /** Options for ShellWindows FindWindow */ + // tslint:disable-next-line no-const-enum + const enum ShellWindowFindWindowOptions { + SWFO_COOKIEPASSED = 4, + SWFO_INCLUDEPENDING = 2, + SWFO_NEEDDISPATCH = 1, + } + + /** Constants for ShellWindows registration */ + // tslint:disable-next-line no-const-enum + const enum ShellWindowTypeConstants { + SWC_3RDPARTY = 2, + SWC_BROWSER = 1, + SWC_CALLBACK = 4, + SWC_DESKTOP = 8, + SWC_EXPLORER = 0, + } + + // tslint:disable-next-line no-const-enum + const enum tagREADYSTATE { + READYSTATE_COMPLETE = 4, + READYSTATE_INTERACTIVE = 3, + READYSTATE_LOADED = 2, + READYSTATE_LOADING = 1, + READYSTATE_UNINITIALIZED = 0, + } + + type TargetFrameValues = '_blank' | '_parent' | '_self' | '_top' ; + + class CScriptErrorList { + private 'SHDocVw.CScriptErrorList_typekey': CScriptErrorList; + private constructor(); + advanceError(): void; + canAdvanceError(): number; + canRetreatError(): number; + getAlwaysShowLockState(): number; + getDetailsPaneOpen(): number; + getErrorChar(): number; + getErrorCode(): number; + getErrorLine(): number; + getErrorMsg(): string; + getErrorUrl(): string; + getPerErrorDisplay(): number; + retreatError(): void; + setDetailsPaneOpen(fDetailsPaneOpen: number): void; + setPerErrorDisplay(fPerErrorDisplay: number): void; + } + + /** Internet Explorer Application. */ + class InternetExplorer { + private 'SHDocVw.InternetExplorer_typekey': InternetExplorer; + private constructor(); + + /** Controls whether address bar is shown */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + /** Internet Explorer Application with default integrity of Medium */ + class InternetExplorerMedium { + private 'SHDocVw.InternetExplorerMedium_typekey': InternetExplorerMedium; + private constructor(); + + /** Controls whether address bar is shown */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + /** Shell Browser Window. */ + class ShellBrowserWindow { + private 'SHDocVw.ShellBrowserWindow_typekey': ShellBrowserWindow; + private constructor(); + + /** Controls whether address bar is shown */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + class ShellNameSpace { + private 'SHDocVw.ShellNameSpace_typekey': ShellNameSpace; + private constructor(); + Columns: string; + + /** number of view types */ + readonly CountViewTypes: number; + + /** method CreateSubscriptionForSelection */ + CreateSubscriptionForSelection(): boolean; + + /** method DeleteSubscriptionForSelection */ + DeleteSubscriptionForSelection(): boolean; + Depth: number; + + /** options */ + EnumOptions: number; + + /** expands item specified depth */ + Expand(var_0: any, iDepth: number): void; + + /** method Export */ + Export(): void; + Flags: number; + + /** method Import */ + Import(): void; + + /** method InvokeContextMenuCommand */ + InvokeContextMenuCommand(strCommand: string): void; + Mode: number; + + /** method MoveSelectionDown */ + MoveSelectionDown(): void; + + /** method MoveSelectionTo */ + MoveSelectionTo(): void; + + /** method MoveSelectionUp */ + MoveSelectionUp(): void; + + /** method NewFolder */ + NewFolder(): void; + + /** method ResetSort */ + ResetSort(): void; + + /** get the root item */ + Root: any; + + /** get the selected item */ + SelectedItem: any; + + /** collection of selected items */ + SelectedItems(): any; + + /** old, use put_Root() instead */ + SetRoot(bstrFullPath: string): void; + + /** set view type */ + SetViewType(iType: number): void; + + /** Query to see if subscriptions are enabled */ + readonly SubscriptionsEnabled: boolean; + + /** method Synchronize */ + Synchronize(): void; + TVFlags: number; + + /** unselects all items */ + UnselectAll(): void; + } + + class ShellUIHelper { + private 'SHDocVw.ShellUIHelper_typekey': ShellUIHelper; + private constructor(); + AddChannel(URL: string): void; + AddDesktopComponent(URL: string, Type: string, Left?: any, Top?: any, Width?: any, Height?: any): void; + AddFavorite(URL: string, Title?: any): void; + AddSearchProvider(URL: string): void; + AddService(URL: string): void; + AddToFavoritesBar(URL: string, Title: string, Type?: any): void; + AutoCompleteAttach(Reserved?: any): void; + AutoCompleteSaveForm(Form?: any): void; + AutoScan(strSearch: string, strFailureUrl: string, pvarTargetFrame?: any): void; + BrandImageUri(): string; + BuildNewTabPage(): void; + ContentDiscoveryReset(): void; + CustomizeClearType(fSet: boolean): void; + CustomizeSettings(fSQM: boolean, fPhishing: boolean, bstrLocale: string): void; + DefaultSearchProvider(): string; + DiagnoseConnection(): void; + EnableSuggestedSites(fEnable: boolean): void; + GetCVListData(): string; + GetCVListLocalData(): string; + GetEMIEListData(): string; + GetEMIEListLocalData(): string; + GetExperimentalFlag(bstrFlagString: string): boolean; + GetExperimentalValue(bstrValueString: string): number; + GetNeedIEAutoLaunchFlag(bstrUrl: string): boolean; + HasNeedIEAutoLaunchFlag(bstrUrl: string): boolean; + ImportExportFavorites(fImport: boolean, strImpExpPath: string): void; + InPrivateFilteringEnabled(): boolean; + IsSearchMigrated(): boolean; + IsSearchProviderInstalled(URL: string): number; + IsServiceInstalled(URL: string, Verb: string): number; + IsSubscribed(URL: string): boolean; + IsSuggestedSitesEnabled(): boolean; + LaunchIE(bstrUrl: string, automated: boolean): void; + LaunchInHVSI(bstrUrl: string): void; + msActiveXFilteringEnabled(): boolean; + msAddSiteMode(): void; + msAddTrackingProtectionList(URL: string, bstrFilterName: string): void; + msChangeDefaultBrowser(fChange: boolean): void; + msClearTile(): void; + msDiagnoseConnectionUILess(): void; + msEnableTileNotificationQueue(fChange: boolean): void; + msEnableTileNotificationQueueForSquare150x150(fChange: boolean): void; + msEnableTileNotificationQueueForSquare310x310(fChange: boolean): void; + msEnableTileNotificationQueueForWide310x150(fChange: boolean): void; + msIsSiteMode(): boolean; + msIsSiteModeFirstRun(fPreserveState: boolean): any; + msLaunchInternetOptions(): void; + msLaunchNetworkClientHelp(): void; + msPinnedSiteState(): any; + msProvisionNetworks(bstrProvisioningXml: string): any; + msRemoveScheduledTileNotification(bstrNotificationId: string): void; + msReportSafeUrl(): void; + msScheduledTileNotification(bstrNotificationXml: string, bstrNotificationId: string, bstrNotificationTag: string, startTime?: any, expirationTime?: any): void; + msSiteModeActivate(): void; + msSiteModeAddButtonStyle(uiButtonID: any, bstrIconURL: string, bstrTooltip: string): any; + msSiteModeAddJumpListItem(bstrName: string, bstrActionUri: string, bstrIconUri: string, pvarWindowType?: any): void; + msSiteModeAddThumbBarButton(bstrIconURL: string, bstrTooltip: string): any; + msSiteModeClearBadge(): void; + msSiteModeClearIconOverlay(): void; + msSiteModeClearJumpList(): void; + msSiteModeCreateJumpList(bstrHeader: string): void; + msSiteModeRefreshBadge(): void; + msSiteModeSetIconOverlay(IconUrl: string, pvarDescription?: any): void; + msSiteModeShowButtonStyle(uiButtonID: any, uiStyleID: any): void; + msSiteModeShowJumpList(): void; + msSiteModeShowThumbBar(): void; + msSiteModeUpdateThumbBarButton(ButtonID: any, fEnabled: boolean, fVisible: boolean): void; + msStartPeriodicBadgeUpdate(pollingUri: string, startTime?: any, uiUpdateRecurrence?: any): void; + msStartPeriodicTileUpdate(pollingUris: any, startTime?: any, uiUpdateRecurrence?: any): void; + msStartPeriodicTileUpdateBatch(pollingUris: any, startTime?: any, uiUpdateRecurrence?: any): void; + msStopPeriodicBadgeUpdate(): void; + msStopPeriodicTileUpdate(): void; + msTrackingProtectionEnabled(): boolean; + NavigateAndFind(URL: string, strQuery: string, varTargetFrame: any): void; + NavigateToSuggestedSites(bstrRelativeUrl: string): void; + OpenFavoritesPane(): void; + OpenFavoritesSettings(): void; + PhishingEnabled(): boolean; + RefreshOfflineDesktop(): void; + ResetAllExperimentalFlagsAndValues(): void; + ResetFirstBootMode(): void; + ResetSafeMode(): void; + RunOnceHasShown(): boolean; + RunOnceRequiredSettingsComplete(fComplete: boolean): void; + RunOnceShown(): void; + SearchGuideUrl(): string; + SetActivitiesVisible(fVisible: boolean): void; + SetExperimentalFlag(bstrFlagString: string, vfFlag: boolean): void; + SetExperimentalValue(bstrValueString: string, dwValue: number): void; + SetNeedIEAutoLaunchFlag(bstrUrl: string, flag: boolean): void; + SetRecentlyClosedVisible(fVisible: boolean): void; + ShowBrowserUI(bstrName: string, pvarIn: any): any; + ShowInPrivateHelp(): void; + ShowTabsHelp(): void; + SkipRunOnce(): void; + SkipTabsWelcome(): void; + SqmEnabled(): boolean; + } + + /** ShellDispatch Load in Shell Context */ + class ShellWindows { + private 'SHDocVw.ShellWindows_typekey': ShellWindows; + private constructor(); + + /** Get count of open Shell windows */ + readonly Count: number; + + /** Find the window based on the location */ + FindWindowSW(pvarloc: any, pvarlocRoot: any, swClass: number, pHWND: number, swfwOptions: number): any; + + /** Return the shell window for the given index */ + Item(index?: any): any; + + /** Notifies the activation */ + OnActivated(lCookie: number, fActive: boolean): void; + + /** Notifies on creation and frame name set */ + OnCreated(lCookie: number, punk: any): void; + + /** Notifies the new location */ + OnNavigate(lCookie: number, pvarloc: any): void; + + /** Used by IExplore to register different processes */ + ProcessAttachDetach(fAttach: boolean): void; + + /** Register a window with the list */ + Register(pid: any, HWND: number, swClass: number, plCookie: number): void; + + /** Register a pending open with the list */ + RegisterPending(lThreadId: number, pvarloc: any, pvarlocRoot: any, swClass: number, plCookie: number): void; + + /** Remove a window from the list */ + Revoke(lCookie: number): void; + } + + /** WebBrowser Control */ + class WebBrowser { + private 'SHDocVw.WebBrowser_typekey': WebBrowser; + private constructor(); + + /** Controls whether address bar is shown (ignored by WebBrowser) */ + AddressBar: boolean; + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Converts client sizes into window sizes. */ + ClientToWindow(pcx: number, pcy: number): void; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** IOleCommandTarget::Exec */ + ExecWB(cmdID: OLECMDID, cmdexecopt: OLECMDEXECOPT, pvaIn?: any, pvaOut?: any): void; + + /** Returns file specification of the application, including path. */ + readonly FullName: string; + + /** Maximizes window and turns off statusbar, toolbar, menubar, and titlebar. */ + FullScreen: boolean; + + /** Retrieve the Associated value for the property vtValue in the context of the object. */ + GetProperty(Property: string): any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** Returns the HWND of the current IE window. */ + readonly HWND: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Controls whether menubar is shown. */ + MenuBar: boolean; + + /** Returns name of the application. */ + readonly Name: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Navigates to a URL or file or pidl. */ + Navigate2(URL: any, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Controls if the frame is offline (read from cache) */ + Offline: boolean; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Returns the path to the application. */ + readonly Path: string; + + /** Associates vtValue with the name szProperty in the context of the object. */ + PutProperty(Property: string, vtValue: any): void; + + /** IOleCommandTarget::QueryStatus */ + QueryStatusWB(cmdID: OLECMDID): OLECMDF; + + /** Exits application and closes the open document. */ + Quit(): void; + readonly ReadyState: tagREADYSTATE; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Registers OC as a top-level browser (for target name resolution) */ + RegisterAsBrowser: boolean; + + /** Registers OC as a drop target for navigation */ + RegisterAsDropTarget: boolean; + + /** Controls whether the window is resizable */ + Resizable: boolean; + + /** Set BrowserBar to Clsid */ + ShowBrowserBar(pvaClsid: string | BrowserBarConstants, pvarShow?: boolean): void; + + /** Controls if any dialog boxes can be shown */ + Silent: boolean; + + /** Turn on or off the statusbar. */ + StatusBar: boolean; + + /** Text of Status window. */ + StatusText: string; + + /** Stops opening a file. */ + Stop(): void; + + /** Controls if the browser is in theater mode */ + TheaterMode: boolean; + + /** Controls which toolbar is shown. */ + ToolBar: number; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** Determines whether the application is visible or hidden. */ + Visible: boolean; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + /** WebBrowser Control */ + class WebBrowser_V1 { + private 'SHDocVw.WebBrowser_V1_typekey': WebBrowser_V1; + private constructor(); + + /** Returns the application automation object if accessible, this automation object otherwise.. */ + readonly Application: any; + + /** Query to see if something is still in progress. */ + readonly Busy: boolean; + + /** Returns the container/parent automation object, if any. */ + readonly Container: any; + + /** Returns the active Document automation object, if any. */ + readonly Document: any; + + /** Navigates to the previous item in the history list. */ + GoBack(): void; + + /** Navigates to the next item in the history list. */ + GoForward(): void; + + /** Go home/start page. */ + GoHome(): void; + + /** Go Search Page. */ + GoSearch(): void; + + /** The vertical dimension (pixels) of the frame window/object. */ + Height: number; + + /** The horizontal position (pixels) of the frame window relative to the screen/container. */ + Left: number; + + /** Gets the short (UI-friendly) name of the URL/file currently viewed. */ + readonly LocationName: string; + + /** Gets the full URL/path currently viewed. */ + readonly LocationURL: string; + + /** Navigates to a URL or file. */ + Navigate(URL: string, Flags?: BrowserNavConstants, TargetFrameName?: TargetFrameValues | string, PostData?: any, Headers?: string): void; + + /** Returns the automation object of the container/parent if one exists or this automation object. */ + readonly Parent: any; + + /** Refresh the currently viewed page. */ + Refresh(): void; + + /** Refresh the currently viewed page. */ + Refresh2(Level?: RefreshConstants): void; + + /** Stops opening a file. */ + Stop(): void; + + /** The vertical position (pixels) of the frame window relative to the screen/container. */ + Top: number; + + /** Returns True if this is the top level object. */ + readonly TopLevelContainer: boolean; + + /** Returns the type of the contained document object. */ + readonly Type: string; + + /** The horizontal dimension (pixels) of the frame window/object. */ + Width: number; + } + + namespace EventHelperTypes { + type InternetExplorer_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type InternetExplorerMedium_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type ShellBrowserWindow_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type ShellNameSpace_FavoritesSelectionChange_ArgNames = ['cItems', 'hItem', 'strName', 'strUrl', 'cVisits', 'strDate', 'fAvailableOffline']; + + type WebBrowser_BeforeNavigate2_ArgNames = ['pDisp', 'URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type WebBrowser_V1_BeforeNavigate_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type WebBrowser_V1_FrameBeforeNavigate_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Cancel']; + + type WebBrowser_V1_FrameNewWindow_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Processed']; + + type WebBrowser_V1_NewWindow_ArgNames = ['URL', 'Flags', 'TargetFrameName', 'PostData', 'Headers', 'Processed']; + + interface InternetExplorer_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface InternetExplorerMedium_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface ShellBrowserWindow_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface ShellNameSpace_FavoritesSelectionChange_Parameter { + readonly cItems: number; + readonly cVisits: number; + readonly fAvailableOffline: number; + readonly hItem: number; + readonly strDate: string; + readonly strName: string; + readonly strUrl: string; + } + + interface WebBrowser_BeforeNavigate2_Parameter { + Cancel: boolean; + readonly Flags: any; + readonly Headers: any; + readonly pDisp: any; + readonly PostData: any; + readonly TargetFrameName: any; + readonly URL: any; + } + + interface WebBrowser_V1_BeforeNavigate_Parameter { + Cancel: boolean; + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + readonly TargetFrameName: string; + readonly URL: string; + } + + interface WebBrowser_V1_FrameBeforeNavigate_Parameter { + Cancel: boolean; + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + readonly TargetFrameName: string; + readonly URL: string; + } + + interface WebBrowser_V1_FrameNewWindow_Parameter { + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + Processed: boolean; + readonly TargetFrameName: string; + readonly URL: string; + } + + interface WebBrowser_V1_NewWindow_Parameter { + readonly Flags: number; + readonly Headers: string; + readonly PostData: any; + Processed: boolean; + readonly TargetFrameName: string; + readonly URL: string; + } + } +} + +interface ActiveXObject { + on( + obj: SHDocVw.InternetExplorer, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.InternetExplorer_BeforeNavigate2_ArgNames, + handler: (this: SHDocVw.InternetExplorer, parameter: SHDocVw.EventHelperTypes.InternetExplorer_BeforeNavigate2_Parameter) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.InternetExplorer, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: (this: SHDocVw.InternetExplorer, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], + handler: (this: SHDocVw.InternetExplorer, parameter: { ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, readonly bstrUrl: string }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly StatusBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: (this: SHDocVw.InternetExplorer, + parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: (this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, readonly StatusCode: any }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: (this: SHDocVw.InternetExplorer, + parameter: { readonly SecureLockIcon: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Left: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetResizable', argNames: ['Resizable'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.InternetExplorer, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.InternetExplorer, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], handler: ( + this: SHDocVw.InternetExplorer, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.InternetExplorerMedium_BeforeNavigate2_ArgNames, + handler: (this: SHDocVw.InternetExplorerMedium, parameter: SHDocVw.EventHelperTypes.InternetExplorerMedium_BeforeNavigate2_Parameter) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { + ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, + readonly bstrUrl: string + }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.InternetExplorerMedium, + parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly StatusBar: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.InternetExplorerMedium, + parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, readonly StatusCode: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly SecureLockIcon: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Left: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetResizable', argNames: ['Resizable'], handler: ( + this: SHDocVw.InternetExplorerMedium, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.InternetExplorerMedium, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], + handler: (this: SHDocVw.InternetExplorerMedium, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.ShellBrowserWindow_BeforeNavigate2_ArgNames, + handler: (this: SHDocVw.ShellBrowserWindow, parameter: SHDocVw.EventHelperTypes.ShellBrowserWindow_BeforeNavigate2_Parameter) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], + handler: (this: SHDocVw.ShellBrowserWindow, parameter: { ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, readonly bstrUrl: string }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly StatusBar: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: (this: SHDocVw.ShellBrowserWindow, parameter: { + readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, + readonly StatusCode: any + }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly SecureLockIcon: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Left: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetResizable', argNames: ['Resizable'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.ShellBrowserWindow, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.ShellBrowserWindow, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], handler: ( + this: SHDocVw.ShellBrowserWindow, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.ShellNameSpace, event: 'FavoritesSelectionChange', argNames: SHDocVw.EventHelperTypes.ShellNameSpace_FavoritesSelectionChange_ArgNames, + handler: (this: SHDocVw.ShellNameSpace, parameter: SHDocVw.EventHelperTypes.ShellNameSpace_FavoritesSelectionChange_Parameter) => void): void; + on(obj: SHDocVw.ShellWindows, event: 'WindowRegistered' | 'WindowRevoked', argNames: ['lCookie'], handler: (this: SHDocVw.ShellWindows, parameter: { readonly lCookie: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'BeforeNavigate2', argNames: SHDocVw.EventHelperTypes.WebBrowser_BeforeNavigate2_ArgNames, handler: ( + this: SHDocVw.WebBrowser, parameter: SHDocVw.EventHelperTypes.WebBrowser_BeforeNavigate2_Parameter) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'BeforeScriptExecute', argNames: ['pDispWindow'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly pDispWindow: any }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'ClientToHostWindow', argNames: ['CX', 'CY'], handler: (this: SHDocVw.WebBrowser, parameter: { CX: number, CY: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'DocumentComplete' | 'NavigateComplete2', argNames: ['pDisp', 'URL'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly URL: any }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'FileDownload', argNames: ['ActiveDocument', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly ActiveDocument: boolean, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'NavigateError', argNames: ['pDisp', 'URL', 'Frame', 'StatusCode', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly URL: any, readonly Frame: any, readonly StatusCode: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'NewProcess', argNames: ['lCauseFlag', 'pWB2', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly lCauseFlag: number, readonly pWB2: any, Cancel: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'NewWindow2', argNames: ['ppDisp', 'Cancel'], handler: (this: SHDocVw.WebBrowser, parameter: { ppDisp: any, Cancel: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'NewWindow3', argNames: ['ppDisp', 'Cancel', 'dwFlags', 'bstrUrlContext', 'bstrUrl'], handler: ( + this: SHDocVw.WebBrowser, parameter: { ppDisp: any, Cancel: boolean, readonly dwFlags: number, readonly bstrUrlContext: string, readonly bstrUrl: string }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnFullScreen', argNames: ['FullScreen'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly FullScreen: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnMenuBar', argNames: ['MenuBar'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly MenuBar: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnStatusBar', argNames: ['StatusBar'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly StatusBar: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnTheaterMode', argNames: ['TheaterMode'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly TheaterMode: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnToolBar', argNames: ['ToolBar'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly ToolBar: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'OnVisible', argNames: ['Visible'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Visible: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'PrintTemplateInstantiation' | 'PrintTemplateTeardown', argNames: ['pDisp'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'PrivacyImpactedStateChange', argNames: ['bImpacted'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly bImpacted: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'PropertyChange', argNames: ['szProperty'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly szProperty: string }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'RedirectXDomainBlocked', argNames: ['pDisp', 'StartURL', 'RedirectURL', 'Frame', 'StatusCode'], + handler: (this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly StartURL: any, readonly RedirectURL: any, readonly Frame: any, readonly StatusCode: any }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'SetPhishingFilterStatus', argNames: ['PhishingFilterStatus'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly PhishingFilterStatus: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'SetSecureLockIcon', argNames: ['SecureLockIcon'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly SecureLockIcon: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Text: string }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'ThirdPartyUrlBlocked', argNames: ['URL', 'dwCount'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly URL: any, readonly dwCount: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'UpdatePageStatus', argNames: ['pDisp', 'nPage', 'fDone'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly pDisp: any, readonly nPage: any, readonly fDone: any }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WebWorkerFinsihed', argNames: ['dwUniqueID'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly dwUniqueID: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'WebWorkerStarted', argNames: ['dwUniqueID', 'bstrWorkerLabel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly dwUniqueID: number, readonly bstrWorkerLabel: string }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'WindowClosing', argNames: ['IsChildWindow', 'Cancel'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly IsChildWindow: boolean, Cancel: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetHeight', argNames: ['Height'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Height: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetLeft', argNames: ['Left'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Left: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetResizable', argNames: ['Resizable'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Resizable: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetTop', argNames: ['Top'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Top: number }) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'WindowSetWidth', argNames: ['Width'], handler: (this: SHDocVw.WebBrowser, parameter: { readonly Width: number }) => void): void; + on( + obj: SHDocVw.WebBrowser, event: 'WindowStateChanged', argNames: ['dwWindowStateFlags', 'dwValidFlagsMask'], handler: ( + this: SHDocVw.WebBrowser, parameter: { readonly dwWindowStateFlags: number, readonly dwValidFlagsMask: number }) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'BeforeNavigate', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_BeforeNavigate_ArgNames, + handler: (this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_BeforeNavigate_Parameter) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'CommandStateChange', argNames: ['Command', 'Enable'], handler: ( + this: SHDocVw.WebBrowser_V1, parameter: { readonly Command: number, readonly Enable: boolean }) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'FrameBeforeNavigate', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameBeforeNavigate_ArgNames, + handler: (this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameBeforeNavigate_Parameter) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'FrameNavigateComplete' | 'NavigateComplete', argNames: ['URL'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { readonly URL: string }) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'FrameNewWindow', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameNewWindow_ArgNames, + handler: (this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_FrameNewWindow_Parameter) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'NewWindow', argNames: SHDocVw.EventHelperTypes.WebBrowser_V1_NewWindow_ArgNames, handler: ( + this: SHDocVw.WebBrowser_V1, parameter: SHDocVw.EventHelperTypes.WebBrowser_V1_NewWindow_Parameter) => void): void; + on( + obj: SHDocVw.WebBrowser_V1, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( + this: SHDocVw.WebBrowser_V1, parameter: { readonly Progress: number, readonly ProgressMax: number }) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'PropertyChange', argNames: ['Property'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { readonly Property: string }) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'Quit', argNames: ['Cancel'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { Cancel: boolean }) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'StatusTextChange' | 'TitleChange', argNames: ['Text'], handler: (this: SHDocVw.WebBrowser_V1, parameter: { readonly Text: string }) => void): void; + on(obj: SHDocVw.InternetExplorer, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.InternetExplorer, parameter: {}) => void): void; + on(obj: SHDocVw.InternetExplorerMedium, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.InternetExplorerMedium, parameter: {}) => void): void; + on(obj: SHDocVw.ShellBrowserWindow, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.ShellBrowserWindow, parameter: {}) => void): void; + on(obj: SHDocVw.ShellNameSpace, event: 'DoubleClick' | 'Initialized' | 'SelectionChange', handler: (this: SHDocVw.ShellNameSpace, parameter: {}) => void): void; + on(obj: SHDocVw.WebBrowser, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.WebBrowser, parameter: {}) => void): void; + on(obj: SHDocVw.WebBrowser_V1, event: 'DownloadBegin' | 'DownloadComplete' | 'WindowActivate' | 'WindowMove' | 'WindowResize', handler: (this: SHDocVw.WebBrowser_V1, parameter: {}) => void): void; + new (progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'InternetExplorer.Application': SHDocVw.InternetExplorer; + 'Shell.Explorer': SHDocVw.WebBrowser; + 'Shell.UIHelper': SHDocVw.ShellUIHelper; + 'ShellNameSpace.ShellNameSpace': SHDocVw.ShellNameSpace; +} + +interface EnumeratorConstructor { + new(col: SHDocVw.ShellWindows): Enumerator; +} diff --git a/types/activex-shdocvw/package.json b/types/activex-shdocvw/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-shdocvw/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/yfiles/tsconfig.json b/types/activex-shdocvw/tsconfig.json similarity index 75% rename from types/yfiles/tsconfig.json rename to types/activex-shdocvw/tsconfig.json index 9152563e46..1759b6965f 100644 --- a/types/yfiles/tsconfig.json +++ b/types/activex-shdocvw/tsconfig.json @@ -1,13 +1,11 @@ + { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es5", "scripthost"], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -19,6 +17,6 @@ }, "files": [ "index.d.ts", - "yfiles-tests.ts" + "activex-shdocvw-tests.ts" ] } \ No newline at end of file diff --git a/types/activex-shdocvw/tslint.json b/types/activex-shdocvw/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-shdocvw/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-shell/activex-shell-tests.ts b/types/activex-shell/activex-shell-tests.ts new file mode 100644 index 0000000000..1a7e08754c --- /dev/null +++ b/types/activex-shell/activex-shell-tests.ts @@ -0,0 +1,489 @@ +/// + +const shell = new ActiveXObject('Shell.Application'); + +const getWindowsFolder = () => shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfWINDOWS); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537735(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + if (!folder) { return; } + const folderItem = folder.ParseName('system.ini'); + if (!folderItem) { return; } + shell.AddToRecent(folderItem.Path); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774065(v=vs.85).aspx +(() => { + const folder = shell.BrowseForFolder(0, 'Example', 0, Shell32.ShellSpecialFolderConstants.ssfWINDOWS); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537736(v=vs.85).aspx +const canStartStop = shell.CanStartStopService('service name'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774069(v=vs.85).aspx +shell.ControlPanelItem('desk.cpl'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774073(v=vs.85).aspx +shell.Explore('C:\\'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537737(v=vs.85).aspx +const explorerPolicy = shell.ExplorerPolicy('ValueName'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537739(v=vs.85).aspx +const settingValue = shell.GetSetting(Shell32.SettingKey.SSF_SHOWALLOBJECTS); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537740(v=vs.85).aspx +const processorLevel = shell.GetSystemInformation('ProcessorLevel'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537741(v=vs.85).aspx +const isRestricted = shell.IsRestricted('system', 'undockwithoutlogon'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537742(v=vs.85).aspx +const isServiceRunning = shell.IsServiceRunning('Themes'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774086(v=vs.85).aspx +shell.Open(Shell32.ShellSpecialFolderConstants.ssfWINDOWS); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537743(v=vs.85).aspx +shell.ServiceStart('Messenger', true); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537744(v=vs.85).aspx +shell.ServiceStop('Messenger', true); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537745(v=vs.85).aspx +shell.ShellExecute("notepad.exe", "", "", "open", Shell32.ShellExecuteShow.Normal); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/gg537746(v=vs.85).aspx?cs-save-lang=1&cs-lang=jscript#code-snippet-1 +shell.ShowBrowserBar(Shell32.ExplorerBarCLSID.Favorites, true); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774107(v=vs.85).aspx +const wshShell = new ActiveXObject('WScript.Shell'); +wshShell.Popup(shell.Windows().Count); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx +shell.NameSpace(`c:\\windows`)!.CopyHere('c:\\autoexec.bat'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787870(v=vs.85).aspx +(() => { + const folder = shell.NameSpace('c:\\windows'); + const folderItem = folder ? folder.ParseName('clock.avi') : undefined; + if (folder && folderItem) { + const info = folder.GetDetailsOf(folderItem, Shell32.FileSystemDetails.Type); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787874(v=vs.85).aspx +shell.NameSpace('c:\\windows')!.MoveHere('c:\\temp.txt', Shell32.FileOperationFlag.FOF_NOCONFIRMATION); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787876(v=vs.85).aspx +shell.NameSpace('c:\\')!.NewFolder('TestFolder'); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787858(v=vs.85).aspx +(() => { + const folder = shell.NameSpace("\\\\server\\share\\folder"); + const offlineStatus = folder ? folder.OfflineStatus : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787880(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + WScript.Echo(folder!.ParentFolder.Title); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787860(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787816(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787850(v=vs.85).aspx +(() => { + const folder = shell.NameSpace('C:\\WINDOWS'); + const folderItem = folder ? folder.Self : undefined; + if (folderItem) { + const verbs = folderItem.Verbs(); + folderItem.InvokeVerb(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787812(v=vs.85).aspx +(() => { + const parentFolder = getWindowsFolder(); + const folderItem = parentFolder ? parentFolder.ParseName('system32') : undefined; + const folder = folderItem ? folderItem.GetFolder : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787814(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787824(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + const folderItem = folder ? folder.ParseName('Internet Explorer.lnk') : undefined; + if (folderItem && folderItem.IsLink) { + const link = folderItem.GetLink; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787818(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787819(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787821(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.Self : undefined; + if (folderItem) { + const isBrowsable = folderItem.IsBrowsable; + const isFileSystem = folderItem.IsFileSystem; + const isFolder = folderItem.IsFolder; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787825(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder!.ParseName('notepad.exe'); + if (folderItem) { + const oldDate = folderItem.ModifyDate; + folderItem.ModifyDate = new Date(1900, 1, 1, 18, 5).getVarDate(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787827(v=vs.85).aspx +(() => { + const rootFolder = shell.NameSpace('C:\\'); + const folderItem = rootFolder ? rootFolder.ParseName('autoexec.bat') : undefined; + if (folderItem) { + const oldName = folderItem.Name; + folderItem.Name = 'test.bat'; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787829(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.Self : undefined; + const parent = folderItem ? folderItem.Parent : undefined; + if (parent) { + WScript.Echo('Got parent object'); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787844(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.Self : undefined; + const path = folderItem ? folderItem.Path : ''; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787846(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder!.ParseName('notepad.exe'); + const size = folderItem ? folderItem.Size : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787848(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + if (folder) { + WScript.Echo(folder.Self.Type); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787798(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItems = folder ? folder.Items() : undefined; + const count = folderItems ? folderItems.Count : undefined; +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787794(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfDRIVES); + if (folder) { + folder.Items().InvokeVerbEx(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774170(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774174(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + const verbs = folder ? folder.Self.Verbs() : undefined; + if (verbs) { + const verb = verbs.Item(0); + WScript.Echo(verb.Name); + verb.DoIt(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787787(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + if (folder) { + const folderItems = folder.Items(); + WScript.Echo(folderItems.Count); + folderItems.Filter(Shell32.ShellFolderEnumerationFlags.SHCONTF_NONFOLDERS, '*.txt'); + WScript.Echo(folderItems.Count); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb787791(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774162(v=vs.85).aspx +(() => { + const echoFirstVerbName = (folder: Shell32.Folder3 | null) => { + if (!folder) { return; } + const verbs = folder.Items().Verbs; + WScript.Echo(verbs.Item(0).Name); + }; + + let folder = getWindowsFolder(); + echoFirstVerbName(folder); + + folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfCONTROLS); + echoFirstVerbName(folder); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774158(v=vs.85).aspx +(() => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfCONTROLS); + if (folder) { + const verbs = folder.Self.Verbs(); + WScript.Echo(verbs.Count); + } +})(); + +const getIELink = () => { + const folder = shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfPROGRAMS); + const folderItem = folder ? folder.ParseName('Internet Explorer.lnk') : undefined; + return { + link: folderItem ? folderItem.GetLink : undefined, + folderItem + }; +}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773990(v=vs.85).aspx +(() => { + const { link, folderItem } = getIELink(); + if (link && folderItem) { + WScript.Echo(link.GetIconLocation(folderItem.Path)); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773996(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + link.Resolve(Shell32.ShellLinkResolveFlags.NoUI); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773998(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + link.Description = 'New Description'; + link.Save(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774002(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + link.SetIconLocation(link.Path, 1); + link.Save(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773986(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.Arguments); + link.Arguments = '/s'; + link.Save(); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773988(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.Description); + link.Description = 'Test'; + link.Save(); + } +})(); + +const parseHotkey = (hotkey: number) => { + // missing implementation + return { + shift: false, + ctrl: false, + alt: false, + extended: false, + hotkey + }; +}; +const buildHotkey = (hotkey: number, shift: boolean = false, ctrl: boolean = false, alt: boolean = false, extended: boolean = false) => { + // missing implementation + return 0; +}; + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773992(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + const { hotkey } = parseHotkey(link.Hotkey); + WScript.Echo(hotkey); + link.Hotkey = buildHotkey(4); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773994(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.Path); + link.Path = 'C:\\Program Files\\IE\\IEXPLORE.EXE'; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774006(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.ShowCommand); + link.ShowCommand = Shell32.LinkShowWindowState.Normal; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774008(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + WScript.Echo(link.WorkingDirectory); + link.WorkingDirectory = ''; + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774115(v=vs.85).aspx +(() => { + const { link } = getIELink(); + if (link) { + const target = link.Target; + if (target) { + WScript.Echo(target.Size); + } + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774055(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.ParseName('notepad.exe') : undefined; + if (folderItem) { + WScript.Echo(folderItem.ExtendedProperty('infotip')); + } + + const wordDoc = shell.NameSpace('C:\\')!.ParseName('test.doc'); + if (wordDoc) { + const FMTID_SummaryInfo = "{F29F85E0-4FF9-1068-AB91-08002B27B3D9}"; + const PID_TITLE = "2"; + const PID_AUTHOR = "4"; + const SCID_TITLE = `${FMTID_SummaryInfo} ${PID_TITLE}`; + const SCID_AUTHOR = `${FMTID_SummaryInfo} ${PID_AUTHOR}`; + const docTitle = wordDoc.ExtendedProperty(SCID_TITLE); + const docAuthor = wordDoc.ExtendedProperty(SCID_AUTHOR); + } +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774057(v=vs.85).aspx +(() => { + const folder = getWindowsFolder(); + const folderItem = folder ? folder.ParseName('notepad.exe') : undefined; + if (folderItem) { + folderItem.InvokeVerbEx("open", "c:\\autoexec.bat"); + } +})(); + +const collectionToArray = (col: any): T[] => { // tslint:disable-line no-unnecessary-generics + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +interface String { + endsWith(searchString: string, length?: number): boolean; +} +if (!String.prototype.endsWith) { + String.prototype.endsWith = function(search, this_len) { + if (this_len === undefined || this_len > this.length) { + this_len = this.length; + } + return this.substring(this_len - search.length, this_len) === search; + }; +} + +// shell.Windows() includes items other than Explorer windows, such as Internet Explorer tabs +const getExplorerWindows = () => + collectionToArray(shell.Windows()) + .filter(x => x.FullName.toLowerCase().endsWith('explorer.exe')); + +const getFolderViews = () => + getExplorerWindows() + .map(x => x.Document as Shell32.ShellFolderView); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774045(v=vs.85).aspx +(() => { + getFolderViews().forEach(x => + ActiveXObject.on(x, 'SelectionChanged', function(this: Shell32.ShellFolderView) { + WScript.Echo(`Selection change in ${this.Folder.Title} -- count: ${this.SelectedItems().Count}`); + }) + ); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773970(v=vs.85).aspx +WScript.Echo(shell.Windows().Item().Path); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb773969(v=vs.85).aspx +WScript.Echo(shell.Windows().Count); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774043(v=vs.85).aspx +(() => { + getFolderViews().forEach(x => + WScript.Echo(`${x.Folder.Title} -- ${x.SelectedItems().Count} selected items`) + ); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774047(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774022(v=vs.85).aspx +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774053(v=vs.85).aspx +(() => { + const folderView = getExplorerWindows()[0].Document as Shell32.ShellFolderView; + const folder = folderView.Folder; + if (folder) { + const folderItem = folder.Self; + folderView.SelectItem(folder.Self, Shell32.ShellFolderViewSelectItem.Focus); + } + WScript.Echo(folderView.ViewOptions); +})(); + +// https://msdn.microsoft.com/en-us/library/windows/desktop/bb774020(v=vs.85).aspx +(() => { + const folderView = getExplorerWindows()[0].Document as Shell32.ShellFolderView; + const focusedItem = folderView.FocusedItem; + if (focusedItem) { + WScript.Echo(`Focused item in first Excplorer window -- ${focusedItem.Path}`); + } +})(); + +(() => { + const router = new ActiveXObject('Shell.FolderView'); + const folder = getFolderViews()[0]; + router.SetFolderView(folder); + ActiveXObject.on(router, 'EnumDone', () => WScript.Echo('Current folder view was finisehd enumerating')); + ActiveXObject.on(router, 'SelectionChanged', () => WScript.Echo('Selection changed in current folder view')); + // the folder view monitored by the ShellFolderViewOC object can be changed via SetFolderView without disconnecting and reconnecting the handlers +})(); diff --git a/types/activex-shell/index.d.ts b/types/activex-shell/index.d.ts new file mode 100644 index 0000000000..cb59a11c5e --- /dev/null +++ b/types/activex-shell/index.d.ts @@ -0,0 +1,1016 @@ +// Type definitions for Microsoft Shell Controls And Automation - Shell32 1.0 +// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773938(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +declare namespace Shell32 { + // tslint:disable-next-line no-const-enum + const enum BrowseInfoFlags { + /** + * Allow folder junctions such as a library or a compressed file with a .zip file name extension to be browsed. + * + * _Windows 7 and later._ + */ + BIF_BROWSEFILEJUNCTIONS = 0x00010000, + + /** Only return computers. If the user selects anything other than a computer, the **OK** button is grayed. */ + BIF_BROWSEFORCOMPUTER = 0x00001000, + + /** + * Only allow the selection of printers. If the user selects anything other than a printer, the **OK** button is grayed. + * + * In Windows XP and later systems, the best practice is to use a Windows XP-style dialog, setting the root of the dialog to the **Printers and Faxes** folder (`CSIDL_PRINTERS`). + */ + BIF_BROWSEFORPRINTER = 0x00002000, + + /** + * The browse dialog box displays files as well as folders. + * + * _[Version 4.7.1](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_BROWSEINCLUDEFILES = 0x00004000, + + /** + * The browse dialog box can display URLs. The `BIF_USENEWUI` and `BIF_BROWSEINCLUDEFILES` flags must also be set. If any of these three flags are not set, the browser dialog box rejects URLs. + * Even when these flags are set, the browse dialog box displays URLs only if the folder that contains the selected item supports URLs. + * + * When the folder's [IShellFolder::GetAttributesOf](https://msdn.microsoft.com/en-us/library/windows/desktop/bb775068.aspx) method is called to request the selected item's attributes, the + * folder must set the `SFGAO_FOLDER` attribute flag. Otherwise, the browse dialog box will not display the URL. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_BROWSEINCLUDEURLS = 0x00000080, + + /** Do not include network folders below the domain level in the dialog box's tree view control. */ + BIF_DONTGOBELOWDOMAIN = 0x00000002, + + /** + * Include an edit control in the browse dialog box that allows the user to type the name of an item. + * + * _[Version 4.7.1](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_EDITBOX = 0x00000010, + + /** + * Use the new user interface. Setting this flag provides the user with a larger dialog box that can be resized. The dialog box has several new capabilities, including: drag-and-drop + * capability within the dialog box, reordering, shortcut menus, new folders, delete, and other shortcut menu commands. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_NEWDIALOGSTYLE = 0x00000040, + + /** + * Do not include the **New Folder** button in the browse dialog box. + * + * _[Version 6.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_NONEWFOLDERBUTTON = 0x00000200, + + /** + * When the selected item is a shortcut, return the PIDL of the shortcut itself rather than its target. + * + * _[Version 6.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_NOTRANSLATETARGETS = 0x00000400, + + /** + * Only return file system ancestors. An ancestor is a subfolder that is beneath the root folder in the namespace hierarchy. If the user selects an ancestor of the root folder that is not + * part of the file system, the **OK** button is grayed. + */ + BIF_RETURNFSANCESTORS = 0x00000008, + + /** + * Only return file system directories. If the user selects folders that are not part of the file system, the **OK** button is grayed. + * + * **Note** The **OK** button remains enabled for `\\server` items, as well as `\\server\share` and directory items. However, if the user selects a `\\server` item, passing the PIDL + * returned by [SHBrowseForFolder](https://msdn.microsoft.com/en-us/library/windows/desktop/bb762115.aspx) to + * [SHGetPathFromIDList](https://msdn.microsoft.com/en-us/library/windows/desktop/bb762194.aspx) fails. + */ + BIF_RETURNONLYFSDIRS = 0x00000001, + + /** + * The browse dialog box can display sharable resources on remote systems. This is intended for applications that want to expose remote shares on a local system. The BIF_NEWDIALOGSTYLE flag + * must also be set. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_SHAREABLE = 0x00008000, + + /** + * Include a status area in the dialog box. The callback function can set the status text by sending messages to the dialog box. This flag is not supported when BIF_NEWDIALOGSTYLE + * is specified. + */ + BIF_STATUSTEXT = 0x00000004, + + /** + * When combined with `BIF_NEWDIALOGSTYLE`, adds a usage hint to the dialog box, in place of the edit box. `BIF_EDITBOX` overrides this flag. + * + * _[Version 6.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_UAHINT = 0x00000100, + + /** + * Use the new user interface, including an edit box. This flag is equivalent to `BIF_EDITBOX | BIF_NEWDIALOGSTYLE`. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + BIF_USENEWUI = 0x00000090, + + /** + * If the user types an invalid name into the edit box, the browse dialog box calls the application's + * [BrowseCallbackProc](https://msdn.microsoft.com/en-us/library/windows/desktop/bb762598.aspx) with the **BFFM_VALIDATEFAILED** message. This flag is ignored if BIF_EDITBOX is not specified. + * + * _[Version 4.71](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779)_ + */ + BIF_VALIDATE = 0x00000020, + } + + // tslint:disable-next-line no-const-enum + const enum ExplorerBarCLSID { + Favorites = '{EFA24E61-B078-11d0-89E4-00C04FC9E26E}', + Folders = '{EFA24E64-B078-11d0-89E4-00C04FC9E26E}', + History = '{EFA24E62-B078-11d0-89E4-00C04FC9E26E}', + Search = '{30D02401-6A81-11d0-8274-00C04FD5AE38}', + } + + // tslint:disable-next-line no-const-enum + const enum FileOperationFlag { + /** Preserve undo information, if possible. */ + FOF_ALLOWUNDO = 64, + + /** Perform the operation on files only if a wildcard file name (*.*) is specified. */ + FOF_FILESONLY = 128, + + /** Respond with "Yes to All" for any dialog box that is displayed. */ + FOF_NOCONFIRMATION = 16, + + /** Do not confirm the creation of a new directory if the operation requires one to be created. */ + FOF_NOCONFIRMMKDIR = 512, + + /** + * Do not copy connected files as a group. Only copy the specified files. + * + * _[Version 5.0](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + FOF_NO_CONNECTED_ELEMENTS = 8192, + + /** + * Do not copy the security attributes of the file. + * + * _[Version 4.7.1](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776779.aspx)_ + */ + FOF_NOCOPYSECURITYATTRIBS = 2048, + + /** Do not display a user interface if an error occurs. */ + FOF_NOERRORUI = 1024, + + /** Only operate in the local directory. Do not operate recursively into subdirectories. */ + FOF_NORECURSION = 4096, + + /** Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists. */ + FOF_RENAMEONCOLLISION = 8, + + /** Do not display a progress dialog box. */ + FOF_SILENT = 4, + + /** Display a progress dialog box but do not show the file names. */ + FOF_SIMPLEPROGRESS = 256, + } + + // tslint:disable-next-line no-const-enum + const enum FileSystemDetails { + Name = 0, + Size = 1, + Type = 2, + LastModified = 3, + Attributes = 4, + InfoTip = -1, + } + + // tslint:disable-next-line no-const-enum + const enum HotkeyModifiers { + SHIFT = 1, + CTRL = 2, + ALT = 4, + Extended = 8 + } + + // tslint:disable-next-line no-const-enum + const enum LinkShowWindowState { + /** Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. */ + Normal = 1, + + /** Activates the window and displays it as a minimized window. */ + Minimized = 2, + + /** Activates the window and displays it as a maximized window. */ + Maximized = 3 + } + + /** Constants for Folder2.OfflineStatus */ + // tslint:disable-next-line no-const-enum + const enum OfflineFolderStatus { + OFS_DIRTYCACHE = 3, + OFS_INACTIVE = -1, + OFS_OFFLINE = 1, + OFS_ONLINE = 0, + OFS_SERVERBACK = 2, + } + + // tslint:disable-next-line no-const-enum + const enum ShellFolderEnumerationFlags { + /** **Windows 7 and later** The calling application is checking for the existence of child items in the folder. */ + SHCONTF_CHECKING_FOR_CHILDREN = 0x00010, + + /** Include items that are folders in the enumeration. */ + SHCONTF_FOLDERS = 0x00020, + + /** Include items that are not folders in the enumeration. */ + SHCONTF_NONFOLDERS = 0x00040, + + /** Include hidden items in the enumeration. This does not include hidden system items. (To include hidden system items, use SHCONTF_INCLUDESUPERHIDDEN.) */ + SHCONTF_INCLUDEHIDDEN = 0x00080, + + /** The calling application is looking for printer objects. */ + SHCONTF_NETPRINTERSRCH = 0x00200, + + /** The calling application is looking for resources that can be shared. */ + SHCONTF_SHAREABLE = 0x00400, + + /** Include items with accessible storage and their ancestors, including hidden items. */ + SHCONTF_STORAGE = 0x00800, + + /** **Windows 7 and later**. Child folders should provide a navigation enumeration. */ + SHCONTF_NAVIGATION_ENUM = 0x01000, + + /** **Windows Vista and later**. The calling application is looking for resources that can be enumerated quickly. */ + SHCONTF_FASTITEMS = 0x02000, + + /** **Windows Vista and later**. Enumerate items as a simple list even if the folder itself is not structured in that way. */ + SHCONTF_FLATLIST = 0x04000, + + /** + * **Windows Vista and later**. The calling application is monitoring for change notifications.This means that the enumerator does not have to return all results. + * Items can be reported through change notifications. + */ + SHCONTF_ENABLE_ASYNC = 0x08000, + + /** + * **Windows 7 and later**. Include hidden system items in the enumeration. This value does not include hidden non-system items. + * (To include hidden non-system items, use SHCONTF_INCLUDEHIDDEN.) + */ + SHCONTF_INCLUDESUPERHIDDEN = 0x10000, + } + + // tslint:disable-next-line no-const-enum + const enum ShellFolderViewOptions { + /** The **Show All Files** option is enabled. */ + SFVVO_SHOWALLOBJECTS = 0x00000001, + + /** The **Hide extensions for known file types** option is disabled. */ + SFVVO_SHOWEXTENSIONS = 0x00000002, + + /** The **Display Compressed Files and Folders with Alternate Color** option is enabled. */ + SFVVO_SHOWCOMPCOLOR = 0x00000008, + + /** The **Do Not Show Hidden Files** option is enabled. */ + SFVVO_SHOWSYSFILES = 0x00000020, + + /** The **Classic Style** option is enabled. */ + SFVVO_WIN95CLASSIC = 0x00000040, + + /** The **Double-Click to Open an Item** option is enabled. */ + SFVVO_DOUBLECLICKINWEBVIEW = 0x00000080, + + /** The **Active Desktop – View as Web Page** option is enabled. */ + SFVVO_DESKTOPHTML = 0x00000200 + } + + // tslint:disable-next-line no-const-enum + const enum ShellFolderViewSelectItem { + Deselect = 0, + Select = 1, + EditMode = 3, + DeselectAllButThis = 4, + ScrollIntoView = 8, + Focus = 16 + } + + // tslint:disable-next-line no-const-enum + const enum ShellLinkResolveFlags { + /** + * Do not display a dialog box if the link cannot be resolved. When this flag is set, the high-order word of _fFlags_ specifies a time-out duration, in milliseconds. + * The method returns if the link cannot be resolved within the time-out duration. If the high-order word is set to zero, the time-out duration defaults to 3000 milliseconds (3 seconds). + */ + NoUI = 1, + + /** If the link has changed, update its path and list of identifiers. */ + Update = 4, + + /** Do not update the link information. */ + NoUpdate = 8, + + /** Do not execute the search heuristics. */ + NoSearch = 16, + + /** Do not use distributed link tracking. */ + NoTrack = 32, + + /** + * Disable distributed link tracking. By default, distributed link tracking tracks removable media across multiple devices based on the volume name. + * It also uses the UNC path to track remote file systems whose drive letter has changed. Setting this flag disables both types of tracking. + */ + NoLinkInfo = 64, + + /** Call the Windows Installer. */ + InvokeMSI = 128 + } + + // tslint:disable-next-line no-const-enum + const enum SettingKey { + /** + * The state of the **Use check boxes to select items** option. This option is enabled automatically when the system has a pen input device configured. + * + * _Windows Vista and later_ + */ + SSF_AUTOCHECKSELECT = 0x00800000, + + /** Not used. */ + SSF_DESKTOPHTML = 0x00000200, + + /** The state of the **Allow all uppercase names** option. As of Windows Vista, this folder option is no longer available. */ + SSF_DONTPRETTYPATH = 0x00000800, + + /** The state of the **Double-click to open an item (single-click to select)** option. */ + SSF_DOUBLECLICKINWEBVIEW = 0x00000080, + + /** Not used. */ + SSF_FILTER = 0x00010000, + + /** Not used. */ + SSF_HIDDENFILEEXTS = 0x00000004, + + /** The state of icon display in the Windows Explorer list view. If this option is active, no icons are displayed in the list view. */ + SSF_HIDEICONS = 0x00004000, + + /** + * The state of display name display in the Windows Explorer list view. If this option is active, icons are displayed in the list view, but display names are not. + * + * _Windows Vista and later_ + */ + SSF_ICONSONLY = 0x01000000, + + /** The state of the **Show map network drive button in toolbar** option. As of Windows Vista, this option is no longer available. */ + SSF_MAPNETDRVBUTTON = 0x00001000, + + /** The state of the Recycle Bin's **Display delete confirmation dialog** option. */ + SSF_NOCONFIRMRECYCLE = 0x00008000, + + /** The state of the **Automatically search for network folders and printers** option. As of Windows Vista, this option is no longer available. */ + SSF_NONETCRAWLING = 0x00100000, + + /** The state of the **Launch folder windows in a separate process** option. */ + SSF_SEPPROCESS = 0x00080000, + + /** Not used. */ + SSF_SERVERADMINUI = 0x00000004, + + /** The state of the **Hidden files and folders** option. */ + SSF_SHOWALLOBJECTS = 0x00000001, + + /** The state of the **Show File Attributes in Detail View** option. As of Windows Vista, this option is no longer available. */ + SSF_SHOWATTRIBCOL = 0x00000100, + + /** The state of the **Show encrypted or compressed NTFS files in color** option. */ + SSF_SHOWCOMPCOLOR = 0x00000008, + + /** The state of the **Hide extensions for known file types** option. */ + SSF_SHOWEXTENSIONS = 0x00000002, + + /** The state of the **Show pop-up description for folder and desktop items** option. */ + SSF_SHOWINFOTIP = 0x00002000, + + /** Not used. */ + SSF_SHOWSTARTPAGE = 0x00400000, + + /** The state of the **Hide protected operating system files** option. */ + SSF_SHOWSUPERHIDDEN = 0x00040000, + + /** + * The state of the **Hidden files and folders** option. In Windows Vista and later, this is equivalent to `SSF_SHOWALLOBJECTS`. In versions of Windows before Windows Vista, this value + * referred to the state of the **Do not show hidden files and folders** option. + */ + SSF_SHOWSYSFILES = 0x00000020, + + /** + * The state of the **Display file icon on thumbnails** option. If this option is active, a file type overlay is applied when a file supplies a thumbnail representation. + * + * _Windows Vista and later_ + */ + SSF_SHOWTYPEOVERLAY = 0x02000000, + + /** Not used. */ + SSF_SORTCOLUMNS = 0x00000010, + + /** The state of the Windows XP display option, which selects between the Windows XP style and the classic style. As of Windows Vista, this option is no longer available. */ + SSF_STARTPANELON = 0x00200000, + + /** The state of the **Display as a web view option**. As of Windows Vista, this option is no longer available. */ + SSF_WEBVIEW = 0x00020000, + + /** The state of the **Classic Style** option. As of Windows Vista, this option is no longer available. */ + SSF_WIN95CLASSIC = 0x00000400, + } + + // tslint:disable-next-line no-const-enum + const enum ShellExecuteShow { + /** Open the application with a hidden window. */ + Hidden = 0, + + /** Open the application with a normal window. If the window is minimized or maximized, the system restores it to its original size and position. */ + Normal = 1, + + /** Open the application with a minimized window. */ + Minimized = 2, + + /** Open the application with a maximized window. */ + Maximized = 3, + + /** Open the application with its window at its most recent size and position. The active window remains active. */ + Last = 4, + + /** Open the application with its window at its current size and position. */ + Current = 5, + + /** Open the application with a minimized window. The active window remains active. */ + MinimizedNotActivated = 7, + + /** Open the application with its window in the default state specified by the application. */ + Application = 10, + } + + /** Constants for Special Folders for open/Explore */ + // tslint:disable-next-line no-const-enum + const enum ShellSpecialFolderConstants { + ssfALTSTARTUP = 29, + ssfAPPDATA = 26, + ssfBITBUCKET = 10, + ssfCOMMONALTSTARTUP = 30, + ssfCOMMONAPPDATA = 35, + ssfCOMMONDESKTOPDIR = 25, + ssfCOMMONFAVORITES = 31, + ssfCOMMONPROGRAMS = 23, + ssfCOMMONSTARTMENU = 22, + ssfCOMMONSTARTUP = 24, + ssfCONTROLS = 3, + ssfCOOKIES = 33, + ssfDESKTOP = 0, + ssfDESKTOPDIRECTORY = 16, + ssfDRIVES = 17, + ssfFAVORITES = 6, + ssfFONTS = 20, + ssfHISTORY = 34, + ssfINTERNETCACHE = 32, + ssfLOCALAPPDATA = 28, + ssfMYPICTURES = 39, + ssfNETHOOD = 19, + ssfNETWORK = 18, + ssfPERSONAL = 5, + ssfPRINTERS = 4, + ssfPRINTHOOD = 27, + ssfPROFILE = 40, + ssfPROGRAMFILES = 38, + ssfPROGRAMFILESx86 = 48, + ssfPROGRAMS = 2, + ssfRECENT = 8, + ssfSENDTO = 9, + ssfSTARTMENU = 11, + ssfSTARTUP = 7, + ssfSYSTEM = 37, + ssfSYSTEMx86 = 41, + ssfTEMPLATES = 21, + ssfWINDOWS = 36, + } + + /** FileSearchBand Class */ + class FileSearchBand { + private 'Shell32.FileSearchBand_typekey': FileSearchBand; + private constructor(); + + /** Retrieve the file from which the search was restored. */ + readonly QueryFile: any; + + /** Get the search scope */ + readonly Scope: any; + + /** Retrieve the guid of the currently active search. */ + readonly SearchID: string; + + /** method SetFocus */ + SetFocus(): void; + + /** method SetSearchParameters */ + SetSearchParameters(pbstrSearchID: string, bNavToResults: boolean, pvarScope?: any, pvarQueryFile?: any): void; + } + + /** Definition of interface Folder version 3 */ + class Folder3 { + private 'Shell32.Folder3_typekey': Folder3; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Copy Items to this folder. */ + CopyHere(vItem: string | ShellFolderItem | FolderItems3, vOptions?: FileOperationFlag): void; + + /** Call this after the WebView barricade is dismissed by the user */ + DismissedWebViewBarricade(): void; + + /** + * Get the details about an item. + * @param vItem The item for which to retrieve the information. + * @param iColumn An integer value that specifies the information to be retrieved. The information available for an item depends on the folder in which it is displayed. This value + * corresponds to the zero-based column number that is displayed in a Shell view. + */ + GetDetailsOf(vItem: ShellFolderItem, iColumn: number): string; + + /** Should the WebView barricade be shown? */ + readonly HaveToShowWebViewBarricade: boolean; + + /** The collection of Items in folder */ + Items(): FolderItems3; + + /** Move Items to this folder. */ + MoveHere(vItem: string | ShellFolderItem | FolderItems3, vOptions?: FileOperationFlag): void; + + /** Create a new sub folder in this folder. */ + NewFolder(bName: string): void; + + /** Offline status of the server? */ + readonly OfflineStatus: OfflineFolderStatus; + + /** Get Parent object */ + readonly ParentFolder: Folder3; + + /** Parse the name to get an item. */ + ParseName(bName: string): ShellFolderItem | null; + + /** Folder's FolderItem interface */ + readonly Self: ShellFolderItem; + + /** Ask if the WebView barricade should be shown or not */ + ShowWebViewBarricade: boolean; + + /** Synchronize all offline files */ + Synchronize(): void; + + /** Get the display name for the window */ + readonly Title: string; + } + + /** Definition of interface FolderItems3 */ + class FolderItems3 { + private 'Shell32.FolderItems3_typekey': FolderItems3; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Get count of items in the folder */ + readonly Count: number; + + /** Set a wildcard filter to apply to the items returned */ + Filter(grfFlags: ShellFolderEnumerationFlags, bstrFileSpec: string): void; + + /** + * Executes a verb on a collection of `FolderItem` objects + * @param vVerb String that corresponds to the command to be executed. If no verb is specified, the default verb is executed. + * @param vArgs String with one or more arguments to the command specified by vVerb. The format of this string depends on the particular verb. + */ + InvokeVerbEx(vVerb?: string, vArgs?: string): void; + + /** Return the figure for the given index */ + Item(index?: any): ShellFolderItem; + + /** Get the list of verbs common to all the items */ + readonly Verbs: FolderItemVerbs; + } + + /** Definition of interface FolderItemVerb */ + class FolderItemVerb { + private 'Shell32.FolderItemVerb_typekey': FolderItemVerb; + private constructor(); + + /** Execute the verb */ + DoIt(): void; + + /** Get display name for item */ + readonly Name: string; + } + + /** Definition of interface FolderItemVerbs */ + class FolderItemVerbs { + private 'Shell32.FolderItemVerbs_typekey': FolderItemVerbs; + private constructor(); + + /** Get count of open folder windows */ + readonly Count: number; + + /** Return the specified verb */ + Item(index?: any): FolderItemVerb; + } + + /** Shell Object Type Information */ + class Shell { + private 'Shell32.Shell_typekey': Shell; + private constructor(); + + /** Add an object to the Recent Docuements */ + AddToRecent(varFile: string | null, bstrCategory?: string): void; + + /** Get Application object */ + readonly Application: any; + + /** Browse the name space for a Folder */ + BrowseForFolder(Hwnd: number, Title: string, Options: number | BrowseInfoFlags, RootFolder?: string | ShellSpecialFolderConstants): Folder3; + + /** Determine if the current user can start/stop the named service. */ + CanStartStopService(ServiceName: string): boolean; + + /** Cascade Windows */ + CascadeWindows(): void; + + /* + * Runs the specified Control Panel (*.cpl) application. If the application is already open, it will activate the running instance. + * + * **Note** As of Windows Vista, most Control Panel applications are Shell items and cannot be opened with this function. To open those Control Panel applications, pass the canonical name to + * `control.exe`. For example: + * + * `control.exe /name Microsoft.Personalization` + */ + ControlPanelItem(bstrDir: string): void; + + /** Eject the pc */ + EjectPC(): void; + + /** Explore a folder */ + Explore(vDir: string | ShellSpecialFolderConstants): void; + + /** + * Return explorer policy value + * + * The specified value name must be within the **HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer** subkey. + * If the value name does not exist then the method returns null. + */ + ExplorerPolicy(bstrPolicyName: string): any; + + /** Bring up the file run dialog box */ + FileRun(): void; + + /** Find a computer */ + FindComputer(): void; + + /** Find Files */ + FindFiles(): void; + + /** Find a Printer in the Directory Service */ + FindPrinter(Name?: string, location?: string, model?: string): void; + + /** Return shell global setting */ + GetSetting(lSetting: number | SettingKey): boolean; + + /** + * `DirectoryServiceAvailable` -- Returns **true** if the directory service is available + * + * `IsOS_DomainMember` -- Returns **true** if the computer is a member of a domain (_Windows XP and later_) + * + * `IsOS_Personal` -- Returns **true** if the operating system is Windows XP Home Edition (_Windows XP only_) + * + * `IsOS_Professional` -- Returns **true** if the operating system is Windows XP Professional Edition (_Windows XP only_) + */ + GetSystemInformation(Name: 'DirectoryServiceAvailable' | 'IsOS_DomainMember' | 'IsOS_Personal' | 'IsOS_Professional'): boolean; + + /** + * `DoubleClickTime` -- The double-click time, in milliseconds + * + * `PhysicalMemoryInstalled` -- The amount of physical memory installed, in bytes + * + * `ProcessorArchitecture` -- The processor architecture. For details, see the discussion of the **wProcessorArchitecture** member of the + * [`SYSTEM_INFO`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms724958.aspx) structure + * + * `ProcessorLevel` -- The processor level. Returns 3, 4, or 5, for x386, x486, and Pentium-level processors, respectively (_Windows Vista and later_) + * + * `ProcessorSpeed` -- The processor speed, in megahertz (MHz) + */ + GetSystemInformation(Name: 'DoubleClickTime' | 'PhysicalMemoryInstalled' | 'ProcessorArchitecture' | 'ProcessorLevel' | 'ProcessorSpeed'): number; + + /** Display shell help */ + Help(): void; + + /** get restriction settings */ + IsRestricted(Group: string, Restriction: string): number; + + /** Determine if a service is running by name. */ + IsServiceRunning(ServiceName: string): any; + + /** Minimize all windows */ + MinimizeAll(): void; + + /** Get special folder from ShellSpecialFolderConstants */ + NameSpace(vDir: string | ShellSpecialFolderConstants): Folder3 | null; + + /** Open a folder */ + Open(vDir: string | ShellSpecialFolderConstants): void; + + /** Get Parent object */ + readonly Parent: any; + + /** Refresh the menu */ + RefreshMenu(): void; + + /** Immersive Search */ + SearchCommand(): void; + + /** + * Start a service by name, and optionally set it to autostart. + * + * The method returns `false` if the service has already been started. Before calling this method, you can call + * [Shell.IsServiceRunning](https://msdn.microsoft.com/en-us/library/windows/desktop/gg537742.aspx) to ascertain the status of the service. + */ + ServiceStart(ServiceName: string, Persistent?: boolean): boolean; + + /** + * Stop a service by name, and optionally disable autostart. + * + * The method returns `false` if the service has already been stopped. Before calling this method, you can call + * [Shell.IsServiceRunning](https://msdn.microsoft.com/en-us/library/windows/desktop/gg537742.aspx) to ascertain the status of the service. + */ + ServiceStop(ServiceName: string, Persistent?: boolean): boolean; + + /** Displays the **Date and Time Properties** dialog box. */ + SetTime(): void; + + /** + * Execute generic command + * @param sFile A string that contains the name of the file on which `ShellExecute` will perform the action specified by `vOperation`. + * @param [vArgs] A string that contains parameter values for the operation. + * @param [vDir] The fully qualified path of the directory that contains the file specified by `sFile`. If this parameter is not specified, the current working directory is used. + * @param [vOperation] The operation to be performed. This value is set to one of the verb strings that is supported by the file. If this parameter is not specified, the default operation is + * performed. + * @param [vShow] A recommendation as to how the application window should be displayed initially. The application can ignore this recommendation. + */ + ShellExecute(File: string, vArgs?: string, vDir?: string, vOperation?: string, vShow?: ShellExecuteShow): void; + + /** Show/Hide browser bar. */ + ShowBrowserBar(bstrClsid: ExplorerBarCLSID, bShow: boolean): any; + + /** Exit Windows */ + ShutdownWindows(): void; + + /** Tile windows horizontally */ + TileHorizontally(): void; + + /** Tile windows vertically */ + TileVertically(): void; + + /** Raise/lower the desktop */ + ToggleDesktop(): void; + + /** Displays the **Taskbar and Start Menu Properties** dialog box. */ + TrayProperties(): void; + + /** Undo Minimize All */ + UndoMinimizeALL(): void; + + /** The collection of open folder windows */ + Windows(): ShellWindows; + + /** Displays the **Windows Security** dialog box. */ + WindowsSecurity(): void; + + /** Displays your open windows in a 3D stack that you can flip through. */ + WindowSwitcher(): void; + } + + /** ShellDispatch Load in Shell Context */ + class ShellDispatchInproc { + private 'Shell32.ShellDispatchInproc_typekey': ShellDispatchInproc; + private constructor(); + } + + /** Shell Folder Item */ + class ShellFolderItem { + private 'Shell32.ShellFolderItem_typekey': ShellFolderItem; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Access an extended property */ + ExtendedProperty(bstrPropName: string): any; + + /** If item is a folder return folder object */ + readonly GetFolder: Folder3 | null; + + /** If item is link return link object */ + readonly GetLink: ShellLinkObject | null; + + /** + * Execute a command on the item. + * Must be one of the values returned by the item's `FolderItemVerb.Name` property. + * If no verb is specified, the default verb will be invoked. + */ + InvokeVerb(vVerb?: string): void; + + /** + * Extended version of InvokeVerb + * @param vVerb String that corresponds to the command to be executed. If no verb is specified, the default verb is executed. + * @param vArgs String with one or more arguments to the command specified by vVerb. The format of this string depends on the particular verb. + */ + InvokeVerbEx(vVerb?: string, vArgs?: string): void; + + /** Indicates if the item can be hosted inside a browser or Windows Explorer frame. */ + readonly IsBrowsable: boolean; + + /** Is the item a file system object? */ + readonly IsFileSystem: boolean; + + /** Is the item a Folder? */ + readonly IsFolder: boolean; + + /** Is the item a link? */ + readonly IsLink: boolean; + + /** Modification Date? */ + ModifyDate: VarDate; + + /** Get display name for item */ + Name: string; + + /** Get Parent object */ + readonly Parent: any; + + /** Get the pathname to the item */ + readonly Path: string; + + /** Size */ + readonly Size: number; + + /** Contains a string representation of the item's type */ + readonly Type: string; + + /** Get the list of verbs for the object */ + Verbs(): FolderItemVerbs; + } + + /** Shell Folder View Object */ + class ShellFolderView { + private 'Shell32.ShellFolderView_typekey': ShellFolderView; + private constructor(); + + /** Get Application object */ + readonly Application: any; + + /** Get Current View Mode */ + CurrentViewMode: number; + + /** Filter View */ + FilterView(bstrFilterText: string): void; + + /** The currently focused item in the folder */ + readonly FocusedItem: ShellFolderItem; + + /** Get the folder being viewed */ + readonly Folder: Folder3; + + /** Get Folder Flags */ + FolderFlags: number; + + /** Get Group By Column */ + GroupBy: string; + + /** Set Icon Size */ + IconSize: number; + + /** Show items menu and return command selected */ + PopupItemMenu(pfi: ShellFolderItem, vx?: any, vy?: any): string; + + /** The collection of Selected Items in folder */ + SelectedItems(): FolderItems3; + + /** Select the item */ + SelectItem(pvfi: ShellFolderItem, dwFlags: ShellFolderViewSelectItem): void; + + /** Select Item relative to the Current Item */ + SelectItemRelative(iRelative: number): void; + + /** Get Sorting Columns */ + SortColumns: string; + + /** Returns the view options for showing a folder. */ + readonly ViewOptions: ShellFolderViewOptions; + } + + /** + * The **ShellFolderView** object fires two events, **EnumDone** and **SelectionChanged**, that are typically handled by applications. However, some applications + * must handle events from a series of **ShellFolderView** objects. For example, an application might host a **WebBrowser** control that allows users to navigate through + * a series of folders. Each folder has its own **ShellFolderView** object with its associated events. Handling these events can be difficult. + * + * The **ShellFolderViewOC** object simplifies event handling for such scenarios. It allows applications to handle events for all ShellFolderView objects with a single + * pair of **ShellFolderViewOC** event handlers. Each time the user navigates to a new folder, the application passes the associated **ShellFolderView** object to the + * **ShellFolderViewOC** object by calling **SetFolderView**. Then, when an **EnumDone** or **SelectionChanged** event is fired, the **ShellFolderViewOC** object + * forwards the event to its own handler for processing. + */ + class ShellFolderViewOC { + private 'Shell32.ShellFolderViewOC_typekey': ShellFolderViewOC; + private constructor(); + + /** Set the ShellFolderView object to monitor events of. */ + SetFolderView(pdisp: ShellFolderView): void; + } + + /** Shell Link object */ + class ShellLinkObject { + private 'Shell32.ShellLinkObject_typekey': ShellLinkObject; + private constructor(); + + /** Arguments for the link */ + Arguments: string; + + /** Description of the link */ + Description: string; + + /** Get the IconLocation for the link */ + GetIconLocation(pbs: string): number; + + /** Hotkey for the link */ + Hotkey: number; + + /** Fully qualified path of the link */ + Path: string; + + /** Tell the link to resolve itself */ + Resolve(fFlags: ShellLinkResolveFlags): void; + + /** + * Tell the link to save the changes + * @param sFile The fully qualified path of the file where the new link information is to be saved. If no file is specified, the current file is used. + */ + Save(vWhere?: string): void; + + /** + * Set the IconLocation for the link + * @param sPath The fully qualified path of the file that contains the icon. + * @param iIcon The index of the icon in the file specified by _sPath_. + */ + SetIconLocation(sPath: string, iIcon: number): void; + + /** Get the Show Command for the link */ + ShowCommand: LinkShowWindowState; + + /** Get the target of a link object */ + readonly Target: ShellFolderItem | null; + + /** Get the working directory for the link */ + WorkingDirectory: string; + } + + class ShellWindows { + private 'Shell32.ShellWindows_typekey': ShellWindows; + private constructor(); + + /** + * Retrieves an InternetExplorer object that represents the Shell window. + * @param index Default is 0 + */ + Item(index?: number): SHDocVw.InternetExplorer; + + /** Contains the number of items in the collection. */ + readonly Count: number; + } +} + +interface ActiveXObject { + on( + obj: Shell32.ShellFolderView, event: 'BeginDrag' | 'DefaultVerbInvoked' | 'EnumDone' | 'SelectionChanged' | 'VerbInvoked', handler: ( + this: Shell32.ShellFolderView, parameter: {}) => void): void; + on( + obj: Shell32.ShellFolderViewOC, event: 'BeginDrag' | 'DefaultVerbInvoked' | 'EnumDone' | 'SelectionChanged' | 'VerbInvoked', + handler: (this: Shell32.ShellFolderViewOC, parameter: {}) => void): void; + new (progid: K): ActiveXObjectNameMap[K]; +} + +interface ActiveXObjectNameMap { + 'Shell.Application': Shell32.Shell; + 'Shell.FolderView': Shell32.ShellFolderViewOC; +} + +interface EnumeratorConstructor { + new(col: Shell32.FolderItems3): Enumerator; + new(col: Shell32.FolderItemVerbs): Enumerator; + new(col: Shell32.ShellWindows): Enumerator; +} diff --git a/types/activex-shell/package.json b/types/activex-shell/package.json new file mode 100644 index 0000000000..d9b1031263 --- /dev/null +++ b/types/activex-shell/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "activex-helpers": "*" + } +} \ No newline at end of file diff --git a/types/activex-shell/tsconfig.json b/types/activex-shell/tsconfig.json new file mode 100644 index 0000000000..97b3ee81cb --- /dev/null +++ b/types/activex-shell/tsconfig.json @@ -0,0 +1,22 @@ + +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es5", "scripthost"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "activex-shell-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-shell/tslint.json b/types/activex-shell/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-shell/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-stdole/tsconfig.json b/types/activex-stdole/tsconfig.json index cbe3ce7aae..d96d7fd4dc 100644 --- a/types/activex-stdole/tsconfig.json +++ b/types/activex-stdole/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-vbide/tsconfig.json index 6fb205a3c4..504d5c01b2 100644 --- a/types/activex-vbide/tsconfig.json +++ b/types/activex-vbide/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-wia/tsconfig.json index e77b3d1b66..b1b82a2134 100644 --- a/types/activex-wia/tsconfig.json +++ b/types/activex-wia/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/activex-word/tsconfig.json index c62626ca52..e220df56dc 100644 --- a/types/activex-word/tsconfig.json +++ b/types/activex-word/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/adal-angular/tsconfig.json b/types/adal-angular/tsconfig.json index 9052e3fc04..b7adaf8e3c 100644 --- a/types/adal-angular/tsconfig.json +++ b/types/adal-angular/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/add-zero/tsconfig.json b/types/add-zero/tsconfig.json index e71d235cdf..bb76d7ed20 100644 --- a/types/add-zero/tsconfig.json +++ b/types/add-zero/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "add-zero-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/add2home/tsconfig.json b/types/add2home/tsconfig.json index 904e5e7453..d32b9dc570 100644 --- a/types/add2home/tsconfig.json +++ b/types/add2home/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/adm-zip/tsconfig.json b/types/adm-zip/tsconfig.json index 8e998c6f38..da3abd8503 100644 --- a/types/adm-zip/tsconfig.json +++ b/types/adm-zip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/adone/adone.d.ts b/types/adone/adone.d.ts index 34540761b5..0d6e3255ee 100644 --- a/types/adone/adone.d.ts +++ b/types/adone/adone.d.ts @@ -110,6 +110,8 @@ declare namespace adone { export function require(path: string): object; export const package: object; + export function sprintf(format: string, ...args: any[]): string; + namespace I { interface Runtime { term: object; // TODO diff --git a/types/adone/glosses/application.d.ts b/types/adone/glosses/application.d.ts index 6b2b783d68..4c9661843a 100644 --- a/types/adone/glosses/application.d.ts +++ b/types/adone/glosses/application.d.ts @@ -1,5 +1,275 @@ declare namespace adone { namespace application { - function run(app: object, ignoreArgs?: boolean): Promise; + namespace I { + type ArgumentType = ((x: string, index: number) => any) | RegExp; + + interface ArgumentInfo { + name: string | string[]; + action?: "store" + | "store_const" + | "store_true" + | "store_false" + | "append" + | "count" + | "set"; + nargs?: number | "+" | "*" | "?" + type?: ArgumentType | ArgumentType[]; + verify?: (args: any, opts: any) => boolean; // TODO + required?: boolean; + description?: string; + help?: string; + holder?: string | string[]; + appendDefaultMessage?: boolean; + appendChoicesHelpMessage?: boolean; + default?: any; + enabled?: boolean; + } + + interface Group { + name: string; + description?: string; + } + + interface MainCommandInfo { + arguments?: Array; + options?: Array; + description?: string; + optionsGroups?: Group[]; + blindMode?: boolean; + match?: (name: string) => boolean; + handler?: (args: object, opts: object) => void; + } + + interface CommandInfo extends MainCommandInfo { + name?: string | string[]; + group?: string; + } + + interface ApplicationInfo { + name?: string; + description?: string; + subsystems?: SubsystemInfo[]; + commandsGroups?: Group[] + } + + interface SubsystemInfo { + name: string; + description?: string; + subsystem: string; + transpile?: boolean; + group?: string; + } + } + + function DSubsystem(info?: I.ApplicationInfo): (...args: any[]) => void; + + function DApplication(info?: I.ApplicationInfo): (...args: any[]) => void; + + function DCliCommand(info?: I.CommandInfo): (...args: any[]) => void; + + function DMainCliCommand(info?: I.MainCommandInfo): (...args: any[]) => void; + + namespace I { + interface LoadSubsystemOptions { + name?: string, + description?: string, + group?: string, + transpile?: boolean + } + + interface CommonAddSubsystemInfo { + name?: string, + useFilename?: boolean + description?: string, + group?: string, + configureArgs?: any[] + transpile?: boolean, + bind?: boolean | string + } + + interface AddSubsystemInfo extends CommonAddSubsystemInfo { + subsystem: Subsystem | string, + } + + interface SysInfo { + name: string; + description: string; + group: string; + configureArgs: any[]; + instance: Subsystem; + path: string | null; + } + + interface SysInfoWithPath extends SysInfo { + path: string; + } + + interface SysInfoNoPath extends SysInfo { + path: null; + } + + interface AddSubsystemsFromOptions extends CommonAddSubsystemInfo { + filter?: string[] | ((file: string) => boolean | Promise) + } + } + + class Subsystem extends event.AsyncEmitter { + constructor(options?: { name?: string }); + + readonly name?: string; + + readonly root?: Subsystem; + + setRoot(root: Subsystem): void; + + readonly parent?: Subsystem; + + readonly state: number; + + readonly isOwned: boolean; + + setState(state: number): void; + + waitForState(expectedState: number, timeout?: number): Promise; + + configure(): void; + + initialize(): void; + + uninitialize(): void; + + configureSubsystems(): Promise; + + uninitializeSubsystems(): Promise; + + reinitializeSubsystems(): Promise; + + configureSubsystem(name: string): Promise; + + loadSubsystem(subsystem: string | Subsystem, options?: I.LoadSubsystemOptions): Promise; + + unloadSubsystem(name: string): Promise; + + initializeSubsystem(name: string): Promise; + + uninitializeSubsystem(name: string): Promise; + + reinitializeSubsystem(name: string): Promise; + + getSubsystem(name: string): Subsystem; + + hasSubsystem(name: string): boolean; + + hasSubsystems(): boolean; + + addSubsystem(info: I.AddSubsystemInfo & { subsystem: Subsystem }): I.SysInfoNoPath; + addSubsystem(info: I.AddSubsystemInfo & { subsystem: string }): I.SysInfoWithPath; + + addSubsystemsFrom(path: string, options?: I.AddSubsystemsFromOptions): I.SysInfoWithPath; + + instantiateSubsystem(subsystem: string | Subsystem, options?: { + transpile?: boolean + }): Subsystem; + + deleteSubsystem(name: string, force?: boolean): void; + + getSubsystemInfo(name: string): I.SysInfo; + + getSubsystems(): I.SysInfo[]; + } + + namespace I { + interface ReportOptions { + events?: string; + signal?: string; + filename?: string; + directory?: string; + } + } + + class Application extends Subsystem { + readonly isMain: boolean; + + main(): void; + + enableReport(opts?: I.ReportOptions): void; + + reportEnabled(): boolean; + + run(): Promise; + + exit(code?: number): Promise; + + exitOnSignal(...names: string[]): void; + + removeProcesshandlers(): void; + + _uncaughtException(err: any): void; + + _unhandledRejection(reson: any, p: Promise): void; + + _rejectionHandled(p: Promise): void; + + _signalExit(sigName: string): void; + + } + + namespace I { + interface Command { + // ? + } + + interface Argument { + // ? + } + + interface PositionalArgument extends Argument { + // ? + } + + interface OptionalArgument extends Argument { + // ? + } + + interface DefineCommandFromSubsystemOptions { + name?: string; + description?: string; + group?: string; + subsystem: string | Subsystem; + configureArgs?: any[]; + lazily?: boolean; + transpile?: boolean; + } + } + + class CliApplication extends Application { + run(options?: { ignoreArgs?: boolean }): Promise; + + getVersion(): Promise; + + exposeCliInterface(ctxId?: string): void; + + readonly mainCommand: I.Command; + + defineMainCommand(schema: I.MainCommandInfo): this; + + defineArguments(schema: I.MainCommandInfo): this; + + defineCommand(schema: I.CommandInfo): I.Command; + + defineCommandFromSubsystem(options?: I.DefineCommandFromSubsystemOptions): void; + + defineOption(schema: I.ArgumentInfo): void; + + defineOptionsGroup(schema: I.Group): void; + + defineCommandsGroup(schema: I.Group): void; + + option(path: string, options?: { value?: boolean }): any; + } + + function run(app: Application, ignoreArgs?: boolean): Promise; + + function runCli(app: CliApplication, ignoreArgs?: boolean): Promise; } } diff --git a/types/adone/glosses/archives.d.ts b/types/adone/glosses/archives.d.ts index 3f059ff14d..ddeb25d891 100644 --- a/types/adone/glosses/archives.d.ts +++ b/types/adone/glosses/archives.d.ts @@ -448,7 +448,7 @@ declare namespace adone { isCompressed(): boolean; } - interface ZipFile extends event.EventEmitter { + interface ZipFile extends event.Emitter { /** * true until close() is called; then it's false */ diff --git a/types/adone/glosses/assertion.d.ts b/types/adone/glosses/assertion.d.ts index e7ba662791..ca0d75bdf5 100644 --- a/types/adone/glosses/assertion.d.ts +++ b/types/adone/glosses/assertion.d.ts @@ -38,7 +38,7 @@ declare namespace adone { proxyExcludedKeys: string[]; } - type PossibleTypes = util.I.PossibleTypes | "array"; + type PossibleTypes = meta.I.PossibleTypes | "array"; type UseFunction = (fn: () => void) => assertion; @@ -53,18 +53,10 @@ declare namespace adone { * Throws an AssertionError, like node.js */ fail(actual?: any, expected?: any, message?: string, operator?: any): void; - /** - * Asserts that value is truthy - */ - isOk(value: any, message?: string): void; /** * Asserts that value is truthy */ ok(value: any, message?: string): void; - /** - * Asserts that value is falsy - */ - isNotOk(value: any, message?: string): void; /** * Asserts that value is falsy */ @@ -104,51 +96,51 @@ declare namespace adone { /** * Asserts that value > above */ - isAbove(value: any, above: any, message?: string): void; + above(value: any, above: any, message?: string): void; /** * Asserts that value >= atLeast */ - isAtLeast(value: any, atLeast: any, message?: string): void; + atLeast(value: any, atLeast: any, message?: string): void; /** * Asserts that value < below */ - isBelow(value: any, below: any, message?: string): void; + below(value: any, below: any, message?: string): void; /** * Asserts that value <= atMost */ - isAtMost(value: any, atMost: any, message?: string): void; + atMost(value: any, atMost: any, message?: string): void; /** * Asserts that value is true */ - isTrue(value: any, message?: string): void; + true(value: any, message?: string): void; /** * Asserts that value is not true */ - isNotTrue(value: any, message?: string): void; + notTrue(value: any, message?: string): void; /** * Asserts that value is false */ - isFalse(value: any, message?: string): void; + false(value: any, message?: string): void; /** * Asserts that value is not false */ - isNotFalse(value: any, message?: string): void; + notFalse(value: any, message?: string): void; /** * Asserts that value is null */ - isNull(value: any, message?: string): void; + null(value: any, message?: string): void; /** * Asserts that valus is not null */ - isNotNull(value: any, message?: string): void; + notNull(value: any, message?: string): void; /** * Asserts that value is NaN */ - isNaN(value: any, message?: string): void; + NaN(value: any, message?: string): void; /** * Asserts that value is not NaN */ - isNotNaN(value: any, message?: string): void; + NotNaN(value: any, message?: string): void; /** * Asserts that value is neither null nor undefined */ @@ -160,63 +152,63 @@ declare namespace adone { /** * Asserts that value is undefined */ - isUndefined(value: any, message?: string): void; + undefined(value: any, message?: string): void; /** * Asserts that value is not undefined */ - isDefined(value: any, message?: string): void; + defined(value: any, message?: string): void; /** * Asserts that value is a function */ - isFunction(value: any, message?: string): void; + function(value: any, message?: string): void; /** * Asserts that value is not a function */ - isNotFunction(value: any, message?: string): void; + notFunction(value: any, message?: string): void; /** * Asserts that value is an object of type Object */ - isObject(value: any, message?: string): void; + object(value: any, message?: string): void; /** * Asserts that value is not an object of type Object */ - isNotObject(value: any, message?: string): void; + notObject(value: any, message?: string): void; /** * Asserts that value is an array */ - isArray(value: any, message?: string): void; + array(value: any, message?: string): void; /** * Asserts that value is not an array */ - isNotArray(value: any, message?: string): void; + notArray(value: any, message?: string): void; /** * Asserts that value is a string */ - isString(value: any, message?: string): void; + string(value: any, message?: string): void; /** * Asserts that value is not a string */ - isNotString(value: any, message?: string): void; + notString(value: any, message?: string): void; /** * Asserts that value is a number */ - isNumber(value: any, message?: string): void; + number(value: any, message?: string): void; /** * Asserts that value is not a number */ - isNotNumber(value: any, message?: string): void; + notNumber(value: any, message?: string): void; /** * Asserts that value is a finite number */ - isFinite(value: any, message?: string): void; + finite(value: any, message?: string): void; /** * Asserts that value is a boolean */ - isBoolean(value: any, message?: string): void; + boolean(value: any, message?: string): void; /** * Asserts that value is not a boolean */ - isNotBoolean(value: any, message?: string): void; + notBoolean(value: any, message?: string): void; /** * Asserts that value's type is `type` */ @@ -562,66 +554,34 @@ declare namespace adone { * Throws an error if value is truthy */ ifError(value: any): void; - /** - * Asserts that object is extensible - */ - isExtensible(object: object, message?: string): void; /** * Asserts that object is extensible */ extensible(object: object, message?: string): void; - /** - * Asserts that object is not extensible - */ - isNotExtensible(object: object, message?: string): void; /** * Asserts that object is not extensible */ notExtensible(object: object, message?: string): void; - /** - * Asserts that object is sealed - */ - isSealed(object: object, message?: string): void; /** * Asserts that object is sealed */ sealed(object: object, message?: string): void; - /** - * Asserts that object is not sealed - */ - isNotSealed(object: object, message?: string): void; /** * Asserts that object is not sealed */ notSealed(object: object, message?: string): void; - /** - * Asserts that object is frozen - */ - isFrozen(object: object, message?: string): void; /** * Asserts that object is frozen */ frozen(object: object, message?: string): void; - /** - * Asserts that object is not frozen - */ - isNotFrozen(object: object, message?: string): void; /** * Asserts that object is not frozen */ notFrozen(object: object, message?: string): void; - /** - * Asserts that value is empty - */ - isEmpty(value: any, message?: string): void; /** * Asserts that value is empty */ empty(value: any, message?: string): void; - /** - * Asserts that value is not empty - */ - isNotEmpty(value: any, message?: string): void; /** * Asserts that value is not empty */ @@ -710,43 +670,43 @@ declare namespace adone { /** * Asserts that the target is non-strictly equal to true */ - ok: this; + ok(): this; /** * Asserts that the target is true */ - true: this; + true(): this; /** * Asserts that the target is false */ - false: this; + false(): this; /** * Asserts that the target is null */ - null: this; + null(): this; /** * Asserts that the target is undefined */ - undefined: this; + undefined(): this; /** * Asserts that the target is NaN */ - NaN: this; + NaN(): this; /** * Asserts that the target is neither null nor undefined */ - exist: this; + exist(): this; /** * Asserts that the target is empty */ - empty: this; + empty(): this; /** * Asserts that the target is an arguments object */ - arguments: this; + arguments(): this; /** * Asserts that the target is an arguments object */ - Arguments: this; + Arguments(): this; /** * Asserts that the target is strictly equal to value(===) */ @@ -976,26 +936,26 @@ declare namespace adone { /** * Asserts that the target is extensible */ - extensible: this; + extensible(): this; /** * Asserts that the target is sealed */ - sealed: this; + sealed(): this; /** * Asserts that the target is frozen */ - frozen: this; + frozen(): this; /** * Asserts that the target is a finite number */ - finite: this; + finite(): this; } interface MockAssertions extends Assertion { /** * Asserts that the spy has been called */ - called: this; + called(): this; /** * Asserts that the spy has been called n times */ @@ -1003,15 +963,15 @@ declare namespace adone { /** * Asserts that the spy has been called once */ - calledOnce: this; + calledOnce(): this; /** * Asserts that the spy has been called twice */ - calledTwice: this; + calledTwice(): this; /** * Asserts that the spy has been been called with `new` */ - calledThrice: this; + calledThrice(): this; /** * Asserts that the spy has been called before anotherSpy */ @@ -1059,7 +1019,7 @@ declare namespace adone { } } - class AssertionError extends x.Exception { + class AssertionError extends exception.Exception { constructor(message?: string, props?: object, ssf?: object) } diff --git a/types/adone/glosses/collections.d.ts b/types/adone/glosses/collections.d.ts deleted file mode 100644 index 178921136d..0000000000 --- a/types/adone/glosses/collections.d.ts +++ /dev/null @@ -1,1965 +0,0 @@ -declare namespace adone { - namespace collection { - namespace I.LinkedList { - /** - * Represents the node of a linked list - */ - interface Node { - /** - * The next node - */ - next?: Node; - - /** - * The previous node - */ - prev?: Node; - - /** - * The value this node contains - */ - value: T; - } - } - - /** - * Represents a linked list - */ - class LinkedList { - /** - * The maximum length of the list - */ - readonly maxLength: number; - - /** - * Current length of the list - */ - readonly length: number; - - /** - * Whether the list is autoresizable - */ - readonly autoresize: boolean; - - /** - * @param maxLength Maximum length of the linked list - */ - constructor(maxLength?: number); - - /** - * Whether the list is full - */ - readonly full: boolean; - - /** - * Whether the list is empty - */ - readonly empty: boolean; - - /** - * Resizes the list - */ - resize(newLength: number): this; - - /** - * Adds a new node to the end - * - * @returns Added node - */ - push(value: T): I.LinkedList.Node; - - /** - * Removes the last node, returns undefined if the list is empty - */ - pop(): T | undefined; - - /** - * Removes the first node, returns undefined if the list is empty - */ - shift(): T | undefined; - - /** - * Inserts a new node at the beginning of the list - * - * @returns Added node - */ - unshift(value: T): I.LinkedList.Node; - - /** - * Moves the given node to the end of the list - */ - pushNode(node: I.LinkedList.Node): void; - - /** - * Moved the given node to the beginning of the list - */ - unshiftNode(node: I.LinkedList.Node): void; - - /** - * Removes the given node from the list - */ - removeNode(node: I.LinkedList.Node): void; - - /** - * Clears the list - * - * @param strong Whether to reset all the node's values - */ - clear(strong?: boolean): void; - - /** - * Convers the list to an array - */ - toArray(): T[]; - - /** - * The first element of the list - */ - readonly front: T; - - /** - * The last element of the list - */ - readonly back: T; - - /** - * Returns an iterator over the list elements - */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns the next node for the given node - */ - nextNode(node: I.LinkedList.Node): I.LinkedList.Node; - - /** - * Maps this linked list to a new one using the given function - */ - map(fn: (value: T, index: number) => R): LinkedList; - - /** - * Invokes the given callback for each value from the beginning to the end (much faster than for-of). - * If the given function returns false it stops iterating. - */ - forEach(callback: (value: T, index: number) => void | boolean): void; - - /** - * Default length of a new created linked list - */ - static DEFAULT_LENGTH: number; - } - - namespace I { - type Long = math.Long; - - type Longable = math.I.Longable; - - namespace ByteArray { - interface Varint32 { - value: number; - length: number; - } - - interface Varint64 { - value: Long; - length: number; - } - - interface String { - string: string; - length: number; - } - - type Wrappable = string | ByteArray | Buffer | Uint8Array | ArrayBuffer; - - type Metrics = "b" | "c"; - } - } - - /** - * Represents an array of bytes, enhanced Node.js Buffer - */ - class ByteArray { - /** - * Constructs a new ByteArray - * - * @param capacity Initial capacity. Defaults to ByteArray.DEFAULT_CAPACITY(64) - * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) - */ - constructor(capacity?: number, noAssert?: boolean); - - /** - * Reads a BitSet as an array of booleans. - * - * @param offset Offset to read from. Will use and increase offset by length if omitted. - */ - readBitSet(offset?: number): boolean[]; - - /** - * Reads the specified number of bytes. - * - * @param length Number of bytes to read - * @param offset Offset to read from. Will use and increase offset by length if omitted. - */ - read(length: number, offset?: number): ByteArray; - - /** - * Reads an 8bit signed integer - * - * @param offset Offset to read from - */ - readInt8(offset?: number): number; - - /** - * Reads an 8bit unsigned integer - * - * @param offset Offset to read from - */ - readUInt8(offset?: number): number; - - /** - * Reads a 16bit signed le integer - * - * @param offset Offset to read from - */ - readInt16LE(offset?: number): number; - - /** - * Reads a 16bit unsigned le integer - * - * @param offset Offset to read from - */ - readUInt16LE(offset?: number): number; - - /** - * Reads a 16bit signed be integer - * - * @param offset Offset to read from - */ - readInt16BE(offset?: number): number; - - /** - * Reads a 16bit unsigned be integer - * - * @param offset Offset to read from - */ - readUInt16BE(offset?: number): number; - - /** - * Reads a 32bit signed le integer - * - * @param offset Offset to read from - */ - readInt32LE(offset?: number): number; - - /** - * Reads a 32bit unsigned le integer - * - * @param offset Offset to read from - */ - readUInt32LE(offset?: number): number; - - /** - * Reads a 32bit signed be integer - * - * @param offset Offset to read from - */ - readInt32BE(offset?: number): number; - - /** - * Reads a 32bit unsigned be integer - * - * @param offset Offset to read from - */ - readUInt32BE(offset?: number): number; - - /** - * Reads a 64bit signed le integer as math.Long - * - * @param offset Offset to read from - */ - readInt64LE(offset?: number): math.Long; - - /** - * Reads a 64bit unsigned le integer as math.Long - * - * @param offset Offset to read from - */ - readUInt64LE(offset?: number): math.Long; - - /** - * Reads a 64bit signed be integer as math.Long - * - * @param offset Offset to read from - */ - readInt64BE(offset?: number): math.Long; - - /** - * Reads a 64bit unsigned be integer as math.Long - * - * @param offset Offset to read from - */ - readUInt64BE(offset?: number): math.Long; - - /** - * Reads a 32bit le float - * - * @param offset Offset to read from - */ - readFloatLE(offset?: number): number; - - /** - * Reads a 32bit be float - * - * @param offset Offset to read from - */ - readFloatBE(offset?: number): number; - - /** - * Reads a 64bit le float - * - * @param offset Offset to read from - */ - readDoubleLE(offset?: number): number; - - /** - * Reads a 64bit be float - * - * @param offset Offset to read from - */ - readDoubleBE(offset?: number): number; - - /** - * Appends some data to this ByteArray. - * This will overwrite any contents behind the specified offset up to the appended data's length. - * - * @param source The source write from - * @param offset Offset to write to - * @param length length to read from the source - * @param encoding encoding to use for wrapping the source in bytearray - */ - write(source: I.ByteArray.Wrappable, offset?: number, length?: number, encoding?: string): this; - - /** - * Writes the array as a bitset. - * @param value Array of booleans to write - */ - writeBitSet(value: number[]): this; - - /** - * Writes the array as a bitset. - * @param value Array of booleans to write - * @param offset Offset to write to - */ - writeBitSet(value: number[], offset: number): number; - - /** - * Writes an 8bit signed integer - * - * @param offset Offset to write to - */ - writeInt8(value: number, offset?: number): this; - - /** - * Writes an 8bit unsigned integer - * - * @param offset Offset to write to - */ - writeUInt8(value: number, offset?: number): this; - - /** - * Writes a 16bit signed le integer - * - * @param offset Offset to write to - */ - writeInt16LE(value: number, offset?: number): this; - - /** - * Writes a 16bit signed be integer - * - * @param offset Offset to write to - */ - writeInt16BE(value: number, offset?: number): this; - - /** - * Writes a 16bit unsigned le integer - * - * @param offset Offset to write to - */ - writeUInt16LE(value: number, offset?: number): this; - - /** - * Writes a 16bit unsigned be integer - * - * @param offset Offset to write to - */ - writeUInt16BE(value: number, offset?: number): this; - - /** - * Writes a 32bit signed le integer - * - * @param offset Offset to write to - */ - writeInt32LE(value: number, offset?: number): this; - - /** - * Writes a 32bit signed be integer - * - * @param offset Offset to write to - */ - writeInt32BE(value: number, offset?: number): this; - - /** - * Writes a 32bit unsigned le integer - * - * @param offset Offset to write to - */ - writeUInt32LE(value: number, offset?: number): this; - - /** - * Writes a 32bit unsigned be integer - * - * @param offset Offset to write to - */ - writeUInt32BE(value: number, offset?: number): this; - - /** - * Writes a 64bit signed le long integer - * - * @param offset Offset to write to - */ - writeInt64LE(value: math.Long | string | number, offset?: number): this; - - /** - * Writes a 64bit signed be long integer - * - * @param offset Offset to write to - */ - writeInt64BE(value: math.Long | string | number, offset?: number): this; - - /** - * Writes a 64bit unsigned le long integer - * - * @param offset Offset to write to - */ - writeUInt64LE(value: math.Long | string | number, offset?: number): this; - - /** - * Writes a 64bit unsigned be long integer - * - * @param offset Offset to write to - */ - writeUInt64BE(value: math.Long | string | number, offset?: number): this; - - /** - * Writes a 32bit le float - * - * @param offset Offset to write to - */ - writeFloatLE(value: number, offset?: number): this; - - /** - * Writes a 32bit be float - * - * @param offset Offset to write to - */ - writeFloatBE(value: number, offset?: number): this; - - /** - * Writes a 64bit le float - * - * @param offset Offset to write to - */ - writeDoubleLE(value: number, offset?: number): this; - - /** - * Writes a 64bit be float - * - * @param offset Offset to write to - */ - writeDoubleBE(value: number, offset?: number): this; - - /** - * Writes a 32bit base 128 variable-length integer - */ - writeVarint32(value: number): this; - - /** - * Writes a 32bit base 128 variable-length integer - * - * @param offset Offset to write to - */ - writeVarint32(value: number, offset: number): number; - - /** - * Writes a zig-zag encoded 32bit base 128 variable-length integer - */ - writeVarint32ZigZag(value: number): this; - - /** - * Writes a zig-zag encoded 32bit base 128 variable-length integer - * - * @param offset Offset to write to - */ - writeVarint32ZigZag(value: number, offset: number): number; - - /** - * Reads a 32bit base 128 variable-length integer - */ - readVarint32(): number; - - /** - * Reads a 32bit base 128 variable-length integer - * - * @param offset Offset to read from - */ - readVarint32(offset: number): I.ByteArray.Varint32; - - /** - * Reads a zig-zag encoded 32bit base 128 variable-length integer - */ - readVarint32ZigZag(): number; - - /** - * Reads a zig-zag encoded 32bit base 128 variable-length integer - * - * @param offset Offset to read from - */ - readVarint32ZigZag(offset: number): I.ByteArray.Varint32; - - /** - * Writes a 64bit base 128 variable-length integer - */ - writeVarint64(value: math.Long | string | number): this; - - /** - * Writes a 64bit base 128 variable-length integer - * - * @param offset Offset to write to - */ - writeVarint64(value: math.Long | string | number, offset: number): number; - - /** - * Writes a zig-zag encoded 64bit base 128 variable-length integer - */ - writeVarint64ZigZag(value: math.Long | string | number): this; - - /** - * Writes a zig-zag encoded 64bit base 128 variable-length integer - * - * @param offset Offset to write to - */ - writeVarint64ZigZag(value: math.Long | string | number, offset: number): number; - - /** - * Reads a 64bit base 128 variable-length integer - */ - readVarint64(): I.Long; - - /** - * Reads a 64bit base 128 variable-length integer - * - * @param offset Offset to read from - */ - readVarint64(offset: number): I.ByteArray.Varint64; - - /** - * Reads a zig-zag encoded 64bit base 128 variable-length integer - */ - readVarint64ZigZag(): math.Long; - - /** - * Reads a zig-zag encoded 64bit base 128 variable-length integer - * - * @param offset Offset to read from - */ - readVarint64ZigZag(offset: number): I.ByteArray.Varint64; - - /** - * Writes a NULL-terminated UTF8 encoded string. - * For this to work the specified string must not contain any NULL characters itself - */ - writeCString(str: string): this; - - /** - * Writes a NULL-terminated UTF8 encoded string. - * For this to work the specified string must not contain any NULL characters itself - * - * @param offset Offset to write to - */ - writeCString(str: string, offset: number): number; - - /** - * Reads a NULL-terminated UTF8 encoded string. - * For this to work the string read must not contain any NULL characters itself - */ - readCString(): string; - - /** - * Reads a NULL-terminated UTF8 encoded string. - * For this to work the string read must not contain any NULL characters itself - * - * @param offset Offset to read from - */ - readCString(offset: number): I.ByteArray.String; - - /** - * Writes an UTF8 encoded string - */ - writeString(str: string): this; - - /** - * Writes an UTF8 encoded string - * - * @param offset Offset to write to - */ - writeString(str: string, offset: number): number; - - /** - * Reads an UTF8 encoded string - * - * @param length Number of characters or bytes to read - * @param metrics Metrics specifying what n is meant to count. Defaults to ByteArray.METRICS_CHARS("c") - */ - readString(length: number, metrics?: I.ByteArray.Metrics): string; - - /** - * Reads an UTF8 encoded string - * - * @param length Number of characters or bytes to read - * @param metrics Metrics specifying what n is meant to count. Defaults to ByteArray.METRICS_CHARS("c") - * @param offset Offset to read from - */ - readString(length: number, metrics: I.ByteArray.Metrics, offset: number): I.ByteArray.String; - - /** - * Reads an UTF8 encoded string - * - * @param length Number of characters or bytes to read - * @param offset Offset to read from - */ - readString(length: number, offset: number): I.ByteArray.String; - - /** - * Writes a length as varint32 prefixed UTF8 encoded string - */ - writeVString(str: string): this; - - /** - * Writes a length as varint32 prefixed UTF8 encoded string - * - * @param offset Offset to read from - */ - writeVString(str: string, offset: number): number; - - /** - * Reads a length as varint32 prefixed UTF8 encoded string - */ - readVString(): string; - - /** - * Reads a length as varint32 prefixed UTF8 encoded string - * - * @param offset Offset to read from - */ - readVString(offset: number): I.ByteArray.String; - - /** - * Appends this ByteArray's contents to another ByteArray. - * This will overwrite any contents behind the specified offset up to the length of this ByteArray's data - * - * @param offset Offset to append to - */ - appendTo(target: ByteArray, offset?: number): this; - - /** - * Enables or disables assertions of argument types and offsets. - * Assertions are enabled by default but you can opt to disable them if your code already makes sure that everything is valid - */ - assert(assert?: boolean): this; - - /** - * Gets the capacity of this ByteArray's backing buffer - */ - capacity(): number; - - /** - * Clears this ByteArray's offsets by setting offset to 0 and limit to the backing buffer's capacity - */ - clear(): this; - - /** - * Creates a cloned instance of this ByteArray, - * preset with this ByteArray's values for offset, markedOffset and limit - * - * @param copy Whether to copy the backing buffer or to return another view on the same, false by default - */ - clone(copy?: boolean): ByteArray; - - /** - * Compacts this ByteArray to be backed by a buffer of its contents' length. - * Will set offset = 0 and limit = capacity and adapt markedOffset to the same relative position if set - * - * @param begin Offset to start at, buffer offset by default - * @param end Offset to end at, buffer limit by default - */ - compact(begin?: number, end?: number): this; - - /** - * Creates a copy of this ByteArray's contents. - * - * @param begin Begin offset, buffer offset by default - * @param end End offset, buffer limit by default - */ - copy(begin?: number, end?: number): ByteArray; - - /** - * Copies this ByteArray's contents to another ByteArray. - * - * @param targetOffset Offset to copy to. Will use and increase the target's offset by the number of bytes copied if omitted - * @param sourceOffset Offset to start copying from. Will use and increase offset by the number of bytes copied if omitted - * @param sourceLimit Offset to end copying from, defaults to the buffer limit - */ - copyTo(target: ByteArray, targetOffset?: number, souceOffset?: number, sourceLimit?: number): this | ByteArray; - - /** - * Makes sure that this ByteArray is backed by a ByteArray#buffer of at least the specified capacity. - * If the current capacity is exceeded, it will be doubled. - * If double the current capacity is less than the required capacity, the required capacity will be used instead - */ - ensureCapacity(capacity: number): this; - - /** - * Overwrites this ByteArray's contents with the specified value. - * - * @param value Byte value to fill with. If given as a string, the first character is used - * @param begin Begin offset. Will use and increase offset by the number of bytes written if omitted. defaults to offset - * @param end End offset, defaults to limit. - */ - fill(value: string | number, begin?: number, end?: number): this; - - /** - * Makes this ByteArray ready for a new sequence of write or relative read operations. - * Sets limit = offset and offset = 0. - * Make sure always to flip a ByteArray when all relative read or write operations are complete - */ - flip(): this; - - /** - * Marks an offset on this ByteArray to be used later - * - * @param offset Offset to mark. Defaults to offset. - */ - mark(offset?: number): this; - - /** - * Prepends some data to this ByteArray. - * This will overwrite any contents before the specified offset up to the prepended data's length. - * If there is not enough space available before the specified offset, - * the backing buffer will be resized and its contents moved accordingly - * - * @param source Data to prepend - * @param offset Offset to prepend at. Will use and decrease offset by the number of bytes prepended if omitted. - */ - prepend(source: I.ByteArray.Wrappable, offset: number): this; - - /** - * Prepends some data to this ByteArray. - * This will overwrite any contents before the specified offset up to the prepended data's length. - * If there is not enough space available before the specified offset, - * the backing buffer will be resized and its contents moved accordingly - * - * @param source Data to prepend - * @param encoding Encoding if data is a string - * @param offset Offset to prepend at. Will use and decrease offset by the number of bytes prepended if omitted. - */ - prepend(source: I.ByteArray.Wrappable, encoding?: string, offset?: number): this; - - /** - * Prepends this ByteArray to another ByteArray. - * This will overwrite any contents before the specified offset up to the prepended data's length. - * If there is not enough space available before the specified offset, - * the backing buffer will be resized and its contents moved accordingly - * - * @param offset Offset to prepend at - */ - prependTo(target: ByteArray, offset?: number): this; - - /** - * Gets the number of remaining readable bytes - */ - remaining(): number; - - /** - * Resets this ByteArray's offset. - * If an offset has been marked through mark before, offset will be set to markedOffset, which will then be discarded. - * If no offset has been marked, sets offset = 0 - */ - reset(): this; - - /** - * Resizes this ByteArray to be backed by a buffer of at least the given capacity. - * Will do nothing if already that large or larger. - * - * @param capacity Capacity required - */ - resize(capacity: number): this; - - /** - * Reverses this ByteArray's contents. - * - * @param begin Offset to start at, defaults to offset - * @param end Offset to end at, defaults to limit - */ - reverse(begin?: number, end?: number): this; - - /** - * Skips the next length bytes. This will just advance - */ - skip(length: number): this; - - /** - * Slices this ByteArray by creating a cloned instance with offset = begin and limit = end - * - * @param begin Begin offset, defaults to offset - * @param end End offset, defaults to limit - */ - slice(begin?: number, end?: number): ByteArray; - - /** - * Returns a copy of the backing buffer that contains this ByteArray's contents. - * - * @param forceCopy If true returns a copy, otherwise returns a view referencing the same memory if possible, false by default - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toBuffer(forceCopy?: boolean, begin?: number, end?: number): Buffer; - - /** - * Returns a raw buffer compacted to contain this ByteArray's contents - */ - toArrayBuffer(): ArrayBuffer; - - /** - * Converts the ByteArray's contents to a string - * - * @param encoding Output encoding - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toString(encoding?: string, begin?: number, end?: number): string; - - /** - * Encodes this ByteArray's contents to a base64 encoded string - * - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toBase64(begin?: number, end?: number): string; - - /** - * Encodes this ByteArray to a binary encoded string, that is using only characters 0x00-0xFF as bytes - * - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toBinary(begin?: number, end?: number): string; - - /** - * Encodes this ByteArray to a hex encoded string with marked offsets - * - * @param columns If true returns two columns hex + ascii, defaults to false - */ - toDebug(columns?: boolean): string; - - /** - * Encodes this ByteArray's contents to a hex encoded string - * - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toHex(begin?: number, end?: number): string; - - /** - * Encodes this ByteArray's contents to an UTF8 encoded string - * - * @param begin Begin offset, offset by default - * @param end End offset, limit by default - */ - toUTF8(begin?: number, end?: number): string; - - static accessor(): typeof Buffer; - - /** - * Allocates a new ByteArray backed by a buffer of the specified capacity. - * - * @param capacity Initial capacity. Defaults to ByteArray.DEFAULT_CAPACITY(64) - * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) - */ - static allocate(capacity?: number, noAssert?: boolean): ByteArray; - - /** - * Concatenates multiple ByteArrays into one - * - * @param encoding Encoding for strings - * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) - */ - static concat(buffers: I.ByteArray.Wrappable[], encoding?: string, noAssert?: boolean): ByteArray; - - static type(): typeof Buffer; - - /** - * Wraps a buffer or a string. - * Sets the allocated ByteArray's offset to 0 and its limit to the length of the wrapped data - * - * @param encoding Encoding for strings - * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) - */ - static wrap(buffer: I.ByteArray.Wrappable, encoding?: string, noAssert?: boolean): ByteArray; - - /** - * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer - */ - static calculateVarint32(value: number): number; - - /** - * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding - */ - static zigZagEncode32(n: number): number; - - /** - * Decodes a zigzag encoded signed 32bit integer - */ - static zigZagDecode32(n: number): number; - - /** - * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer - */ - static calculateVarint64(value: number | string): number; - - /** - * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding - */ - static zigZagEncode64(value: number | string | I.Long): I.Long; - - /** - * Decodes a zigzag encoded signed 64bit integer. - */ - static zigZagDecode64(value: number | string | I.Long): I.Long; - - /** - * Calculates the number of UTF8 characters of a string. - * JavaScript itself uses UTF-16, - * so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF - */ - static calculateUTF8Chars(str: string): number; - - /** - * Calculates the number of UTF8 bytes of a string. - */ - static calculateString(str: string): number; - - /** - * Decodes a base64 encoded string to a ByteArray - */ - static fromBase64(str: string): ByteArray; - - /** - * Encodes a binary string to base64 like window.btoa does - */ - static btoa(str: string): string; - - /** - * Decodes a base64 encoded string to binary like window.atob does - */ - static atob(b64: string): string; - - /** - * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteArray - */ - static fromBinary(str: string): ByteArray; - - /** - * Decodes a hex encoded string with marked offsets to a ByteArray - */ - static fromDebug(str: string, noAssert?: boolean): ByteArray; - - /** - * Decodes a hex encoded string to a ByteArray - */ - static fromHex(str: string, noAssert?: boolean): ByteArray; - - /** - * Decodes an UTF8 encoded string to a ByteArray - */ - static fromUTF8(str: string, noAssert?: boolean): ByteArray; - - /** - * Default initial capacity - */ - static DEFAULT_CAPACITY: number; - - /** - * Default no assertions flag - */ - static DEFAULT_NOASSERT: boolean; - - /** - * Maximum number of bytes required to store a 32bit base 128 variable-length integer - */ - static MAX_VARINT32_BYTES: number; - - /** - * Maximum number of bytes required to store a 64bit base 128 variable-length integer - */ - static MAX_VARINT64_BYTES: number; - - /** - * Metrics representing number of UTF8 characters. Evaluates to `c`. - */ - static METRICS_CHARS: string; - - /** - * Metrics representing number of bytes. Evaluates to `b`. - */ - static METRICS_BYTES: string; - } - - /** - * Represents a queue - */ - class Queue { - /** - * Whether the queue is full - */ - readonly full: boolean; - - /** - * The length of the queue - */ - readonly length: number; - - /** - * Whether the queue is empty - */ - readonly empty: boolean; - - /** - * Inserts a new element at the end - */ - push(x: S): this; - - /** - * Removes and returns an element from the beginning - */ - pop(): T | undefined; - } - - /** - * Represents an asynchronous queue, each pop is a promise - * that is resolved with an existing element or an element that will be pushed in the future - */ - class AsyncQueue extends Queue> { - /** - * Returns a promise that will be resolved with an existing element or an element that will be pushed in the future - */ - pop(): Promise; - } - - namespace I.PriorityQueue { - interface ConstructorOptions { - /** - * Function that compares objects. - * - * Must return a positive value if a > b, a negative if a < b, and zero for equal objects - */ - compare?(a: T, b: T): number; - - /** - * Function that evaluates the priority value by the given objects, - * if the returned value > 0, then the first argument has higher priority, - * = 0 same priority, < 0 lower priority. - * By default the top element is an element that has the highest priority, - * the default priority function is equal to the compare function - */ - priority?(a: T, b: T): number; - } - } - - /** - * Represents a priority queue - */ - class PriorityQueue { - /** - * Whether the queue is empty - */ - readonly empty: boolean; - - /** - * The length of the queue - */ - readonly length: number; - - constructor(options?: I.PriorityQueue.ConstructorOptions); - - /** - * Clones the queue - */ - clone(): PriorityQueue; - - /** - * Inserts a new element - */ - push(x: T): this; - - /** - * Removes the top element (that has the highest priority) - */ - pop(): T | undefined; - - /** - * Deletes the given element from the queue - */ - delete(x: T): this; - - /** - * Replaces the top element (pop + push) - */ - replace(x: T): T; - - /** - * Faster push + pop - */ - pushpop(x: T): T; - - /** - * Converts the queue to an array, it works with a clone of the queue, so the original queue is untouched - */ - toArray(): T[]; - - /** - * Creates a queue object from the given iterable - */ - static from(iterable: Iterable, options?: I.PriorityQueue.ConstructorOptions): PriorityQueue; - } - - /** - * Represents a faster LRU cache but with less functionality - */ - class FastLRU { - /** - * @param size Cache size, unlimited by default - */ - constructor(size?: number, options?: { - /** - * Function that is called when a value is deleted - */ - dispose?(key: K, value: V): void - }); - - /** - * The actual size of the cache - */ - readonly size: number; - - /** - * Gets the value by the given key - */ - get(key: K): V | undefined; - - /** - * Sets a new value for the given key - */ - set(key: K, value: V): void; - - /** - * Deletes the given key from the cache - */ - delete(key: K): boolean; - - /** - * Checks whether the cache has an element with the given key - */ - has(key: K): boolean; - - /** - * Returns the keys iterator - */ - keys(): IterableIterator; - - /** - * Returns the values iterator - */ - values(): IterableIterator; - - /** - * Returns the entries iterator - */ - entries(): IterableIterator<[K, V]>; - - /** - * Clears the cache - */ - clear(): void; - } - - /** - * Represents a stack - */ - class Stack { - /** - * Whether the stack is empty - */ - readonly empty: boolean; - - /** - * The top element of the stack - */ - readonly top: T; - - /** - * Inserts a new element - */ - push(x: T): this; - - /** - * Removes the top element - */ - pop(): T | undefined; - - /** - * Returns an iterator over the values - */ - [Symbol.iterator](): IterableIterator; - - /** - * Creates a stack and pushed all the values from the given iterable object - */ - static from(iterable: Iterable): Stack; - } - - namespace I.BinarySearchTree { - interface ConstructorOptions { - /** - * The parent tree - */ - parent?: Tree; - - /** - * Value to keep in this node - */ - value?: V; - - /** - * WHether the values must be unique, false by default. - * If false you can store many values for same keys, otherwise only one - */ - unique?: boolean; - - /** - * Custom keys comparator, by default if a > b => -1, a < b -1, a === b => 0 - */ - compareKeys?(a: K, b: K): number; - - /** - * Function that defines whether 2 values are the same, by default a === b - */ - checkValueEquality?(a: V, b: V): boolean; - } - - interface Query { - $lt?: K; - $lte?: K; - $gt?: K; - $gte?: K; - } - } - - /** - * Represents a binary search tree - */ - class BinarySearchTree { - constructor(options?: I.BinarySearchTree.ConstructorOptions>); - - /** - * Returns the max descendant tree - */ - getMaxKeyDescendant(): BinarySearchTree; - - /** - * Returns the maximum key - */ - getMaxKey(): K; - - /** - * Returns the min descendant tree - */ - getMinKeyDescendant(): BinarySearchTree; - - /** - * Returns the minumum key - */ - getMinKey(): K; - - /** - * Traverses the tree and calls the given function for each node - */ - checkAllNodesFullfillCondition(test: (key: K, value: V) => void): void; - - /** - * Checks whether the tree is a binary search tree - */ - checkIsBST(): void; - - /** - * Returns the of keys in the tree - */ - getNumberOfKeys(): number; - - /** - * Inserts a new key/value - */ - insert(key: K, value: V): void; - - /** - * Searches the given key in the tree - */ - search(key: K): V[]; - - /** - * Returns all the values from the given key bounds - */ - betweenBounds(query: I.BinarySearchTree.Query): V[]; - - /** - * Deletes the given key/value from the tree - */ - delete(key: K, value?: V): void; - - /** - * Executed the given callback for each node from left to right - */ - executeOnEveryNode(fn: (tree: BinarySearchTree) => void): void; - - /** - * Prints the tree - */ - prettyPrint(printData?: boolean, spacing?: string): void; - } - - /** - * Represents an AVL tree, a self-balancing binary search tree - */ - class AVLTree { - constructor(options?: I.BinarySearchTree.ConstructorOptions>); - - /** - * Checks whether the tree is an avl tree - */ - checkIsAVLT(): void; - - /** - * Inserts a new key/value - */ - insert(key: K, value: V): void; - - /** - * Deletes the given key/value from the tree - */ - delete(key: K, value?: V): void; - - /** - * Returns the of keys in the tree - */ - getNumberOFKeys(): number; - - /** - * Searches the given key in the tree - */ - search(key: K): V[]; - - /** - * Returns all the values from the given key bounds - */ - betweenBounds(query: I.BinarySearchTree.Query): V[]; - - /** - * Executed the given callback for each node from left to right - */ - executeOnEveryNode(fn: (tree: AVLTree) => void): void; - - /** - * Prints the tree - */ - prettyPrint(printDate?: boolean, spacing?: string): void; - } - - namespace I.RedBlackTree { - interface Node { - /** - * The key associated to the node - */ - key: K; - - /** - * The value associated to the node - */ - value: V; - - /** - * The left subtree of the node - */ - left?: Node; - - /** - * The right subtree of the node - */ - right?: Node; - } - - interface Iterator { - /** - * Checks if the iterator is valid - */ - readonly valid: boolean; - - /** - * The value of the node at the iterator's current position, null if invalid - */ - readonly node: Node | null; - - /** - * The key of the item referenced by the iterator, undefined if invalid - */ - readonly key?: K; - - /** - * The value of the item referenced by the iterator, undefined if invalid - */ - readonly value?: V; - - /** - * Returns the position of this iterator in the sequence - */ - readonly index: number; - - /** - * If true, then the iterator is not at the end of the sequence - */ - readonly hasNext: boolean; - - /** - * If true, then the iterator is not at the beginning of the sequence - */ - readonly hasPrev: boolean; - - /** - * The tree associated to the iterator - */ - tree: RedBlackTree; - - /** - * Makes a copy of the iterator - */ - clone(): Iterator; - - /** - * Removes the item at the position of the iterator and returns a new rb-tree - */ - remove(): RedBlackTree; - - /** - * Advances the iterator to the next position - */ - next(): void; - - /** - * Updates the value of the node in the tree at this iterator and returns a new rb-tree - */ - update(value: V): RedBlackTree; - - /** - * Moves the iterator backward one element - */ - prev(): void; - } - } - - /** - * Represents a fully persistent red-black tree - */ - class RedBlackTree { - /** - * The root node of the tree - */ - root: I.RedBlackTree.Node; - - constructor(compare?: (a: K, b: K) => number, root?: RedBlackTree); - - /** - * A sorted array of all the keys in the tree - */ - readonly keys: K[]; - - /** - * An array of all the values in the tree - */ - readonly values: V[]; - - /** - * The number of items in the tree - */ - readonly length: number; - - /** - * An iterator pointing to the first element in the tree - */ - readonly begin: I.RedBlackTree.Iterator; - - /** - * An iterator pointing to the last element in the tree - */ - readonly end: I.RedBlackTree.Iterator; - - /** - * Creates a new tree with the new pair inserted - */ - insert(key: K, value: V): RedBlackTree; - - /** - * Walks a visitor function over the nodes of the tree in order - * - * @param visit A callback that gets executed on each node. - * If a truthy value is returned from the visitor, then iteration is stopped. - * @param lo An optional start of the range to visit (inclusive) - * @param hi An optional end of the range to visit (non-inclusive) - */ - forEach(visit: (key: K, value: V) => T, lo?: K, hi?: K): T; - - /** - * Finds an iterator starting at the given element - */ - at(idx: number): I.RedBlackTree.Iterator; - - /** - * Finds the first item in the tree whose key is >= key - */ - ge(key: K): I.RedBlackTree.Iterator; - - /** - * Finds the first item in the tree whose key is > key - */ - gt(key: K): I.RedBlackTree.Iterator; - - /** - * Finds the first item in the tree whose key is < key - */ - lt(key: K): I.RedBlackTree.Iterator; - - /** - * Finds the first item in the tree whose key is <= key - */ - le(key: K): I.RedBlackTree.Iterator; - - /** - * Returns an iterator pointing to the first item in the tree with key, otherwise null - */ - find(key: K): I.RedBlackTree.Iterator | null; - - /** - * Removes the first item with key in the tree - */ - remove(key: K): RedBlackTree; - - /** - * Retrieves the value associated to the given key - */ - get(key: K): V | undefined; - } - - /** - * Respresetns a data structure which is a combination of an array and a set. - * Adding a new member is O(1), testing for membership is O(1), - * and finding the index of an element is O(1). - */ - class ArraySet { - /** - * The number of unique items in this ArraySet. - * If duplicates have been added, than those do not count towards the size. - */ - readonly length: number; - - /** - * Adds the given value to this set. - * - * @param allowDuplicates Whether to allow duplicates in the set, false by default - */ - add(value: T, allowDuplicates?: boolean): this; - - /** - * Checks whether the given value is a member of the set - */ - has(value: T): boolean; - - /** - * Returns the index of the given element. - * If the value is not present it will return -1 - */ - indexOf(value: T): number; - - /** - * Converts the set to an array - */ - toArray(): T[]; - - /** - * Creates an ArraySet from the given iterable object - * - * @param allowDuplicates Whether to allow duplicates in the set, false by default - */ - static from(iterable: Iterable, allowDuplicates?: boolean): ArraySet; - } - - namespace I.BufferList { - type Appendable = Buffer | BufferList | string | number | Array; - } - - /** - * Represents a Node.js Buffer list collector, reader and streamer with callback/promise interface support - */ - class BufferList extends std.stream.Duplex implements PromiseLike { - /** - * Creates a new buffer list - */ - constructor(); - - /** - * Creates a new buffer list and initiates with the given value - */ - constructor(buffer: I.BufferList.Appendable); - - /** - * Creates a new buffer list and subscribes the given callback on the end/error event - */ - constructor(callback: (err: any, data: Buffer) => void); - - /** - * Adds an additional buffer or BufferList to the internal list - */ - append(buf: I.BufferList.Appendable): this; - - /** - * Ends the stream - */ - end(chunk?: Buffer): void; - end(chunk?: () => void): void; - - /** - * Returns the byte at the specified index - */ - get(idx: number): number; - - /** - * Returns a new Buffer object containing the bytes within the range specified. - */ - slice(start?: number, end?: number): Buffer; - - /** - * Copies the content of the list in the dest buffer - * starting from destStart and containing the bytes within the range specified with srcStart to srcEnd - * - * @param dstStart writes from this position - * @param srcStart reads bytes from this position - * @param srcEnd read bytes to this position - */ - copy(dst: T, dstStart?: number, srcStart?: number, srcEnd?: number): T; - - /** - * Returns a new BufferList object containing the bytes within the range specified. - * No copies will be performed. All buffers in the result share memory with the original list. - * - * @param start slice from - * @param end slice to - */ - shallowSlice(start?: number, end?: number): BufferList; - - /** - * Return a string representation of the buffer - */ - toString(encoding?: fs.I.Encoding, start?: number, end?: number): string; - - /** - * Shifts bytes off the start of the list - */ - consume(bytes: number): this; - - /** - * Performs a shallow-copy of the list. - */ - duplicate(): BufferList; - - /** - * Destroys the stream - */ - destroy(): void; - - then( - onfulfilled?: ((value: Buffer) => T1 | PromiseLike) | null, - onrejected?: ((reason: any) => T2 | PromiseLike) | null - ): PromiseLike; - - catch(onrejected?: ((reason: any) => T | PromiseLike) | null): PromiseLike; - } - - /** - * Represents a Map that has a default values factory object or function. - * Each get of non-existent key goes through the factory - */ - class DefaultMap extends Map { - constructor(factory?: ((key: K) => V) | { [key: string]: V }, iterable?: Iterable<[K, V]>); - } - - namespace I.LRU { - type LengthCalculator = (value: V, key: K) => number; - interface ConstructorOptions { - /** - * The maximum size of the cache, checked by applying the length function to all values in the cache. - * Default is Infinity - */ - max?: number; - - /** - * Maximum age in ms. Items are not pro-actively pruned out as they age, - * but if you try to get an item that is too old, - * it'll drop it and return undefined instead of giving it to you - */ - maxAge?: number; - - /** - * Function that is used to calculate the length of stored items - */ - length?: LengthCalculator; - - /** - * Function that is called on items when they are dropped from the cache - */ - dispose?(key: K, value: V): void; - - /** - * Whether to return the stale value before deleting it - */ - stale?: boolean; - - /** - * Dispose will only be called when a key falls out of the cache, not when it is overwritten - */ - noDisposeOnSet?: boolean; - } - - interface SerializedEntry { - /** - * key - */ - key: K; - - /** - * value - */ - value: V; - - /** - * when it becomes expired - */ - e: number; - } - - interface Entry { - /** - * key - */ - key: K; - - /** - * value - */ - value: V; - - /** - * entry length - */ - length: number; - - /** - * Timestamp when the entry was created - */ - now: number; - - /** - * Maximum live time - */ - maxAge: number; - } - } - - /** - * Represent an LRU cache - */ - class LRU { - /** - * Creates an LRU cache of the given size - */ - constructor(max: number); - - /** - * Creates an LRU cache with the given options - */ - constructor(options?: I.LRU.ConstructorOptions); - - /** - * The length of the cache, setter resizes the cache - */ - max: number; - - /** - * stale setting - */ - allowStale: boolean; - - /** - * maxAge setting - */ - maxAge: number; - - /** - * length setting - */ - lengthCalculator: I.LRU.LengthCalculator; - - /** - * Total length of objects in cache taking into account length options function - */ - readonly length: number; - - /** - * Total quantity of objects currently in cache. - * Note, that stale items are returned as part of this item count. - */ - readonly itemCount: number; - - /** - * Iterates over all the keys in the cache, in reverse recent-ness order. (ie, less recently used items are iterated over first.) - */ - rforEach(fn: (this: T, value: V, key: K, cache: LRU) => void, thisp?: T): void; - - /** - * Iterates over all the keys in the cache, in order of recent-ness - */ - forEach(fn: (this: T, value: V, key: K, cache: LRU) => void, thisp?: T): void; - - /** - * Returns an array of the keys in the cache - */ - keys(): K[]; - - /** - * Returns an array of the values in the cache - */ - values(): V[]; - - /** - * Clears the cache entirely, throwing away all values - */ - reset(): void; - - /** - * Return an array of the cache entries ready for serialization and usage with 'destinationCache.load(arr)` - */ - dump(): Array>; - - /** - * Returns an internal lru list of entries - */ - dumpLru(): LinkedList>; - - /** - * @param opts std.util.inspect options - */ - inspect(opts?: object): string; - - /** - * Sets a new value for the given key. Updates the "recently used"-ness of the key - * - * @param maxAge maxAge option specific for this key - * @returns Whether the key was set - */ - set(key: K, value: V, maxAge?: number): boolean; - - /** - * Check if a key is in the cache, without updating the recent-ness or deleting it for being stale - */ - has(key: K): boolean; - - /** - * Gets the value of the given key. Updates the "recently used"-ness of the key - */ - get(key: K): V | undefined; - - /** - * Returns the key value without updating the "recently used"-ness of the key - */ - peek(key: K): V | undefined; - - /** - * Deletes the less recently used element - */ - pop(): I.LRU.Entry; - - /** - * Deletes a key out of the cache - */ - del(key: K): void; - - /** - * Loads another cache entries array, obtained with sourceCache.dump(), into the cache. - * The destination cache is reset before loading new entries - */ - load(arr: Array>): void; - - /** - * Manually iterates over the entire cache proactively pruning old entries - */ - prune(): void; - } - - /** - * Represents a Map that keeps keys only for a specified interval of time - */ - class TimedoutMap extends Map { - /** - * @param timeout maximum age of the keys, 1000 by default - * @param callback callback that is called with each key when the timeout is passed - */ - constructor(timeout?: number, callback?: (key: K) => void); - - /** - * Gets the timeout - */ - getTimeout(): number; - - /** - * Sets the timeout - */ - setTimeout(ms: number): void; - - /** - * Iterates over the map and calls the callback for each element - */ - forEach(callback: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): this; - - /** - * Deletes the given key - */ - delete(key: K): boolean; - } - } -} diff --git a/types/adone/glosses/collections/array_set.d.ts b/types/adone/glosses/collections/array_set.d.ts new file mode 100644 index 0000000000..c13d8769f1 --- /dev/null +++ b/types/adone/glosses/collections/array_set.d.ts @@ -0,0 +1,44 @@ +declare namespace adone.collection { + /** + * Respresetns a data structure which is a combination of an array and a set. + * Adding a new member is O(1), testing for membership is O(1), + * and finding the index of an element is O(1). + */ + class ArraySet { + /** + * The number of unique items in this ArraySet. + * If duplicates have been added, than those do not count towards the size. + */ + readonly length: number; + + /** + * Adds the given value to this set. + * + * @param allowDuplicates Whether to allow duplicates in the set, false by default + */ + add(value: T, allowDuplicates?: boolean): this; + + /** + * Checks whether the given value is a member of the set + */ + has(value: T): boolean; + + /** + * Returns the index of the given element. + * If the value is not present it will return -1 + */ + indexOf(value: T): number; + + /** + * Converts the set to an array + */ + toArray(): T[]; + + /** + * Creates an ArraySet from the given iterable object + * + * @param allowDuplicates Whether to allow duplicates in the set, false by default + */ + static from(iterable: Iterable, allowDuplicates?: boolean): ArraySet; + } +} diff --git a/types/adone/glosses/collections/async_queue.d.ts b/types/adone/glosses/collections/async_queue.d.ts new file mode 100644 index 0000000000..9a575a33be --- /dev/null +++ b/types/adone/glosses/collections/async_queue.d.ts @@ -0,0 +1,12 @@ +declare namespace adone.collection { + /** + * Represents an asynchronous queue, each pop is a promise + * that is resolved with an existing element or an element that will be pushed in the future + */ + class AsyncQueue extends Queue> { + /** + * Returns a promise that will be resolved with an existing element or an element that will be pushed in the future + */ + pop(): Promise; + } +} diff --git a/types/adone/glosses/collections/avl_tree.d.ts b/types/adone/glosses/collections/avl_tree.d.ts new file mode 100644 index 0000000000..2b5dc132b6 --- /dev/null +++ b/types/adone/glosses/collections/avl_tree.d.ts @@ -0,0 +1,48 @@ +declare namespace adone.collection { + /** + * Represents an AVL tree, a self-balancing binary search tree + */ + class AVLTree { + constructor(options?: I.BinarySearchTree.ConstructorOptions>); + + /** + * Checks whether the tree is an avl tree + */ + checkIsAVLT(): void; + + /** + * Inserts a new key/value + */ + insert(key: K, value: V): void; + + /** + * Deletes the given key/value from the tree + */ + delete(key: K, value?: V): void; + + /** + * Returns the of keys in the tree + */ + getNumberOFKeys(): number; + + /** + * Searches the given key in the tree + */ + search(key: K): V[]; + + /** + * Returns all the values from the given key bounds + */ + betweenBounds(query: I.BinarySearchTree.Query): V[]; + + /** + * Executed the given callback for each node from left to right + */ + executeOnEveryNode(fn: (tree: AVLTree) => void): void; + + /** + * Prints the tree + */ + prettyPrint(printDate?: boolean, spacing?: string): void; + } +} diff --git a/types/adone/glosses/collections/binary_search_tree.d.ts b/types/adone/glosses/collections/binary_search_tree.d.ts new file mode 100644 index 0000000000..878bd7e6a4 --- /dev/null +++ b/types/adone/glosses/collections/binary_search_tree.d.ts @@ -0,0 +1,110 @@ +declare namespace adone.collection { + namespace I.BinarySearchTree { + interface ConstructorOptions { + /** + * The parent tree + */ + parent?: Tree; + + /** + * Value to keep in this node + */ + value?: V; + + /** + * WHether the values must be unique, false by default. + * If false you can store many values for same keys, otherwise only one + */ + unique?: boolean; + + /** + * Custom keys comparator, by default if a > b => -1, a < b -1, a === b => 0 + */ + compareKeys?(a: K, b: K): number; + + /** + * Function that defines whether 2 values are the same, by default a === b + */ + checkValueEquality?(a: V, b: V): boolean; + } + + interface Query { + $lt?: K; + $lte?: K; + $gt?: K; + $gte?: K; + } + } + + /** + * Represents a binary search tree + */ + class BinarySearchTree { + constructor(options?: I.BinarySearchTree.ConstructorOptions>); + + /** + * Returns the max descendant tree + */ + getMaxKeyDescendant(): BinarySearchTree; + + /** + * Returns the maximum key + */ + getMaxKey(): K; + + /** + * Returns the min descendant tree + */ + getMinKeyDescendant(): BinarySearchTree; + + /** + * Returns the minumum key + */ + getMinKey(): K; + + /** + * Traverses the tree and calls the given function for each node + */ + checkAllNodesFullfillCondition(test: (key: K, value: V) => void): void; + + /** + * Checks whether the tree is a binary search tree + */ + checkIsBST(): void; + + /** + * Returns the of keys in the tree + */ + getNumberOfKeys(): number; + + /** + * Inserts a new key/value + */ + insert(key: K, value: V): void; + + /** + * Searches the given key in the tree + */ + search(key: K): V[]; + + /** + * Returns all the values from the given key bounds + */ + betweenBounds(query: I.BinarySearchTree.Query): V[]; + + /** + * Deletes the given key/value from the tree + */ + delete(key: K, value?: V): void; + + /** + * Executed the given callback for each node from left to right + */ + executeOnEveryNode(fn: (tree: BinarySearchTree) => void): void; + + /** + * Prints the tree + */ + prettyPrint(printData?: boolean, spacing?: string): void; + } +} diff --git a/types/adone/glosses/collections/buffer_list.d.ts b/types/adone/glosses/collections/buffer_list.d.ts new file mode 100644 index 0000000000..b2a4157385 --- /dev/null +++ b/types/adone/glosses/collections/buffer_list.d.ts @@ -0,0 +1,92 @@ +declare namespace adone.collection { + namespace I.BufferList { + type Appendable = Buffer | BufferList | string | number | Array; + } + + /** + * Represents a Node.js Buffer list collector, reader and streamer with callback/promise interface support + */ + class BufferList extends std.stream.Duplex implements PromiseLike { + /** + * Creates a new buffer list + */ + constructor(); + + /** + * Creates a new buffer list and initiates with the given value + */ + constructor(buffer: I.BufferList.Appendable); + + /** + * Creates a new buffer list and subscribes the given callback on the end/error event + */ + constructor(callback: (err: any, data: Buffer) => void); + + /** + * Adds an additional buffer or BufferList to the internal list + */ + append(buf: I.BufferList.Appendable): this; + + /** + * Ends the stream + */ + end(chunk?: Buffer): void; + end(chunk?: () => void): void; + + /** + * Returns the byte at the specified index + */ + get(idx: number): number; + + /** + * Returns a new Buffer object containing the bytes within the range specified. + */ + slice(start?: number, end?: number): Buffer; + + /** + * Copies the content of the list in the dest buffer + * starting from destStart and containing the bytes within the range specified with srcStart to srcEnd + * + * @param dstStart writes from this position + * @param srcStart reads bytes from this position + * @param srcEnd read bytes to this position + */ + copy(dst: T, dstStart?: number, srcStart?: number, srcEnd?: number): T; + + /** + * Returns a new BufferList object containing the bytes within the range specified. + * No copies will be performed. All buffers in the result share memory with the original list. + * + * @param start slice from + * @param end slice to + */ + shallowSlice(start?: number, end?: number): BufferList; + + /** + * Return a string representation of the buffer + */ + toString(encoding?: fs.I.Encoding, start?: number, end?: number): string; + + /** + * Shifts bytes off the start of the list + */ + consume(bytes: number): this; + + /** + * Performs a shallow-copy of the list. + */ + duplicate(): BufferList; + + /** + * Destroys the stream + */ + destroy(): void; + + then( + onfulfilled?: ((value: Buffer) => T1 | PromiseLike) | null, + onrejected?: ((reason: any) => T2 | PromiseLike) | null + ): PromiseLike; + + catch(onrejected?: ((reason: any) => T | PromiseLike) | null): PromiseLike; + } +} diff --git a/types/adone/glosses/collections/byte_array.d.ts b/types/adone/glosses/collections/byte_array.d.ts new file mode 100644 index 0000000000..1dc3080fb3 --- /dev/null +++ b/types/adone/glosses/collections/byte_array.d.ts @@ -0,0 +1,892 @@ +declare namespace adone.collection { + namespace I { + type Long = math.Long; + + type Longable = math.I.Longable; + + namespace ByteArray { + interface Varint32 { + value: number; + length: number; + } + + interface Varint64 { + value: Long; + length: number; + } + + interface String { + string: string; + length: number; + } + + type Wrappable = string | ByteArray | Buffer | Uint8Array | ArrayBuffer; + + type Metrics = "b" | "c"; + } + } + + /** + * Represents an array of bytes, enhanced Node.js Buffer + */ + class ByteArray { + readonly woffset: number; + + readonly roffset: number; + + readonly buffer: Buffer; + + readonly noAssert: boolean; + + /** + * Constructs a new ByteArray + * + * @param capacity Initial capacity. Defaults to ByteArray.DEFAULT_CAPACITY(64) + * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) + */ + constructor(capacity?: number, noAssert?: boolean); + + /** + * Reads a BitSet as an array of booleans. + * + * @param offset Offset to read from. Will use and increase offset by length if omitted. + */ + readBitSet(offset?: number): boolean[]; + + /** + * Reads the specified number of bytes. + * + * @param length Number of bytes to read + * @param offset Offset to read from. Will use and increase offset by length if omitted. + */ + read(length: number, offset?: number): ByteArray; + + /** + * Reads an 8bit signed integer + * + * @param offset Offset to read from + */ + readInt8(offset?: number): number; + + /** + * Reads an 8bit unsigned integer + * + * @param offset Offset to read from + */ + readUInt8(offset?: number): number; + + /** + * Reads a 16bit signed le integer + * + * @param offset Offset to read from + */ + readInt16LE(offset?: number): number; + + /** + * Reads a 16bit unsigned le integer + * + * @param offset Offset to read from + */ + readUInt16LE(offset?: number): number; + + /** + * Reads a 16bit signed be integer + * + * @param offset Offset to read from + */ + readInt16BE(offset?: number): number; + + /** + * Reads a 16bit unsigned be integer + * + * @param offset Offset to read from + */ + readUInt16BE(offset?: number): number; + + /** + * Reads a 32bit signed le integer + * + * @param offset Offset to read from + */ + readInt32LE(offset?: number): number; + + /** + * Reads a 32bit unsigned le integer + * + * @param offset Offset to read from + */ + readUInt32LE(offset?: number): number; + + /** + * Reads a 32bit signed be integer + * + * @param offset Offset to read from + */ + readInt32BE(offset?: number): number; + + /** + * Reads a 32bit unsigned be integer + * + * @param offset Offset to read from + */ + readUInt32BE(offset?: number): number; + + /** + * Reads a 64bit signed le integer as math.Long + * + * @param offset Offset to read from + */ + readInt64LE(offset?: number): math.Long; + + /** + * Reads a 64bit unsigned le integer as math.Long + * + * @param offset Offset to read from + */ + readUInt64LE(offset?: number): math.Long; + + /** + * Reads a 64bit signed be integer as math.Long + * + * @param offset Offset to read from + */ + readInt64BE(offset?: number): math.Long; + + /** + * Reads a 64bit unsigned be integer as math.Long + * + * @param offset Offset to read from + */ + readUInt64BE(offset?: number): math.Long; + + /** + * Reads a 32bit le float + * + * @param offset Offset to read from + */ + readFloatLE(offset?: number): number; + + /** + * Reads a 32bit be float + * + * @param offset Offset to read from + */ + readFloatBE(offset?: number): number; + + /** + * Reads a 64bit le float + * + * @param offset Offset to read from + */ + readDoubleLE(offset?: number): number; + + /** + * Reads a 64bit be float + * + * @param offset Offset to read from + */ + readDoubleBE(offset?: number): number; + + /** + * Appends some data to this ByteArray. + * This will overwrite any contents behind the specified offset up to the appended data's length. + * + * @param source The source write from + * @param offset Offset to write at + * @param length length to read from the source + * @param encoding encoding to use for wrapping the source in bytearray + */ + write(source: I.ByteArray.Wrappable, offset?: number, length?: number, encoding?: string): this; + + /** + * Writes the array as a bitset. + * @param value Array of booleans to write + */ + writeBitSet(value: number[]): this; + + /** + * Writes the array as a bitset. + * @param value Array of booleans to write + * @param offset Offset to write at + */ + writeBitSet(value: number[], offset: number): number; + + /** + * Writes a buffer at the given offset + * @param buf Buffer to write + * @param offset Offset to write at + */ + writeBuffer(buf: Buffer, offset?: number): this; + + /** + * Writes an 8bit signed integer + * + * @param offset Offset to write at + */ + writeInt8(value: number, offset?: number): this; + + /** + * Writes an 8bit unsigned integer + * + * @param offset Offset to write at + */ + writeUInt8(value: number, offset?: number): this; + + /** + * Writes a 16bit signed le integer + * + * @param offset Offset to write at + */ + writeInt16LE(value: number, offset?: number): this; + + /** + * Writes a 16bit signed be integer + * + * @param offset Offset to write at + */ + writeInt16BE(value: number, offset?: number): this; + + /** + * Writes a 16bit unsigned le integer + * + * @param offset Offset to write at + */ + writeUInt16LE(value: number, offset?: number): this; + + /** + * Writes a 16bit unsigned be integer + * + * @param offset Offset to write at + */ + writeUInt16BE(value: number, offset?: number): this; + + /** + * Writes a 32bit signed le integer + * + * @param offset Offset to write at + */ + writeInt32LE(value: number, offset?: number): this; + + /** + * Writes a 32bit signed be integer + * + * @param offset Offset to write at + */ + writeInt32BE(value: number, offset?: number): this; + + /** + * Writes a 32bit unsigned le integer + * + * @param offset Offset to write at + */ + writeUInt32LE(value: number, offset?: number): this; + + /** + * Writes a 32bit unsigned be integer + * + * @param offset Offset to write at + */ + writeUInt32BE(value: number, offset?: number): this; + + /** + * Writes a 64bit signed le long integer + * + * @param offset Offset to write at + */ + writeInt64LE(value: math.Long | string | number, offset?: number): this; + + /** + * Writes a 64bit signed be long integer + * + * @param offset Offset to write at + */ + writeInt64BE(value: math.Long | string | number, offset?: number): this; + + /** + * Writes a 64bit unsigned le long integer + * + * @param offset Offset to write at + */ + writeUInt64LE(value: math.Long | string | number, offset?: number): this; + + /** + * Writes a 64bit unsigned be long integer + * + * @param offset Offset to write at + */ + writeUInt64BE(value: math.Long | string | number, offset?: number): this; + + /** + * Writes a 32bit le float + * + * @param offset Offset to write at + */ + writeFloatLE(value: number, offset?: number): this; + + /** + * Writes a 32bit be float + * + * @param offset Offset to write at + */ + writeFloatBE(value: number, offset?: number): this; + + /** + * Writes a 64bit le float + * + * @param offset Offset to write at + */ + writeDoubleLE(value: number, offset?: number): this; + + /** + * Writes a 64bit be float + * + * @param offset Offset to write at + */ + writeDoubleBE(value: number, offset?: number): this; + + /** + * Writes a 32bit base 128 variable-length integer + */ + writeVarint32(value: number): this; + + /** + * Writes a 32bit base 128 variable-length integer + * + * @param offset Offset to write at + */ + writeVarint32(value: number, offset: number): number; + + /** + * Writes a zig-zag encoded 32bit base 128 variable-length integer + */ + writeVarint32ZigZag(value: number): this; + + /** + * Writes a zig-zag encoded 32bit base 128 variable-length integer + * + * @param offset Offset to write at + */ + writeVarint32ZigZag(value: number, offset: number): number; + + /** + * Reads a 32bit base 128 variable-length integer + */ + readVarint32(): number; + + /** + * Reads a 32bit base 128 variable-length integer + * + * @param offset Offset to read from + */ + readVarint32(offset: number): I.ByteArray.Varint32; + + /** + * Reads a zig-zag encoded 32bit base 128 variable-length integer + */ + readVarint32ZigZag(): number; + + /** + * Reads a zig-zag encoded 32bit base 128 variable-length integer + * + * @param offset Offset to read from + */ + readVarint32ZigZag(offset: number): I.ByteArray.Varint32; + + /** + * Writes a 64bit base 128 variable-length integer + */ + writeVarint64(value: math.Long | string | number): this; + + /** + * Writes a 64bit base 128 variable-length integer + * + * @param offset Offset to write at + */ + writeVarint64(value: math.Long | string | number, offset: number): number; + + /** + * Writes a zig-zag encoded 64bit base 128 variable-length integer + */ + writeVarint64ZigZag(value: math.Long | string | number): this; + + /** + * Writes a zig-zag encoded 64bit base 128 variable-length integer + * + * @param offset Offset to write at + */ + writeVarint64ZigZag(value: math.Long | string | number, offset: number): number; + + /** + * Reads a 64bit base 128 variable-length integer + */ + readVarint64(): I.Long; + + /** + * Reads a 64bit base 128 variable-length integer + * + * @param offset Offset to read from + */ + readVarint64(offset: number): I.ByteArray.Varint64; + + /** + * Reads a zig-zag encoded 64bit base 128 variable-length integer + */ + readVarint64ZigZag(): math.Long; + + /** + * Reads a zig-zag encoded 64bit base 128 variable-length integer + * + * @param offset Offset to read from + */ + readVarint64ZigZag(offset: number): I.ByteArray.Varint64; + + /** + * Writes a NULL-terminated UTF8 encoded string. + * For this to work the specified string must not contain any NULL characters itself + */ + writeCString(str: string): this; + + /** + * Writes a NULL-terminated UTF8 encoded string. + * For this to work the specified string must not contain any NULL characters itself + * + * @param offset Offset to write at + */ + writeCString(str: string, offset: number): number; + + /** + * Reads a NULL-terminated UTF8 encoded string. + * For this to work the string read must not contain any NULL characters itself + */ + readCString(): string; + + /** + * Reads a NULL-terminated UTF8 encoded string. + * For this to work the string read must not contain any NULL characters itself + * + * @param offset Offset to read from + */ + readCString(offset: number): I.ByteArray.String; + + /** + * Writes an UTF8 encoded string + */ + writeString(str: string): this; + + /** + * Writes an UTF8 encoded string + * + * @param offset Offset to write at + */ + writeString(str: string, offset: number): number; + + /** + * Reads an UTF8 encoded string + * + * @param length Number of characters or bytes to read + * @param metrics Metrics specifying what n is meant to count. Defaults to ByteArray.METRICS_CHARS("c") + */ + readString(length: number, metrics?: I.ByteArray.Metrics): string; + + /** + * Reads an UTF8 encoded string + * + * @param length Number of characters or bytes to read + * @param metrics Metrics specifying what n is meant to count. Defaults to ByteArray.METRICS_CHARS("c") + * @param offset Offset to read from + */ + readString(length: number, metrics: I.ByteArray.Metrics, offset: number): I.ByteArray.String; + + /** + * Reads an UTF8 encoded string + * + * @param length Number of characters or bytes to read + * @param offset Offset to read from + */ + readString(length: number, offset: number): I.ByteArray.String; + + /** + * Writes a length as varint32 prefixed UTF8 encoded string + */ + writeVString(str: string): this; + + /** + * Writes a length as varint32 prefixed UTF8 encoded string + * + * @param offset Offset to read from + */ + writeVString(str: string, offset: number): number; + + /** + * Reads a length as varint32 prefixed UTF8 encoded string + */ + readVString(): string; + + /** + * Reads a length as varint32 prefixed UTF8 encoded string + * + * @param offset Offset to read from + */ + readVString(offset: number): I.ByteArray.String; + + /** + * Appends this ByteArray's contents to another ByteArray. + * This will overwrite any contents behind the specified offset up to the length of this ByteArray's data + * + * @param offset Offset to append to + */ + appendTo(target: ByteArray, offset?: number): this; + + /** + * Enables or disables assertions of argument types and offsets. + * Assertions are enabled by default but you can opt to disable them if your code already makes sure that everything is valid + */ + assert(assert?: boolean): this; + + /** + * Gets the capacity of this ByteArray's backing buffer + */ + capacity(): number; + + /** + * Clears this ByteArray's offsets by setting offset to 0 and limit to the backing buffer's capacity + */ + clear(): this; + + /** + * Creates a cloned instance of this ByteArray, + * preset with this ByteArray's values for offset, markedOffset and limit + * + * @param copy Whether to copy the backing buffer or to return another view on the same, false by default + */ + clone(copy?: boolean): ByteArray; + + /** + * Compacts this ByteArray to be backed by a buffer of its contents' length. + * Will set offset = 0 and limit = capacity and adapt markedOffset to the same relative position if set + * + * @param begin Offset to start at, buffer offset by default + * @param end Offset to end at, buffer limit by default + */ + compact(begin?: number, end?: number): this; + + /** + * Creates a copy of this ByteArray's contents. + * + * @param begin Begin offset, buffer offset by default + * @param end End offset, buffer limit by default + */ + copy(begin?: number, end?: number): ByteArray; + + /** + * Copies this ByteArray's contents to another ByteArray. + * + * @param targetOffset Offset to copy to. Will use and increase the target's offset by the number of bytes copied if omitted + * @param sourceOffset Offset to start copying from. Will use and increase offset by the number of bytes copied if omitted + * @param sourceLimit Offset to end copying from, defaults to the buffer limit + */ + copyTo(target: ByteArray, targetOffset?: number, souceOffset?: number, sourceLimit?: number): this | ByteArray; + + /** + * Makes sure that this ByteArray is backed by a ByteArray#buffer of at least the specified capacity. + * If the current capacity is exceeded, it will be doubled. + * If double the current capacity is less than the required capacity, the required capacity will be used instead + */ + ensureCapacity(capacity: number): this; + + /** + * Overwrites this ByteArray's contents with the specified value. + * + * @param value Byte value to fill with. If given as a string, the first character is used + * @param begin Begin offset. Will use and increase offset by the number of bytes written if omitted. defaults to offset + * @param end End offset, defaults to limit. + */ + fill(value: string | number, begin?: number, end?: number): this; + + /** + * Makes this ByteArray ready for a new sequence of write or relative read operations. + * Sets limit = offset and offset = 0. + * Make sure always to flip a ByteArray when all relative read or write operations are complete + */ + flip(): this; + + /** + * Marks an offset on this ByteArray to be used later + * + * @param offset Offset to mark. Defaults to offset. + */ + mark(offset?: number): this; + + /** + * Prepends some data to this ByteArray. + * This will overwrite any contents before the specified offset up to the prepended data's length. + * If there is not enough space available before the specified offset, + * the backing buffer will be resized and its contents moved accordingly + * + * @param source Data to prepend + * @param offset Offset to prepend at. Will use and decrease offset by the number of bytes prepended if omitted. + */ + prepend(source: I.ByteArray.Wrappable, offset: number): this; + + /** + * Prepends some data to this ByteArray. + * This will overwrite any contents before the specified offset up to the prepended data's length. + * If there is not enough space available before the specified offset, + * the backing buffer will be resized and its contents moved accordingly + * + * @param source Data to prepend + * @param encoding Encoding if data is a string + * @param offset Offset to prepend at. Will use and decrease offset by the number of bytes prepended if omitted. + */ + prepend(source: I.ByteArray.Wrappable, encoding?: string, offset?: number): this; + + /** + * Prepends this ByteArray to another ByteArray. + * This will overwrite any contents before the specified offset up to the prepended data's length. + * If there is not enough space available before the specified offset, + * the backing buffer will be resized and its contents moved accordingly + * + * @param offset Offset to prepend at + */ + prependTo(target: ByteArray, offset?: number): this; + + /** + * Gets the number of remaining readable bytes + */ + remaining(): number; + + /** + * Resets this ByteArray's offset. + * If an offset has been marked through mark before, offset will be set to markedOffset, which will then be discarded. + * If no offset has been marked, sets offset = 0 + */ + reset(): this; + + /** + * Resizes this ByteArray to be backed by a buffer of at least the given capacity. + * Will do nothing if already that large or larger. + * + * @param capacity Capacity required + */ + resize(capacity: number): this; + + /** + * Reverses this ByteArray's contents. + * + * @param begin Offset to start at, defaults to offset + * @param end Offset to end at, defaults to limit + */ + reverse(begin?: number, end?: number): this; + + /** + * Skips the next length bytes. This will just advance + */ + skip(length: number): this; + + /** + * Slices this ByteArray by creating a cloned instance with offset = begin and limit = end + * + * @param begin Begin offset, defaults to offset + * @param end End offset, defaults to limit + */ + slice(begin?: number, end?: number): ByteArray; + + /** + * Returns a copy of the backing buffer that contains this ByteArray's contents. + * + * @param forceCopy If true returns a copy, otherwise returns a view referencing the same memory if possible, false by default + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toBuffer(forceCopy?: boolean, begin?: number, end?: number): Buffer; + + /** + * Returns a raw buffer compacted to contain this ByteArray's contents + */ + toArrayBuffer(): ArrayBuffer; + + /** + * Converts the ByteArray's contents to a string + * + * @param encoding Output encoding + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toString(encoding?: string, begin?: number, end?: number): string; + + /** + * Encodes this ByteArray's contents to a base64 encoded string + * + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toBase64(begin?: number, end?: number): string; + + /** + * Encodes this ByteArray to a binary encoded string, that is using only characters 0x00-0xFF as bytes + * + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toBinary(begin?: number, end?: number): string; + + /** + * Encodes this ByteArray to a hex encoded string with marked offsets + * + * @param columns If true returns two columns hex + ascii, defaults to false + */ + toDebug(columns?: boolean): string; + + /** + * Encodes this ByteArray's contents to a hex encoded string + * + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toHex(begin?: number, end?: number): string; + + /** + * Encodes this ByteArray's contents to an UTF8 encoded string + * + * @param begin Begin offset, offset by default + * @param end End offset, limit by default + */ + toUTF8(begin?: number, end?: number): string; + + static accessor(): typeof Buffer; + + /** + * Allocates a new ByteArray backed by a buffer of the specified capacity. + * + * @param capacity Initial capacity. Defaults to ByteArray.DEFAULT_CAPACITY(64) + * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) + */ + static allocate(capacity?: number, noAssert?: boolean): ByteArray; + + /** + * Concatenates multiple ByteArrays into one + * + * @param encoding Encoding for strings + * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) + */ + static concat(buffers: I.ByteArray.Wrappable[], encoding?: string, noAssert?: boolean): ByteArray; + + static type(): typeof Buffer; + + /** + * Wraps a buffer or a string. + * Sets the allocated ByteArray's offset to 0 and its limit to the length of the wrapped data + * + * @param encoding Encoding for strings + * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteArray.DEFAULT_NOASSERT(false) + */ + static wrap(buffer: I.ByteArray.Wrappable, encoding?: string, noAssert?: boolean): ByteArray; + + /** + * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer + */ + static calculateVarint32(value: number): number; + + /** + * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding + */ + static zigZagEncode32(n: number): number; + + /** + * Decodes a zigzag encoded signed 32bit integer + */ + static zigZagDecode32(n: number): number; + + /** + * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer + */ + static calculateVarint64(value: number | string): number; + + /** + * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding + */ + static zigZagEncode64(value: number | string | I.Long): I.Long; + + /** + * Decodes a zigzag encoded signed 64bit integer. + */ + static zigZagDecode64(value: number | string | I.Long): I.Long; + + /** + * Calculates the number of UTF8 characters of a string. + * JavaScript itself uses UTF-16, + * so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF + */ + static calculateUTF8Chars(str: string): number; + + /** + * Calculates the number of UTF8 bytes of a string. + */ + static calculateString(str: string): number; + + /** + * Decodes a base64 encoded string to a ByteArray + */ + static fromBase64(str: string): ByteArray; + + /** + * Encodes a binary string to base64 like window.btoa does + */ + static btoa(str: string): string; + + /** + * Decodes a base64 encoded string to binary like window.atob does + */ + static atob(b64: string): string; + + /** + * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteArray + */ + static fromBinary(str: string): ByteArray; + + /** + * Decodes a hex encoded string with marked offsets to a ByteArray + */ + static fromDebug(str: string, noAssert?: boolean): ByteArray; + + /** + * Decodes a hex encoded string to a ByteArray + */ + static fromHex(str: string, noAssert?: boolean): ByteArray; + + /** + * Decodes an UTF8 encoded string to a ByteArray + */ + static fromUTF8(str: string, noAssert?: boolean): ByteArray; + + /** + * Default initial capacity + */ + static DEFAULT_CAPACITY: number; + + /** + * Default no assertions flag + */ + static DEFAULT_NOASSERT: boolean; + + /** + * Maximum number of bytes required to store a 32bit base 128 variable-length integer + */ + static MAX_VARINT32_BYTES: number; + + /** + * Maximum number of bytes required to store a 64bit base 128 variable-length integer + */ + static MAX_VARINT64_BYTES: number; + + /** + * Metrics representing number of UTF8 characters. Evaluates to `c`. + */ + static METRICS_CHARS: string; + + /** + * Metrics representing number of bytes. Evaluates to `b`. + */ + static METRICS_BYTES: string; + } +} diff --git a/types/adone/glosses/collections/default_map.d.ts b/types/adone/glosses/collections/default_map.d.ts new file mode 100644 index 0000000000..46b8ccebfe --- /dev/null +++ b/types/adone/glosses/collections/default_map.d.ts @@ -0,0 +1,9 @@ +declare namespace adone.collection { + /** + * Represents a Map that has a default values factory object or function. + * Each get of non-existent key goes through the factory + */ + class DefaultMap extends Map { + constructor(factory?: ((key: K) => V) | { [key: string]: V }, iterable?: Iterable<[K, V]>); + } +} diff --git a/types/adone/glosses/collections/fast_lru.d.ts b/types/adone/glosses/collections/fast_lru.d.ts new file mode 100644 index 0000000000..e991322bc0 --- /dev/null +++ b/types/adone/glosses/collections/fast_lru.d.ts @@ -0,0 +1,61 @@ +declare namespace adone.collection { + /** + * Represents a faster LRU cache but with less functionality + */ + class FastLRU { + /** + * @param size Cache size, unlimited by default + */ + constructor(size?: number, options?: { + /** + * Function that is called when a value is deleted + */ + dispose?(key: K, value: V): void + }); + + /** + * The actual size of the cache + */ + readonly size: number; + + /** + * Gets the value by the given key + */ + get(key: K): V | undefined; + + /** + * Sets a new value for the given key + */ + set(key: K, value: V): void; + + /** + * Deletes the given key from the cache + */ + delete(key: K): boolean; + + /** + * Checks whether the cache has an element with the given key + */ + has(key: K): boolean; + + /** + * Returns the keys iterator + */ + keys(): IterableIterator; + + /** + * Returns the values iterator + */ + values(): IterableIterator; + + /** + * Returns the entries iterator + */ + entries(): IterableIterator<[K, V]>; + + /** + * Clears the cache + */ + clear(): void; + } +} diff --git a/types/adone/glosses/collections/index.d.ts b/types/adone/glosses/collections/index.d.ts new file mode 100644 index 0000000000..234ffe85f4 --- /dev/null +++ b/types/adone/glosses/collections/index.d.ts @@ -0,0 +1,28 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +declare namespace adone { + /** + * Data structures + */ + namespace collection { + // + } +} diff --git a/types/adone/glosses/collections/linked_list.d.ts b/types/adone/glosses/collections/linked_list.d.ts new file mode 100644 index 0000000000..69ffa4da4b --- /dev/null +++ b/types/adone/glosses/collections/linked_list.d.ts @@ -0,0 +1,150 @@ +declare namespace adone.collection { + namespace I.LinkedList { + /** + * Represents the node of a linked list + */ + interface Node { + /** + * The next node + */ + next?: Node; + + /** + * The previous node + */ + prev?: Node; + + /** + * The value this node contains + */ + value: T; + } + } + + /** + * Represents a linked list + */ + class LinkedList { + /** + * The maximum length of the list + */ + readonly maxLength: number; + + /** + * Current length of the list + */ + readonly length: number; + + /** + * Whether the list is autoresizable + */ + readonly autoresize: boolean; + + /** + * @param maxLength Maximum length of the linked list + */ + constructor(maxLength?: number); + + /** + * Whether the list is full + */ + readonly full: boolean; + + /** + * Whether the list is empty + */ + readonly empty: boolean; + + /** + * Resizes the list + */ + resize(newLength: number): this; + + /** + * Adds a new node to the end + * + * @returns Added node + */ + push(value: T): I.LinkedList.Node; + + /** + * Removes the last node, returns undefined if the list is empty + */ + pop(): T | undefined; + + /** + * Removes the first node, returns undefined if the list is empty + */ + shift(): T | undefined; + + /** + * Inserts a new node at the beginning of the list + * + * @returns Added node + */ + unshift(value: T): I.LinkedList.Node; + + /** + * Moves the given node to the end of the list + */ + pushNode(node: I.LinkedList.Node): void; + + /** + * Moved the given node to the beginning of the list + */ + unshiftNode(node: I.LinkedList.Node): void; + + /** + * Removes the given node from the list + */ + removeNode(node: I.LinkedList.Node): void; + + /** + * Clears the list + * + * @param strong Whether to reset all the node's values + */ + clear(strong?: boolean): void; + + /** + * Convers the list to an array + */ + toArray(): T[]; + + /** + * The first element of the list + */ + readonly front: T; + + /** + * The last element of the list + */ + readonly back: T; + + /** + * Returns an iterator over the list elements + */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns the next node for the given node + */ + nextNode(node: I.LinkedList.Node): I.LinkedList.Node; + + /** + * Maps this linked list to a new one using the given function + */ + map(fn: (value: T, index: number) => R): LinkedList; + + /** + * Invokes the given callback for each value from the beginning to the end (much faster than for-of). + * If the given function returns false it stops iterating. + */ + forEach(callback: (value: T, index: number) => void | boolean): void; + + /** + * Default length of a new created linked list + */ + static DEFAULT_LENGTH: number; + } +} diff --git a/types/adone/glosses/collections/lru.d.ts b/types/adone/glosses/collections/lru.d.ts new file mode 100644 index 0000000000..7d41e32cd5 --- /dev/null +++ b/types/adone/glosses/collections/lru.d.ts @@ -0,0 +1,213 @@ +declare namespace adone.collection { + namespace I.LRU { + type LengthCalculator = (value: V, key: K) => number; + interface ConstructorOptions { + /** + * The maximum size of the cache, checked by applying the length function to all values in the cache. + * Default is Infinity + */ + max?: number; + + /** + * Maximum age in ms. Items are not pro-actively pruned out as they age, + * but if you try to get an item that is too old, + * it'll drop it and return undefined instead of giving it to you + */ + maxAge?: number; + + /** + * Function that is used to calculate the length of stored items + */ + length?: LengthCalculator; + + /** + * Function that is called on items when they are dropped from the cache + */ + dispose?(key: K, value: V): void; + + /** + * Whether to return the stale value before deleting it + */ + stale?: boolean; + + /** + * Dispose will only be called when a key falls out of the cache, not when it is overwritten + */ + noDisposeOnSet?: boolean; + } + + interface SerializedEntry { + /** + * key + */ + key: K; + + /** + * value + */ + value: V; + + /** + * when it becomes expired + */ + e: number; + } + + interface Entry { + /** + * key + */ + key: K; + + /** + * value + */ + value: V; + + /** + * entry length + */ + length: number; + + /** + * Timestamp when the entry was created + */ + now: number; + + /** + * Maximum live time + */ + maxAge: number; + } + } + + /** + * Represent an LRU cache + */ + class LRU { + /** + * Creates an LRU cache of the given size + */ + constructor(max: number); + + /** + * Creates an LRU cache with the given options + */ + constructor(options?: I.LRU.ConstructorOptions); + + /** + * The length of the cache, setter resizes the cache + */ + max: number; + + /** + * stale setting + */ + allowStale: boolean; + + /** + * maxAge setting + */ + maxAge: number; + + /** + * length setting + */ + lengthCalculator: I.LRU.LengthCalculator; + + /** + * Total length of objects in cache taking into account length options function + */ + readonly length: number; + + /** + * Total quantity of objects currently in cache. + * Note, that stale items are returned as part of this item count. + */ + readonly itemCount: number; + + /** + * Iterates over all the keys in the cache, in reverse recent-ness order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (this: T, value: V, key: K, cache: LRU) => void, thisp?: T): void; + + /** + * Iterates over all the keys in the cache, in order of recent-ness + */ + forEach(fn: (this: T, value: V, key: K, cache: LRU) => void, thisp?: T): void; + + /** + * Returns an array of the keys in the cache + */ + keys(): K[]; + + /** + * Returns an array of the values in the cache + */ + values(): V[]; + + /** + * Clears the cache entirely, throwing away all values + */ + reset(): void; + + /** + * Return an array of the cache entries ready for serialization and usage with 'destinationCache.load(arr)` + */ + dump(): Array>; + + /** + * Returns an internal lru list of entries + */ + dumpLru(): LinkedList>; + + /** + * @param opts std.util.inspect options + */ + inspect(opts?: object): string; + + /** + * Sets a new value for the given key. Updates the "recently used"-ness of the key + * + * @param maxAge maxAge option specific for this key + * @returns Whether the key was set + */ + set(key: K, value: V, maxAge?: number): boolean; + + /** + * Check if a key is in the cache, without updating the recent-ness or deleting it for being stale + */ + has(key: K): boolean; + + /** + * Gets the value of the given key. Updates the "recently used"-ness of the key + */ + get(key: K): V | undefined; + + /** + * Returns the key value without updating the "recently used"-ness of the key + */ + peek(key: K): V | undefined; + + /** + * Deletes the less recently used element + */ + pop(): I.LRU.Entry; + + /** + * Deletes a key out of the cache + */ + del(key: K): void; + + /** + * Loads another cache entries array, obtained with sourceCache.dump(), into the cache. + * The destination cache is reset before loading new entries + */ + load(arr: Array>): void; + + /** + * Manually iterates over the entire cache proactively pruning old entries + */ + prune(): void; + } +} diff --git a/types/adone/glosses/collections/map_cache.d.ts b/types/adone/glosses/collections/map_cache.d.ts new file mode 100644 index 0000000000..55bbb6e05f --- /dev/null +++ b/types/adone/glosses/collections/map_cache.d.ts @@ -0,0 +1,13 @@ +declare namespace adone.collection { + class MapCache { + has(key: string): boolean; + + get(key: string): T; + + set(key: string, value: T): void; + + delete(key: string): void; + + clear(): void; + } +} diff --git a/types/adone/glosses/collections/ns_cache.d.ts b/types/adone/glosses/collections/ns_cache.d.ts new file mode 100644 index 0000000000..5630c295d3 --- /dev/null +++ b/types/adone/glosses/collections/ns_cache.d.ts @@ -0,0 +1,17 @@ +declare namespace adone.collection { + class NSCache { + constructor(size: number, namespaces: string[]); + + resize(newSize: number): void; + + set(ns: string, key: string, value: T): void; + + get(ns: string, key: string): T; + + has(ns: string, key: string): boolean; + + delete(ns: string, key: string): void; + + clear(): void; + } +} diff --git a/types/adone/glosses/collections/priority_queue.d.ts b/types/adone/glosses/collections/priority_queue.d.ts new file mode 100644 index 0000000000..0fb1e92814 --- /dev/null +++ b/types/adone/glosses/collections/priority_queue.d.ts @@ -0,0 +1,78 @@ +declare namespace adone.collection { + namespace I.PriorityQueue { + interface ConstructorOptions { + /** + * Function that compares objects. + * + * Must return a positive value if a > b, a negative if a < b, and zero for equal objects + */ + compare?(a: T, b: T): number; + + /** + * Function that evaluates the priority value by the given objects, + * if the returned value > 0, then the first argument has higher priority, + * = 0 same priority, < 0 lower priority. + * By default the top element is an element that has the highest priority, + * the default priority function is equal to the compare function + */ + priority?(a: T, b: T): number; + } + } + + /** + * Represents a priority queue + */ + class PriorityQueue { + /** + * Whether the queue is empty + */ + readonly empty: boolean; + + /** + * The length of the queue + */ + readonly length: number; + + constructor(options?: I.PriorityQueue.ConstructorOptions); + + /** + * Clones the queue + */ + clone(): PriorityQueue; + + /** + * Inserts a new element + */ + push(x: T): this; + + /** + * Removes the top element (that has the highest priority) + */ + pop(): T | undefined; + + /** + * Deletes the given element from the queue + */ + delete(x: T): this; + + /** + * Replaces the top element (pop + push) + */ + replace(x: T): T; + + /** + * Faster push + pop + */ + pushpop(x: T): T; + + /** + * Converts the queue to an array, it works with a clone of the queue, so the original queue is untouched + */ + toArray(): T[]; + + /** + * Creates a queue object from the given iterable + */ + static from(iterable: Iterable, options?: I.PriorityQueue.ConstructorOptions): PriorityQueue; + } +} diff --git a/types/adone/glosses/collections/queue.d.ts b/types/adone/glosses/collections/queue.d.ts new file mode 100644 index 0000000000..e67eb8fda9 --- /dev/null +++ b/types/adone/glosses/collections/queue.d.ts @@ -0,0 +1,31 @@ +declare namespace adone.collection { + /** + * Represents a queue + */ + class Queue { + /** + * Whether the queue is full + */ + readonly full: boolean; + + /** + * The length of the queue + */ + readonly length: number; + + /** + * Whether the queue is empty + */ + readonly empty: boolean; + + /** + * Inserts a new element at the end + */ + push(x: S): this; + + /** + * Removes and returns an element from the beginning + */ + pop(): T | undefined; + } +} diff --git a/types/adone/glosses/collections/rb_tree.d.ts b/types/adone/glosses/collections/rb_tree.d.ts new file mode 100644 index 0000000000..2ed7a81323 --- /dev/null +++ b/types/adone/glosses/collections/rb_tree.d.ts @@ -0,0 +1,184 @@ +declare namespace adone.collection { + namespace I.RedBlackTree { + interface Node { + /** + * The key associated to the node + */ + key: K; + + /** + * The value associated to the node + */ + value: V; + + /** + * The left subtree of the node + */ + left?: Node; + + /** + * The right subtree of the node + */ + right?: Node; + } + + interface Iterator { + /** + * Checks if the iterator is valid + */ + readonly valid: boolean; + + /** + * The value of the node at the iterator's current position, null if invalid + */ + readonly node: Node | null; + + /** + * The key of the item referenced by the iterator, undefined if invalid + */ + readonly key?: K; + + /** + * The value of the item referenced by the iterator, undefined if invalid + */ + readonly value?: V; + + /** + * Returns the position of this iterator in the sequence + */ + readonly index: number; + + /** + * If true, then the iterator is not at the end of the sequence + */ + readonly hasNext: boolean; + + /** + * If true, then the iterator is not at the beginning of the sequence + */ + readonly hasPrev: boolean; + + /** + * The tree associated to the iterator + */ + tree: RedBlackTree; + + /** + * Makes a copy of the iterator + */ + clone(): Iterator; + + /** + * Removes the item at the position of the iterator and returns a new rb-tree + */ + remove(): RedBlackTree; + + /** + * Advances the iterator to the next position + */ + next(): void; + + /** + * Updates the value of the node in the tree at this iterator and returns a new rb-tree + */ + update(value: V): RedBlackTree; + + /** + * Moves the iterator backward one element + */ + prev(): void; + } + } + + /** + * Represents a fully persistent red-black tree + */ + class RedBlackTree { + /** + * The root node of the tree + */ + root: I.RedBlackTree.Node; + + constructor(compare?: (a: K, b: K) => number, root?: RedBlackTree); + + /** + * A sorted array of all the keys in the tree + */ + readonly keys: K[]; + + /** + * An array of all the values in the tree + */ + readonly values: V[]; + + /** + * The number of items in the tree + */ + readonly length: number; + + /** + * An iterator pointing to the first element in the tree + */ + readonly begin: I.RedBlackTree.Iterator; + + /** + * An iterator pointing to the last element in the tree + */ + readonly end: I.RedBlackTree.Iterator; + + /** + * Creates a new tree with the new pair inserted + */ + insert(key: K, value: V): RedBlackTree; + + /** + * Walks a visitor function over the nodes of the tree in order + * + * @param visit A callback that gets executed on each node. + * If a truthy value is returned from the visitor, then iteration is stopped. + * @param lo An optional start of the range to visit (inclusive) + * @param hi An optional end of the range to visit (non-inclusive) + */ + forEach(visit: (key: K, value: V) => T, lo?: K, hi?: K): T; + + /** + * Finds an iterator starting at the given element + */ + at(idx: number): I.RedBlackTree.Iterator; + + /** + * Finds the first item in the tree whose key is >= key + */ + ge(key: K): I.RedBlackTree.Iterator; + + /** + * Finds the first item in the tree whose key is > key + */ + gt(key: K): I.RedBlackTree.Iterator; + + /** + * Finds the first item in the tree whose key is < key + */ + lt(key: K): I.RedBlackTree.Iterator; + + /** + * Finds the first item in the tree whose key is <= key + */ + le(key: K): I.RedBlackTree.Iterator; + + /** + * Returns an iterator pointing to the first item in the tree with key, otherwise null + */ + find(key: K): I.RedBlackTree.Iterator | null; + + /** + * Removes the first item with key in the tree + */ + remove(key: K): RedBlackTree; + + /** + * Retrieves the value associated to the given key + */ + get(key: K): V | undefined; + } +} diff --git a/types/adone/glosses/collections/refcounted_cache.d.ts b/types/adone/glosses/collections/refcounted_cache.d.ts new file mode 100644 index 0000000000..79410423a4 --- /dev/null +++ b/types/adone/glosses/collections/refcounted_cache.d.ts @@ -0,0 +1,9 @@ +declare namespace adone.collection { + class RefcountedCache extends MapCache { + ref(key: string): void; + + unref(key: string): void; + + references(key: string): number; + } +} diff --git a/types/adone/glosses/collections/set.d.ts b/types/adone/glosses/collections/set.d.ts new file mode 100644 index 0000000000..f1a6bae96d --- /dev/null +++ b/types/adone/glosses/collections/set.d.ts @@ -0,0 +1,17 @@ +declare namespace adone.collection { + class Set { + constructor(key?: (x: T) => any); + + has(value: T): boolean; + + add(value: T): void; + + delete(value: T): void; + + get(value: T): T; // ??? + + readonly size: number; + + only(): T; + } +} diff --git a/types/adone/glosses/collections/stack.d.ts b/types/adone/glosses/collections/stack.d.ts new file mode 100644 index 0000000000..90fe35b99b --- /dev/null +++ b/types/adone/glosses/collections/stack.d.ts @@ -0,0 +1,36 @@ +declare namespace adone.collection { + /** + * Represents a stack + */ + class Stack { + /** + * Whether the stack is empty + */ + readonly empty: boolean; + + /** + * The top element of the stack + */ + readonly top: T; + + /** + * Inserts a new element + */ + push(x: T): this; + + /** + * Removes the top element + */ + pop(): T | undefined; + + /** + * Returns an iterator over the values + */ + [Symbol.iterator](): IterableIterator; + + /** + * Creates a stack and pushed all the values from the given iterable object + */ + static from(iterable: Iterable): Stack; + } +} diff --git a/types/adone/glosses/collections/timedout_map.d.ts b/types/adone/glosses/collections/timedout_map.d.ts new file mode 100644 index 0000000000..fedcf79fa2 --- /dev/null +++ b/types/adone/glosses/collections/timedout_map.d.ts @@ -0,0 +1,32 @@ +declare namespace adone.collection { + /** + * Represents a Map that keeps keys only for a specified interval of time + */ + class TimedoutMap extends Map { + /** + * @param timeout maximum age of the keys, 1000 by default + * @param callback callback that is called with each key when the timeout is passed + */ + constructor(timeout?: number, callback?: (key: K) => void); + + /** + * Gets the timeout + */ + getTimeout(): number; + + /** + * Sets the timeout + */ + setTimeout(ms: number): void; + + /** + * Iterates over the map and calls the callback for each element + */ + forEach(callback: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): this; + + /** + * Deletes the given key + */ + delete(key: K): boolean; + } +} diff --git a/types/adone/glosses/data.d.ts b/types/adone/glosses/data.d.ts index f711836bdd..4d3dae7b2b 100644 --- a/types/adone/glosses/data.d.ts +++ b/types/adone/glosses/data.d.ts @@ -30,7 +30,12 @@ declare namespace adone { * or an array of String and Number objects that serve as a whitelist * for selecting/filtering the properties of the value object to be included in the JSON string */ - replacer?: I.Replacer + replacer?: I.Replacer, + + /** + * Wheter to append a newline + */ + newline?: boolean }): Buffer; /** @@ -84,6 +89,8 @@ declare namespace adone { */ function decode(buf: collection.I.ByteArray.Wrappable): any; + function tryDecode(buf: collection.ByteArray): any; + namespace I { type Type = string | number; // ? type DecodeFunction = (buf: collection.ByteArray) => any; @@ -153,6 +160,8 @@ declare namespace adone { * Represents a MessagePack serializer */ class Serializer { + constructor(initialCapacity?: number); + /** * Encoder instance */ @@ -211,6 +220,8 @@ declare namespace adone { * x.Exception, Error, Date, Map, Set, math.Long */ const serializer: Serializer; + + function registerCommonTypesFor(s: Serializer): void; } /** @@ -244,21 +255,32 @@ declare namespace adone { * Base64 encoder */ namespace base64 { + namespace I { + interface DecodeOptions { + buffer?: boolean; + encoding?: string; + } + + interface EncodeOptions { + buffer?: boolean; + } + } + /** * Encodes a string/Buffer to base64 */ - function encode(str: string | Buffer, options: { buffer: false }): string; - function encode(str: string | Buffer, options?: { buffer?: true }): Buffer; + function encode(str: string | Buffer, options: I.EncodeOptions & { buffer: false }): string; + function encode(str: string | Buffer, options?: I.EncodeOptions): Buffer; /** * Decodes base64 string/buffer into a buffer */ - function decode(str: string | Buffer, options: { buffer: true }): Buffer; + function decode(str: string | Buffer, options: I.DecodeOptions & { buffer: true }): Buffer; /** * Decodes base64 string/buffer into a string */ - function decode(str: string | Buffer, options?: { buffer?: false }): string; + function decode(str: string | Buffer, options?: I.DecodeOptions): string; function encodeVLQ(value: number): string; @@ -560,7 +582,7 @@ declare namespace adone { /** * Represents a YAML exception */ - class Exception extends adone.x.Exception { + class Exception extends adone.exception.Exception { reason: string; mark: Mark; @@ -1028,5 +1050,183 @@ declare namespace adone { */ function decode(buf: Buffer, options?: I.DeserializeOptions): any; } + + namespace protobuf { + namespace schema { + namespace I { + interface Field { + name: string | null; + type: string | null; + tag: number; + map: { + from: string; + to: string; + } | null; + oneof: string | null; + required: boolean; + repeated: boolean; + options: object; + } + + interface Enum { + name: string; + values: object; + options: object; + } + + interface Extend { + name: string; + message: Message; + } + + interface Message { + name: string; + enums: Enum[]; + extends: Extend[]; + messages: Message[]; + fields: Field[]; + extensions: { + from: number, + to: number + } | null; + } + + interface RPCMethod { + name: string; + input_type: string | null; + output_type: string | null; + client_streaming: boolean; + server_streaming: boolean; + options: object; + } + + interface Service { + name: string; + methods: RPCMethod[]; + options: object; + } + + interface Schema { + syntax: any; // ?? + package: string | null; + imports: string[]; + enums: Enum[]; + messages: Message[]; + options: object; + extends: Extend[]; + services?: Service[]; + } + } + + function parse(buf: Buffer | string): I.Schema; + + function stringify(schema: object): string; + } + + function create(proto: Buffer | string | object, opts?: object): object; + } + + namespace base32 { + function charmap(alphabet: string, mappings?: T): T; + + namespace I { + interface Spec { + alphabet: string; + charmap: { + [c: string]: number; + }; + } + } + + const rfc4648: I.Spec; + + const crockford: I.Spec; + + const base32hex: I.Spec; + + namespace I { + interface DecoderOptions { + type: "rfc4648" | "crockford" | "base32hex"; + charmap?: object; + } + + interface EncoderOptions { + type: "rfc4648" | "crockford" | "base32hex"; + alphabet?: string; + } + } + + class Decoder { + constructor(options?: I.DecoderOptions); + + write(str: string): this; + + finalize(str?: string): Buffer; + } + + class Encoder { + constructor(options?: I.EncoderOptions); + + write(buf: Buffer): this; + + finalize(buf?: Buffer): string; + } + + function encode(buf: Buffer, options?: I.EncoderOptions): string; + + function decode(str: string, options?: I.DecoderOptions): Buffer; + } + + namespace I { + interface BaseX { + encode(buf: Buffer): string; + + decode(str: string): Buffer; + + decodeUnsafe(str: string): Buffer; + } + } + + function basex(alphabet: string): I.BaseX; + + const base58: I.BaseX; + + namespace base64url { + function unescape(str: string): string; + + function escape(str: string): string; + + namespace I { + interface EncodeOptions { + encoding?: string; + } + + interface DecodeOptions { + encoding?: string; + buffer?: boolean; + } + } + + function encode(str: Buffer | string, options?: I.EncodeOptions): string; + + function decode(str: string, options: I.DecodeOptions & { buffer: true }): Buffer; + function decode(str: string, options?: I.DecodeOptions): string; + } + + namespace varint { + function encode(num: number, out?: T[], offset?: number): T[]; + + function decode(buf: Buffer, offset?: number): number; + + function encodingLength(value: number): number; + } + + namespace varintSigned { + function encode(num: number, out?: T[], offset?: number): T[]; + + function decode(buf: Buffer, offset?: number): number; + + function encodingLength(value: number): number; + } } } diff --git a/types/adone/glosses/events.d.ts b/types/adone/glosses/events.d.ts index ecb323f925..e812624aa9 100644 --- a/types/adone/glosses/events.d.ts +++ b/types/adone/glosses/events.d.ts @@ -1,25 +1,48 @@ declare namespace adone { namespace event { - class EventEmitter { - static listenerCount(emitter: EventEmitter, event: string | symbol): number; + namespace I { + interface PropagateEventsEnder { + end(): void; + } + } + + class Emitter { + static listenerCount(emitter: Emitter, event: string | symbol): number; + static defaultMaxListeners: number; addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Array<(...args: any[]) => any>; + emit(event: string | symbol, ...args: any[]): boolean; + eventNames(): Array; + listenerCount(type: string | symbol): number; + + propagateEvents(dest: Emitter, events: string[]): I.PropagateEventsEnder; + + static propagateEvents(source: Emitter, dest: Emitter, events: string[]): I.PropagateEventsEnder; } - class AsyncEmitter extends EventEmitter { + class AsyncEmitter extends Emitter { constructor(concurrency?: number); setConcurrency(max?: number): this; diff --git a/types/adone/glosses/exceptions.d.ts b/types/adone/glosses/exceptions.d.ts index 347a3c632d..1b1981f80e 100644 --- a/types/adone/glosses/exceptions.d.ts +++ b/types/adone/glosses/exceptions.d.ts @@ -1,5 +1,5 @@ declare namespace adone { - namespace x { + namespace exception { class Exception extends Error { constructor(message?: string | Error, captureStackTrace?: boolean); } diff --git a/types/adone/glosses/fake.d.ts b/types/adone/glosses/fake.d.ts new file mode 100644 index 0000000000..0c403747e4 --- /dev/null +++ b/types/adone/glosses/fake.d.ts @@ -0,0 +1,337 @@ +declare namespace adone { + namespace fake { + namespace I { + interface Card { + name: string; + username: string; + email: string; + address: FullAddress; + phone: string; + website: string; + company: Company; + posts: Post[]; + accountHistory: string[]; + } + + interface FullAddress { + streetA: string; + streetB: string; + streetC: string; + streetD: string; + city: string; + state: string; + county: string; + zipcode: string; + geo: Geo; + } + + interface Geo { + lat: string; + lng: string; + } + + interface Company { + name: string; + catchPhrase: string; + bs: string; + } + + interface Post { + words: string; + sentence: string; + sentences: string; + paragraph: string; + } + + interface ContextualCard { + name: string; + username: string; + email: string; + dob: Date; + phone: string; + address: Address; + website: string; + company: Company; + } + + interface Address { + street: string; + suite: string; + city: string; + state: string; + zipcode: string; + geo: Geo; + } + + interface UserCard { + name: string; + username: string; + email: string; + address: Address; + phone: string; + website: string; + company: Company; + } + + interface Transaction { + amount: string; + date: Date; + business: string; + name: string; + type: string; + account: string; + } + } + + namespace address { + function zipCode(format?: string): string; + function city(format?: number): string; + function cityPrefix(): string; + function citySuffix(): string; + function streetName(): string; + function streetAddress(useFullAddress?: boolean): string; + function streetSuffix(): string; + function streetPrefix(): string; + function secondaryAddress(): string; + function county(): string; + function country(): string; + function countryCode(): string; + function state(useAbbr?: boolean): string; + function stateAbbr(): string; + function latitude(): string; + function longitude(): string; + } + + namespace commerce { + function color(): string; + function department(): string; + function productName(): string; + function price(min?: number, max?: number, dec?: number, symbol?: string): string; + function productAdjective(): string; + function productMaterial(): string; + function product(): string; + } + + namespace company { + function suffixes(): string[]; + function companyName(format?: number): string; + function companySuffix(): string; + function catchPhrase(): string; + function bs(): string; + function catchPhraseAdjective(): string; + function catchPhraseDescriptor(): string; + function catchPhraseNoun(): string; + function bsAdjective(): string; + function bsBuzz(): string; + function bsNoun(): string; + } + + namespace database { + function column(): string; + function type(): string; + function collation(): string; + function engine(): string; + } + + namespace date { + function past(years?: number, refDate?: string|Date): Date; + function future(years?: number, refDate?: string|Date): Date; + function between(from: string|number|Date, to: string|Date): Date; + function recent(days?: number): Date; + function soon(days?: number): Date; + function month(options?: { abbr?: boolean, context?: boolean }): string; + function weekday(options?: { abbr?: boolean, context?: boolean }): string; + } + + function fake(str: string): string; + + namespace finance { + function account(length?: number): string; + function accountName(): string; + function mask(length?: number, parens?: boolean, elipsis?: boolean): string; + function amount(min?: number, max?: number, dec?: number, symbol?: string): string; + function transactionType(): string; + function currencyCode(): string; + function currencyName(): string; + function currencySymbol(): string; + function bitcoinAddress(): string; + function ethereumAddress(): string; + function iban(formatted?: boolean): string; + function bic(): string; + } + + namespace hacker { + function abbreviation(): string; + function adjective(): string; + function noun(): string; + function verb(): string; + function ingverb(): string; + function phrase(): string; + } + + namespace helpers { + function randomize(array: T[]): T; + function randomize(): string; + function slugify(string?: string): string; + function replaceSymbolWithNumber(string?: string, symbol?: string): string; + function replaceSymbols(string?: string): string; + function shuffle(o: T[]): T[]; + function shuffle(): string[]; + function mustache(str: string, data: { [key: string]: string|((substring: string, ...args: any[]) => string) }): string; + function createCard(): I.Card; + function contextualCard(): I.ContextualCard; + function userCard(): I.UserCard; + function createTransaction(): I.Transaction; + } + + namespace image { + function image(): string; + function avatar(): string; + function imageUrl(width?: number, height?: number, category?: string): string; + function abstract(width?: number, height?: number): string; + function animals(width?: number, height?: number): string; + function business(width?: number, height?: number): string; + function cats(width?: number, height?: number): string; + function city(width?: number, height?: number): string; + function food(width?: number, height?: number): string; + function nightlife(width?: number, height?: number): string; + function fashion(width?: number, height?: number): string; + function people(width?: number, height?: number): string; + function nature(width?: number, height?: number): string; + function sports(width?: number, height?: number): string; + function technics(width?: number, height?: number): string; + function transport(width?: number, height?: number): string; + function dataUri(width?: number, height?: number): string; + } + + namespace internet { + function avatar(): string; + function email(firstName?: string, lastName?: string, provider?: string): string; + function exampleEmail(firstName?: string, lastName?: string): string; + function userName(firstName?: string, lastName?: string): string; + function protocol(): string; + function url(): string; + function domainName(): string; + function domainSuffix(): string; + function domainWord(): string; + function ip(): string; + function ipv6(): string; + function userAgent(): string; + function color(baseRed255?: number, baseGreen255?: number, baseBlue255?: number): string; + function mac(): string; + function password(len?: number, memorable?: boolean, pattern?: string|RegExp, prefix?: string): string; + } + + namespace lorem { + function word(): string; + function words(num?: number): string; + function sentence(wordCount?: number, range?: number): string; + function slug(wordCount?: number): string; + function sentences(sentenceCount?: number): string; + function paragraph(sentenceCount?: number): string; + function paragraphs(paragraphCount?: number, separator?: string): string; + function text(times?: number): string; + function lines(lineCount?: number): string; + } + + namespace name { + function firstName(gender?: number): string; + function lastName(gender?: number): string; + function findName(firstName?: string, lastName?: string, gender?: number): string; + function jobTitle(): string; + function prefix(): string; + function suffix(): string; + function title(): string; + function jobDescriptor(): string; + function jobArea(): string; + function jobType(): string; + } + + namespace phone { + function phoneNumber(format?: string): string; + function phoneNumberFormat(phoneFormatsArrayIndex?: number): string; + function phoneFormats(): string; + } + + namespace random { + function number(max: number): number; + function number(options?: { min?: number, max?: number, precision?: number }): number; + function arrayElement(): string; + function arrayElement(array: T[]): T; + function objectElement(object?: { [key: string]: any }, field?: "key"): string; + function objectElement(object?: { [key: string]: T }, field?: any): T; + function uuid(): string; + function boolean(): boolean; + function word(type?: string): string; + function words(count?: number): string; + function image(): string; + function locale(): string; + function alphaNumeric(count?: number): string; + function hexaDecimal(count?: number): string; + } + + namespace system { + function fileName(ext: string, type: string): string; + function commonFileName(ext: string, type: string): string; + function mimeType(): string; + function commonFileType(): string; + function commonFileExt(): string; + function fileType(): string; + function fileExt(mimeType: string): string; + function directoryPath(): string; + function filePath(): string; + function semver(): string; + } + + function seed(value: number): void; + + namespace I { + type Locale = + | "az" + | "cz" + | "de" + | "de_AT" + | "de_CH" + | "el" + | "en" + | "en_AU" + | "en_BORK" + | "en_CA" + | "en_GB" + | "en_IE" + | "en_IND" + | "en_US" + | "en_au_ocker" + | "es" + | "es_MX" + | "fa" + | "fr" + | "fr_CA" + | "ge" + | "id_ID" + | "it" + | "ja" + | "ko" + | "lv" + | "nb_NO" + | "nep" + | "nl" + | "nl_BE" + | "pl" + | "pt_BR" + | "ro" + | "ru" + | "sk" + | "sv" + | "tr" + | "uk" + | "vi" + | "zh_CN" + | "zh_TW"; + } + + function getLocale(): I.Locale; + + function setLocale(locale: I.Locale): void; + } +} diff --git a/types/adone/glosses/fast.d.ts b/types/adone/glosses/fast.d.ts index 725e0e9db3..1b04bec6d3 100644 --- a/types/adone/glosses/fast.d.ts +++ b/types/adone/glosses/fast.d.ts @@ -152,7 +152,7 @@ declare namespace adone { type SymbolicFile = File; /* tslint:disable-next-line:no-empty-interface */ - interface Stream extends stream.CoreStream { + interface Stream extends stream.core.Stream { // } } @@ -160,7 +160,7 @@ declare namespace adone { export const File: I.FileConstructor; namespace I { - type CoreStreamSource = stream.I.CoreStream.Source; + type CoreStreamSource = stream.core.I.Source; interface LocalStreamConstructorOptions { /** @@ -586,7 +586,7 @@ declare namespace adone { /** * Read JSON manifests written out by revisionHash */ - manifest?: File[] | stream.CoreStream, + manifest?: File[] | stream.core.Stream, /** * Modify the name of the unreved files before using them diff --git a/types/adone/glosses/fs.d.ts b/types/adone/glosses/fs.d.ts index 7fa8f51593..7517764faf 100644 --- a/types/adone/glosses/fs.d.ts +++ b/types/adone/glosses/fs.d.ts @@ -22,6 +22,14 @@ declare namespace adone { function readlink(path: string | Buffer | I.URL, options: { encoding: null }): Promise; function readlink(path: string | Buffer | I.URL, options?: { encoding?: I.Encoding }): Promise; + /** + * Reads the value of a symbolic link + */ + function readlinkSync(path: string | Buffer | I.URL, encoding: null): Buffer; + function readlinkSync(path: string | Buffer | I.URL, encoding: I.Encoding): string; + function readlinkSync(path: string | Buffer | I.URL, options: { encoding: null }): Buffer; + function readlinkSync(path: string | Buffer | I.URL, options?: { encoding?: I.Encoding }): string; + /** * Deletes a name and possibly the file it refers to */ @@ -32,6 +40,21 @@ declare namespace adone { */ function unlinkSync(path: string | Buffer | I.URL): void; + /** + * Changes the file system timestamps of the object referenced by path + */ + function utimes(path: string | Buffer | I.URL, atime: number | string | Date, mtime: number | string | Date): Promise; + + /** + * Changes the file system timestamps of the object referenced by path + */ + function utimesSync(path: string | Buffer | I.URL, atime: number | string | Date, mtime: number | string | Date): void; + + /** + * Changes the file system timestamps of the object referenced by path + */ + function utimesMillis(path: string | Buffer | I.URL, atime: number, mtime: number): Promise; + /** * Changes permissions of a file */ @@ -42,6 +65,11 @@ declare namespace adone { */ function chown(path: string | Buffer | I.URL, uid: number, gid: number): Promise; + /** + * Changes ownership recursively for a given path + */ + function chownr(path: string | Buffer | I.URL, uid: number, gid: number): Promise; + /** * Deletes a directory */ @@ -63,6 +91,87 @@ declare namespace adone { function readdirSync(path: string | Buffer | I.URL, options: { encoding: null }): Buffer[]; function readdirSync(path: string | Buffer | I.URL, options?: { encoding?: I.Encoding }): string[]; + namespace I { + interface ReaddirpEntry { + /** + * filename + */ + name: string; + + /** + * full path to a file + */ + fullPath: string; + + /** + * relative path to a file + */ + path: string; + + /** + * relative path to the parent dir + */ + parentDir: string; + + /** + * full path to the parent dir + */ + fullParentDir: string; + + /** + * file stats + */ + stat: fs.I.Stats; + } + + type ReaddirpFilter = string | ((entry: ReaddirpEntry) => boolean); + + interface ReaddirpOptions { + /** + * filter for files + */ + fileFilter?: ReaddirpFilter | ReaddirpFilter[]; + + /** + * filter for directories + */ + directoryFilter?: ReaddirpFilter | ReaddirpFilter[]; + + /** + * maximum recursion depth + * + * Infinity by default + */ + depth?: number; + + /** + * whether to emit files + * + * true by default + */ + files?: boolean; + + /** + * whether to emit directories + * + * true by default + */ + directories?: boolean; + + /** + * whether to use lstat for stating + * + * false by default + */ + lstat?: boolean; + } + } + + /** + * Traverses the given path + */ + function readdirp(root: string | Buffer | I.URL, options?: I.ReaddirpOptions): stream.core.Stream; + /** * Gets file status, identical to stat, except that if pathname is a symbolic link, * then it returns information about the link itself, not the file that it refers to @@ -117,6 +226,15 @@ declare namespace adone { flag?: I.Flag }): Promise; + /** + * Appends data to a file, creating the file if it does not yet exist + */ + function appendFileSync(file: string | Buffer | number, data: string | Buffer, options?: { + encoding?: I.Encoding, + mode?: number, + flag?: I.Flag + }): void; + /** * Tests a user's permissions for the file or directory specified by path */ @@ -154,6 +272,14 @@ declare namespace adone { cwd?: string }): Promise; + /** + * Recursively deletes empty directiries inside the given directory + */ + function rmEmpty(path: string, options?: { + cwd?: string; + filter?: (filename: string) => boolean + }): Promise; + namespace I { interface Access { read: boolean; @@ -460,12 +586,12 @@ declare namespace adone { /** * Copies this from this directory to the given path */ - copyTo(destPath: string, options?: I.CopyOptions): Promise; + copyTo(destPath: string, options?: I.CopyToOptions): Promise; /** * Copies files from the given path to this directory */ - copyFrom(srcPath: string, options?: I.CopyOptions): Promise; + copyFrom(srcPath: string, options?: I.CopyToOptions): Promise; /** * Creates a new directory with the given path @@ -560,7 +686,7 @@ declare namespace adone { /** * Represents a file that supports random access */ - class RandomAccessFile extends event.EventEmitter { + class RandomAccessFile extends event.Emitter { constructor(filename: string, options?: I.RandomAccessFile.ConstructorOptions); /** @@ -602,7 +728,7 @@ declare namespace adone { /** * Represents an abstract random access reader */ - class AbstractRandomAccessReader extends event.EventEmitter { + class AbstractRandomAccessReader extends event.Emitter { /** * Increments the reference counter */ @@ -826,7 +952,7 @@ declare namespace adone { }>; } - type Stream = stream.CoreStream; + type Stream = stream.core.Stream; interface EmitterConstructor { new(pattern: string, optons: Options, callback?: (error: any, matches: string[]) => void): Emitter; @@ -835,7 +961,7 @@ declare namespace adone { prototype: Emitter; } - interface Emitter extends event.EventEmitter { + interface Emitter extends event.Emitter { isIgnored(path: string): boolean; /** @@ -999,7 +1125,7 @@ declare namespace adone { /** * Represents a file watcher */ - class Watcher extends event.EventEmitter { + class Watcher extends event.Emitter { constructor(options?: I.Watcher.ConstructorOptions); /** @@ -1128,214 +1254,209 @@ declare namespace adone { function whichSync(cmd: string, options?: I.Which.Options): string; /** - * Functions to work with files using file descriptors + * Opens and possibly creates a file */ - namespace fd { - /** - * Opens and possibly create a file - */ - function open(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): Promise; + function open(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): Promise; - /** - * Opens and possibly create a file - */ - function openSync(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): I.FD; + /** + * Opens and possibly creates a file + */ + function openSync(path: string | Buffer | I.URL, flags: I.Flag | number, mode?: number): I.FD; - /** - * Closes a file descriptor - */ - function close(fd: I.FD): Promise; + /** + * Closes a file descriptor + */ + function close(fd: I.FD): Promise; - /** - * Closes a file descriptor - */ - function closeSync(fd: I.FD): void; + /** + * Closes a file descriptor + */ + function closeSync(fd: I.FD): void; - /** - * Changes the file timestamps of a file referenced by the supplied file descriptor - */ - function utimes(fd: I.FD, atime: number, mtime: number): Promise; + /** + * Changes the file timestamps of a file referenced by the supplied file descriptor + */ + function futimes(fd: I.FD, atime: number, mtime: number): Promise; - /** - * Changes the file timestamps of a file referenced by the supplied file descriptor - */ - function utimesSync(fd: I.FD, atime: number, mtime: number): void; + /** + * Changes the file timestamps of a file referenced by the supplied file descriptor + */ + function futimesSync(fd: I.FD, atime: number, mtime: number): void; - /** - * Gets file status - */ - function stat(fd: I.FD): Promise; + /** + * Gets file status + */ + function fstat(fd: I.FD): Promise; - /** - * Gets file status - */ - function statSync(fd: I.FD): I.Stats; + /** + * Gets file status + */ + function fstatSync(fd: I.FD): I.Stats; - /** - * Truncates a file to a specified length - */ - function truncate(fd: I.FD, length?: number): Promise; + /** + * Truncates a file to a specified length + */ + function ftruncate(fd: I.FD, length?: number): Promise; - /** - * Truncates a file to a specified length - */ - function truncateSync(fd: I.FD, length?: number): void; + /** + * Truncates a file to a specified length + */ + function ftruncateSync(fd: I.FD, length?: number): void; + /** + * Read data from the file specified by fd + */ + function read( + fd: I.FD, /** - * Read data from the file specified by fd + * The buffer that the data will be written to */ - function read( - fd: I.FD, - /** - * The buffer that the data will be written to - */ - buffer: Buffer | Uint8Array, - /** - * The offset in the buffer to start writing at - */ - offset: number, - /** - * An integer specifying the number of bytes to read - */ - length: number, - /** - * An argument specifying where to begin reading from in the file - */ - position: number - ): Promise; - - function readSync( - fd: I.FD, - /** - * The buffer that the data will be written to - */ - buffer: Buffer | Uint8Array, - /** - * The offset in the buffer to start writing at - */ - offset: number, - /** - * An integer specifying the number of bytes to read - */ - length: number, - /** - * An argument specifying where to begin reading from in the file - */ - position: number - ): number; - + buffer: Buffer | Uint8Array, /** - * Writes buffer to the file specified by fd + * The offset in the buffer to start writing at */ - function write( - fd: I.FD, - buffer: Buffer | Uint8Array, - /** - * Determines the part of the buffer to be written - */ - offset?: number, - /** - * An integer specifying the number of bytes to write - */ - length?: number, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number - ): Promise; - + offset: number, /** - * Writes string to the file specified by fd + * An integer specifying the number of bytes to read */ - function write( - fd: I.FD, - string: string, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number, - /** - * The expected string encoding - */ - encoding?: I.Encoding - ): Promise; - + length: number, /** - * Writes buffer to the file specified by fd + * An argument specifying where to begin reading from in the file */ - function writeSync( - fd: I.FD, - buffer: Buffer | Uint8Array, - /** - * Determines the part of the buffer to be written - */ - offset?: number, - /** - * An integer specifying the number of bytes to write - */ - length?: number, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number - ): number; + position: number + ): Promise; + function readSync( + fd: I.FD, /** - * Writes string to the file specified by fd + * The buffer that the data will be written to */ - function writeSync( - fd: I.FD, - string: string, - /** - * The offset from the beginning of the file where this data should be written - */ - position?: number, - /** - * The expected string encoding - */ - encoding?: I.Encoding - ): number; + buffer: Buffer | Uint8Array, + /** + * The offset in the buffer to start writing at + */ + offset: number, + /** + * An integer specifying the number of bytes to read + */ + length: number, + /** + * An argument specifying where to begin reading from in the file + */ + position: number + ): number; + /** + * Writes buffer to the file specified by fd + */ + function write( + fd: I.FD, + buffer: Buffer | Uint8Array, /** - * Synchronizes a file's in-core state with storage + * Determines the part of the buffer to be written */ - function sync(fd: I.FD): Promise; + offset?: number, + /** + * An integer specifying the number of bytes to write + */ + length?: number, + /** + * The offset from the beginning of the file where this data should be written + */ + position?: number + ): Promise; + /** + * Writes string to the file specified by fd + */ + function write( + fd: I.FD, + string: string, /** - * Synchronizes a file's in-core state with storage + * The offset from the beginning of the file where this data should be written */ - function syncSync(fd: I.FD): void; + position?: number, + /** + * The expected string encoding + */ + encoding?: I.Encoding + ): Promise; + /** + * Writes buffer to the file specified by fd + */ + function writeSync( + fd: I.FD, + buffer: Buffer | Uint8Array, /** - * Changes ownership of a file + * Determines the part of the buffer to be written */ - function chown(fd: I.FD, uid: number, gid: number): Promise; + offset?: number, + /** + * An integer specifying the number of bytes to write + */ + length?: number, + /** + * The offset from the beginning of the file where this data should be written + */ + position?: number + ): number; + /** + * Writes string to the file specified by fd + */ + function writeSync( + fd: I.FD, + string: string, /** - * Changes ownership of a file + * The offset from the beginning of the file where this data should be written */ - function chownSync(fd: I.FD, uid: number, gid: number): void; + position?: number, + /** + * The expected string encoding + */ + encoding?: I.Encoding + ): number; - /** - * Changes permissions of a file - */ - function chmod(fd: I.FD, mode: number): Promise; + /** + * Synchronizes a file's in-core state with storage + */ + function fsync(fd: I.FD): Promise; - /** - * Changes permissions of a file - */ - function chmodSync(fd: I.FD, mode: number): void; + /** + * Synchronizes a file's in-core state with storage + */ + function fsyncSync(fd: I.FD): void; - /** - * Repositions read/write file offset - */ - function seek(fd: I.FD, offset: number, whence: number): Promise; + /** + * Changes ownership of a file + */ + function fchown(fd: I.FD, uid: number, gid: number): Promise; - /** - * Applies or removes an advisory lock on an open file - */ - function lock(fd: I.FD, flags: "sh" | "ex" | "shnb" | "exnb" | "un" | number): Promise; - } + /** + * Changes ownership of a file + */ + function fchownSync(fd: I.FD, uid: number, gid: number): void; + + /** + * Changes permissions of a file + */ + function fchmod(fd: I.FD, mode: number): Promise; + + /** + * Changes permissions of a file + */ + function fchmodSync(fd: I.FD, mode: number): void; + + /** + * Repositions read/write file offset + */ + function seek(fd: I.FD, offset: number, whence: number): Promise; + + /** + * Applies or removes an advisory lock on an open file + */ + function flock(fd: I.FD, flags: "sh" | "ex" | "shnb" | "exnb" | "un" | number): Promise; namespace constants { const F_OK: number; @@ -1475,12 +1596,63 @@ declare namespace adone { function existsSync(path: string | Buffer | I.URL): boolean; /** - * Creates a new directory and any necessary subdirectories + * Creates a new directory */ function mkdir(path: string, mode?: number): Promise; + /** + * Creates a new directory + */ + function mkdirSync(path: string, mode?: number): Promise; + + /** + * Creates a new directory and any necessary subdirectories + */ + function mkdirp(path: string, mode?: number): Promise; + + /** + * Creates a new directory and any necessary subdirectories + */ + function mkdirpSync(path: string, mode?: number): Promise; + namespace I { interface CopyOptions { + /** + * regexp or function against which each filename is tested whether to copy it or not + */ + filter?: RegExp | ((src: string, dst: string) => boolean); + + /** + * transform function which applies when files are streamed + */ + transform?( + readStream: NodeJS.ReadableStream, + writeStream: NodeJS.WritableStream, + file: { + name: string, + mode: number, + mtime: Date, + atime: Date, + stats: adone.fs.I.Stats + } + ): void; + + /** + * Whether to overwrite destination files if they exist. + * + * true by default + */ + clobber?: boolean; // ??? + + /** + * Whether to overwrite destination files if they exist. + * + * true by default + */ + overwrite?: boolean; + } + + interface CopyToOptions { /** * Do not replace existing files */ @@ -1494,10 +1666,15 @@ declare namespace adone { } /** - * Copies all files from src to dst + * Recursively copies all the files from src to dst */ function copy(src: string, dst: string, options?: I.CopyOptions): Promise; + /** + * Copies all files from src to dst + */ + function copyTo(src: string, dst: string, options?: I.CopyToOptions): Promise; + /** * Renames a file */ @@ -1514,8 +1691,32 @@ declare namespace adone { /** * Returns the last lines of a file + * + * @param path path to a file + * @param n number of lines to return */ - function tail(path: string, n: number, options?: { separator?: string, chunkLength?: number }): Promise; + function tail(path: string, n: number, options?: { + /** + * Line separator + * + * By default "\r\n" for windows and "\n" for others + */ + separator?: string, + + /** + * The number of bytes to read at once + * + * By default 4096 + */ + chunkLength?: number + + /** + * Position from which to start reading (from the end) + * + * By default stats.size of the file + */ + pos?: number + }): Promise; namespace I { interface StatVFS { @@ -1667,11 +1868,6 @@ declare namespace adone { */ function lookup(path: string): Promise; - /** - * Recursively changes ownership of files - */ - function chownr(path: string, uid: number, gid: number): Promise; - namespace I.TailWatcher { interface ConstructorOptions { /** @@ -1709,7 +1905,7 @@ declare namespace adone { * Represents an event emitter that watches for a file growing, * emits "line" event for each new line in a file */ - class TailWatcher extends event.EventEmitter { + class TailWatcher extends event.Emitter { constructor(filename: string, options?: I.TailWatcher.ConstructorOptions); /** diff --git a/types/adone/glosses/is.d.ts b/types/adone/glosses/is.d.ts index 335439a0bf..9065da138b 100644 --- a/types/adone/glosses/is.d.ts +++ b/types/adone/glosses/is.d.ts @@ -6,13 +6,13 @@ declare namespace adone { /** * Checks whether the given object is `null` */ - function _null(obj: any): boolean; + function _null(obj: any): obj is null; export { _null as null }; /** * Checks whether the given object is `undefined` */ - export function undefined(obj: any): boolean; + export function undefined(obj: any): obj is undefined; /** * Checks whether the given object is nither `undefined` nor `null` @@ -22,52 +22,54 @@ declare namespace adone { /** * Checks whether the given object is either `undefined` or `null` */ - export function nil(obj: any): boolean; + export function nil(obj: any): obj is undefined | null; /** * Checks whether the given object is a number */ - export function number(obj: any): boolean; + export function number(obj: any): obj is number; /** * Checks whether the given object is a finite number or a string represents a finite number */ - export function numeral(obj: any): boolean; + export function numeral(obj: number): obj is number; + export function numeral(obj: string): obj is string; + export function numeral(obj: any): obj is number | string; /** * Checks whether the given object is either +Infinity or -Inginity */ - export function infinite(obj: any): boolean; + export function infinite(obj: any): obj is number; /** * Checks whether the given object is an odd number */ - export function odd(obj: any): boolean; + export function odd(obj: any): obj is number; /** * Checks whether the given object is an even number */ - export function even(obj: any): boolean; + export function even(obj: any): obj is number; /** * Checks whether the given object is a float */ - export function float(obj: any): boolean; + export function float(obj: any): obj is number; /** * Checks whether the given object is -0 */ - export function negativeZero(obj: any): boolean; + export function negativeZero(obj: any): obj is number; /** * Checks whether the given object is a string */ - export function string(obj: any): boolean; + export function string(obj: any): obj is string; /** - * Checks whether the given object is an empty string + * Checks whether the given object is an empty string, i.e. a string with only whitespace characters */ - export function emptyString(obj: any): boolean; + export function emptyString(obj: any): obj is string; /** * Checks whether the first string is a substring of the second string from the given offset @@ -87,7 +89,7 @@ declare namespace adone { /** * Checks whether the given object is a boolean */ - export function boolean(obj: any): boolean; + export function boolean(obj: any): obj is boolean; /** * Checks whether the given object is a string with ".json" extension or an object @@ -215,7 +217,7 @@ declare namespace adone { /** * Checks whether the given string is a glob */ - export function glob(str: string): boolean; + export function glob(str: any): str is string; /** * Checks whether the given path is not a dot-file path (.secret) @@ -225,18 +227,18 @@ declare namespace adone { /** * Checks whether the given object is a function */ - function _function(obj: any): boolean; + function _function(obj: any): obj is (...args: any[]) => any; export { _function as function }; /** * Checks whether the given object is an async function */ - export function asyncFunction(obj: any): boolean; + export function asyncFunction(obj: any): obj is (...args: any[]) => Promise; /** * Checks whether the given object is a promise */ - export function promise(obj: any): boolean; + export function promise(obj: any): obj is PromiseLike; /** * Checks whether the given string is a valid date-string @@ -246,7 +248,7 @@ declare namespace adone { /** * Checks whether the given object is a buffer */ - export function buffer(obj: any): boolean; + export function buffer(obj: any): obj is Buffer; /** * Checks whether the given object is a callback function, i.e. it has a common function name @@ -266,27 +268,27 @@ declare namespace adone { /** * Checks whether the given object is a finite number */ - export function finite(obj: any): boolean; + export function finite(obj: any): obj is number; /** * Checks whether the given object is an integer */ - export function integer(obj: any): boolean; + export function integer(obj: any): obj is number; /** * Checks whether the given object is a safe integer */ - export function safeInteger(obj: any): boolean; + export function safeInteger(obj: any): obj is number; /** * Checks whether the given object is an array */ - export function array(obj: any): boolean; + export function array(obj: any): obj is any[]; /** * Checks whether the given object is a Uint8 array */ - export function uint8Array(obj: any): boolean; + export function uint8Array(obj: any): obj is Uint8Array; /** * Checks whether the given object is an adone configuration @@ -296,22 +298,22 @@ declare namespace adone { /** * Checks whether the given object is an instance of adone.math.Long */ - export function long(obj: any): boolean; + export function long(obj: any): obj is adone.math.Long; /** * Checks whether the given object is an instance of adone.math.BigNumber */ - export function bigNumber(obj: any): boolean; + export function bigNumber(obj: any): obj is adone.math.BigNumber; /** * Checks whether the given object is an instance of adone.collection.ByteArray */ - export function byteArray(obj: any): boolean; + export function byteArray(obj: any): obj is adone.collection.ByteArray; /** * Checks whether the given object is an instance of adone.datetime */ - export function datetime(obj: any): boolean; + export function datetime(obj: any): obj is adone.I.datetime.Datetime; export function transform(obj: any): boolean; @@ -498,17 +500,17 @@ declare namespace adone { /** * Checks whether the given object is an array buffer */ - export function arrayBuffer(obj: any): boolean; + export function arrayBuffer(obj: any): obj is ArrayBuffer; /** * Checks whether the given object is an array buffer view */ - export function arrayBufferView(obj: any): boolean; + export function arrayBufferView(obj: any): obj is ArrayBufferView; /** * Checks whether the given object is a date */ - export function date(obj: any): boolean; + export function date(obj: any): obj is Date; /** * Checks whether the given object is an error, instance of Error @@ -518,27 +520,22 @@ declare namespace adone { /** * Checks whether the given object is a map */ - export function map(obj: any): boolean; + export function map(obj: any): obj is Map; /** * Checks whether the given object is a regexp */ - export function regexp(obj: any): boolean; + export function regexp(obj: any): obj is RegExp; /** * Checks whether the given object is a set */ - export function set(obj: any): boolean; + export function set(obj: any): obj is Set; /** * Checks whether the given object is a symbol */ - export function symbol(obj: any): boolean; - - /** - * Checks whether the given buffer a valid UTF-8 encoded text - */ - export function validUTF8(obj: Buffer): boolean; + export function symbol(obj: any): obj is symbol; /** * Checks whether the given object is a vault valuable @@ -549,5 +546,135 @@ declare namespace adone { * Checks whether the given object is an adone task */ export function task(obj: any): boolean; + + namespace I { + interface FQDNOptions { + /** + * Whether to require top-level domain, default `true` + */ + requireTld?: boolean; + + /** + * Whether to allow underscores("_"), default `false` + */ + allowUnderscores?: boolean; + + /** + * Whether to allow trailing dot, default `false` + */ + allowTrailingDot?: boolean; + } + } + + /** + * Checks whether the given object(string) is a fully qualified domain name (e.g. domain.com). + */ + export function fqdn(obj: any, options?: I.FQDNOptions): obj is string; + + /** + * Checks whether the given object(string) is a url + */ + export function url(obj: any, options?: I.FQDNOptions & { + /** + * List of valid protocols. + * Used when requireValidProtocol is `true`. + * Default ["http", "https", "ftp"] + */ + protocols?: string[], + + /** + * Whether to require protocol, default `true` + */ + requireProtocol?: boolean, + + /** + * Whether to require host, default `true` + */ + requireHost?: boolean, + + /** + * Whether to require valid protocol defined in `protocols` options, default `true` + */ + requireValidProtocol?: boolean, + + /** + * Whether to allow urls like "//example.com", default `false` + */ + allowProtocolRelativeUrls?: boolean + }): obj is string; + + /** + * Checks whether the given object(string) is a valid email address + */ + export function email(obj: any, options?: { + /** + * Whether to allow email addresses with display names ("Name "") + */ + allowDisplayName?: boolean, + + /** + * Whether to require display name + */ + requireDisplayName?: boolean, + + /** + * Whether to allow UTF8 characters in the local part + */ + allowUtf8LocalPart?: boolean, + + /** + * Whether to require top-level domain, default `true` + */ + requireTld?: boolean + }): obj is string; + + /** + * Checks whether the given object is a valid IPv4 address + */ + export function ip(obj: any, version: 4): boolean; + + /** + * Checks whether the given object is a valid IPv6 address + */ + export function ip(obj: any, version: 6): boolean; + + /** + * Checks whether the given object in a valid IPv4 or IPv6 address + */ + export function ip(obj: any): boolean; + + /** + * Checks whether the given object is a valid UUIDv1 identifier + */ + export function uuid(obj: any, version: 1): obj is string; + + /** + * Checks whether the given object is a valid UUIDv2 identifier + */ + export function uuid(obj: any, version: 2): obj is string; + + /** + * Checks whether the given object is a valid UUIDv3 identifier + */ + export function uuid(obj: any, version: 3): obj is string; + + /** + * Checks whether the given object is a valid UUIDv4 identifier + */ + export function uuid(obj: any, version: 4): obj is string; + + /** + * Checks whether the given object is a valid UUIDv5 identifier + */ + export function uuid(obj: any, version: 5): obj is string; + + /** + * Checks whether the given object is a valid UUID identifier (v1, v2, v3, v4 or v5) + */ + export function uuid(obj: any, version?: "all"): obj is string; + + export function emitter(obj: any): obj is event.Emitter; + + export function asyncEmitter(obj: any): obj is event.AsyncEmitter; } } diff --git a/types/adone/glosses/meta.d.ts b/types/adone/glosses/meta.d.ts new file mode 100644 index 0000000000..bc96c1e148 --- /dev/null +++ b/types/adone/glosses/meta.d.ts @@ -0,0 +1,13 @@ +declare namespace adone { + namespace meta { + namespace I { + type PossibleTypes = "object" | "class" | "null" | "global" | "Array" | "RegExp" | "Date" + | "Promise" | "Set" | "Map" | "WeakSet" | "DataView" | "Map Iterator" | "Set Iterator" + | "Array Iterator" | "String Iterator" | "Object" | "function" | "boolean" | "number" + | "undefined" | "string" | "symbol"; + } + + function typeOf(obj: any): I.PossibleTypes; + function typeOf(obj: any): string; + } +} diff --git a/types/adone/glosses/promise.d.ts b/types/adone/glosses/promise.d.ts index cdfe0ec2f5..cc0eac9c73 100644 --- a/types/adone/glosses/promise.d.ts +++ b/types/adone/glosses/promise.d.ts @@ -125,5 +125,36 @@ declare namespace adone { */ function _finally(promise: Promise, onFinally?: (...args: any[]) => void): Promise; export { _finally as finally }; + + namespace I { + type ResolvableProps = object & {[K in keyof T]: PromiseLike | T[K]}; + } + + /** + * Returns a promise that is fulfilled when all the object's values are fulfilled + */ + export function props(obj: I.ResolvableProps): Promise; + + namespace I { + interface _RetryOptions { + max: number; + + timeout: number; + + match: (string | RegExp | Error) | Array; + + backOffBase: number; + + backOffExponent: number; + + report: (message: string, options: _RetryOptions, err: any) => void; + + name: string; + } + + type RetryOptions = Partial<_RetryOptions>; + } + + export function retry(fn: (info: { current: number }) => PromiseLike | T, options?: number | I.RetryOptions): Promise; } } diff --git a/types/adone/glosses/shani.d.ts b/types/adone/glosses/shani.d.ts index 0b79633f78..5bc2d0153f 100644 --- a/types/adone/glosses/shani.d.ts +++ b/types/adone/glosses/shani.d.ts @@ -94,6 +94,11 @@ declare namespace adone { * Mark this block as exclusive */ skip: DescribeFunction; + + /** + * Mark this block as todo + */ + todo: DescribeFunction; } interface TestOptions { @@ -146,6 +151,11 @@ declare namespace adone { * Mark this test as exclusive */ skip: TestFunction; + + /** + * Mark this test as todo + */ + todo: TestFunction; } interface HookRuntimeContext { @@ -172,7 +182,7 @@ declare namespace adone { | "end before each hook" | "end after each hook" | "end before test hook" | "end after test hook"; - interface Emitter extends event.EventEmitter { + interface Emitter extends event.Emitter { on(event: "enter block", listener: (event: { block: Block }) => void): this; on(event: "exit block", listener: (event: { block: Block }) => void): this; on(event: "start test", listener: (event: { block: Block, test: Test }) => void): this; @@ -267,6 +277,11 @@ declare namespace adone { */ only(): this; + /** + * Marks this test as todo + */ + todo(): this; + /** * Returns the timeout of the test */ @@ -355,6 +370,11 @@ declare namespace adone { */ only(): this; + /** + * Marks this block as todo + */ + todo(): this; + /** * Returns the timeout of the block */ @@ -1423,7 +1443,7 @@ declare namespace adone { /** * Requires the value to be of the given type */ - typeOf(type: adone.util.I.PossibleTypes): Matcher; + typeOf(type: adone.meta.I.PossibleTypes): Matcher; typeOf(type: string): Matcher; /** diff --git a/types/adone/glosses/std.d.ts b/types/adone/glosses/std.d.ts index ec4bc4c37a..58be35f3b5 100644 --- a/types/adone/glosses/std.d.ts +++ b/types/adone/glosses/std.d.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as path from "path"; import * as util from "util"; diff --git a/types/adone/glosses/streams.d.ts b/types/adone/glosses/streams.d.ts index 012a6aadc3..e4d07065b6 100644 --- a/types/adone/glosses/streams.d.ts +++ b/types/adone/glosses/streams.d.ts @@ -1,223 +1,225 @@ declare namespace adone { namespace stream { - namespace I.CoreStream { - interface ConstructorOptions { - /** - * Whether the initial stream is asynchronous - */ - async?: boolean; + namespace core { + namespace I { + interface ConstructorOptions { + /** + * Whether the initial stream is asynchronous + */ + async?: boolean; - /** - * Whether the initial stream is synchronous - */ - sync?: boolean; + /** + * Whether the initial stream is synchronous + */ + sync?: boolean; - /** - * The initial transform (passthrough is default) - */ - transform?: TransformFunction; + /** + * The initial transform (passthrough is default) + */ + transform?: TransformFunction; - /** - * The initial flush function - */ - flush?: FlushFunction; + /** + * The initial flush function + */ + flush?: FlushFunction; + } + + type Source = S[] | Stream; + + interface TransformContext { + /** + * Pushes the given value into the stream + */ + push(value: T): boolean; + } + + type TransformFunction = (this: TransformContext, value: S) => void; + type FlushFunction = (this: TransformContext) => void; } - type Source = S[] | CoreStream; + /** + * Represents a chain of transform streams + */ + class Stream implements PromiseLike { + constructor(source?: I.Source, options?: I.ConstructorOptions); + + /** + * Writes the given value into the stream + */ + write(value: S): boolean; - interface TransformContext { /** * Pushes the given value into the stream */ push(value: T): boolean; + + /** + * Ends the stream + */ + end(): this; + + /** + * Destroys the stream + */ + destroy(): this; + + /** + * Pauses the stream + */ + pause(): this; + + /** + * Resumes the stream + */ + resume(): this; + + /** + * Whether the stream is paused + */ + isPaused(): boolean; + + /** + * Whether the stream is ended + */ + isEnded(): boolean; + + /** + * Pipes this stream to another + */ + pipe(stream: T, options?: { end?: boolean }): T; + + /** + * Adds a new synchronous transform stream into the chain + */ + throughSync(transform: I.TransformFunction, flush?: I.FlushFunction): Stream; + + /** + * Adds a new asynchronous transform stream into the chain + */ + throughAsync(transform: I.TransformFunction, flush?: I.FlushFunction): Stream; + + /** + * Adds a new transform stream into the chain + */ + through(transform: I.TransformFunction, flush?: I.FlushFunction): Stream; + + /** + * Adds a new map transform into the chain. + * + * Note: synchronous functions create a synchronous transform. + * If your function returns a promise use an asynchronous function if you don't want to pass a promise through the stream + */ + map(callback: (value: T) => R | Promise): Stream; + + /** + * Adds a new conditional map transform into the chain + */ + mapIf(condition: (value: T) => boolean | Promise, callback: (value: T) => R): Stream; + + /** + * Adds a new filter transform into the chain + */ + filter(callback: (value: T) => boolean | Promise): this; + + /** + * Adds a new transform that calls the given callback for each value from the stream. + * + * This method resumes the stream. + */ + forEach(callback: (value: T) => void, options?: { + /** + * Whethe to wait for asynchronous functions (await) + */ + wait?: boolean, + + /** + * Passthrough the read values, by default it eats everything + */ + passthrough?: boolean + }): this; + + /** + * Adds a new transform that calls the given callback when the underlying stream ends. + * + * This method resumes the stream. + */ + done(callback: () => void, options?: { + /** + * Passthrough the read values, by default it eats everything + */ + passthrough?: boolean + }): this; + + /** + * Adds a new transform that gather all the read values into an array and calls the given callback + * when the underlying stream ends. + * + * This method resumes the stream. + */ + toArray(callback: (result: T[]) => void, options?: { + /** + * Passthrough the read values, by default it eats everything + */ + passthrough?: boolean + }): this; + + /** + * Adds a new transform that filters the values by their uniqueness + * + * @param prop callback that calculates value's hash which is used in uniqueness checks + */ + unique(prop?: (value: T) => any): this; + + /** + * Adds a new transform that filters the values using the given given function with ability to restore the filtered values + */ + stash(name: string, filter: (value: T) => boolean): this; + stash(filter: (value: T) => boolean): this; + + /** + * Adds a new transform that restores the previous stashed values + */ + unstash(name?: string): Stream; // ?? + + /** + * Flattens all the read array values + */ + flatten(): Stream; // ?? + + /** + * Merges the given stream into a core stream + */ + static merge(streams: Array | nodestd.stream.Transform | nodestd.stream.Readable | nodestd.stream.Duplex>, options?: { + /** + * Whether to end the stream when all the given streams end + */ + end?: boolean, + + /** + * Options for the initial core stream + */ + sourceOptions?: I.ConstructorOptions + }): Stream; + + /** + * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. + * + * This method resumes the stream. + */ + then(onResolve?: (value: T[]) => T1 | PromiseLike, onReject?: (reason: any) => T2 | PromiseLike): Promise; + + /** + * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. + * + * This method resumes the stream. + */ + catch(onReject?: (reason: any) => T1 | PromiseLike): Promise; } - type TransformFunction = (this: TransformContext, value: S) => void; - type FlushFunction = (this: TransformContext) => void; + /** + * Creates a CoreStream instance + */ + function create(source?: I.Source, options?: I.ConstructorOptions): Stream; } - - /** - * Represents a chain of transform streams - */ - class CoreStream implements PromiseLike { - constructor(source?: I.CoreStream.Source, options?: I.CoreStream.ConstructorOptions); - - /** - * Writes the given value into the stream - */ - write(value: S): boolean; - - /** - * Pushes the given value into the stream - */ - push(value: T): boolean; - - /** - * Ends the stream - */ - end(): this; - - /** - * Destroys the stream - */ - destroy(): this; - - /** - * Pauses the stream - */ - pause(): this; - - /** - * Resumes the stream - */ - resume(): this; - - /** - * Whether the stream is paused - */ - isPaused(): boolean; - - /** - * Whether the stream is ended - */ - isEnded(): boolean; - - /** - * Pipes this stream to another - */ - pipe(stream: T, options?: { end?: boolean }): T; - - /** - * Adds a new synchronous transform stream into the chain - */ - throughSync(transform: I.CoreStream.TransformFunction, flush?: I.CoreStream.FlushFunction): CoreStream; - - /** - * Adds a new asynchronous transform stream into the chain - */ - throughAsync(transform: I.CoreStream.TransformFunction, flush?: I.CoreStream.FlushFunction): CoreStream; - - /** - * Adds a new transform stream into the chain - */ - through(transform: I.CoreStream.TransformFunction, flush?: I.CoreStream.FlushFunction): CoreStream; - - /** - * Adds a new map transform into the chain. - * - * Note: synchronous functions create a synchronous transform. - * If your function returns a promise use an asynchronous function if you don't want to pass a promise through the stream - */ - map(callback: (value: T) => R | Promise): CoreStream; - - /** - * Adds a new conditional map transform into the chain - */ - mapIf(condition: (value: T) => boolean | Promise, callback: (value: T) => R): CoreStream; - - /** - * Adds a new filter transform into the chain - */ - filter(callback: (value: T) => boolean | Promise): this; - - /** - * Adds a new transform that calls the given callback for each value from the stream. - * - * This method resumes the stream. - */ - forEach(callback: (value: T) => void, options?: { - /** - * Whethe to wait for asynchronous functions (await) - */ - wait?: boolean, - - /** - * Passthrough the read values, by default it eats everything - */ - passthrough?: boolean - }): this; - - /** - * Adds a new transform that calls the given callback when the underlying stream ends. - * - * This method resumes the stream. - */ - done(callback: () => void, options?: { - /** - * Passthrough the read values, by default it eats everything - */ - passthrough?: boolean - }): this; - - /** - * Adds a new transform that gather all the read values into an array and calls the given callback - * when the underlying stream ends. - * - * This method resumes the stream. - */ - toArray(callback: (result: T[]) => void, options?: { - /** - * Passthrough the read values, by default it eats everything - */ - passthrough?: boolean - }): this; - - /** - * Adds a new transform that filters the values by their uniqueness - * - * @param prop callback that calculates value's hash which is used in uniqueness checks - */ - unique(prop?: (value: T) => any): this; - - /** - * Adds a new transform that filters the values using the given given function with ability to restore the filtered values - */ - stash(name: string, filter: (value: T) => boolean): this; - stash(filter: (value: T) => boolean): this; - - /** - * Adds a new transform that restores the previous stashed values - */ - unstash(name?: string): CoreStream; // ?? - - /** - * Flattens all the read array values - */ - flatten(): CoreStream; // ?? - - /** - * Merges the given stream into a core stream - */ - static merge(streams: Array | nodestd.stream.Transform | nodestd.stream.Readable | nodestd.stream.Duplex>, options?: { - /** - * Whether to end the stream when all the given streams end - */ - end?: boolean, - - /** - * Options for the initial core stream - */ - sourceOptions?: I.CoreStream.ConstructorOptions - }): CoreStream; - - /** - * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. - * - * This method resumes the stream. - */ - then(onResolve?: (value: T[]) => T1 | PromiseLike, onReject?: (reason: any) => T2 | PromiseLike): Promise; - - /** - * Creates a promise that will be fulfilled with an array of all the emitted values or the first occurred error. - * - * This method resumes the stream. - */ - catch(onReject?: (reason: any) => T1 | PromiseLike): Promise; - } - - /** - * Creates a CoreStream instance - */ - function core(source?: I.CoreStream.Source, options?: I.CoreStream.ConstructorOptions): CoreStream; } } diff --git a/types/adone/glosses/utils.d.ts b/types/adone/glosses/utils.d.ts index 6a05273ffd..480c2354ce 100644 --- a/types/adone/glosses/utils.d.ts +++ b/types/adone/glosses/utils.d.ts @@ -16,10 +16,6 @@ declare namespace adone { function functionName(fn: (...args: any[]) => any): string; - function mapArguments(argmap: (...args: any[]) => any): (...args: any[]) => any; - function mapArguments(argmap: number): (...args: T[]) => T[]; - function mapArguments(...args: any[]): (x: T) => T; - namespace I { interface ParseMsResult { days: number; @@ -33,8 +29,6 @@ declare namespace adone { function pluralizeWord(str: string, plural?: string, count?: number): string; - function functionParams(func: (...args: any[]) => any): string[]; - function randomChoice(arrayLike: ArrayLike, from?: number, to?: number): T; function shuffleArray(array: T[]): T[]; @@ -70,19 +64,8 @@ declare namespace adone { function globParent(str: string): string; - namespace I { - interface ByResult { - (a: S, b: S): R; - compare(a: T, b: T): R; - by(a: S): T; - } - } - function by(by: (a: S) => T, compare?: (a: T, b: T) => R): I.ByResult; - function toFastProperties(object: object): object; - function stripBom(x: string): string; - namespace I { interface SortKeysOptions { deep?: boolean; @@ -118,12 +101,42 @@ declare namespace adone { namespace I { interface CloneOptions { + /** + * Clone recursively + * + * `true` by default + */ deep?: boolean; + + /** + * Clone non-plain object, they will be plain objects + * + * `false` by default + */ + nonPlainObjects?: boolean; + + /** + * Clone only enumerable properties + * + * `true` by default + */ + onlyEnumerable?: boolean; } } - function clone(object: object, options?: I.CloneOptions): object; - function toUTF8Array(str: string): number[]; + class Cloner { + /** + * Clones the given object + */ + clone(obj: any, options?: I.CloneOptions): any; + + /** + * Returns a clone function that is binded to this cloner + */ + binding(): (obj: any, options?: I.CloneOptions) => any; + } + + function clone(object: any, options?: I.CloneOptions): any; function asyncIter(array: T[], iter: (elem: T, index: number, cb: () => void) => any, cb: () => void): void; @@ -150,20 +163,31 @@ declare namespace adone { function assignDeep(target: T, ...sources: object[]): T; namespace I { - interface MatchOptions { + interface MatchPathOptions { index?: boolean; start?: number; end?: number; dot?: boolean; } } - function match(criteria: any, options?: I.MatchOptions): (value: any, options?: I.MatchOptions) => number | boolean; - function match(criteria: any, value: any, options?: I.MatchOptions): number | boolean; + function matchPath(criteria: any, options?: I.MatchPathOptions): (value: any, options?: I.MatchPathOptions) => number | boolean; + function matchPath(criteria: any, value: any, options?: I.MatchPathOptions): number | boolean; namespace I { + class Sorter { + edges: string[]; + + add(item: string, deps: string | string[]): void; + + sort(): string[]; + + clear(): void; + } + interface ToposortFunction { - (edges: Array<[T, T]>): T[]; - array(nodes: T[], edges: Array<[T, T]>): T[]; + (edges: Array<[string, string]>): string[]; + array(nodes: string[], edges: Array<[string, string]>): string[]; + Sorter: typeof Sorter; } } const toposort: I.ToposortFunction; @@ -188,16 +212,6 @@ declare namespace adone { } function jsesc(argument: any, options?: I.JSEscOptions): string; - namespace I { - type PossibleTypes = "object" | "class" | "null" | "global" | "Array" | "RegExp" | "Date" - | "Promise" | "Set" | "Map" | "WeakSet" | "DataView" | "Map Iterator" | "Set Iterator" - | "Array Iterator" | "String Iterator" | "Object" | "function" | "boolean" | "number" - | "undefined" | "string" | "symbol"; - } - - function typeOf(obj: any): I.PossibleTypes; - function typeOf(obj: any): string; - namespace memcpy { function utou(target: Buffer, targetOffset: number, source: Buffer, sourceStart: number, sourceEnd: number): number; function atoa(target: ArrayBuffer, targetOffset: number, source: ArrayBuffer, sourceStart: number, sourceEnd: number): number; @@ -217,12 +231,12 @@ declare namespace adone { function v1(options?: I.V1Options): string; function v1(options: I.V1Options, buf: any[], offset?: number): number[]; - function v4(options?: any): string; - function v4(options: any, buf: any[], offset?: number): number[]; - function v3(name: string | number[], namespace: string | number[]): string; function v3(name: string | number[], namespace: string | number[], buf: any[], offset?: number): number[]; + function v4(options?: any): string; + function v4(options: any, buf: any[], offset?: number): number[]; + function v5(name: string | number[], namespace: string | number[]): string; function v5(name: string | number[], namespace: string | number[], buf: any[], offset?: number): number[]; } @@ -237,40 +251,6 @@ declare namespace adone { } function delegate(object: object, property: string): I.Delegator; - namespace I { - interface GlobExpOptions { - nocomment?: boolean; - nonegate?: boolean; - nobrace?: boolean; - noglobstar?: boolean; - nocase?: boolean; - dot?: boolean; - noext?: boolean; - matchBase?: boolean; - flipNegate?: boolean; - } - } - - class GlobExp { - constructor(pattern: string, options?: I.GlobExpOptions); - - hasMagic(): boolean; - - static hasMagic(pattern: string, options?: I.GlobExpOptions): boolean; - - expandBraces(): string[]; - - static expandBraces(pattern: string, options?: I.GlobExpOptions): string[]; - - makeRe(): RegExp; - - static makeRe(pattern: string, options?: I.GlobExpOptions): RegExp; - - static test(p: string, pattern: string, options?: I.GlobExpOptions): boolean; - - test(p: string): boolean; - } - namespace iconv { // TODO: need to normalize source code } @@ -278,9 +258,6 @@ declare namespace adone { namespace sqlstring { function escapeId(val: string | string[], forbidQualified?: boolean): string; function dateToString(date: any, timeZone?: string): string; - function arrayToList(array: any[]): string; - function bufferToString(buffer: Buffer): string; - function objectToValues(object: object, timeZone?: string): string; function escape(value: any, stringifyObjects?: boolean, timeZone?: string): string; function format(sql: string, values?: any, stringifyObjects?: boolean, timeZone?: string): string; } @@ -316,49 +293,71 @@ declare namespace adone { } const binarySearch: I.BinarySearchFunction; + /** + * buffer tools + */ namespace buffer { - function concat(list: Buffer[], totalLength: number): Buffer; - function mask(buffer: Buffer, mask: Buffer, output: Buffer, offset: number, length: number): void; - function unmask(buffer: Buffer, mask: Buffer): void; + /** + * Converts the given Buffer to ArrayBuffer + */ + function toArrayBuffer(buf: Buffer): ArrayBuffer; + + /** + * Returns a new buffer that represents a^b + * + * If the lengths are not equal, it assumes missing bytes as 0x00 + * + * @param length length of the result buffer. max(a.length, b.length) by default + */ + function xor(a: Buffer, b: Buffer, length?: number): Buffer; } function shebang(str: string): string | null; - class ReInterval { - constructor(callback: (...args: any[]) => void, interval: number, args?: any[]); - - reschedule(interval: number): void; - - clear(): void; - - destroy(): void; - } - - class RateLimiter { - constructor(tokensPerInterval?: number, interval?: number, fireImmediately?: boolean); - - removeTokens(count: number): Promise; - - tryRemoveTokens(count: number): boolean; - - getTokensRemaining(): number; - } - namespace I { - interface ThrottleOptions { - max?: number; - interval?: number; - ordered?: boolean; - waitForReturn?: boolean; + interface ReInterval { + reschedule(interval: number): void; + + clear(): void; + + destroy(): void; } } - function throttle(fn: () => R, options?: I.ThrottleOptions): () => Promise; - function throttle(fn: (a: T1) => R, options?: I.ThrottleOptions): (a: T1) => Promise; - function throttle(fn: (a: T1, b: T2) => R, options?: I.ThrottleOptions): (a: T1, b: T2) => Promise; - function throttle(fn: (a: T1, b: T2, c: T3) => R, options?: I.ThrottleOptions): (a: T1, b: T2, c: T3) => Promise; - function throttle(fn: (a: T1, b: T2, c: T3, d: T4) => R, options?: I.ThrottleOptions): (a: T1, b: T2, c: T3, d: T4) => Promise; - function throttle(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => R, options?: I.ThrottleOptions): (a: T1, b: T2, c: T3, d: T4, e: T5) => Promise; - function throttle(fn: (...args: any[]) => R, options?: I.ThrottleOptions): (...args: any[]) => Promise; + + function reinterval(callback: (...args: any[]) => void, interval: number, args?: any[]): I.ReInterval; + + namespace throttle { + namespace I { + interface Options { + max?: number; + interval?: number; + ordered?: boolean; + waitForReturn?: boolean; + onDone?: () => void; + drop?: boolean; + dropLast?: boolean; + } + } + function create(fn: () => R, options?: I.Options): () => Promise; + function create(fn: (a: T1) => R, options?: I.Options): (a: T1) => Promise; + function create(fn: (a: T1, b: T2) => R, options?: I.Options): (a: T1, b: T2) => Promise; + function create(fn: (a: T1, b: T2, c: T3) => R, options?: I.Options): (a: T1, b: T2, c: T3) => Promise; + function create(fn: (a: T1, b: T2, c: T3, d: T4) => R, options?: I.Options): (a: T1, b: T2, c: T3, d: T4) => Promise; + function create(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => R, options?: I.Options): (a: T1, b: T2, c: T3, d: T4, e: T5) => Promise; + function create(fn: (...args: any[]) => R, options?: I.Options): (...args: any[]) => Promise; + + class RateLimiter { + constructor(tokensPerInterval?: number, interval?: number, fireImmediately?: boolean); + + removeTokens(count: number): Promise; + + tryRemoveTokens(count: number): boolean; + + getTokensRemaining(): number; + } + + const DROPPED: symbol; + } namespace I.fakeClock { interface Timer { @@ -475,36 +474,6 @@ declare namespace adone { function lowerBoundKey(range: I.Range): T | undefined; } - /** - * Utils for uid/gid - */ - namespace userid { - /** - * Returns uid by the given username - */ - function uid(username: string): { uid: number, gid: number }; - - /** - * Returns gid by the given groupname - */ - function gid(groupname: string): number; - - /** - * Returns username by the given uid - */ - function username(uid: number): string; - - /** - * Returns groupname by the given gid - */ - function groupname(gid: number): string; - - /** - * Returns gids the given user belongs - */ - function gids(username: string): number[]; - } - /** * Represents a log file rotator */ @@ -572,5 +541,598 @@ declare namespace adone { function debounce(fn: (a: T1, b: T2, c: T3, d: T4) => R, timeout: number, options?: I.DebounceOptions): (a: T1, b: T2, c: T3, d: T4) => R; function debounce(fn: (a: T1, b: T2, c: T3, d: T4, e: T5) => R, timeout: number, options?: I.DebounceOptions): (a: T1, b: T2, c: T3, d: T4, e: T5) => R; function debounce(fn: (...args: any[]) => R, timeout: number, options?: I.DebounceOptions): (...args: any[]) => R; + + /** + * Finds difference between the given arrays + */ + function arrayDiff(...arrays: T[][]): T[]; + + namespace I { + type FillRangeTransform = () => void; + + interface FillRangeOptions { + /** + * The increment to use for the range. Can be used with letters or numbers + */ + step?: number; + + /** + * By default, null is returned when an invalid range is passed. + * Enable this option to throw a RangeError on invalid ranges + * + * false by default + */ + strictRanges?: boolean; + + /** + * Cast all returned values to strings. + * + * By default, integers are returned as numbers. + */ + stringify?: boolean; + + /** + * Create a regex-compatible source string, instead of expanding values to an array. + * + * false by default + */ + toRegex?: boolean; + + /** + * Customize each value in the returned array (or string) + */ + transform?: FillRangeTransform; + } + } + + /** + * Expands numbers and letters + */ + function fillRange(from: number, to: number, options: I.FillRangeOptions & { toRegex: true }): string; + function fillRange(from: number, to: number, options: I.FillRangeOptions & { stringify: true }): string[]; + function fillRange(from: number, to: number, options?: I.FillRangeOptions): number[]; + + function fillRange(from: string, to: string, options: I.FillRangeOptions & { toRegex: true }): string; + function fillRange(from: string, to: string, options?: I.FillRangeOptions): string[]; + + function fillRange(from: string | number, to: string | number, options: I.FillRangeOptions & { toRegex: true }): string; + function fillRange(from: string | number, to: string | number, options?: I.FillRangeOptions): Array; + + namespace inflection { + function singularizeWord(str: string, singular?: string): string; + function pluralizeWord(str: string, plural?: string): string; + function underscore(str: string, allUpperCase?: boolean): string; + } + + function machineId(original?: boolean): Promise; + + namespace I { + interface MergeOptions { + plainObjects?: boolean; + allowPrototypes?: boolean; + } + } + + function merge(target: any, source: any, options?: I.MergeOptions): any; + + function omit(obj: any, props: ((v: string) => boolean) | string[] | string): object; + + function parseTime(val: number): number; + function parseTime(val: any): number | null; + + function pick(obj: any, props: Iterable): object; + + // pool: TODO + + namespace querystring { + function escape(str: string): string; + + const formats: { + RFC1738: "RFC1738" + RFC3986: "RFC3986", + default: string, + formatters: { + RFC1738(val: string): string, + RFC3986(val: string): string + } + }; + + namespace I { + interface ParseOptions { + ignoreQueryPrefix?: boolean; + delimiter?: string; + depth?: number; + arrayLimit?: number; + parseArrays?: boolean; + decoder?: (str: string, defaultDecoder: (str: string) => string) => string; + allowDots?: boolean; + plainObjects?: boolean; + allowPrototypes?: boolean; + parameterLimit?: number; + strictNullHandling?: boolean; + } + + interface StringifyOptions { + delimiter?: string; + strictNullHandling?: boolean; + skipNulls?: boolean; + encode?: boolean; + encoder?: (str: string) => any; + filter?: Array | ((prefix: string, value: any) => any); + arrayFormat?: "indices" | "brackets" | "repeat"; + indices?: boolean; + sort?: (a: any, b: any) => number; + serializeDate?: (d: Date) => string; + format?: "RFC1738" | "RFC3986"; + encodeValuesOnly?: boolean; + addQueryPrefix?: boolean; + allowDots?: boolean; + } + } + + function parse(str: string, options?: I.ParseOptions): any; + + function stringify(obj: any, options?: I.StringifyOptions): string; + + function unescape(str: string): string; + } + + namespace I { + interface RegexNotOptions { + contains?: boolean; + } + } + + function regexNot(pattern: string, options?: I.RegexNotOptions): RegExp; + + function repeat(item: T, n: number): T[]; + + // retry: TODO + + function signalNameToCode(signame: string): number; + + function splitBuffer(buf: string | Buffer, splitBuf: string | Buffer, includeDelim?: boolean): Buffer[]; + + namespace I { + type SplitStringSplitFunction = (token: { + val: string; + idx: number; + arr: string[]; + str: string; + }) => void; + + interface SplitStringOptions { + braces?: object | boolean; + keepEscaping?: boolean; + keepQuotes?: boolean; + keepDoubleQuotes?: boolean; + keepSingleQuotes?: boolean; + separator?: string; + split?: SplitStringSplitFunction; + } + } + + function splitString(str: string): string[]; + function splitString(str: string, options: I.SplitStringOptions): string[]; + function splitString(str: string, splitter: I.SplitStringSplitFunction): string[]; + function splitString(str: string, options: I.SplitStringOptions, splitter: I.SplitStringSplitFunction): string[]; + + // terraformer: TODO + + namespace I { + interface ToRegexOptions { + contains?: boolean; + negate?: boolean; + nocase?: boolean; + flags?: string; + cache?: boolean; + } + } + + function toRegex(patterns: string | string[], options?: I.ToRegexOptions): RegExp; + + namespace I { + interface ToRegexRangeOptions { + capture?: boolean; + shorthand?: boolean; + relaxZeros?: boolean; + } + } + + function toRegexRange(min: string | number, max: string | number, options?: I.ToRegexRangeOptions): RegExp; + + namespace xorDistance { + function compare(a: Buffer, b: Buffer): boolean; + + function create(a: Buffer, b: Buffer): Buffer; + + function gt(a: Buffer, b: Buffer): boolean; + + function lt(a: Buffer, b: Buffer): boolean; + + function eq(a: Buffer, b: Buffer): boolean; + } + + namespace I { + interface BracesOptions { + /** + * Generate an "expanded" brace pattern (this option is unncessary with the `.expand` method, which does the same thing). + * + * @default undefined + */ + expand?: boolean; + + /** + * Enabled by default. + * + * @default true + */ + optimize?: boolean; + + /** + * Duplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options + * + * @default true + */ + nodupes?: boolean; + + /** + * When `braces.expand()` is used, or `options.expand` is true, brace patterns will automatically be [optimized](#optionsoptimize) + * when the difference between the range minimum and range maximum exceeds the `rangeLimit`. + * This is to prevent huge ranges from freezing your application. + * + * You can set this to any number, or change `options.rangeLimit` to `Inifinity` to disable this altogether. + * + * @default 250 + */ + rangeLimit?: number; + + /** + * Customize range expansion. + * + * @default undefined + */ + transform?: (str: string) => string; + + /** + * In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. + * + * Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) + * + * The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) + * are defined in the given pattern, and not to try to expand them as lists. + * + * @default undefined + */ + quantifiers?: boolean; + + /** + * Strip backslashes that were used for escaping from the result. + * + * @default undefined + */ + unescape?: boolean; + } + interface BracesFunction { + (pattern: string, options?: BracesOptions): string[]; + expand(pattern: string, options?: BracesOptions): string[]; + MAX_LENGTH: number; + clearCache(): void; + resizeCache(newSize: number): void; + getCache(): object; // TODO + makeRe(pattern: string, options?: BracesOptions): RegExp; + } + } + + const braces: I.BracesFunction; + + namespace I { + interface MatchOptions { + /** + * Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `matchBase`. + * + * @default false + */ + basename?: boolean; + + /** + * Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. + * Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. + * Instead, the star is treated the same as an other star. + * + * @default true + */ + bash?: boolean; + + /** + * Disable regex and function memoization. + * + * @default undefined + */ + cache?: boolean; + + /** + * Match dotfiles. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `dot`. + * + * @default false + */ + dot?: boolean; + + /** + * Similar to the `--failglob` behavior in Bash, throws an error when no matches are found. + * + * @default undefined + */ + failglob?: boolean; + + /** + * String or array of glob patterns to match files to ignore. + * + * @default undefined + */ + ignore?: string | string[]; + + /** + * Alias for [options.basename](#options-basename). + */ + matchBase?: boolean; + + /** + * Disable expansion of brace patterns. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nobrace`. + * + * @default undefined + */ + nobrace?: boolean; + + /** + * Use a case-insensitive regex for matching files. Same behavior as [minimatch](https://github.com/isaacs/minimatch). + * + * @default undefined + */ + nocase?: boolean; + + /** + * Remove duplicate elements from the result array. + * + * @default undefined + */ + nodupes?: boolean; + + /** + * Disable extglob support, so that extglobs are regarded as literal characters. + * + * @default undefined + */ + noext?: boolean; + + /** + * Disallow negation (`!`) patterns, and treat leading `!` as a literal character to match. + * + * @default undefined + */ + nonegate?: boolean; + + /** + * Disable matching with globstars (`**`). + * + * @default undefined + */ + noglobstar?: boolean; + + /** + * Alias for [options.nullglob](#options-nullglob). + */ + nonull?: boolean; + + /** + * If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. + * Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nonull`. + * + * @default undefined + */ + nullglob?: boolean; + + /** + * Pass your own instance of [snapdragon](https://github.com/jonschlinkert/snapdragon), to customize parsers or compilers. + * + * @default undefined + */ + snapdragon?: object; + + /** + * Generate a source map by enabling the `sourcemap` option with the `.parse`, `.compile`, or `.create` methods. + * + * _(Note that sourcemaps are currently not enabled for brace patterns)_ + */ + sourcemap?: boolean; + + /** + * Remove backslashes from returned matches. + * + * @default undefined + */ + unescape?: boolean; + + /** + * Convert path separators on returned files to posix/unix-style forward slashes. + * + * @default true + */ + unixify?: boolean; + } + + interface MatchFunction { + /** + * The main function takes a list of strings and one or more glob patterns to use for matching. + * + * @param list A list of strings to match + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an array of matches + */ + (list: string[], patterns: string | string[], options?: MatchOptions): string[]; + + /** + * Similar to the main function, but `pattern` must be a string. + * + * @param list Array of strings to match + * @param pattern Glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an array of matches + */ + match(list: string[], pattern: string, options?: MatchOptions): string[]; + + /** + * Returns true if the specified `string` matches the given glob `pattern`. + * + * @param string String to match + * @param pattern Glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if the string matches the glob pattern. + */ + isMatch(string: string, pattern: string, options?: MatchOptions): boolean; + + /** + * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. + * + * @param list The string or array of strings to test. Returns as soon as the first match is found. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + some(list: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns true if every string in the given `list` matches any of the given glob `patterns`. + * + * @param list The string or array of strings to test. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + every(list: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * @param str The string to test. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + any(str: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns true if **all** of the given `patterns` match the specified string. + * + * @param str The string to test. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if any patterns match `str` + */ + all(str: string | string[], patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Returns a list of strings that _**do not match any**_ of the given `patterns`. + * + * @param list Array of strings to match. + * @param patterns One or more glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an array of strings that **do not match** the given patterns. + */ + not(list: string[], patterns: string | string[], options?: MatchOptions): string[]; + + /** + * Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string. + * + * @param str The string to match. + * @param patterns Glob pattern to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns true if the patter matches any part of `str`. + */ + contains(str: string, patterns: string | string[], options?: MatchOptions): boolean; + + /** + * Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. + * If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead. + * + * @param object The object with keys to filter. + * @param patterns One or more glob patterns to use for matching. + * @param options See available options for changing how matches are performed + * @returns Returns an object with only keys that match the given patterns. + */ + matchKeys(object: T, patterns: string | string[], options?: MatchOptions): Partial; + + /** + * Returns a memoized matcher function from the given glob `pattern` and `options`. + * The returned function takes a string to match as its only argument and returns true if the string is a match. + * + * @param pattern Glob pattern + * @param options See available options for changing how matches are performed. + * @returns Returns a matcher function. + */ + matcher(pattern: string | string[], options?: MatchOptions): (str: string) => boolean; + + /** + * Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match. + * + * @param pattern Glob pattern to use for matching. + * @param string String to match + * @param options See available options for changing how matches are performed + * @returns Returns an array of captures if the string matches the glob pattern, otherwise `null`. + */ + capture(pattern: string, string: string, options?: MatchOptions): string[] | null; + + /** + * Create a regular expression from the given glob `pattern`. + * + * @param pattern A glob pattern to convert to regex. + * @param options See available options for changing how matches are performed. + * @returns Returns a regex created from the given pattern. + */ + makeRe(pattern: string, options?: MatchOptions): RegExp; + + /** + * Expand the given brace `pattern`. + * + * @param pattern String with brace pattern to expand. + * @param options Any options to change how expansion is performed. See the [braces](https://github.com/micromatch/braces) library for all available options. + */ + braces(pattern: string, options?: MatchOptions): string[]; + + /** + * Parses the given glob `pattern` and returns an array of abstract syntax trees (ASTs), with the compiled `output` and optional source `map` on each AST. + * + * @param pattern Glob pattern to parse and compile. + * @param options Any options to change how parsing and compiling is performed. + * @returns Returns an object with the parsed AST, compiled string and optional source map. + */ + create(pattern: string, options?: MatchOptions): object; + + /** + * Parse the given `str` with the given `options`. + * + * @returns Returns an AST + */ + parse(str: string, options?: MatchOptions): object; + + /** + * Compile the given `ast` or string with the given `options`. + * + * @returns Returns an object that has an `output` property with the compiled string. + */ + compile(ast: object | string, options?: MatchOptions): object; + + MAX_LENGTH: number; + + clearCache(): void; + + resizeCache(newSize: number): void; + + getCache(): object; // TODO + } + } + + const match: I.MatchFunction; } } diff --git a/types/adone/index.d.ts b/types/adone/index.d.ts index 74883c2185..5d22ac1bfd 100644 --- a/types/adone/index.d.ts +++ b/types/adone/index.d.ts @@ -8,16 +8,18 @@ /// /// /// -/// +/// /// /// /// /// /// +/// /// /// /// /// +/// /// /// /// diff --git a/types/adone/test/glosses/application.ts b/types/adone/test/glosses/application.ts new file mode 100644 index 0000000000..38c5b0c8ff --- /dev/null +++ b/types/adone/test/glosses/application.ts @@ -0,0 +1,1663 @@ +namespace applicationTests { + const { + CliApplication, + DApplication, + DSubsystem, + DCliCommand, + DMainCliCommand, + Subsystem, + runCli, + Application + } = adone.application; + + namespace DApplicationTests { + { + @DApplication() + class App extends CliApplication {} + } + { + @DApplication({}) + class App extends CliApplication {} + } + { + @DApplication({ + name: "hello" + }) + class App extends CliApplication {} + } + { + @DApplication({ + description: "hello" + }) + class App extends CliApplication {} + } + { + @DApplication({ + subsystems: [ + { + name: "hello", + subsystem: "a.js" + } + ] + }) + class App extends CliApplication {} + } + { + @DApplication({ + subsystems: [ + { + name: "hello", + subsystem: "a.js", + transpile: true + } + ] + }) + class App extends CliApplication {} + } + { + @DApplication({ + commandsGroups: [{ + name: "a", + description: "b" + }] + }) + class App extends CliApplication {} + } + } + + namespace DSubsystemTests { + { + @DSubsystem() + class App extends Subsystem {} + } + { + @DSubsystem({}) + class App extends Subsystem {} + } + { + @DSubsystem({ + name: "hello" + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + description: "hello" + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + subsystems: [ + { + name: "hello", + subsystem: "a.js" + } + ] + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + subsystems: [ + { + name: "hello", + subsystem: "a.js", + transpile: true + } + ] + }) + class App extends Subsystem {} + } + { + @DSubsystem({ + commandsGroups: [{ + name: "a", + description: "b" + }] + }) + class App extends Subsystem {} + } + } + + namespace DMainCliCommandTests { + { + class App extends CliApplication { + @DMainCliCommand() + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({}) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({}) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + blindMode: true + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + description: "a" + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + match: (arg) => arg.startsWith("hello") + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + optionsGroups: [{ + description: "a", + name: "a" + }] + }) + main() {} + } + } + + namespace argumentsTests { + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: ["hello"] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: ["hello"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "append" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "count" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "set" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store_const" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store_false" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store_true" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + action: "store" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + appendChoicesHelpMessage: true + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + appendDefaultMessage: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + default: null + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + description: "hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + enabled: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + help: "asd" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + holder: "a" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + holder: ["a"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: 1 + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: "*" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: "+" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + nargs: "?" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + required: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: String + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + type: [/^abc$/] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + arguments: [{ + name: "hello", + verify: (args, opts) => { + return true; + } + }] + }) + main() {} + } + } + } + + namespace optionsTests { + { + class App extends CliApplication { + @DMainCliCommand({ + options: ["--hello"] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: ["hello"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "append" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "count" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "set" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store_const" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store_false" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store_true" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + action: "store" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + appendChoicesHelpMessage: true + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + appendDefaultMessage: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + default: null + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + description: "hello" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + enabled: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + help: "asd" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + holder: "a" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + holder: ["a"] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: 1 + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: "*" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: "+" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + nargs: "?" + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + required: false + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: String + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + type: [/^abc$/] + }] + }) + main() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + verify: (args, opts) => { + return true; + } + }] + }) + main() {} + } + } + } + } + + namespace DCliCommandTests { + { + class App extends CliApplication { + @DCliCommand() + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({}) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({}) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + blindMode: true + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + description: "a" + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + match: (arg) => arg.startsWith("hello") + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + optionsGroups: [{ + description: "a", + name: "a" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + name: "cmdd" + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + group: "asdasd" + }) + cmd() {} + } + } + + namespace argumentsTests { + { + class App extends CliApplication { + @DCliCommand({ + arguments: ["hello"] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: ["hello"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "append" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "count" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "set" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store_const" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store_false" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store_true" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + action: "store" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + appendChoicesHelpMessage: true + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + appendDefaultMessage: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + default: null + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + description: "hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + enabled: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + help: "asd" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + holder: "a" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + holder: ["a"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: 1 + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: "*" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: "+" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + nargs: "?" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + required: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: String + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + type: [/^abc$/] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + arguments: [{ + name: "hello", + verify: (args, opts) => { + return true; + } + }] + }) + cmd() {} + } + } + } + + namespace optionsTests { + { + class App extends CliApplication { + @DCliCommand({ + options: ["--hello"] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: ["hello"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "append" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "count" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "set" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store_const" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store_false" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store_true" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + action: "store" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + appendChoicesHelpMessage: true + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + appendDefaultMessage: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + default: null + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + description: "hello" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + enabled: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + help: "asd" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + holder: "a" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + holder: ["a"] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: 1 + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: "*" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: "+" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + nargs: "?" + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + required: false + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: String + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: (x: string, i: number) => { + return true; + } + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: [(x: string, i: number) => { + return true; + }] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DCliCommand({ + options: [{ + name: "--hello", + type: [/^abc$/] + }] + }) + cmd() {} + } + } + { + class App extends CliApplication { + @DMainCliCommand({ + options: [{ + name: "--hello", + verify: (args, opts) => { + return true; + } + }] + }) + cmd() {} + } + } + } + } + + namespace subsystemTests { + new Subsystem().name; + new Subsystem().root; + new Subsystem().setRoot(new Subsystem()); + new Subsystem().parent; + new Subsystem().state + 2; + new Subsystem().isOwned === true; + new Subsystem().setState(1); + new Subsystem().waitForState(2).then(() => {}); + new Subsystem().waitForState(2, 100).then(() => {}); + new Subsystem().configure(); + new Subsystem().initialize(); + new Subsystem().uninitialize(); + new Subsystem().configureSubsystems().then(() => {}); + new Subsystem().uninitializeSubsystems().then(() => {}); + new Subsystem().reinitializeSubsystems().then(() => {}); + new Subsystem().configureSubsystem("a").then(() => {}); + new Subsystem().loadSubsystem("a").then(() => {}); + new Subsystem().loadSubsystem(new Subsystem()).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), {}).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { description: "a" }).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { group: "a" }).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { name: "a" }).then(() => {}); + new Subsystem().loadSubsystem(new Subsystem(), { transpile: false }).then(() => {}); + new Subsystem().unloadSubsystem("a").then(() => {}); + new Subsystem().initializeSubsystem("a").then(() => {}); + new Subsystem().uninitializeSubsystem("a").then(() => {}); + new Subsystem().getSubsystem("a").waitForState(2).then(() => {}); + new Subsystem().hasSubsystem("a") === true; + new Subsystem().hasSubsystem("a") === true; + new Subsystem().hasSubsystems() === true; + new Subsystem().addSubsystem({ subsystem: "ppp" }); + new Subsystem().addSubsystem({ subsystem: "ppp", bind: true }); + new Subsystem().addSubsystem({ subsystem: "ppp", bind: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", configureArgs: [1] }); + new Subsystem().addSubsystem({ subsystem: "ppp", description: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", group: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", name: "a" }); + new Subsystem().addSubsystem({ subsystem: "ppp", transpile: false }); + new Subsystem().addSubsystem({ subsystem: "ppp", useFilename: true }); + { + const sysInfo = new Subsystem().addSubsystem({ subsystem: "ppp" }); + sysInfo.configureArgs[0]; + sysInfo.description.charCodeAt(10); + sysInfo.group.charCodeAt(10); + sysInfo.instance.waitForState(2, 30).then(() => {}); + sysInfo.name.charCodeAt(100); + sysInfo.path.charCodeAt(100); + } + { + const sysInfo = new Subsystem().addSubsystem({ subsystem: new Subsystem() }); + sysInfo.configureArgs[0]; + sysInfo.description.charCodeAt(10); + sysInfo.group.charCodeAt(10); + sysInfo.instance.waitForState(2, 30).then(() => {}); + sysInfo.name.charCodeAt(100); + sysInfo.path === null; + } + new Subsystem().addSubsystemsFrom("asd", {}); + new Subsystem().addSubsystemsFrom("asd", { filter: ["a"] }); + new Subsystem().addSubsystemsFrom("asd", { filter: (file) => file.charCodeAt(100) === 100 }); + new Subsystem().addSubsystemsFrom("asd", { filter: async (file) => file.charCodeAt(100) === 100 }); + new Subsystem().addSubsystemsFrom("asd", { bind: "a" }); + new Subsystem().addSubsystemsFrom("asd", { bind: true }); + new Subsystem().addSubsystemsFrom("asd", { configureArgs: [1] }); + new Subsystem().addSubsystemsFrom("asd", { description: "a" }); + new Subsystem().addSubsystemsFrom("asd", { group: "a" }); + new Subsystem().addSubsystemsFrom("asd", { name: "a" }); + new Subsystem().addSubsystemsFrom("asd", { transpile: true }); + new Subsystem().addSubsystemsFrom("asd", { useFilename: true }); + + new Subsystem().instantiateSubsystem("asd").waitForState(2, 200).then(() => {}); + new Subsystem().instantiateSubsystem(new Subsystem()).waitForState(2, 200).then(() => {}); + new Subsystem().instantiateSubsystem(new Subsystem(), { transpile: false }).waitForState(2, 200).then(() => {}); + new Subsystem().deleteSubsystem("name"); + new Subsystem().deleteSubsystem("name", true); + new Subsystem().getSubsystemInfo("name").configureArgs[0]; + new Subsystem().getSubsystems()[0].configureArgs[0]; + } + + namespace applicationTests { + new Application().isMain === true; + new Application().main(); + new Application().enableReport(); + new Application().enableReport({}); + new Application().enableReport({ directory: "a" }); + new Application().enableReport({ events: "a" }); + new Application().enableReport({ filename: "a" }); + new Application().enableReport({ signal: "a" }); + new Application().run().then(() => {}); + new Application().exit().then(() => {}); + new Application().exit(1).then(() => {}); + new Application().exitOnSignal("SIGINT", "SIGUSR1"); + new Application().removeProcesshandlers(); + new Application()._uncaughtException; + new Application()._unhandledRejection; + new Application()._rejectionHandled; + new Application()._signalExit("asd"); + } + + namespace cliApplicationTests { + new CliApplication().run({ ignoreArgs: true }).then(() => {}); + new CliApplication().getVersion().then(() => {}); + new CliApplication().exposeCliInterface(); + new CliApplication().mainCommand; + new CliApplication().defineMainCommand({ + arguments: [{ + name: "a", + default: 100500, + nargs: 100, + required: false + }], + options: [{ + name: "--a", + default: 1000, + nargs: 101231 + }], + optionsGroups: [{ + name: "a", + description: "a" + }] + }); + new CliApplication().defineCommand({ + name: "a", + arguments: [{ + name: "a", + default: 100500, + nargs: 100, + required: false + }], + options: [{ + name: "--a", + default: 1000, + nargs: 101231 + }], + optionsGroups: [{ + name: "a", + description: "a" + }] + }); + new CliApplication().defineCommandFromSubsystem({ + configureArgs: [1], + description: "a", + lazily: true, + subsystem: "a", + group: "a", + name: "a", + transpile: false + }); + new CliApplication().defineOption({ + name: "--a", + action: "store" + }); + new CliApplication().defineOptionsGroup({ + name: "a", + description: "b" + }); + new CliApplication().defineCommandsGroup({ + name: "a", + description: "b" + }); + new CliApplication().option("a"); + new CliApplication().option("a", { value: true }); + } +} diff --git a/types/adone/test/glosses/assertion.ts b/types/adone/test/glosses/assertion.ts index 4d07c78182..3e457dc876 100644 --- a/types/adone/test/glosses/assertion.ts +++ b/types/adone/test/glosses/assertion.ts @@ -3,9 +3,9 @@ namespace assertionTests { namespace assertionInterface { namespace exception { - const a: adone.x.Exception = new assertion.AssertionError(); - const b: adone.x.Exception = new assertion.AssertionError("hello"); - const c: adone.x.Exception = new assertion.AssertionError("hello", { actual: 2, expected: 3 }, () => {}); + const a: adone.exception.Exception = new assertion.AssertionError(); + const b: adone.exception.Exception = new assertion.AssertionError("hello"); + const c: adone.exception.Exception = new assertion.AssertionError("hello", { actual: 2, expected: 3 }, () => {}); } namespace config { @@ -38,11 +38,11 @@ namespace assertionTests { assert.fail(1, 2, "hello"); assert.fail(1, 2, "hello", "<"); - assert.isOk(1); - assert.isOk(1, "hello"); + assert.ok(1); + assert.ok(1, "hello"); - assert.isNotOk(1); - assert.isNotOk(1, "hello"); + assert.notOk(1); + assert.notOk(1, "hello"); assert.equal(1, 2); assert.equal(1, 2, "hello"); @@ -68,38 +68,38 @@ namespace assertionTests { assert.notDeepEqual(1, 2); assert.notDeepEqual(1, 2, "hello"); - assert.isAbove(1, 2); - assert.isAbove(1, 2, "hello"); + assert.above(1, 2); + assert.above(1, 2, "hello"); - assert.isAtLeast(1, 2); - assert.isAtLeast(1, 2, "hello"); + assert.atLeast(1, 2); + assert.atLeast(1, 2, "hello"); - assert.isBelow(1, 2); - assert.isBelow(1, 2, "hello"); + assert.below(1, 2); + assert.below(1, 2, "hello"); - assert.isAtMost(1, 2); - assert.isAtMost(1, 2, "hello"); + assert.atMost(1, 2); + assert.atMost(1, 2, "hello"); - assert.isTrue(1); - assert.isTrue(1, "hello"); + assert.true(1); + assert.true(1, "hello"); - assert.isNotTrue(1); - assert.isNotTrue(1, "hello"); + assert.notTrue(1); + assert.notTrue(1, "hello"); - assert.isFalse(1); - assert.isFalse(1, "hello"); + assert.false(1); + assert.false(1, "hello"); - assert.isNotFalse(1); - assert.isNotFalse(1, "hello"); + assert.notFalse(1); + assert.notFalse(1, "hello"); - assert.isNull(1); - assert.isNull(1, "hello"); + assert.null(1); + assert.null(1, "hello"); - assert.isNaN(1); - assert.isNaN(1, "hello"); + assert.NaN(1); + assert.NaN(1, "hello"); - assert.isNotNaN(1); - assert.isNotNaN(1, "hello"); + assert.NotNaN(1); + assert.NotNaN(1, "hello"); assert.exists(1); assert.exists(1, "hello"); @@ -107,49 +107,49 @@ namespace assertionTests { assert.notExists(1); assert.notExists(1, "hello"); - assert.isUndefined(1); - assert.isUndefined(1, "hello"); + assert.undefined(1); + assert.undefined(1, "hello"); - assert.isDefined(1); - assert.isDefined(1, "hello"); + assert.defined(1); + assert.defined(1, "hello"); - assert.isFunction(1); - assert.isFunction(1, "hello"); + assert.function(1); + assert.function(1, "hello"); - assert.isNotFunction(1); - assert.isNotFunction(1, "hello"); + assert.notFunction(1); + assert.notFunction(1, "hello"); - assert.isObject(1); - assert.isObject(1, "hello"); + assert.object(1); + assert.object(1, "hello"); - assert.isNotObject(1); - assert.isNotObject(1, "hello"); + assert.notObject(1); + assert.notObject(1, "hello"); - assert.isArray(1); - assert.isArray(1, "hello"); + assert.array(1); + assert.array(1, "hello"); - assert.isNotArray(1); - assert.isNotArray(1, "hello"); + assert.notArray(1); + assert.notArray(1, "hello"); - assert.isString(1, "hello"); + assert.string(1, "hello"); - assert.isNotString(1); - assert.isNotString(1, "hello"); + assert.notString(1); + assert.notString(1, "hello"); - assert.isNumber(1); - assert.isNumber(1, "hello"); + assert.number(1); + assert.number(1, "hello"); - assert.isNotNumber(1); - assert.isNotNumber(1, "hello"); + assert.notNumber(1); + assert.notNumber(1, "hello"); - assert.isFinite(1); - assert.isFinite(1, "hello"); + assert.finite(1); + assert.finite(1, "hello"); - assert.isBoolean(1); - assert.isBoolean(1, "hello"); + assert.boolean(1); + assert.boolean(1, "hello"); - assert.isNotBoolean(1); - assert.isNotBoolean(1, "hello"); + assert.notBoolean(1); + assert.notBoolean(1, "hello"); assert.typeOf(1, "string"); assert.typeOf(1, "number", "hello"); @@ -457,26 +457,26 @@ namespace assertionTests { assert.ifError(1); - assert.isExtensible({}); - assert.isExtensible({}, "hello"); + assert.extensible({}); + assert.extensible({}, "hello"); - assert.isNotExtensible({}); - assert.isNotExtensible({}, "hello"); + assert.notExtensible({}); + assert.notExtensible({}, "hello"); - assert.isSealed({}); - assert.isSealed({}, "hello"); + assert.sealed({}); + assert.sealed({}, "hello"); - assert.isNotSealed({}); - assert.isNotSealed({}, "hello"); + assert.notSealed({}); + assert.notSealed({}, "hello"); - assert.isFrozen({}); - assert.isFrozen({}, "hello"); + assert.frozen({}); + assert.frozen({}, "hello"); - assert.isNotFrozen({}); - assert.isNotFrozen({}, "hello"); + assert.notFrozen({}); + assert.notFrozen({}, "hello"); - assert.isEmpty({}); - assert.isEmpty({}, "hello"); + assert.empty({}); + assert.empty({}, "hello"); } const { expect } = assertion; @@ -499,16 +499,16 @@ namespace assertionTests { expect(1).to.contain(2, "hello").and; expect(1).but.contains(2).and; expect(1).but.contains(2, "hello").and; - expect(1).to.ok.not.ok; - expect(1).to.be.true.but.false; - expect(1).to.be.false.but.true; - expect(1).to.be.null.and.null; - expect(1).to.be.undefined.and.true; - expect(1).to.be.NaN.and.null; - expect(1).to.exist.and.be.null; - expect(1).to.be.empty.and.true; - expect(1).to.be.arguments.and.a("number"); - expect(1).to.be.Arguments.and.false; + expect(1).to.ok().and.a("string"); + expect(1).to.be.true().but.false(); + expect(1).to.be.false().but.true(); + expect(1).to.be.null().and.null(); + expect(1).to.be.undefined().and.true(); + expect(1).to.be.NaN().and.null(); + expect(1).to.exist().and.be.null(); + expect(1).to.be.empty().and.true(); + expect(1).to.be.arguments().and.a("number"); + expect(1).to.be.Arguments().and.false(); expect(1).to.be.equal(2).and; expect(1).to.be.equal(2, "hello").and; expect(1).but.equals(2).and; @@ -624,19 +624,19 @@ namespace assertionTests { expect(() => {}).but.decreases({}, "a", "hello").and; expect(() => {}).to.decreases({}).by(2).and; expect(() => {}).to.decreases({}).by(2, "hello").and; - expect({}).to.be.extensible.and; - expect({}).to.be.sealed.and; - expect({}).to.be.frozen.and; - expect({}).to.be.finite.and; + expect({}).to.be.extensible().and; + expect({}).to.be.sealed().and; + expect({}).to.be.frozen().and; + expect({}).to.be.finite().and; namespace mockTests { const s1 = adone.shani.util.spy(); const s2 = adone.shani.util.spy(); - expect(s1).to.have.been.called; - expect(s1).to.have.been.calledOnce; - expect(s1).to.have.been.calledTwice; - expect(s1).to.have.been.calledThrice; + expect(s1).to.have.been.called(); + expect(s1).to.have.been.calledOnce(); + expect(s1).to.have.been.calledTwice(); + expect(s1).to.have.been.calledThrice(); expect(s1).to.have.callCount(100); expect(s1).to.have.been.calledBefore(s2); expect(s1).to.have.been.calledAfter(s2); diff --git a/types/adone/test/glosses/collections.ts b/types/adone/test/glosses/collections.ts deleted file mode 100644 index ec227d4440..0000000000 --- a/types/adone/test/glosses/collections.ts +++ /dev/null @@ -1,1003 +0,0 @@ -namespace collectionTests { - const { collection } = adone; - - namespace linkedListTests { - const { LinkedList } = collection; - - namespace creation { - new LinkedList(); - new LinkedList(10); - } - - namespace properties { - { const a: boolean = new LinkedList().full; } - { const a: boolean = new LinkedList().empty; } - { const a: number = new LinkedList().maxLength; } - { const a: number = new LinkedList().length; } - { const a: boolean = new LinkedList().autoresize; } - } - - namespace resize { - { const a: boolean = new LinkedList().resize(100).full; } - } - - namespace push { - const a = new LinkedList().push(10); - a.next; - a.prev; - const b: number = a.value; - } - - namespace pop { - const a: number | undefined = new LinkedList().pop(); - } - - namespace shift { - const a: number | undefined = new LinkedList().shift(); - } - - namespace unshift { - const a = new LinkedList().unshift("hello"); - a.next; - a.prev; - const b: string = a.value; - } - - namespace pushNode { - const a = new LinkedList(); - const node = a.push("1230"); - a.pushNode(node); - } - - namespace unshiftNode { - const a = new LinkedList(); - const node = a.push(10); - a.unshiftNode(node); - } - - namespace removeNode { - const a = new LinkedList(); - const node = a.unshift("10"); - a.removeNode(node); - } - - namespace clear { - new LinkedList().clear(); - new LinkedList().clear(true); - } - - namespace toArray { - const a = new LinkedList(); - const b: number[] = a.toArray(); - } - - namespace front { - const a = new LinkedList(); - const b: number = a.front; - } - - namespace back { - const a = new LinkedList(); - const b: number = a.back; - } - - namespace iterating { - const a = new LinkedList(); - for (const b of a) { - const i: string = b; - } - const c = new LinkedList(); - for (const b of c) { - const i: number = b; - } - } - - namespace nextNode { - const a = new LinkedList(); - const n1 = a.push("h"); - const n2 = a.nextNode(n1); - n1.next; - n1.prev; - const t: string = n1.value; - } - - namespace map { - const a = new LinkedList(); - const f = (a: number, idx: number) => `${a}${idx}`; - const b = a.map(f); - const c: string = b.front; - } - - namespace forEach { - const a = new LinkedList(); - - a.forEach((a: number, b: number) => { - const c = a + b; - }); - } - - namespace static { - const a: number = LinkedList.DEFAULT_LENGTH; - } - } - - namespace ByteArrayTests { - const { ByteArray } = collection; - - new ByteArray(); - new ByteArray(10); - new ByteArray(10, true); - - const buffer = new ByteArray(); - - namespace readBitSet { - const a: boolean[] = buffer.readBitSet(); - const b: boolean[] = buffer.readBitSet(10); - } - - namespace read { - const a: adone.collection.ByteArray = buffer.read(1); - const b: adone.collection.ByteArray = buffer.read(1, 10); - } - - namespace readInt8 { - const a: number = buffer.readInt8(); - const b: number = buffer.readInt8(10); - } - - namespace readUInt8 { - const a: number = buffer.readUInt8(); - const b: number = buffer.readUInt8(10); - } - - namespace readInt16LE { - const a: number = buffer.readInt16LE(); - const b: number = buffer.readInt16LE(10); - } - - namespace readUInt16LE { - const a: number = buffer.readUInt16LE(); - const b: number = buffer.readUInt16LE(10); - } - - namespace readInt16BE { - const a: number = buffer.readInt16BE(); - const b: number = buffer.readInt16BE(10); - } - - namespace readUInt16BE { - const a: number = buffer.readUInt16BE(); - const b: number = buffer.readUInt16BE(10); - } - - namespace readInt32LE { - const a: number = buffer.readInt32LE(); - const b: number = buffer.readInt32LE(10); - } - - namespace readUInt32LE { - const a: number = buffer.readUInt32LE(); - const b: number = buffer.readUInt32LE(10); - } - - namespace readInt32BE { - const a: number = buffer.readInt32BE(); - const b: number = buffer.readInt32BE(10); - } - - namespace readUInt32BE { - const a: number = buffer.readUInt32BE(); - const b: number = buffer.readUInt32BE(10); - } - - namespace readInt64LE { - const a: adone.math.Long = buffer.readInt64LE(); - const b: adone.math.Long = buffer.readInt64LE(10); - } - - namespace readUInt64LE { - const a: adone.math.Long = buffer.readUInt64LE(); - const b: adone.math.Long = buffer.readUInt64LE(10); - } - - namespace readInt64BE { - const a: adone.math.Long = buffer.readInt64BE(); - const b: adone.math.Long = buffer.readInt64BE(10); - } - - namespace readUInt64BE { - const a: adone.math.Long = buffer.readUInt64BE(); - const b: adone.math.Long = buffer.readUInt64BE(10); - } - - namespace readFloatLE { - const a: number = buffer.readFloatLE(); - const b: number = buffer.readFloatLE(10); - } - - namespace readFloatBE { - const a: number = buffer.readFloatBE(); - const b: number = buffer.readFloatBE(10); - } - - namespace readDoubleLE { - const a: number = buffer.readDoubleLE(); - const b: number = buffer.readDoubleLE(10); - } - - namespace readDoubleBE { - const a: number = buffer.readDoubleBE(); - const b: number = buffer.readDoubleBE(10); - } - - namespace write { - const a: adone.collection.ByteArray = buffer.write("1"); - const b: adone.collection.ByteArray = buffer.write(new ByteArray()); - const c: adone.collection.ByteArray = buffer.write(Buffer.alloc(10)); - const d: adone.collection.ByteArray = buffer.write(new Uint8Array([1, 2, 3])); - const e: adone.collection.ByteArray = buffer.write(new ArrayBuffer(10)); - const f: adone.collection.ByteArray = buffer.write("1", 10); - const g: adone.collection.ByteArray = buffer.write("1", 10, 10); - const h: adone.collection.ByteArray = buffer.write("1", 10, 10, "utf8"); - } - - namespace writeBitSet { - const a: adone.collection.ByteArray = buffer.writeBitSet([1, 2, 3]); - const b: number = buffer.writeBitSet([1, 2, 3], 10); - } - - namespace writeInt8 { - const a: adone.collection.ByteArray = buffer.writeInt8(10); - const b: adone.collection.ByteArray = buffer.writeInt8(10, 10); - } - - namespace writeUInt8 { - const a: adone.collection.ByteArray = buffer.writeUInt8(10); - const b: adone.collection.ByteArray = buffer.writeUInt8(10, 10); - } - - namespace writeInt16LE { - const a: adone.collection.ByteArray = buffer.writeInt16LE(10); - const b: adone.collection.ByteArray = buffer.writeInt16LE(10, 10); - } - - namespace writeInt16BE { - const a: adone.collection.ByteArray = buffer.writeInt16BE(10); - const b: adone.collection.ByteArray = buffer.writeInt16BE(10, 10); - } - - namespace writeUInt16LE { - const a: adone.collection.ByteArray = buffer.writeUInt16LE(10); - const b: adone.collection.ByteArray = buffer.writeUInt16LE(10, 10); - } - - namespace writeUInt16BE { - const a: adone.collection.ByteArray = buffer.writeUInt16BE(10); - const b: adone.collection.ByteArray = buffer.writeUInt16BE(10, 10); - } - - namespace writeInt32LE { - const a: adone.collection.ByteArray = buffer.writeInt32LE(10); - const b: adone.collection.ByteArray = buffer.writeInt32LE(10, 10); - } - - namespace writeInt32BE { - const a: adone.collection.ByteArray = buffer.writeInt32BE(10); - const b: adone.collection.ByteArray = buffer.writeInt32BE(10, 10); - } - - namespace writeUInt32LE { - const a: adone.collection.ByteArray = buffer.writeUInt32LE(10); - const b: adone.collection.ByteArray = buffer.writeUInt32LE(10, 10); - } - - namespace writeUInt32BE { - const a: adone.collection.ByteArray = buffer.writeUInt32BE(10); - const b: adone.collection.ByteArray = buffer.writeUInt32BE(10, 10); - } - - namespace writeInt64LE { - const a: adone.collection.ByteArray = buffer.writeInt64LE(10); - const b: adone.collection.ByteArray = buffer.writeInt64LE(10, 10); - } - - namespace writeInt64BE { - const a: adone.collection.ByteArray = buffer.writeInt64BE(10); - const b: adone.collection.ByteArray = buffer.writeInt64BE(10, 10); - } - - namespace writeUInt64LE { - const a: adone.collection.ByteArray = buffer.writeUInt64LE(10); - const b: adone.collection.ByteArray = buffer.writeUInt64LE(10, 10); - } - - namespace writeUInt64BE { - const a: adone.collection.ByteArray = buffer.writeUInt64BE(10); - const b: adone.collection.ByteArray = buffer.writeUInt64BE(10, 10); - } - - namespace writeFloatLE { - const a: adone.collection.ByteArray = buffer.writeFloatLE(10); - const b: adone.collection.ByteArray = buffer.writeFloatLE(10, 10); - } - - namespace writeFloatBE { - const a: adone.collection.ByteArray = buffer.writeFloatBE(10); - const b: adone.collection.ByteArray = buffer.writeFloatBE(10, 10); - } - - namespace writeDoubleLE { - const a: adone.collection.ByteArray = buffer.writeDoubleLE(10); - const b: adone.collection.ByteArray = buffer.writeDoubleLE(10, 10); - } - - namespace writeDoubleBE { - const a: adone.collection.ByteArray = buffer.writeDoubleBE(10); - const b: adone.collection.ByteArray = buffer.writeDoubleBE(10, 10); - } - - namespace writeVarInt32 { - const a: adone.collection.ByteArray = buffer.writeVarint32(10); - const b: number = buffer.writeVarint32(10, 10); - } - - namespace writeVarInt32ZigZag { - const a: adone.collection.ByteArray = buffer.writeVarint32ZigZag(10); - const b: number = buffer.writeVarint32ZigZag(10, 10); - } - - namespace readVarint32 { - const a: number = buffer.readVarint32(); - const b: { value: number, length: number } = buffer.readVarint32(10); - } - - namespace readVarint32ZigZag { - const a: number = buffer.readVarint32ZigZag(); - const b: { value: number, length: number } = buffer.readVarint32ZigZag(10); - } - - namespace writeVarint64 { - const a: adone.collection.ByteArray = buffer.writeVarint64(10); - const b: number = buffer.writeVarint64(10, 10); - } - - namespace writeVarint64ZigZag { - const a: adone.collection.ByteArray = buffer.writeVarint64ZigZag(10); - const b: number = buffer.writeVarint64ZigZag(10, 10); - } - - namespace readVarint64 { - const a: adone.math.Long = buffer.readVarint64(); - const b: { value: adone.math.Long, length: number } = buffer.readVarint64(10); - } - - namespace readVarint64ZigZag { - const a: adone.math.Long = buffer.readVarint64ZigZag(); - const b: { value: adone.math.Long, length: number } = buffer.readVarint64ZigZag(10); - } - - namespace writeCString { - const a: adone.collection.ByteArray = buffer.writeCString("asd"); - const b: number = buffer.writeCString("123", 10); - } - - namespace readCString { - const a: string = buffer.readCString(); - const b: { string: string, length: number } = buffer.readCString(10); - } - - namespace writeString { - const a: adone.collection.ByteArray = buffer.writeString("abc"); - const b: number = buffer.writeString("abc", 10); - } - - namespace readString { - const a: string = buffer.readString(10); - const b: string = buffer.readString(10, "b"); - const c: string = buffer.readString(10, "c"); - const d: { string: string, length: number } = buffer.readString(10, "c", 10); - } - - namespace writeVString { - const a: adone.collection.ByteArray = buffer.writeVString("abc"); - const b: number = buffer.writeVString("abc", 10); - } - - namespace readVString { - const a: string = buffer.readVString(); - const b: { string: string, length: number } = buffer.readVString(10); - } - - namespace appendTo { - const a: adone.collection.ByteArray = buffer.appendTo(new ByteArray()); - const b: adone.collection.ByteArray = buffer.appendTo(new ByteArray(), 10); - } - - namespace assert { - const a: adone.collection.ByteArray = buffer.assert(); - const b: adone.collection.ByteArray = buffer.assert(true); - } - - namespace capacity { - const a: number = buffer.capacity(); - } - - namespace clear { - const a: adone.collection.ByteArray = buffer.clear(); - } - - namespace copy { - const a: adone.collection.ByteArray = buffer.clone(); - const c: adone.collection.ByteArray = buffer.clone(true); - } - - namespace compact { - const a: adone.collection.ByteArray = buffer.compact(); - const b: adone.collection.ByteArray = buffer.compact(1); - const c: adone.collection.ByteArray = buffer.compact(1, 10); - } - - namespace copyTo { - const a: adone.collection.ByteArray = buffer.copyTo(new ByteArray()); - const b: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0); - const c: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0, 0); - const d: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0, 0, 10); - } - - namespace ensureCapacity { - const a: adone.collection.ByteArray = buffer.ensureCapacity(10); - } - - namespace fill { - const a: adone.collection.ByteArray = buffer.fill("0"); - const b: adone.collection.ByteArray = buffer.fill(0); - const c: adone.collection.ByteArray = buffer.fill(0, 0); - const d: adone.collection.ByteArray = buffer.fill(0, 0, 10); - } - - namespace flip { - const a: adone.collection.ByteArray = buffer.flip(); - } - - namespace mark { - const a: adone.collection.ByteArray = buffer.mark(); - const b: adone.collection.ByteArray = buffer.mark(10); - } - - namespace prepend { - const a: adone.collection.ByteArray = buffer.prepend(""); - const b: adone.collection.ByteArray = buffer.prepend(new ByteArray()); - const c: adone.collection.ByteArray = buffer.prepend(Buffer.alloc(10)); - const d: adone.collection.ByteArray = buffer.prepend(new Uint8Array([1, 2, 3])); - const e: adone.collection.ByteArray = buffer.prepend(new ArrayBuffer(10)); - const f: adone.collection.ByteArray = buffer.prepend("", "utf8"); - const g: adone.collection.ByteArray = buffer.prepend("", "utf8", 10); - const h: adone.collection.ByteArray = buffer.prepend("", 10); - } - - namespace prependTo { - const a: adone.collection.ByteArray = buffer.prependTo(new ByteArray()); - const b: adone.collection.ByteArray = buffer.prependTo(new ByteArray(), 10); - } - - namespace remaining { - const a: number = buffer.remaining(); - } - - namespace reset { - const a: adone.collection.ByteArray = buffer.reset(); - } - - namespace resize { - const a: adone.collection.ByteArray = buffer.resize(10); - } - - namespace reverse { - const a: adone.collection.ByteArray = buffer.reverse(); - const b: adone.collection.ByteArray = buffer.reverse(1); - const c: adone.collection.ByteArray = buffer.reverse(1, 10); - } - - namespace skip { - const a: adone.collection.ByteArray = buffer.skip(10); - } - - namespace slice { - const a: adone.collection.ByteArray = buffer.slice(); - const b: adone.collection.ByteArray = buffer.slice(1); - const c: adone.collection.ByteArray = buffer.slice(1, 10); - } - - namespace toBuffer { - const a: Buffer = buffer.toBuffer(); - const b: Buffer = buffer.toBuffer(true); - const c: Buffer = buffer.toBuffer(true, 0); - const d: Buffer = buffer.toBuffer(true, 0, 10); - } - - namespace toArrayBuffer { - const a: ArrayBuffer = buffer.toArrayBuffer(); - } - - namespace toString { - const a: string = buffer.toString(); - const b: string = buffer.toString("utf8"); - const c: string = buffer.toString("utf8", 0); - const d: string = buffer.toString("utf8", 0, 10); - } - - namespace toBase64 { - const a: string = buffer.toBase64(); - const b: string = buffer.toBase64(0); - const c: string = buffer.toBase64(0, 10); - } - - namespace toBinary { - const a: string = buffer.toBinary(); - const b: string = buffer.toBinary(0); - const c: string = buffer.toBinary(0, 10); - } - - namespace toDebug { - const a: string = buffer.toDebug(); - const b: string = buffer.toDebug(true); - } - - namespace toUTF8 { - const a: string = buffer.toUTF8(); - const b: string = buffer.toUTF8(0); - const c: string = buffer.toUTF8(0, 10); - } - - namespace static { - namespace accessor { - const a: typeof Buffer = ByteArray.accessor(); - } - - namespace allocate { - const a: adone.collection.ByteArray = ByteArray.allocate(); - const b: adone.collection.ByteArray = ByteArray.allocate(10); - const c: adone.collection.ByteArray = ByteArray.allocate(10, true); - } - - namespace concat { - const a: adone.collection.ByteArray = ByteArray.concat([ - new ByteArray(), - Buffer.alloc(10), - new Uint8Array([1, 2, 3]), - new ArrayBuffer(10) - ]); - const b: adone.collection.ByteArray = ByteArray.concat([ - new ByteArray(), - Buffer.alloc(10), - new Uint8Array([1, 2, 3]), - new ArrayBuffer(10) - ], "utf8"); - const c: adone.collection.ByteArray = ByteArray.concat([ - new ByteArray(), - Buffer.alloc(10), - new Uint8Array([1, 2, 3]), - new ArrayBuffer(10) - ], "utf8", true); - } - - namespace type { - const a: typeof Buffer = ByteArray.type(); - } - - namespace wrap { - const a: adone.collection.ByteArray = ByteArray.wrap(""); - const b: adone.collection.ByteArray = ByteArray.wrap(new ByteArray()); - const c: adone.collection.ByteArray = ByteArray.wrap(Buffer.alloc(10)); - const d: adone.collection.ByteArray = ByteArray.wrap(new Uint8Array([1, 2, 3])); - const e: adone.collection.ByteArray = ByteArray.wrap(new ArrayBuffer(10)); - const f: adone.collection.ByteArray = ByteArray.wrap("", "utf8"); - const g: adone.collection.ByteArray = ByteArray.wrap("", "utf8", true); - } - - namespace calculateVarint32 { - const a: number = ByteArray.calculateVarint32(10); - } - - namespace zigZagEncode32 { - const a: number = ByteArray.zigZagEncode32(10); - } - - namespace zigZagDecode32 { - const a: number = ByteArray.zigZagDecode32(10); - } - - namespace calculateVarint64 { - const a: number = ByteArray.calculateVarint64(10); - const b: number = ByteArray.calculateVarint64("10"); - } - - namespace zigZagEncode64 { - const a: adone.math.Long = ByteArray.zigZagEncode64(10); - const b: adone.math.Long = ByteArray.zigZagEncode64("10"); - const c: adone.math.Long = ByteArray.zigZagEncode64(adone.math.Long.fromValue(10)); - } - - namespace zigZagDecode64 { - const a: adone.math.Long = ByteArray.zigZagDecode64(10); - const b: adone.math.Long = ByteArray.zigZagDecode64("10"); - const c: adone.math.Long = ByteArray.zigZagDecode64(adone.math.Long.fromValue(10)); - } - - namespace calculateUTF8Chars { - const a: number = ByteArray.calculateUTF8Chars("123"); - } - - namespace calculateString { - const a: number = ByteArray.calculateString("123"); - } - - namespace fromBase64 { - const a: adone.collection.ByteArray = ByteArray.fromBase64("123"); - } - - namespace btoa { - const a: string = ByteArray.btoa("123"); - } - - namespace atob { - const a: string = ByteArray.atob("123"); - } - - namespace fromBinary { - const a: adone.collection.ByteArray = ByteArray.fromBinary("123"); - } - - namespace fromDebug { - const a: adone.collection.ByteArray = ByteArray.fromDebug("12"); - const b: adone.collection.ByteArray = ByteArray.fromDebug("12", true); - } - - namespace fromHex { - const a: adone.collection.ByteArray = ByteArray.fromHex("192"); - const b: adone.collection.ByteArray = ByteArray.fromHex("192", true); - } - - namespace fromUTF8 { - const a: adone.collection.ByteArray = ByteArray.fromUTF8("123"); - const b: adone.collection.ByteArray = ByteArray.fromUTF8("123", true); - } - - namespace constants { - const a: number = ByteArray.DEFAULT_CAPACITY; - const b: boolean = ByteArray.DEFAULT_NOASSERT; - const c: number = ByteArray.MAX_VARINT32_BYTES; - const d: number = ByteArray.MAX_VARINT64_BYTES; - const e: string = ByteArray.METRICS_CHARS; - const f: string = ByteArray.METRICS_BYTES; - } - } - } - - namespace queueTests { - const { Queue } = collection; - type Queue = adone.collection.Queue; - - new Queue(); - { const a: Queue = new Queue().push(123).push(123); } - { const a: number | undefined = new Queue().push(123).pop(); } - { const a: string | undefined = new Queue().push(123).pop(); } - { const a: boolean = new Queue().full; } - { const a: number = new Queue().length; } - { const a: boolean = new Queue().empty; } - } - - namespace asyncQueueTests { - const { AsyncQueue } = collection; - type AsyncQueue = adone.collection.AsyncQueue; - - { const a: AsyncQueue = new AsyncQueue().push(123); } - { const a: Promise = new AsyncQueue().push(123).pop(); } - } - - namespace priorityQueueTests { - const { PriorityQueue } = collection; - type PriorityQueue = adone.collection.PriorityQueue; - - { const a: boolean = new PriorityQueue().empty; } - { const a: number = new PriorityQueue().length; } - new PriorityQueue(); - new PriorityQueue({}); - new PriorityQueue({ - compare(a: number, b: number) { - return a - b; - } - }); - new PriorityQueue({ - priority(a: string, b: string) { - return a.length - b.length; - } - }); - { const a: PriorityQueue = new PriorityQueue().clone(); } - { const a: PriorityQueue = new PriorityQueue().push("123"); } - { const a: string | undefined = new PriorityQueue().pop(); } - { const a: PriorityQueue = new PriorityQueue().delete("123"); } - { const a: PriorityQueue = new PriorityQueue().delete("123"); } - { const a: string = new PriorityQueue().replace("123"); } - { const a: string = new PriorityQueue().pushpop("123"); } - { const a: string[] = new PriorityQueue().toArray(); } - { const a: PriorityQueue = PriorityQueue.from(["1"]); } - { const a: PriorityQueue = PriorityQueue.from(["1"], {}); } - { const a: PriorityQueue = PriorityQueue.from(["1"], { compare: (a: string, b: string) => a.length - b.length }); } - { const a: PriorityQueue = PriorityQueue.from(["1"], { priority: (a: string, b: string) => a.length - b.length }); } - } - - namespace fastlruTests { - const { FastLRU } = collection; - - new FastLRU(); - new FastLRU(100); - new FastLRU(100, { dispose: (key: string, value: number) => null }); - { const a: number = new FastLRU().size; } - { const a: number | undefined = new FastLRU().get("key"); } - new FastLRU().set("key", 123); - { const a: boolean = new FastLRU().delete("key"); } - { const a: boolean = new FastLRU().has("key"); } - { const a: string[] = [...new FastLRU().keys()]; } - { const a: number[] = [...new FastLRU().values()]; } - { const a: number[] = [...new FastLRU().values()]; } - { const a: Array<[string, number]> = [...new FastLRU().entries()]; } - new FastLRU().clear(); - } - - namespace stackTests { - const { Stack } = collection; - type Stack = adone.collection.Stack; - - { const a: boolean = new Stack().empty; } - { const a: number = new Stack().top; } - { const a: Stack = new Stack().push(123); } - { const a: number | undefined = new Stack().pop(); } - { const a: number[] = [...new Stack()]; } - { const a: Stack = Stack.from([1, 2, 3]); } - } - - namespace binarySearchTreeTests { - const { BinarySearchTree } = collection; - type BinarySearchTree = adone.collection.BinarySearchTree; - - new BinarySearchTree(); - new BinarySearchTree({}); - new BinarySearchTree({ checkValueEquality: (a: number, b: number) => a === b }); - new BinarySearchTree({ compareKeys: (a: string, b: string) => a.length - b.length }); - new BinarySearchTree({ parent: new BinarySearchTree() }); - new BinarySearchTree({ unique: true }); - new BinarySearchTree({ value: 123 }); - { const a: BinarySearchTree = new BinarySearchTree().getMaxKeyDescendant(); } - { const a: string = new BinarySearchTree().getMaxKey(); } - { const a: BinarySearchTree = new BinarySearchTree().getMinKeyDescendant(); } - { const a: string = new BinarySearchTree().getMinKey(); } - new BinarySearchTree().checkAllNodesFullfillCondition((key: string, value: number) => null); - new BinarySearchTree().checkIsBST(); - { const a: number = new BinarySearchTree().getNumberOfKeys(); } - new BinarySearchTree().insert("asd", 123); - { const a: number[] = new BinarySearchTree().search("asd"); } - { const a: number[] = new BinarySearchTree().betweenBounds({ $gt: "" }); } - { const a: number[] = new BinarySearchTree().betweenBounds({ $lt: "" }); } - { const a: number[] = new BinarySearchTree().betweenBounds({ $lte: "" }); } - { const a: number[] = new BinarySearchTree().betweenBounds({ $gte: "" }); } - new BinarySearchTree().delete("key"); - new BinarySearchTree().delete("key", 123); - new BinarySearchTree().executeOnEveryNode((tree: BinarySearchTree) => null); - new BinarySearchTree().prettyPrint(); - new BinarySearchTree().prettyPrint(true); - new BinarySearchTree().prettyPrint(true, " "); - } - - namespace avlTreeTests { - const { AVLTree } = collection; - type AVLTree = adone.collection.AVLTree; - - new AVLTree(); - new AVLTree({ checkValueEquality: (a: number, b: number) => a === b }); - new AVLTree({ compareKeys: (a: string, b: string) => a.length - b.length }); - new AVLTree({ parent: new AVLTree() }); - new AVLTree({ unique: false }); - new AVLTree({ value: 123 }); - new AVLTree().checkIsAVLT(); - new AVLTree().insert("123", 123); - new AVLTree().delete("123"); - new AVLTree().delete("123", 123); - { const a: number = new AVLTree().getNumberOFKeys(); } - { const a: number[] = new AVLTree().search("key"); } - { const a: number[] = new AVLTree().betweenBounds({}); } - { const a: number[] = new AVLTree().betweenBounds({ $gt: "ads" }); } - { const a: number[] = new AVLTree().betweenBounds({ $lt: "ads" }); } - { const a: number[] = new AVLTree().betweenBounds({ $gte: "ads" }); } - { const a: number[] = new AVLTree().betweenBounds({ $lte: "ads" }); } - new AVLTree().executeOnEveryNode((tree: AVLTree) => null); - } - - namespace redBlackTreeTests { - const { RedBlackTree } = collection; - type RedBlackTree = adone.collection.RedBlackTree; - type RedBlackTreeIterator = adone.collection.I.RedBlackTree.Iterator; - type RedBlackTreeNode = adone.collection.I.RedBlackTree.Node; - - new RedBlackTree(); - new RedBlackTree((a: string, b: string) => a.length - b.length); - new RedBlackTree(undefined, new RedBlackTree()); - { const a: string[] = new RedBlackTree().keys; } - { const a: number[] = new RedBlackTree().values; } - { const a: number = new RedBlackTree().length; } - { - const a: RedBlackTreeIterator = new RedBlackTree().begin; - { const b: boolean = a.valid; } - { const b: RedBlackTreeNode | null = a.node; } - { const b: string | undefined = a.key; } - { const b: number | undefined = a.value; } - { const b: number = a.index; } - { const b: boolean = a.hasNext; } - { const b: boolean = a.hasPrev; } - { const b: RedBlackTree = a.tree; } - { const b: RedBlackTreeIterator = a.clone(); } - { const b: RedBlackTree = a.remove(); } - a.next(); - { const b: RedBlackTree = a.update(333); } - a.prev(); - } - { const a: RedBlackTreeIterator = new RedBlackTree().end; } - { const a: RedBlackTree = new RedBlackTree().insert("123", 456); } - { const a: number = new RedBlackTree().forEach((key: string, value: number) => value); } - { const a: number = new RedBlackTree().forEach((key: string, value: number) => value, "1"); } - { const a: number = new RedBlackTree().forEach((key: string, value: number) => value, "1", "2"); } - { const a: RedBlackTreeIterator = new RedBlackTree().at(1); } - { const a: RedBlackTreeIterator = new RedBlackTree().ge("1"); } - { const a: RedBlackTreeIterator = new RedBlackTree().gt("1"); } - { const a: RedBlackTreeIterator = new RedBlackTree().lt("1"); } - { const a: RedBlackTreeIterator = new RedBlackTree().le("1"); } - { const a: RedBlackTreeIterator | null = new RedBlackTree().find("1"); } - { const a: RedBlackTree = new RedBlackTree().remove("1"); } - { const a: RedBlackTree = new RedBlackTree().remove("1"); } - { const a: number | undefined = new RedBlackTree().get("1"); } - } - - namespace arraySetTests { - const { ArraySet } = collection; - type ArraySet = adone.collection.ArraySet; - - new ArraySet(); - { const a: number = new ArraySet().length; } - { const a: ArraySet = new ArraySet().add("hello"); } - { const a: ArraySet = new ArraySet().add("hello", true); } - { const a: boolean = new ArraySet().has("string"); } - { const a: number = new ArraySet().indexOf("hello"); } - { const a: string[] = new ArraySet().toArray(); } - { const a: ArraySet = ArraySet.from([1]); } - { const a: ArraySet = ArraySet.from([1], true); } - } - - namespace bufferListTests { - const { BufferList } = collection; - type BufferList = adone.collection.BufferList; - - new BufferList(); - new BufferList(Buffer.from("123")); - new BufferList("123"); - new BufferList(123); - new BufferList([Buffer.from("123"), "123", 123]); - new BufferList((err: any, data: Buffer) => null); - new BufferList().append(Buffer.from("123")); - new BufferList().append("123"); - new BufferList().append(123); - new BufferList().append([Buffer.from("123"), "123", 123]); - new BufferList().end(Buffer.from("123")); - new BufferList().end(); - { const a: number = new BufferList().get(123); } - { const a: Buffer = new BufferList().slice(); } - { const a: Buffer = new BufferList().slice(1); } - { const a: Buffer = new BufferList().slice(1, 2); } - { const a: Buffer = new BufferList().copy(Buffer.alloc(100)); } - { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0); } - { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0, 1); } - { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0, 1, 2); } - { const a: BufferList = new BufferList().shallowSlice(); } - { const a: BufferList = new BufferList().shallowSlice(1); } - { const a: BufferList = new BufferList().shallowSlice(1, 2); } - { const a: string = new BufferList().toString(); } - { const a: string = new BufferList().toString("utf8"); } - { const a: string = new BufferList().toString("utf8", 1); } - { const a: string = new BufferList().toString("utf8", 1, 2); } - { const a: BufferList = new BufferList().consume(10); } - { const a: BufferList = new BufferList().duplicate(); } - new BufferList().destroy(); - new BufferList().then((x: Buffer) => null); - new BufferList().catch((err: any) => null); - } - - namespace defaultMapTests { - const { DefaultMap } = collection; - type DefaultMap = adone.collection.DefaultMap; - - new DefaultMap(); - { const a: DefaultMap = new DefaultMap(undefined, [["1", 2]]); } - { const a: DefaultMap = new DefaultMap((key: string) => 123); } - { const a: DefaultMap = new DefaultMap({ a: 123 }); } - } - - namespace lruTests { - const { LRU } = collection; - type LRU = adone.collection.LRU; - - new LRU(); - new LRU(100); - new LRU({}); - new LRU({ max: 100 }); - new LRU({ dispose: (key: string, value: number) => null }); - new LRU({ maxAge: 100 }); - new LRU({ noDisposeOnSet: false }); - new LRU({ stale: true }); - { const a: number = new LRU().max; } - { new LRU().max = 100; } - { const a: boolean = new LRU().allowStale; } - { new LRU().allowStale = false; } - { const a: number = new LRU().maxAge; } - { new LRU().maxAge = 100; } - { const a: (v: number, k: string) => number = new LRU().lengthCalculator; } - { new LRU().lengthCalculator = () => 123; } - { const a: number = new LRU().length; } - { const a: number = new LRU().itemCount; } - new LRU().rforEach((value: number, key: string) => null); - new LRU().rforEach(function (value: number, key: string) { - const b: number = this.a; - }, { a: 1 }); - new LRU().forEach((value: number, key: string) => null); - new LRU().forEach(function (value: number, key: string) { - const b: number = this.a; - }, { a: 1 }); - { const a: string[] = new LRU().keys(); } - { const a: number[] = new LRU().values(); } - new LRU().reset(); - { - const a: Array> = new LRU().dump(); - const [b] = a; - { const c: number = b.e; } - { const c: string = b.key; } - { const c: number = b.value; } - } - { - const a: adone.collection.LinkedList> = new LRU().dumpLru(); - const b = a.shift(); - if (b !== undefined) { - { const a: string = b.key; } - { const a: number = b.value; } - { const a: number = b.now; } - { const a: number = b.maxAge; } - } - } - { const a: string = new LRU().inspect(); } - { const a: string = new LRU().inspect({}); } - { const a: boolean = new LRU().set("asd", 13); } - { const a: boolean = new LRU().set("asd", 13, 100500); } - { const a: boolean = new LRU().has("asd"); } - { const a: number | undefined = new LRU().get("asd"); } - { const a: number | undefined = new LRU().peek("asd"); } - { const a: adone.collection.I.LRU.Entry = new LRU().pop(); } - new LRU().del("asd"); - new LRU().load(new LRU().dump()); - new LRU().prune(); - } - - namespace timedoutMapTests { - const { TimedoutMap } = collection; - type TimedoutMap = adone.collection.TimedoutMap; - - new TimedoutMap(); - new TimedoutMap(1000); - new TimedoutMap(1000, (key: string) => null); - { - const a: TimedoutMap = new TimedoutMap().forEach((value: number, key: string) => null); - } - { - const a: TimedoutMap = new TimedoutMap().forEach(function (value: number, key: string) { - const a: number = this.a; - }, { a: 1 }); - } - { const a: boolean = new TimedoutMap().delete("123"); } - } -} diff --git a/types/adone/test/glosses/collections/array_set.ts b/types/adone/test/glosses/collections/array_set.ts new file mode 100644 index 0000000000..49fd8582ce --- /dev/null +++ b/types/adone/test/glosses/collections/array_set.ts @@ -0,0 +1,19 @@ +namespace adoneTests.collection.ArraySet { + const { + collection: { + ArraySet + } + } = adone; + + type ArraySet = adone.collection.ArraySet; + + new ArraySet(); + { const a: number = new ArraySet().length; } + { const a: ArraySet = new ArraySet().add("hello"); } + { const a: ArraySet = new ArraySet().add("hello", true); } + { const a: boolean = new ArraySet().has("string"); } + { const a: number = new ArraySet().indexOf("hello"); } + { const a: string[] = new ArraySet().toArray(); } + { const a: ArraySet = ArraySet.from([1]); } + { const a: ArraySet = ArraySet.from([1], true); } +} diff --git a/types/adone/test/glosses/collections/async_queue.ts b/types/adone/test/glosses/collections/async_queue.ts new file mode 100644 index 0000000000..43374e6d3a --- /dev/null +++ b/types/adone/test/glosses/collections/async_queue.ts @@ -0,0 +1,12 @@ +namespace adoneTests.collection.AsyncQueue { + const { + collection: { + AsyncQueue + } + } = adone; + + type AsyncQueue = adone.collection.AsyncQueue; + + { const a: AsyncQueue = new AsyncQueue().push(123); } + { const a: Promise = new AsyncQueue().push(123).pop(); } +} diff --git a/types/adone/test/glosses/collections/avl_tree.ts b/types/adone/test/glosses/collections/avl_tree.ts new file mode 100644 index 0000000000..9c032deb2d --- /dev/null +++ b/types/adone/test/glosses/collections/avl_tree.ts @@ -0,0 +1,28 @@ +namespace adoneTests.collection.AVLTree { + const { + collection: { + AVLTree + } + } = adone; + + type AVLTree = adone.collection.AVLTree; + + new AVLTree(); + new AVLTree({ checkValueEquality: (a: number, b: number) => a === b }); + new AVLTree({ compareKeys: (a: string, b: string) => a.length - b.length }); + new AVLTree({ parent: new AVLTree() }); + new AVLTree({ unique: false }); + new AVLTree({ value: 123 }); + new AVLTree().checkIsAVLT(); + new AVLTree().insert("123", 123); + new AVLTree().delete("123"); + new AVLTree().delete("123", 123); + { const a: number = new AVLTree().getNumberOFKeys(); } + { const a: number[] = new AVLTree().search("key"); } + { const a: number[] = new AVLTree().betweenBounds({}); } + { const a: number[] = new AVLTree().betweenBounds({ $gt: "ads" }); } + { const a: number[] = new AVLTree().betweenBounds({ $lt: "ads" }); } + { const a: number[] = new AVLTree().betweenBounds({ $gte: "ads" }); } + { const a: number[] = new AVLTree().betweenBounds({ $lte: "ads" }); } + new AVLTree().executeOnEveryNode((tree: AVLTree) => null); +} diff --git a/types/adone/test/glosses/collections/binary_search_tree.ts b/types/adone/test/glosses/collections/binary_search_tree.ts new file mode 100644 index 0000000000..56f9a28e72 --- /dev/null +++ b/types/adone/test/glosses/collections/binary_search_tree.ts @@ -0,0 +1,36 @@ +namespace adoneTests.collection.BinarySearchTree { + const { + collection: { + BinarySearchTree + } + } = adone; + + type BinarySearchTree = adone.collection.BinarySearchTree; + + new BinarySearchTree(); + new BinarySearchTree({}); + new BinarySearchTree({ checkValueEquality: (a: number, b: number) => a === b }); + new BinarySearchTree({ compareKeys: (a: string, b: string) => a.length - b.length }); + new BinarySearchTree({ parent: new BinarySearchTree() }); + new BinarySearchTree({ unique: true }); + new BinarySearchTree({ value: 123 }); + { const a: BinarySearchTree = new BinarySearchTree().getMaxKeyDescendant(); } + { const a: string = new BinarySearchTree().getMaxKey(); } + { const a: BinarySearchTree = new BinarySearchTree().getMinKeyDescendant(); } + { const a: string = new BinarySearchTree().getMinKey(); } + new BinarySearchTree().checkAllNodesFullfillCondition((key: string, value: number) => null); + new BinarySearchTree().checkIsBST(); + { const a: number = new BinarySearchTree().getNumberOfKeys(); } + new BinarySearchTree().insert("asd", 123); + { const a: number[] = new BinarySearchTree().search("asd"); } + { const a: number[] = new BinarySearchTree().betweenBounds({ $gt: "" }); } + { const a: number[] = new BinarySearchTree().betweenBounds({ $lt: "" }); } + { const a: number[] = new BinarySearchTree().betweenBounds({ $lte: "" }); } + { const a: number[] = new BinarySearchTree().betweenBounds({ $gte: "" }); } + new BinarySearchTree().delete("key"); + new BinarySearchTree().delete("key", 123); + new BinarySearchTree().executeOnEveryNode((tree: BinarySearchTree) => null); + new BinarySearchTree().prettyPrint(); + new BinarySearchTree().prettyPrint(true); + new BinarySearchTree().prettyPrint(true, " "); +} diff --git a/types/adone/test/glosses/collections/buffer_list.ts b/types/adone/test/glosses/collections/buffer_list.ts new file mode 100644 index 0000000000..265d54033f --- /dev/null +++ b/types/adone/test/glosses/collections/buffer_list.ts @@ -0,0 +1,42 @@ +namespace adoneTests.collection.BufferList { + const { + collection: { + BufferList + } + } = adone; + + type BufferList = adone.collection.BufferList; + + new BufferList(); + new BufferList(Buffer.from("123")); + new BufferList("123"); + new BufferList(123); + new BufferList([Buffer.from("123"), "123", 123]); + new BufferList((err: any, data: Buffer) => null); + new BufferList().append(Buffer.from("123")); + new BufferList().append("123"); + new BufferList().append(123); + new BufferList().append([Buffer.from("123"), "123", 123]); + new BufferList().end(Buffer.from("123")); + new BufferList().end(); + { const a: number = new BufferList().get(123); } + { const a: Buffer = new BufferList().slice(); } + { const a: Buffer = new BufferList().slice(1); } + { const a: Buffer = new BufferList().slice(1, 2); } + { const a: Buffer = new BufferList().copy(Buffer.alloc(100)); } + { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0); } + { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0, 1); } + { const a: Buffer = new BufferList().copy(Buffer.alloc(100), 0, 1, 2); } + { const a: BufferList = new BufferList().shallowSlice(); } + { const a: BufferList = new BufferList().shallowSlice(1); } + { const a: BufferList = new BufferList().shallowSlice(1, 2); } + { const a: string = new BufferList().toString(); } + { const a: string = new BufferList().toString("utf8"); } + { const a: string = new BufferList().toString("utf8", 1); } + { const a: string = new BufferList().toString("utf8", 1, 2); } + { const a: BufferList = new BufferList().consume(10); } + { const a: BufferList = new BufferList().duplicate(); } + new BufferList().destroy(); + new BufferList().then((x: Buffer) => null); + new BufferList().catch((err: any) => null); +} diff --git a/types/adone/test/glosses/collections/byte_array.ts b/types/adone/test/glosses/collections/byte_array.ts new file mode 100644 index 0000000000..7254008322 --- /dev/null +++ b/types/adone/test/glosses/collections/byte_array.ts @@ -0,0 +1,561 @@ +namespace adoneTests.collection.ByteArray { + const { + collection: { + ByteArray + } + } = adone; + + new ByteArray(); + new ByteArray(10); + new ByteArray(10, true); + + const buffer = new ByteArray(); + + buffer.woffset === 2; + buffer.roffset === 3; + buffer.noAssert === true; + buffer.buffer.writeUInt8(0, 0); + + namespace readBitSet { + const a: boolean[] = buffer.readBitSet(); + const b: boolean[] = buffer.readBitSet(10); + } + + namespace read { + const a: adone.collection.ByteArray = buffer.read(1); + const b: adone.collection.ByteArray = buffer.read(1, 10); + } + + namespace readInt8 { + const a: number = buffer.readInt8(); + const b: number = buffer.readInt8(10); + } + + namespace readUInt8 { + const a: number = buffer.readUInt8(); + const b: number = buffer.readUInt8(10); + } + + namespace readInt16LE { + const a: number = buffer.readInt16LE(); + const b: number = buffer.readInt16LE(10); + } + + namespace readUInt16LE { + const a: number = buffer.readUInt16LE(); + const b: number = buffer.readUInt16LE(10); + } + + namespace readInt16BE { + const a: number = buffer.readInt16BE(); + const b: number = buffer.readInt16BE(10); + } + + namespace readUInt16BE { + const a: number = buffer.readUInt16BE(); + const b: number = buffer.readUInt16BE(10); + } + + namespace readInt32LE { + const a: number = buffer.readInt32LE(); + const b: number = buffer.readInt32LE(10); + } + + namespace readUInt32LE { + const a: number = buffer.readUInt32LE(); + const b: number = buffer.readUInt32LE(10); + } + + namespace readInt32BE { + const a: number = buffer.readInt32BE(); + const b: number = buffer.readInt32BE(10); + } + + namespace readUInt32BE { + const a: number = buffer.readUInt32BE(); + const b: number = buffer.readUInt32BE(10); + } + + namespace readInt64LE { + const a: adone.math.Long = buffer.readInt64LE(); + const b: adone.math.Long = buffer.readInt64LE(10); + } + + namespace readUInt64LE { + const a: adone.math.Long = buffer.readUInt64LE(); + const b: adone.math.Long = buffer.readUInt64LE(10); + } + + namespace readInt64BE { + const a: adone.math.Long = buffer.readInt64BE(); + const b: adone.math.Long = buffer.readInt64BE(10); + } + + namespace readUInt64BE { + const a: adone.math.Long = buffer.readUInt64BE(); + const b: adone.math.Long = buffer.readUInt64BE(10); + } + + namespace readFloatLE { + const a: number = buffer.readFloatLE(); + const b: number = buffer.readFloatLE(10); + } + + namespace readFloatBE { + const a: number = buffer.readFloatBE(); + const b: number = buffer.readFloatBE(10); + } + + namespace readDoubleLE { + const a: number = buffer.readDoubleLE(); + const b: number = buffer.readDoubleLE(10); + } + + namespace readDoubleBE { + const a: number = buffer.readDoubleBE(); + const b: number = buffer.readDoubleBE(10); + } + + namespace write { + const a: adone.collection.ByteArray = buffer.write("1"); + const b: adone.collection.ByteArray = buffer.write(new ByteArray()); + const c: adone.collection.ByteArray = buffer.write(Buffer.alloc(10)); + const d: adone.collection.ByteArray = buffer.write(new Uint8Array([1, 2, 3])); + const e: adone.collection.ByteArray = buffer.write(new ArrayBuffer(10)); + const f: adone.collection.ByteArray = buffer.write("1", 10); + const g: adone.collection.ByteArray = buffer.write("1", 10, 10); + const h: adone.collection.ByteArray = buffer.write("1", 10, 10, "utf8"); + } + + namespace writeBitSet { + const a: adone.collection.ByteArray = buffer.writeBitSet([1, 2, 3]); + const b: number = buffer.writeBitSet([1, 2, 3], 10); + } + + namespace writeInt8 { + const a: adone.collection.ByteArray = buffer.writeInt8(10); + const b: adone.collection.ByteArray = buffer.writeInt8(10, 10); + } + + namespace writeUInt8 { + const a: adone.collection.ByteArray = buffer.writeUInt8(10); + const b: adone.collection.ByteArray = buffer.writeUInt8(10, 10); + } + + namespace writeInt16LE { + const a: adone.collection.ByteArray = buffer.writeInt16LE(10); + const b: adone.collection.ByteArray = buffer.writeInt16LE(10, 10); + } + + namespace writeInt16BE { + const a: adone.collection.ByteArray = buffer.writeInt16BE(10); + const b: adone.collection.ByteArray = buffer.writeInt16BE(10, 10); + } + + namespace writeUInt16LE { + const a: adone.collection.ByteArray = buffer.writeUInt16LE(10); + const b: adone.collection.ByteArray = buffer.writeUInt16LE(10, 10); + } + + namespace writeUInt16BE { + const a: adone.collection.ByteArray = buffer.writeUInt16BE(10); + const b: adone.collection.ByteArray = buffer.writeUInt16BE(10, 10); + } + + namespace writeInt32LE { + const a: adone.collection.ByteArray = buffer.writeInt32LE(10); + const b: adone.collection.ByteArray = buffer.writeInt32LE(10, 10); + } + + namespace writeInt32BE { + const a: adone.collection.ByteArray = buffer.writeInt32BE(10); + const b: adone.collection.ByteArray = buffer.writeInt32BE(10, 10); + } + + namespace writeUInt32LE { + const a: adone.collection.ByteArray = buffer.writeUInt32LE(10); + const b: adone.collection.ByteArray = buffer.writeUInt32LE(10, 10); + } + + namespace writeUInt32BE { + const a: adone.collection.ByteArray = buffer.writeUInt32BE(10); + const b: adone.collection.ByteArray = buffer.writeUInt32BE(10, 10); + } + + namespace writeInt64LE { + const a: adone.collection.ByteArray = buffer.writeInt64LE(10); + const b: adone.collection.ByteArray = buffer.writeInt64LE(10, 10); + } + + namespace writeInt64BE { + const a: adone.collection.ByteArray = buffer.writeInt64BE(10); + const b: adone.collection.ByteArray = buffer.writeInt64BE(10, 10); + } + + namespace writeUInt64LE { + const a: adone.collection.ByteArray = buffer.writeUInt64LE(10); + const b: adone.collection.ByteArray = buffer.writeUInt64LE(10, 10); + } + + namespace writeUInt64BE { + const a: adone.collection.ByteArray = buffer.writeUInt64BE(10); + const b: adone.collection.ByteArray = buffer.writeUInt64BE(10, 10); + } + + namespace writeFloatLE { + const a: adone.collection.ByteArray = buffer.writeFloatLE(10); + const b: adone.collection.ByteArray = buffer.writeFloatLE(10, 10); + } + + namespace writeFloatBE { + const a: adone.collection.ByteArray = buffer.writeFloatBE(10); + const b: adone.collection.ByteArray = buffer.writeFloatBE(10, 10); + } + + namespace writeDoubleLE { + const a: adone.collection.ByteArray = buffer.writeDoubleLE(10); + const b: adone.collection.ByteArray = buffer.writeDoubleLE(10, 10); + } + + namespace writeDoubleBE { + const a: adone.collection.ByteArray = buffer.writeDoubleBE(10); + const b: adone.collection.ByteArray = buffer.writeDoubleBE(10, 10); + } + + namespace writeVarInt32 { + const a: adone.collection.ByteArray = buffer.writeVarint32(10); + const b: number = buffer.writeVarint32(10, 10); + } + + namespace writeVarInt32ZigZag { + const a: adone.collection.ByteArray = buffer.writeVarint32ZigZag(10); + const b: number = buffer.writeVarint32ZigZag(10, 10); + } + + namespace readVarint32 { + const a: number = buffer.readVarint32(); + const b: { value: number, length: number } = buffer.readVarint32(10); + } + + namespace readVarint32ZigZag { + const a: number = buffer.readVarint32ZigZag(); + const b: { value: number, length: number } = buffer.readVarint32ZigZag(10); + } + + namespace writeVarint64 { + const a: adone.collection.ByteArray = buffer.writeVarint64(10); + const b: number = buffer.writeVarint64(10, 10); + } + + namespace writeVarint64ZigZag { + const a: adone.collection.ByteArray = buffer.writeVarint64ZigZag(10); + const b: number = buffer.writeVarint64ZigZag(10, 10); + } + + namespace readVarint64 { + const a: adone.math.Long = buffer.readVarint64(); + const b: { value: adone.math.Long, length: number } = buffer.readVarint64(10); + } + + namespace readVarint64ZigZag { + const a: adone.math.Long = buffer.readVarint64ZigZag(); + const b: { value: adone.math.Long, length: number } = buffer.readVarint64ZigZag(10); + } + + namespace writeCString { + const a: adone.collection.ByteArray = buffer.writeCString("asd"); + const b: number = buffer.writeCString("123", 10); + } + + namespace readCString { + const a: string = buffer.readCString(); + const b: { string: string, length: number } = buffer.readCString(10); + } + + namespace writeString { + const a: adone.collection.ByteArray = buffer.writeString("abc"); + const b: number = buffer.writeString("abc", 10); + } + + namespace readString { + const a: string = buffer.readString(10); + const b: string = buffer.readString(10, "b"); + const c: string = buffer.readString(10, "c"); + const d: { string: string, length: number } = buffer.readString(10, "c", 10); + } + + namespace writeVString { + const a: adone.collection.ByteArray = buffer.writeVString("abc"); + const b: number = buffer.writeVString("abc", 10); + } + + namespace readVString { + const a: string = buffer.readVString(); + const b: { string: string, length: number } = buffer.readVString(10); + } + + namespace appendTo { + const a: adone.collection.ByteArray = buffer.appendTo(new ByteArray()); + const b: adone.collection.ByteArray = buffer.appendTo(new ByteArray(), 10); + } + + namespace assert { + const a: adone.collection.ByteArray = buffer.assert(); + const b: adone.collection.ByteArray = buffer.assert(true); + } + + namespace capacity { + const a: number = buffer.capacity(); + } + + namespace clear { + const a: adone.collection.ByteArray = buffer.clear(); + } + + namespace copy { + const a: adone.collection.ByteArray = buffer.clone(); + const c: adone.collection.ByteArray = buffer.clone(true); + } + + namespace compact { + const a: adone.collection.ByteArray = buffer.compact(); + const b: adone.collection.ByteArray = buffer.compact(1); + const c: adone.collection.ByteArray = buffer.compact(1, 10); + } + + namespace copyTo { + const a: adone.collection.ByteArray = buffer.copyTo(new ByteArray()); + const b: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0); + const c: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0, 0); + const d: adone.collection.ByteArray = buffer.copyTo(new ByteArray(), 0, 0, 10); + } + + namespace ensureCapacity { + const a: adone.collection.ByteArray = buffer.ensureCapacity(10); + } + + namespace fill { + const a: adone.collection.ByteArray = buffer.fill("0"); + const b: adone.collection.ByteArray = buffer.fill(0); + const c: adone.collection.ByteArray = buffer.fill(0, 0); + const d: adone.collection.ByteArray = buffer.fill(0, 0, 10); + } + + namespace flip { + const a: adone.collection.ByteArray = buffer.flip(); + } + + namespace mark { + const a: adone.collection.ByteArray = buffer.mark(); + const b: adone.collection.ByteArray = buffer.mark(10); + } + + namespace prepend { + const a: adone.collection.ByteArray = buffer.prepend(""); + const b: adone.collection.ByteArray = buffer.prepend(new ByteArray()); + const c: adone.collection.ByteArray = buffer.prepend(Buffer.alloc(10)); + const d: adone.collection.ByteArray = buffer.prepend(new Uint8Array([1, 2, 3])); + const e: adone.collection.ByteArray = buffer.prepend(new ArrayBuffer(10)); + const f: adone.collection.ByteArray = buffer.prepend("", "utf8"); + const g: adone.collection.ByteArray = buffer.prepend("", "utf8", 10); + const h: adone.collection.ByteArray = buffer.prepend("", 10); + } + + namespace prependTo { + const a: adone.collection.ByteArray = buffer.prependTo(new ByteArray()); + const b: adone.collection.ByteArray = buffer.prependTo(new ByteArray(), 10); + } + + namespace remaining { + const a: number = buffer.remaining(); + } + + namespace reset { + const a: adone.collection.ByteArray = buffer.reset(); + } + + namespace resize { + const a: adone.collection.ByteArray = buffer.resize(10); + } + + namespace reverse { + const a: adone.collection.ByteArray = buffer.reverse(); + const b: adone.collection.ByteArray = buffer.reverse(1); + const c: adone.collection.ByteArray = buffer.reverse(1, 10); + } + + namespace skip { + const a: adone.collection.ByteArray = buffer.skip(10); + } + + namespace slice { + const a: adone.collection.ByteArray = buffer.slice(); + const b: adone.collection.ByteArray = buffer.slice(1); + const c: adone.collection.ByteArray = buffer.slice(1, 10); + } + + namespace toBuffer { + const a: Buffer = buffer.toBuffer(); + const b: Buffer = buffer.toBuffer(true); + const c: Buffer = buffer.toBuffer(true, 0); + const d: Buffer = buffer.toBuffer(true, 0, 10); + } + + namespace toArrayBuffer { + const a: ArrayBuffer = buffer.toArrayBuffer(); + } + + namespace toString { + const a: string = buffer.toString(); + const b: string = buffer.toString("utf8"); + const c: string = buffer.toString("utf8", 0); + const d: string = buffer.toString("utf8", 0, 10); + } + + namespace toBase64 { + const a: string = buffer.toBase64(); + const b: string = buffer.toBase64(0); + const c: string = buffer.toBase64(0, 10); + } + + namespace toBinary { + const a: string = buffer.toBinary(); + const b: string = buffer.toBinary(0); + const c: string = buffer.toBinary(0, 10); + } + + namespace toDebug { + const a: string = buffer.toDebug(); + const b: string = buffer.toDebug(true); + } + + namespace toUTF8 { + const a: string = buffer.toUTF8(); + const b: string = buffer.toUTF8(0); + const c: string = buffer.toUTF8(0, 10); + } + + namespace static { + namespace accessor { + const a: typeof Buffer = ByteArray.accessor(); + } + + namespace allocate { + const a: adone.collection.ByteArray = ByteArray.allocate(); + const b: adone.collection.ByteArray = ByteArray.allocate(10); + const c: adone.collection.ByteArray = ByteArray.allocate(10, true); + } + + namespace concat { + const a: adone.collection.ByteArray = ByteArray.concat([ + new ByteArray(), + Buffer.alloc(10), + new Uint8Array([1, 2, 3]), + new ArrayBuffer(10) + ]); + const b: adone.collection.ByteArray = ByteArray.concat([ + new ByteArray(), + Buffer.alloc(10), + new Uint8Array([1, 2, 3]), + new ArrayBuffer(10) + ], "utf8"); + const c: adone.collection.ByteArray = ByteArray.concat([ + new ByteArray(), + Buffer.alloc(10), + new Uint8Array([1, 2, 3]), + new ArrayBuffer(10) + ], "utf8", true); + } + + namespace type { + const a: typeof Buffer = ByteArray.type(); + } + + namespace wrap { + const a: adone.collection.ByteArray = ByteArray.wrap(""); + const b: adone.collection.ByteArray = ByteArray.wrap(new ByteArray()); + const c: adone.collection.ByteArray = ByteArray.wrap(Buffer.alloc(10)); + const d: adone.collection.ByteArray = ByteArray.wrap(new Uint8Array([1, 2, 3])); + const e: adone.collection.ByteArray = ByteArray.wrap(new ArrayBuffer(10)); + const f: adone.collection.ByteArray = ByteArray.wrap("", "utf8"); + const g: adone.collection.ByteArray = ByteArray.wrap("", "utf8", true); + } + + namespace calculateVarint32 { + const a: number = ByteArray.calculateVarint32(10); + } + + namespace zigZagEncode32 { + const a: number = ByteArray.zigZagEncode32(10); + } + + namespace zigZagDecode32 { + const a: number = ByteArray.zigZagDecode32(10); + } + + namespace calculateVarint64 { + const a: number = ByteArray.calculateVarint64(10); + const b: number = ByteArray.calculateVarint64("10"); + } + + namespace zigZagEncode64 { + const a: adone.math.Long = ByteArray.zigZagEncode64(10); + const b: adone.math.Long = ByteArray.zigZagEncode64("10"); + const c: adone.math.Long = ByteArray.zigZagEncode64(adone.math.Long.fromValue(10)); + } + + namespace zigZagDecode64 { + const a: adone.math.Long = ByteArray.zigZagDecode64(10); + const b: adone.math.Long = ByteArray.zigZagDecode64("10"); + const c: adone.math.Long = ByteArray.zigZagDecode64(adone.math.Long.fromValue(10)); + } + + namespace calculateUTF8Chars { + const a: number = ByteArray.calculateUTF8Chars("123"); + } + + namespace calculateString { + const a: number = ByteArray.calculateString("123"); + } + + namespace fromBase64 { + const a: adone.collection.ByteArray = ByteArray.fromBase64("123"); + } + + namespace btoa { + const a: string = ByteArray.btoa("123"); + } + + namespace atob { + const a: string = ByteArray.atob("123"); + } + + namespace fromBinary { + const a: adone.collection.ByteArray = ByteArray.fromBinary("123"); + } + + namespace fromDebug { + const a: adone.collection.ByteArray = ByteArray.fromDebug("12"); + const b: adone.collection.ByteArray = ByteArray.fromDebug("12", true); + } + + namespace fromHex { + const a: adone.collection.ByteArray = ByteArray.fromHex("192"); + const b: adone.collection.ByteArray = ByteArray.fromHex("192", true); + } + + namespace fromUTF8 { + const a: adone.collection.ByteArray = ByteArray.fromUTF8("123"); + const b: adone.collection.ByteArray = ByteArray.fromUTF8("123", true); + } + + namespace constants { + const a: number = ByteArray.DEFAULT_CAPACITY; + const b: boolean = ByteArray.DEFAULT_NOASSERT; + const c: number = ByteArray.MAX_VARINT32_BYTES; + const d: number = ByteArray.MAX_VARINT64_BYTES; + const e: string = ByteArray.METRICS_CHARS; + const f: string = ByteArray.METRICS_BYTES; + } + } +} diff --git a/types/adone/test/glosses/collections/default_map.ts b/types/adone/test/glosses/collections/default_map.ts new file mode 100644 index 0000000000..1273b91982 --- /dev/null +++ b/types/adone/test/glosses/collections/default_map.ts @@ -0,0 +1,14 @@ +namespace adoneTests.collection.DefaultMap { + const { + collection: { + DefaultMap + } + } = adone; + + type DefaultMap = adone.collection.DefaultMap; + + new DefaultMap(); + { const a: DefaultMap = new DefaultMap(undefined, [["1", 2]]); } + { const a: DefaultMap = new DefaultMap((key: string) => 123); } + { const a: DefaultMap = new DefaultMap({ a: 123 }); } +} diff --git a/types/adone/test/glosses/collections/fast_lru.ts b/types/adone/test/glosses/collections/fast_lru.ts new file mode 100644 index 0000000000..0e61f51dc5 --- /dev/null +++ b/types/adone/test/glosses/collections/fast_lru.ts @@ -0,0 +1,21 @@ +namespace adoneTests.collection.FastLRU { + const { + collection: { + FastLRU + } + } = adone; + + new FastLRU(); + new FastLRU(100); + new FastLRU(100, { dispose: (key: string, value: number) => null }); + { const a: number = new FastLRU().size; } + { const a: number | undefined = new FastLRU().get("key"); } + new FastLRU().set("key", 123); + { const a: boolean = new FastLRU().delete("key"); } + { const a: boolean = new FastLRU().has("key"); } + { const a: string[] = [...new FastLRU().keys()]; } + { const a: number[] = [...new FastLRU().values()]; } + { const a: number[] = [...new FastLRU().values()]; } + { const a: Array<[string, number]> = [...new FastLRU().entries()]; } + new FastLRU().clear(); +} diff --git a/types/adone/test/glosses/collections/linked_list.ts b/types/adone/test/glosses/collections/linked_list.ts new file mode 100644 index 0000000000..f64a32c1aa --- /dev/null +++ b/types/adone/test/glosses/collections/linked_list.ts @@ -0,0 +1,123 @@ +namespace adoneTests.collection.LinkedList { + const { + collection: { + LinkedList + } + } = adone; + + namespace creation { + new LinkedList(); + new LinkedList(10); + } + + namespace properties { + { const a: boolean = new LinkedList().full; } + { const a: boolean = new LinkedList().empty; } + { const a: number = new LinkedList().maxLength; } + { const a: number = new LinkedList().length; } + { const a: boolean = new LinkedList().autoresize; } + } + + namespace resize { + { const a: boolean = new LinkedList().resize(100).full; } + } + + namespace push { + const a = new LinkedList().push(10); + a.next; + a.prev; + const b: number = a.value; + } + + namespace pop { + const a: number | undefined = new LinkedList().pop(); + } + + namespace shift { + const a: number | undefined = new LinkedList().shift(); + } + + namespace unshift { + const a = new LinkedList().unshift("hello"); + a.next; + a.prev; + const b: string = a.value; + } + + namespace pushNode { + const a = new LinkedList(); + const node = a.push("1230"); + a.pushNode(node); + } + + namespace unshiftNode { + const a = new LinkedList(); + const node = a.push(10); + a.unshiftNode(node); + } + + namespace removeNode { + const a = new LinkedList(); + const node = a.unshift("10"); + a.removeNode(node); + } + + namespace clear { + new LinkedList().clear(); + new LinkedList().clear(true); + } + + namespace toArray { + const a = new LinkedList(); + const b: number[] = a.toArray(); + } + + namespace front { + const a = new LinkedList(); + const b: number = a.front; + } + + namespace back { + const a = new LinkedList(); + const b: number = a.back; + } + + namespace iterating { + const a = new LinkedList(); + for (const b of a) { + const i: string = b; + } + const c = new LinkedList(); + for (const b of c) { + const i: number = b; + } + } + + namespace nextNode { + const a = new LinkedList(); + const n1 = a.push("h"); + const n2 = a.nextNode(n1); + n1.next; + n1.prev; + const t: string = n1.value; + } + + namespace map { + const a = new LinkedList(); + const f = (a: number, idx: number) => `${a}${idx}`; + const b = a.map(f); + const c: string = b.front; + } + + namespace forEach { + const a = new LinkedList(); + + a.forEach((a: number, b: number) => { + const c = a + b; + }); + } + + namespace static { + const a: number = LinkedList.DEFAULT_LENGTH; + } +} diff --git a/types/adone/test/glosses/collections/lru.ts b/types/adone/test/glosses/collections/lru.ts new file mode 100644 index 0000000000..934e5a1fbf --- /dev/null +++ b/types/adone/test/glosses/collections/lru.ts @@ -0,0 +1,67 @@ +namespace adoneTests.collection.LRU { + const { + collection: { + LRU + } + } = adone; + + type LRU = adone.collection.LRU; + + new LRU(); + new LRU(100); + new LRU({}); + new LRU({ max: 100 }); + new LRU({ dispose: (key: string, value: number) => null }); + new LRU({ maxAge: 100 }); + new LRU({ noDisposeOnSet: false }); + new LRU({ stale: true }); + { const a: number = new LRU().max; } + { new LRU().max = 100; } + { const a: boolean = new LRU().allowStale; } + { new LRU().allowStale = false; } + { const a: number = new LRU().maxAge; } + { new LRU().maxAge = 100; } + { const a: (v: number, k: string) => number = new LRU().lengthCalculator; } + { new LRU().lengthCalculator = () => 123; } + { const a: number = new LRU().length; } + { const a: number = new LRU().itemCount; } + new LRU().rforEach((value: number, key: string) => null); + new LRU().rforEach(function (value: number, key: string) { + const b: number = this.a; + }, { a: 1 }); + new LRU().forEach((value: number, key: string) => null); + new LRU().forEach(function (value: number, key: string) { + const b: number = this.a; + }, { a: 1 }); + { const a: string[] = new LRU().keys(); } + { const a: number[] = new LRU().values(); } + new LRU().reset(); + { + const a: Array> = new LRU().dump(); + const [b] = a; + { const c: number = b.e; } + { const c: string = b.key; } + { const c: number = b.value; } + } + { + const a: adone.collection.LinkedList> = new LRU().dumpLru(); + const b = a.shift(); + if (b !== undefined) { + { const a: string = b.key; } + { const a: number = b.value; } + { const a: number = b.now; } + { const a: number = b.maxAge; } + } + } + { const a: string = new LRU().inspect(); } + { const a: string = new LRU().inspect({}); } + { const a: boolean = new LRU().set("asd", 13); } + { const a: boolean = new LRU().set("asd", 13, 100500); } + { const a: boolean = new LRU().has("asd"); } + { const a: number | undefined = new LRU().get("asd"); } + { const a: number | undefined = new LRU().peek("asd"); } + { const a: adone.collection.I.LRU.Entry = new LRU().pop(); } + new LRU().del("asd"); + new LRU().load(new LRU().dump()); + new LRU().prune(); +} diff --git a/types/adone/test/glosses/collections/map_cache.ts b/types/adone/test/glosses/collections/map_cache.ts new file mode 100644 index 0000000000..bcd0ffb887 --- /dev/null +++ b/types/adone/test/glosses/collections/map_cache.ts @@ -0,0 +1,21 @@ +namespace adoneTests.collection.MapCache { + const { + collection: { + MapCache + } + } = adone; + + new MapCache(); + + new MapCache().has("hello"); + new MapCache().get("hello"); + new MapCache().set("hello", "world"); + new MapCache().delete("hello"); + new MapCache().clear(); + + { + const a = new MapCache(); + a.set("a", "b"); + a.get("a").charCodeAt(20); + } +} diff --git a/types/adone/test/glosses/collections/ns_cache.ts b/types/adone/test/glosses/collections/ns_cache.ts new file mode 100644 index 0000000000..a8e8c14397 --- /dev/null +++ b/types/adone/test/glosses/collections/ns_cache.ts @@ -0,0 +1,21 @@ +namespace adoneTests.collection.NSCache { + const { + collection: { + NSCache + } + } = adone; + + new NSCache(10, ["a", "b", "c"]); + new NSCache(10, ["a", "b", "c"]).resize(100); + new NSCache(10, ["a", "b", "c"]).set("a", "b", "c"); + new NSCache(10, ["a", "b", "c"]).get("a", "b"); + new NSCache(10, ["a", "b", "c"]).has("a", "b"); + new NSCache(10, ["a", "b", "c"]).delete("a", "b"); + new NSCache(10, ["a", "b", "c"]).clear(); + + { + const a = new NSCache(10, ["a", "b", "c"]); + a.set("a", "b", "c"); + a.get("a", "b").charCodeAt(100); + } +} diff --git a/types/adone/test/glosses/collections/priority_queue.ts b/types/adone/test/glosses/collections/priority_queue.ts new file mode 100644 index 0000000000..950e7394e7 --- /dev/null +++ b/types/adone/test/glosses/collections/priority_queue.ts @@ -0,0 +1,36 @@ +namespace adoneTests.collection.PriorityQueue { + const { + collection: { + PriorityQueue + } + } = adone; + + type PriorityQueue = adone.collection.PriorityQueue; + + { const a: boolean = new PriorityQueue().empty; } + { const a: number = new PriorityQueue().length; } + new PriorityQueue(); + new PriorityQueue({}); + new PriorityQueue({ + compare(a: number, b: number) { + return a - b; + } + }); + new PriorityQueue({ + priority(a: string, b: string) { + return a.length - b.length; + } + }); + { const a: PriorityQueue = new PriorityQueue().clone(); } + { const a: PriorityQueue = new PriorityQueue().push("123"); } + { const a: string | undefined = new PriorityQueue().pop(); } + { const a: PriorityQueue = new PriorityQueue().delete("123"); } + { const a: PriorityQueue = new PriorityQueue().delete("123"); } + { const a: string = new PriorityQueue().replace("123"); } + { const a: string = new PriorityQueue().pushpop("123"); } + { const a: string[] = new PriorityQueue().toArray(); } + { const a: PriorityQueue = PriorityQueue.from(["1"]); } + { const a: PriorityQueue = PriorityQueue.from(["1"], {}); } + { const a: PriorityQueue = PriorityQueue.from(["1"], { compare: (a: string, b: string) => a.length - b.length }); } + { const a: PriorityQueue = PriorityQueue.from(["1"], { priority: (a: string, b: string) => a.length - b.length }); } +} diff --git a/types/adone/test/glosses/collections/queue.ts b/types/adone/test/glosses/collections/queue.ts new file mode 100644 index 0000000000..fd6df7f39b --- /dev/null +++ b/types/adone/test/glosses/collections/queue.ts @@ -0,0 +1,17 @@ +namespace adoneTests.collection.Queue { + const { + collection: { + Queue + } + } = adone; + + type Queue = adone.collection.Queue; + + new Queue(); + { const a: Queue = new Queue().push(123).push(123); } + { const a: number | undefined = new Queue().push(123).pop(); } + { const a: string | undefined = new Queue().push(123).pop(); } + { const a: boolean = new Queue().full; } + { const a: number = new Queue().length; } + { const a: boolean = new Queue().empty; } +} diff --git a/types/adone/test/glosses/collections/rb_tree.ts b/types/adone/test/glosses/collections/rb_tree.ts new file mode 100644 index 0000000000..1b624284f6 --- /dev/null +++ b/types/adone/test/glosses/collections/rb_tree.ts @@ -0,0 +1,48 @@ +namespace adoneTests.collection.RedBlackTree { + const { + collection: { + RedBlackTree + } + } = adone; + + type RedBlackTree = adone.collection.RedBlackTree; + type RedBlackTreeIterator = adone.collection.I.RedBlackTree.Iterator; + type RedBlackTreeNode = adone.collection.I.RedBlackTree.Node; + + new RedBlackTree(); + new RedBlackTree((a: string, b: string) => a.length - b.length); + new RedBlackTree(undefined, new RedBlackTree()); + { const a: string[] = new RedBlackTree().keys; } + { const a: number[] = new RedBlackTree().values; } + { const a: number = new RedBlackTree().length; } + { + const a: RedBlackTreeIterator = new RedBlackTree().begin; + { const b: boolean = a.valid; } + { const b: RedBlackTreeNode | null = a.node; } + { const b: string | undefined = a.key; } + { const b: number | undefined = a.value; } + { const b: number = a.index; } + { const b: boolean = a.hasNext; } + { const b: boolean = a.hasPrev; } + { const b: RedBlackTree = a.tree; } + { const b: RedBlackTreeIterator = a.clone(); } + { const b: RedBlackTree = a.remove(); } + a.next(); + { const b: RedBlackTree = a.update(333); } + a.prev(); + } + { const a: RedBlackTreeIterator = new RedBlackTree().end; } + { const a: RedBlackTree = new RedBlackTree().insert("123", 456); } + { const a: number = new RedBlackTree().forEach((key: string, value: number) => value); } + { const a: number = new RedBlackTree().forEach((key: string, value: number) => value, "1"); } + { const a: number = new RedBlackTree().forEach((key: string, value: number) => value, "1", "2"); } + { const a: RedBlackTreeIterator = new RedBlackTree().at(1); } + { const a: RedBlackTreeIterator = new RedBlackTree().ge("1"); } + { const a: RedBlackTreeIterator = new RedBlackTree().gt("1"); } + { const a: RedBlackTreeIterator = new RedBlackTree().lt("1"); } + { const a: RedBlackTreeIterator = new RedBlackTree().le("1"); } + { const a: RedBlackTreeIterator | null = new RedBlackTree().find("1"); } + { const a: RedBlackTree = new RedBlackTree().remove("1"); } + { const a: RedBlackTree = new RedBlackTree().remove("1"); } + { const a: number | undefined = new RedBlackTree().get("1"); } +} diff --git a/types/adone/test/glosses/collections/refcounted_cache.ts b/types/adone/test/glosses/collections/refcounted_cache.ts new file mode 100644 index 0000000000..6262d57d60 --- /dev/null +++ b/types/adone/test/glosses/collections/refcounted_cache.ts @@ -0,0 +1,17 @@ +namespace adoneTests.collection.RefcountedCache { + const { + collection: { + RefcountedCache + } + } = adone; + + new RefcountedCache(); + new RefcountedCache().ref("a"); + new RefcountedCache().unref("a"); + new RefcountedCache().references("a") === 5; + + { + const a = new RefcountedCache(); + a.get("b").charCodeAt(100); + } +} diff --git a/types/adone/test/glosses/collections/set.ts b/types/adone/test/glosses/collections/set.ts new file mode 100644 index 0000000000..2e2314956e --- /dev/null +++ b/types/adone/test/glosses/collections/set.ts @@ -0,0 +1,26 @@ +namespace adoneTests.collection.Set { + const { + collection: { + Set + } + } = adone; + + new Set().add("a"); + new Set().has("a"); + new Set().delete("a"); + new Set().get("a"); + new Set().has("a") === true; + new Set().only(); + new Set().size === 5; + + { + const a = new Set(); + + a.add(1); + a.has(2); + a.delete(2); + a.get(2); // ??? + a.only() === 5; + a.size === 5; + } +} diff --git a/types/adone/test/glosses/collections/stack.ts b/types/adone/test/glosses/collections/stack.ts new file mode 100644 index 0000000000..df13f82f8e --- /dev/null +++ b/types/adone/test/glosses/collections/stack.ts @@ -0,0 +1,16 @@ +namespace adoneTests.collection.Stack { + const { + collection: { + Stack + } + } = adone; + + type Stack = adone.collection.Stack; + + { const a: boolean = new Stack().empty; } + { const a: number = new Stack().top; } + { const a: Stack = new Stack().push(123); } + { const a: number | undefined = new Stack().pop(); } + { const a: number[] = [...new Stack()]; } + { const a: Stack = Stack.from([1, 2, 3]); } +} diff --git a/types/adone/test/glosses/collections/timedout_map.ts b/types/adone/test/glosses/collections/timedout_map.ts new file mode 100644 index 0000000000..ffca754e2a --- /dev/null +++ b/types/adone/test/glosses/collections/timedout_map.ts @@ -0,0 +1,22 @@ +namespace adoneTests.collection.TimedoutMap { + const { + collection: { + TimedoutMap + } + } = adone; + + type TimedoutMap = adone.collection.TimedoutMap; + + new TimedoutMap(); + new TimedoutMap(1000); + new TimedoutMap(1000, (key: string) => null); + { + const a: TimedoutMap = new TimedoutMap().forEach((value: number, key: string) => null); + } + { + const a: TimedoutMap = new TimedoutMap().forEach(function (value: number, key: string) { + const a: number = this.a; + }, { a: 1 }); + } + { const a: boolean = new TimedoutMap().delete("123"); } +} diff --git a/types/adone/test/glosses/data.ts b/types/adone/test/glosses/data.ts index e8ccedddcc..00403a56da 100644 --- a/types/adone/test/glosses/data.ts +++ b/types/adone/test/glosses/data.ts @@ -11,6 +11,7 @@ namespace dataTests { { const a: Buffer = json.encode(1, { replacer: ["a", "b", "c"] }); } { const a: Buffer = json.encode(1, { replacer: (k: string, v: any) => null }); } { const a: Buffer = json.encode(1, { space: " " }); } + { const a: Buffer = json.encode(1, { newline: true }); } json.decode("123"); json.decode(Buffer.from("123")); @@ -52,6 +53,8 @@ namespace dataTests { mpak.decode(new Uint8Array(10)); mpak.decode(new ArrayBuffer(10)); + mpak.tryDecode(new adone.collection.ByteArray()); + new mpak.Encoder([]); new mpak.Encoder([{ type: 10, @@ -73,6 +76,9 @@ namespace dataTests { new mpak.Decoder([]).decode(new ArrayBuffer(10)); new mpak.Decoder([]).tryDecode(adone.collection.ByteArray.wrap("hello")); + new mpak.Serializer(); + new mpak.Serializer(100); + mpak.registerCommonTypesFor(new mpak.Serializer()); { const a: adone.data.mpak.Encoder = new mpak.Serializer().encoder; } { const a: adone.data.mpak.Decoder = new mpak.Serializer().decoder; } { const a: adone.data.mpak.Serializer = new mpak.Serializer().registerEncoder(10, (x) => true, (x) => new adone.collection.ByteArray(10)); } @@ -125,6 +131,7 @@ namespace dataTests { { const a: string = base64.decode("string", {}); } { const a: string = base64.decode("string", { buffer: false }); } { const a: Buffer = base64.decode("string", { buffer: true }); } + { const a: string = base64.decode("string", { encoding: "utf8" }); } { const a: string = base64.encodeVLQ(123); } { const a: number = base64.decodeVLQ("H"); } @@ -563,4 +570,277 @@ namespace dataTests { bson.decode(bson.encode({ a: 1 }), { promoteLongs: false }).a; bson.decode(bson.encode({ a: 1 }), { promoteValues: true }).a; } + + namespace protobuf { + const { + protobuf + } = data; + + protobuf.create("hello"); + protobuf.create(Buffer.from("hello")); + protobuf.create({}); + protobuf.create({}, {}); + + namespace schema { + const { + schema + } = protobuf; + + const s = schema.parse("hello"); + s.syntax; + s.package; + if (!adone.is.null(s.package)) { + const c: string = s.package; + } + s.imports[0].charCodeAt(100); + + namespace enums { + const [a] = s.enums; + a.name.charCodeAt(100); + a.values; + a.options; + } + + namespace message { + const [msg] = s.messages; + msg.name; + { + const [a] = msg.enums; + a.name; + a.options; + a.values; + } + { + const [a] = msg.extends; + a.name; + a.message; + } + { + const [a] = msg.messages; + a.name; + a.enums; + a.extends; + a.messages; + a.fields; + a.extensions; + } + { + const [a] = msg.fields; + if (!adone.is.null(a.name)) { + a.name.charCodeAt(100); + } + if (!adone.is.null(a.type)) { + a.type.charCodeAt(100); + } + a.tag === 3; + if (!adone.is.null(a.map)) { + a.map.from.charCodeAt(100); + a.map.to.charCodeAt(100); + } + if (!adone.is.null(a.oneof)) { + a.oneof.charCodeAt(100); + } + a.required === false; + a.repeated === true; + a.options; + } + if (!adone.is.null(msg.extensions)) { + msg.extensions.from === 2; + msg.extensions.to === 3; + } + } + + s.options; + + s.extends[0].message; + s.extends[0].name; + + if (!adone.is.nil(s.services)) { + const [svc] = s.services; + + svc.name.charCodeAt(100); + svc.options; + + const [m] = svc.methods; + + m.name.charCodeAt(100); + if (!adone.is.null(m.input_type)) { + m.input_type.charCodeAt(100); + } + if (!adone.is.null(m.output_type)) { + m.output_type.charCodeAt(100); + } + m.client_streaming === true; + m.server_streaming === true; + m.options; + } + } + } + + namespace base32 { + const { + base32 + } = data; + + base32.charmap("asd"); + base32.charmap("asd", {}); + + base32.rfc4648.alphabet.charCodeAt(0); + base32.rfc4648.charmap["X"] === 2; + + base32.crockford.alphabet.charCodeAt(0); + base32.crockford.charmap["X"] === 2; + + base32.base32hex.alphabet.charCodeAt(0); + base32.base32hex.charmap["X"] === 2; + + namespace decoder { + const { + Decoder + } = base32; + new Decoder(); + new Decoder({ + type: "base32hex" + }); + new Decoder({ + type: "crockford" + }); + new Decoder({ + type: "rfc4648" + }); + new Decoder({ + type: "rfc4648", + charmap: {} + }); + const d = new Decoder(); + d.write("asd").write("aa"); + { const a: Buffer = d.finalize(); } + { const a: Buffer = d.finalize("c"); } + } + + namespace encoder { + const { + Encoder + } = base32; + + new Encoder(); + new Encoder({ + type: "base32hex" + }); + new Encoder({ + type: "crockford" + }); + new Encoder({ + type: "rfc4648" + }); + new Encoder({ + type: "rfc4648", + alphabet: "a" + }); + + const e = new Encoder(); + e.write(Buffer.from("b")).write(Buffer.from("a")); + { const a: string = e.finalize(); } + { const a: string = e.finalize(Buffer.from("c")); } + } + + base32.encode(Buffer.from("hello")).charCodeAt(100); + base32.encode(Buffer.from("hello"), { + type: "rfc4648" + }).charCodeAt(100); + base32.encode(Buffer.from("hello"), { + type: "crockford" + }).charCodeAt(100); + base32.encode(Buffer.from("hello"), { + type: "base32hex" + }).charCodeAt(100); + base32.encode(Buffer.from("hello"), { + type: "base32hex", + alphabet: "asd" + }).charCodeAt(100); + + base32.decode("asd").writeUInt8(100, 0); + base32.decode("asd", { + type: "base32hex" + }).writeUInt8(100, 0); + base32.decode("asd", { + type: "crockford" + }).writeUInt8(100, 0); + base32.decode("asd", { + type: "rfc4648" + }).writeUInt8(100, 0); + base32.decode("asd", { + type: "rfc4648", + charmap: {} + }).writeUInt8(100, 0); + } + + namespace basex { + const { + basex + } = data; + + const d = basex("abc"); + const a: Buffer = d.decode("str"); + const b: string = d.encode(Buffer.from("hello")); + const c: Buffer = d.decodeUnsafe("hello"); + } + + namespace base58 { + const { + base58 + } = data; + + const a: Buffer = base58.decode("str"); + const b: string = base58.encode(Buffer.from("hello")); + const c: Buffer = base58.decodeUnsafe("hello"); + } + + namespace base64url { + const { + base64url + } = data; + + base64url.unescape("a").charCodeAt(100); + base64url.escape("a").charCodeAt(100); + + base64url.encode("a").charCodeAt(100); + base64url.encode(Buffer.from("a")).charCodeAt(100); + base64url.encode(Buffer.from("a"), {}).charCodeAt(100); + base64url.encode(Buffer.from("a"), { + encoding: "utf8" + }).charCodeAt(100); + + base64url.decode("a").charCodeAt(100); + base64url.decode("a", { buffer: true }).writeUInt8(0, 0); + base64url.decode("a", { encoding: "utf8" }).charCodeAt(100); + } + + namespace varint { + const { + varint + } = data; + + varint.encode(12)[0]; + varint.encode(12, [])[0]; + varint.encode(12, [], 1)[0]; + + varint.decode(Buffer.from("hello")) === 5; + varint.decode(Buffer.from("hello"), 2) === 5; + varint.encodingLength(100500) === 5; + } + + namespace varintSigned { + const { + varintSigned + } = data; + + varintSigned.encode(12)[0]; + varintSigned.encode(12, [])[0]; + varintSigned.encode(12, [], 1)[0]; + + varintSigned.decode(Buffer.from("hello")) === 5; + varintSigned.decode(Buffer.from("hello"), 2) === 5; + varintSigned.encodingLength(100500) === 5; + } } diff --git a/types/adone/test/glosses/events.ts b/types/adone/test/glosses/events.ts index 7f31089b52..448867951e 100644 --- a/types/adone/test/glosses/events.ts +++ b/types/adone/test/glosses/events.ts @@ -1,76 +1,86 @@ namespace eventsTests { namespace EventEmitter { namespace static { - const a: number = adone.event.EventEmitter.listenerCount(new adone.event.EventEmitter(), "event"); - const b: number = adone.event.EventEmitter.defaultMaxListeners; + const a: number = adone.event.Emitter.listenerCount(new adone.event.Emitter(), "event"); + const b: number = adone.event.Emitter.defaultMaxListeners; } namespace addListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().addListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().addListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().addListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().addListener(Symbol("event"), () => { }); } namespace on { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().on("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().on(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().on("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().on(Symbol("event"), () => { }); } namespace once { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().once("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().once(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().once("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().once(Symbol("event"), () => { }); } namespace prependListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().prependListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().prependListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().prependListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().prependListener(Symbol("event"), () => { }); } namespace prependOnceListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().prependOnceListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().prependOnceListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().prependOnceListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().prependOnceListener(Symbol("event"), () => { }); } namespace removeListener { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().removeListener("event", () => { }); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().removeListener(Symbol("event"), () => { }); + const a: adone.event.Emitter = new adone.event.Emitter().removeListener("event", () => { }); + const b: adone.event.Emitter = new adone.event.Emitter().removeListener(Symbol("event"), () => { }); } namespace removeAllListeners { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().removeAllListeners("event"); - const b: adone.event.EventEmitter = new adone.event.EventEmitter().removeAllListeners(Symbol("event")); + const a: adone.event.Emitter = new adone.event.Emitter().removeAllListeners("event"); + const b: adone.event.Emitter = new adone.event.Emitter().removeAllListeners(Symbol("event")); } namespace setMaxListeners { - const a: adone.event.EventEmitter = new adone.event.EventEmitter().setMaxListeners(10); + const a: adone.event.Emitter = new adone.event.Emitter().setMaxListeners(10); } namespace getMaxListeners { - const a: number = new adone.event.EventEmitter().getMaxListeners(); + const a: number = new adone.event.Emitter().getMaxListeners(); } namespace listeners { - const a: Array<(...args: any[]) => any> = new adone.event.EventEmitter().listeners("event"); - const b: Array<(...args: any[]) => any> = new adone.event.EventEmitter().listeners(Symbol("event")); + const a: Array<(...args: any[]) => any> = new adone.event.Emitter().listeners("event"); + const b: Array<(...args: any[]) => any> = new adone.event.Emitter().listeners(Symbol("event")); } namespace emit { - const a: boolean = new adone.event.EventEmitter().emit("event", 1, 2, 3); - const b: boolean = new adone.event.EventEmitter().emit(Symbol("event"), 1, 2, 3); + const a: boolean = new adone.event.Emitter().emit("event", 1, 2, 3); + const b: boolean = new adone.event.Emitter().emit(Symbol("event"), 1, 2, 3); } namespace eventNames { - const a: Array = new adone.event.EventEmitter().eventNames(); - const b: Array = new adone.event.EventEmitter().eventNames(); + const a: Array = new adone.event.Emitter().eventNames(); + const b: Array = new adone.event.Emitter().eventNames(); } namespace listenerCount { - const a: number = new adone.event.EventEmitter().listenerCount("event"); - const b: number = new adone.event.EventEmitter().listenerCount(Symbol("event")); + const a: number = new adone.event.Emitter().listenerCount("event"); + const b: number = new adone.event.Emitter().listenerCount(Symbol("event")); + } + + namespace propagateEvents { + const e = new adone.event.Emitter().propagateEvents(new adone.event.Emitter(), ["a"]); + e.end(); + } + + namespace staticPropagateEvents { + const e = adone.event.Emitter.propagateEvents(new adone.event.Emitter(), new adone.event.Emitter(), ["a"]); + e.end(); } } namespace AsyncEmitter { - const a: adone.event.EventEmitter = new adone.event.AsyncEmitter(); + const a: adone.event.Emitter = new adone.event.AsyncEmitter(); new adone.event.AsyncEmitter(10); namespace setConcurrency { diff --git a/types/adone/test/glosses/exceptions.ts b/types/adone/test/glosses/exceptions.ts index e13dc3fff7..d9694990d0 100644 --- a/types/adone/test/glosses/exceptions.ts +++ b/types/adone/test/glosses/exceptions.ts @@ -1,36 +1,36 @@ namespace ExcetpionsTests { - { const a: Error = new adone.x.Exception(); } - { const a: Error = new adone.x.Exception("message"); } - { const a: Error = new adone.x.Exception(new Error()); } - { const a: Error = new adone.x.Exception(new Error(), true); } - { const a: adone.x.Exception = new adone.x.Runtime(); } - { const a: adone.x.Exception = new adone.x.IncompleteBufferError(); } - { const a: adone.x.Exception = new adone.x.NotImplemented(); } - { const a: adone.x.Exception = new adone.x.IllegalState(); } - { const a: adone.x.Exception = new adone.x.NotValid(); } - { const a: adone.x.Exception = new adone.x.Unknown(); } - { const a: adone.x.Exception = new adone.x.NotExists(); } - { const a: adone.x.Exception = new adone.x.Exists(); } - { const a: adone.x.Exception = new adone.x.Empty(); } - { const a: adone.x.Exception = new adone.x.InvalidAccess(); } - { const a: adone.x.Exception = new adone.x.NotSupported(); } - { const a: adone.x.Exception = new adone.x.InvalidArgument(); } - { const a: adone.x.Exception = new adone.x.InvalidNumberOfArguments(); } - { const a: adone.x.Exception = new adone.x.NotFound(); } - { const a: adone.x.Exception = new adone.x.Timeout(); } - { const a: adone.x.Exception = new adone.x.Incorrect(); } - { const a: adone.x.Exception = new adone.x.NotAllowed(); } - { const a: adone.x.Exception = new adone.x.LimitExceeded(); } - { const a: adone.x.Exception = new adone.x.Encoding(); } - { const a: adone.x.Exception = new adone.x.Network(); } - { const a: adone.x.Exception = new adone.x.Bind(); } - { const a: adone.x.Exception = new adone.x.Connect(); } - { const a: adone.x.Exception = new adone.x.Database(); } - { const a: adone.x.Exception = new adone.x.DatabaseInitialization(); } - { const a: adone.x.Exception = new adone.x.DatabaseOpen(); } - { const a: adone.x.Exception = new adone.x.DatabaseRead(); } - { const a: adone.x.Exception = new adone.x.DatabaseWrite(); } - { const a: adone.x.Exception = new adone.x.NetronIllegalState(); } - { const a: adone.x.Exception = new adone.x.NetronPeerDisconnected(); } - { const a: adone.x.Exception = new adone.x.NetronTimeout(); } + { const a: Error = new adone.exception.Exception(); } + { const a: Error = new adone.exception.Exception("message"); } + { const a: Error = new adone.exception.Exception(new Error()); } + { const a: Error = new adone.exception.Exception(new Error(), true); } + { const a: adone.exception.Exception = new adone.exception.Runtime(); } + { const a: adone.exception.Exception = new adone.exception.IncompleteBufferError(); } + { const a: adone.exception.Exception = new adone.exception.NotImplemented(); } + { const a: adone.exception.Exception = new adone.exception.IllegalState(); } + { const a: adone.exception.Exception = new adone.exception.NotValid(); } + { const a: adone.exception.Exception = new adone.exception.Unknown(); } + { const a: adone.exception.Exception = new adone.exception.NotExists(); } + { const a: adone.exception.Exception = new adone.exception.Exists(); } + { const a: adone.exception.Exception = new adone.exception.Empty(); } + { const a: adone.exception.Exception = new adone.exception.InvalidAccess(); } + { const a: adone.exception.Exception = new adone.exception.NotSupported(); } + { const a: adone.exception.Exception = new adone.exception.InvalidArgument(); } + { const a: adone.exception.Exception = new adone.exception.InvalidNumberOfArguments(); } + { const a: adone.exception.Exception = new adone.exception.NotFound(); } + { const a: adone.exception.Exception = new adone.exception.Timeout(); } + { const a: adone.exception.Exception = new adone.exception.Incorrect(); } + { const a: adone.exception.Exception = new adone.exception.NotAllowed(); } + { const a: adone.exception.Exception = new adone.exception.LimitExceeded(); } + { const a: adone.exception.Exception = new adone.exception.Encoding(); } + { const a: adone.exception.Exception = new adone.exception.Network(); } + { const a: adone.exception.Exception = new adone.exception.Bind(); } + { const a: adone.exception.Exception = new adone.exception.Connect(); } + { const a: adone.exception.Exception = new adone.exception.Database(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseInitialization(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseOpen(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseRead(); } + { const a: adone.exception.Exception = new adone.exception.DatabaseWrite(); } + { const a: adone.exception.Exception = new adone.exception.NetronIllegalState(); } + { const a: adone.exception.Exception = new adone.exception.NetronPeerDisconnected(); } + { const a: adone.exception.Exception = new adone.exception.NetronTimeout(); } } diff --git a/types/adone/test/glosses/fake.ts b/types/adone/test/glosses/fake.ts new file mode 100644 index 0000000000..016d7ba7b0 --- /dev/null +++ b/types/adone/test/glosses/fake.ts @@ -0,0 +1,206 @@ +namespace adoneTests.fake { + const { + fake + } = adone; + + { const a: string = fake.address.zipCode(); } + { const a: string = fake.address.zipCode('###'); } + { const a: string = fake.address.city(); } + { const a: string = fake.address.city(0); } + { const a: string = fake.address.cityPrefix(); } + { const a: string = fake.address.citySuffix(); } + { const a: string = fake.address.streetName(); } + { const a: string = fake.address.streetAddress(); } + { const a: string = fake.address.streetAddress(false); } + { const a: string = fake.address.streetSuffix(); } + { const a: string = fake.address.streetPrefix(); } + { const a: string = fake.address.secondaryAddress(); } + { const a: string = fake.address.county(); } + { const a: string = fake.address.country(); } + { const a: string = fake.address.countryCode(); } + { const a: string = fake.address.state(); } + { const a: string = fake.address.state(false); } + { const a: string = fake.address.stateAbbr(); } + { const a: string = fake.address.latitude(); } + { const a: string = fake.address.longitude(); } + + { const a: string = fake.commerce.color(); } + { const a: string = fake.commerce.department(); } + { const a: string = fake.commerce.productName(); } + { const a: string = fake.commerce.price(); } + { const a: string = fake.commerce.price(0, 0, 0, '#'); } + { const a: string = fake.commerce.productAdjective(); } + { const a: string = fake.commerce.productMaterial(); } + { const a: string = fake.commerce.product(); } + + { const a: string[] = fake.company.suffixes(); } + { const a: string = fake.company.companyName(); } + { const a: string = fake.company.companyName(0); } + { const a: string = fake.company.companySuffix(); } + { const a: string = fake.company.catchPhrase(); } + { const a: string = fake.company.bs(); } + { const a: string = fake.company.catchPhraseAdjective(); } + { const a: string = fake.company.catchPhraseDescriptor(); } + { const a: string = fake.company.catchPhraseNoun(); } + { const a: string = fake.company.bsAdjective(); } + { const a: string = fake.company.bsBuzz(); } + { const a: string = fake.company.bsNoun(); } + + { const a: string = fake.database.column(); } + { const a: string = fake.database.type(); } + { const a: string = fake.database.collation(); } + { const a: string = fake.database.engine(); } + + { const a: Date = fake.date.past(); } + { const a: Date = fake.date.future(); } + { const a: Date = fake.date.between('foo', 'bar'); } + { const a: Date = fake.date.between(new Date(), new Date()); } + { const a: Date = fake.date.recent(); } + { const a: Date = fake.date.recent(100); } + { const a: Date = fake.date.soon(); } + { const a: Date = fake.date.soon(30); } + { const a: string = fake.date.month(); } + { const a: string = fake.date.month({ + abbr: true, + context: true + }); } + { const a: string = fake.date.weekday(); } + { const a: string = fake.date.weekday({ + abbr: true, + context: true + }); } + + { const a: string = fake.finance.account(); } + { const a: string = fake.finance.account(0); } + { const a: string = fake.finance.accountName(); } + { const a: string = fake.finance.mask(); } + { const a: string = fake.finance.mask(0, false, false); } + { const a: string = fake.finance.amount(); } + { const a: string = fake.finance.amount(0, 0, 0, '#'); } + { const a: string = fake.finance.transactionType(); } + { const a: string = fake.finance.currencyCode(); } + { const a: string = fake.finance.currencyName(); } + { const a: string = fake.finance.currencySymbol(); } + { const a: string = fake.finance.bitcoinAddress(); } + { const a: string = fake.finance.ethereumAddress(); } + { const a: string = fake.finance.iban(); } + { const a: string = fake.finance.iban(true); } + { const a: string = fake.finance.bic(); } + + { const a: string = fake.hacker.abbreviation(); } + { const a: string = fake.hacker.adjective(); } + { const a: string = fake.hacker.noun(); } + { const a: string = fake.hacker.verb(); } + { const a: string = fake.hacker.ingverb(); } + { const a: string = fake.hacker.phrase(); } + + { const a: string = fake.helpers.randomize(); } + { const a: number = fake.helpers.randomize([1, 2, 3, 4]); } + { const a: string = fake.helpers.randomize(['foo', 'bar', 'quux']); } + { const a: string = fake.helpers.slugify('foo bar quux'); } + { const a: string = fake.helpers.replaceSymbolWithNumber('foo# bar#'); } + { const a: string = fake.helpers.replaceSymbols('foo# bar? quux#'); } + { const a: string[] = fake.helpers.shuffle(['foo', 'bar', 'quux']); } + { const a: string = fake.helpers.mustache('{{foo}}{{bar}}', {foo: 'x', bar: 'y'}); } + + const card = fake.helpers.createCard(); + { const a: string = card.name; } + { const a: string = card.address.streetA; } + const contextualCard = fake.helpers.contextualCard(); + { const a: string = contextualCard.name; } + { const a: string = contextualCard.address.suite; } + const userCard = fake.helpers.userCard(); + { const a: string = userCard.name; } + { const a: string = userCard.address.suite; } + + { const a: string = fake.internet.avatar(); } + { const a: string = fake.internet.email(); } + { const a: string = fake.internet.email('foo', 'bar', 'quux'); } + { const a: string = fake.internet.exampleEmail(); } + { const a: string = fake.internet.exampleEmail('foo', 'bar'); } + { const a: string = fake.internet.protocol(); } + { const a: string = fake.internet.url(); } + { const a: string = fake.internet.domainName(); } + { const a: string = fake.internet.domainSuffix(); } + { const a: string = fake.internet.domainWord(); } + { const a: string = fake.internet.ip(); } + { const a: string = fake.internet.userAgent(); } + { const a: string = fake.internet.color(); } + { const a: string = fake.internet.color(0, 0, 0); } + { const a: string = fake.internet.mac(); } + { const a: string = fake.internet.password(); } + { const a: string = fake.internet.password(0, false, '#', 'foo'); } + + { const a: string = fake.lorem.word(); } + { const a: string = fake.lorem.words(); } + { const a: string = fake.lorem.words(0); } + { const a: string = fake.lorem.sentence(); } + { const a: string = fake.lorem.sentence(0, 0); } + { const a: string = fake.lorem.slug(); } + { const a: string = fake.lorem.slug(0); } + { const a: string = fake.lorem.sentences(); } + { const a: string = fake.lorem.sentences(0); } + { const a: string = fake.lorem.paragraph(); } + { const a: string = fake.lorem.paragraph(0); } + { const a: string = fake.lorem.paragraphs(); } + { const a: string = fake.lorem.paragraphs(0, ''); } + { const a: string = fake.lorem.text(); } + { const a: string = fake.lorem.text(0); } + { const a: string = fake.lorem.lines(); } + { const a: string = fake.lorem.lines(0); } + + { const a: string = fake.name.firstName(); } + { const a: string = fake.name.firstName(0); } + { const a: string = fake.name.lastName(); } + { const a: string = fake.name.lastName(0); } + { const a: string = fake.name.findName(); } + { const a: string = fake.name.findName('', '', 0); } + { const a: string = fake.name.jobTitle(); } + { const a: string = fake.name.prefix(); } + { const a: string = fake.name.suffix(); } + { const a: string = fake.name.title(); } + { const a: string = fake.name.jobDescriptor(); } + { const a: string = fake.name.jobArea(); } + { const a: string = fake.name.jobType(); } + + { const a: string = fake.phone.phoneNumber(); } + { const a: string = fake.phone.phoneNumber('#'); } + { const a: string = fake.phone.phoneNumberFormat(); } + { const a: string = fake.phone.phoneNumberFormat(0); } + { const a: string = fake.phone.phoneFormats(); } + + { const a: number = fake.random.number(); } + { const a: number = fake.random.number(0); } + { const a: number = fake.random.number({ + min: 0, + max: 0, + precision: 0 + }); } + { const a: string = fake.random.arrayElement(); } + { const a: string = fake.random.arrayElement(['foo', 'bar', 'quux']); } + { const a: string = fake.random.objectElement(); } + { const a: string = fake.random.objectElement({foo: 'bar', field: 'foo'}); } + { const a: string = fake.random.uuid(); } + { const a: boolean = fake.random.boolean(); } + { const a: string = fake.random.word(); } + { const a: string = fake.random.word("noun"); } + { const a: string = fake.random.words(); } + { const a: string = fake.random.words(0); } + { const a: string = fake.random.image(); } + { const a: string = fake.random.locale(); } + { const a: string = fake.random.alphaNumeric(); } + { const a: string = fake.random.alphaNumeric(0); } + { const a: string = fake.random.hexaDecimal(); } + { const a: string = fake.random.hexaDecimal(3); } + + { const a: string = fake.system.fileName("foo", "bar"); } + { const a: string = fake.system.commonFileName("foo", "bar"); } + { const a: string = fake.system.mimeType(); } + { const a: string = fake.system.commonFileType(); } + { const a: string = fake.system.commonFileExt(); } + { const a: string = fake.system.fileType(); } + { const a: string = fake.system.fileExt("foo"); } + { const a: string = fake.system.directoryPath(); } + { const a: string = fake.system.filePath(); } + { const a: string = fake.system.semver(); } +} diff --git a/types/adone/test/glosses/fs.ts b/types/adone/test/glosses/fs.ts index 8b7e765c9f..e7c5333624 100644 --- a/types/adone/test/glosses/fs.ts +++ b/types/adone/test/glosses/fs.ts @@ -11,6 +11,15 @@ namespace fsTests { fs.readlink("file", null).then((x: Buffer) => x); fs.readlink("file", "hex").then((x: string) => x); fs.readlink("file").then((x: string) => x); + fs.readlinkSync("file"); + fs.readlinkSync(Buffer.from("file")); + fs.readlinkSync(new URL("file://file")); + { const a: string = fs.readlinkSync("file", {}); } + { const a: string = fs.readlinkSync("file", { encoding: "utf8" }); } + { const a: Buffer = fs.readlinkSync("file", { encoding: null }); } + { const a: Buffer = fs.readlinkSync("file", null); } + { const a: string = fs.readlinkSync("file", "hex"); } + { const a: string = fs.readlinkSync("file"); } } namespace unlinkTests { @@ -22,6 +31,24 @@ namespace fsTests { fs.unlinkSync(new URL("file://file")); } + namespace utimesTests { + fs.utimes("hello", 100, 100).then(() => {}); + fs.utimes(Buffer.from("hello"), 100, 100).then(() => {}); + fs.utimes(new URL("hello"), 100, 100).then(() => {}); + fs.utimes("hello", "100", "100").then(() => {}); + fs.utimes("hello", new Date(100), new Date(100)).then(() => {}); + + fs.utimesSync("hello", 100, 100); + fs.utimesSync(Buffer.from("hello"), 100, 100); + fs.utimesSync(new URL("hello"), 100, 100); + fs.utimesSync("hello", "100", "100"); + fs.utimesSync("hello", new Date(100), new Date(100)); + + fs.utimesMillis("hello", 100, 100); + fs.utimesMillis(Buffer.from("hello"), 100, 100); + fs.utimesMillis(new URL("hello"), 100, 100); + } + namespace chmodTests { fs.chmod("file", 0o333).then(() => {}); fs.chmod(Buffer.from("file"), 0o333).then(() => {}); @@ -60,6 +87,87 @@ namespace fsTests { const e: Buffer[] = fs.readdirSync("file", { encoding: null }); } + namespace readdirpTests { + fs.readdirp("hello").forEach((entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + }); + + fs.readdirp(Buffer.from("hello")); + fs.readdirp(new URL("hello")); + fs.readdirp("hello", {}); + fs.readdirp("hello", { depth: 100 }); + fs.readdirp("hello", { directories: true }); + fs.readdirp("hello", { directoryFilter: () => true }); + fs.readdirp("hello", { + directoryFilter: (entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + } + }); + fs.readdirp("hello", { + directoryFilter: [(entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + }] + }); + fs.readdirp("hello", { + directoryFilter: ["*"] + }); + fs.readdirp("hello", { + directoryFilter: "*" + }); + fs.readdirp("hello", { fileFilter: () => true }); + fs.readdirp("hello", { + fileFilter: (entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + } + }); + fs.readdirp("hello", { + fileFilter: [(entry) => { + { const a: string = entry.fullParentDir; } + { const a: string = entry.fullPath; } + { const a: string = entry.name; } + { const a: string = entry.parentDir; } + { const a: string = entry.path; } + { const a: adone.fs.I.Stats = entry.stat; } + return true; + }] + }); + fs.readdirp("hello", { + fileFilter: ["*"] + }); + fs.readdirp("hello", { + fileFilter: "*" + }); + fs.readdirp("hello", { + files: false + }); + fs.readdirp("hello", { + lstat: true + }); + } + namespace lstatTests { fs.lstat("file").then((x: nodestd.fs.Stats) => {}); fs.lstat(Buffer.from("file")).then((x: nodestd.fs.Stats) => {}); @@ -119,6 +227,15 @@ namespace fsTests { fs.appendFile("file", "hello", { encoding: "utf8" }).then(() => {}); fs.appendFile("file", "hello", { mode: 0o755 }).then(() => {}); fs.appendFile("file", "hello", { flag: "w" }).then(() => {}); + + fs.appendFileSync("file", "hello"); + fs.appendFileSync(Buffer.from("file"), "hello"); + fs.appendFileSync(10, "hello"); + fs.appendFileSync("file", Buffer.from("hello")); + fs.appendFileSync("file", "hello", {}); + fs.appendFileSync("file", "hello", { encoding: "utf8" }); + fs.appendFileSync("file", "hello", { mode: 0o755 }); + fs.appendFileSync("file", "hello", { flag: "w" }); } namespace accessTests { @@ -153,6 +270,12 @@ namespace fsTests { fs.rm("file", { cwd: __dirname }).then((x) => {}); } + namespace rmEmptyTests { + fs.rmEmpty("file").then(() => {}); + fs.rmEmpty("file", { cwd: "a" }).then(() => {}); + fs.rmEmpty("file", { filter: (filename) => filename.charCodeAt(0) === 100 }).then(() => {}); + } + namespace ModeTests { const stat = fs.statSync("file"); const mode = new fs.Mode(stat); @@ -513,37 +636,36 @@ namespace fsTests { } namespace fdTests { - const { fd } = fs; - fd.open("hello", "r+").then((x: number) => {}); - fd.open(Buffer.from("hello"), "r+").then((x: number) => {}); - fd.open(new URL("file://hello"), "r+").then((x: number) => {}); - { const a: number = fd.openSync("hello", "r+"); } - { const a: number = fd.openSync(Buffer.from("hello"), "r+"); } - { const a: number = fd.openSync(new URL("file://hello"), "r+"); } - fd.close(10).then(() => {}); - fd.closeSync(10); - fd.utimes(10, 100500, 100500).then(() => {}); - fd.utimesSync(10, 100500, 100500); - fd.stat(10).then((x: adone.fs.I.Stats) => {}); - { const a: adone.fs.I.Stats = fd.statSync(10); } - fd.truncate(10).then(() => {}); - fd.truncate(10, 10).then(() => {}); - fd.truncateSync(10); - fd.truncateSync(10, 10); - fd.read(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); - { const a: number = fd.readSync(10, Buffer.alloc(10), 0, 10, 10); } - fd.write(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); - { const a: number = fd.writeSync(10, Buffer.alloc(10), 0, 10, 10); } - fd.write(10, "hello", 10, "utf8").then((x: number) => {}); - { const a: number = fd.writeSync(10, "hello", 10, "utf8"); } - fd.sync(10).then(() => {}); - fd.syncSync(10); - fd.chown(10, 0, 0).then(() => {}); - fd.chownSync(10, 0, 0); - fd.chmod(10, 0o755).then(() => {}); - fd.chmodSync(10, 0o755); - fd.seek(10, 100, 0).then((x: number) => {}); - fd.lock(10, "sh").then(() => {}); + fs.open("hello", "r+").then((x: number) => {}); + fs.open(Buffer.from("hello"), "r+").then((x: number) => {}); + fs.open(new URL("file://hello"), "r+").then((x: number) => {}); + { const a: number = fs.openSync("hello", "r+"); } + { const a: number = fs.openSync(Buffer.from("hello"), "r+"); } + { const a: number = fs.openSync(new URL("file://hello"), "r+"); } + fs.close(10).then(() => {}); + fs.closeSync(10); + fs.futimes(10, 100500, 100500).then(() => {}); + fs.futimesSync(10, 100500, 100500); + fs.fstat(10).then((x: adone.fs.I.Stats) => {}); + { const a: adone.fs.I.Stats = fs.fstatSync(10); } + fs.ftruncate(10).then(() => {}); + fs.ftruncate(10, 10).then(() => {}); + fs.ftruncateSync(10); + fs.ftruncateSync(10, 10); + fs.read(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); + { const a: number = fs.readSync(10, Buffer.alloc(10), 0, 10, 10); } + fs.write(10, Buffer.alloc(10), 0, 10, 10).then((x: number) => {}); + { const a: number = fs.writeSync(10, Buffer.alloc(10), 0, 10, 10); } + fs.write(10, "hello", 10, "utf8").then((x: number) => {}); + { const a: number = fs.writeSync(10, "hello", 10, "utf8"); } + fs.fsync(10).then(() => {}); + fs.fsyncSync(10); + fs.fchown(10, 0, 0).then(() => {}); + fs.fchownSync(10, 0, 0); + fs.fchmod(10, 0o755).then(() => {}); + fs.fchmodSync(10, 0o755); + fs.seek(10, 100, 0).then((x: number) => {}); + fs.flock(10, "sh").then(() => {}); } namespace constantsTests { @@ -668,13 +790,44 @@ namespace fsTests { namespace mkdirTests { fs.mkdir("/path/to/some/dir").then(() => {}); fs.mkdir("/path/to/some/dir", 0o755).then(() => {}); + + fs.mkdirSync("/path/to/some/dir").then(() => {}); + fs.mkdirSync("/path/to/some/dir", 0o755).then(() => {}); + } + + namespace mkdirTests { + fs.mkdirp("/path/to/some/dir").then(() => {}); + fs.mkdirp("/path/to/some/dir", 0o755).then(() => {}); + + fs.mkdirpSync("/path/to/some/dir").then(() => {}); + fs.mkdirpSync("/path/to/some/dir", 0o755).then(() => {}); } namespace copyTests { fs.copy("a", "b").then(() => {}); - fs.copy("a", "b", {}).then(() => {}); - fs.copy("a", "b", { cwd: "/tmp" }).then(() => {}); - fs.copy("a", "b", { ignoreExisting: true }).then(() => {}); + fs.copy("a", "b", {}); + fs.copy("a", "b", { clobber: true }).then(() => {}); + fs.copy("a", "b", { overwrite: true }).then(() => {}); + fs.copy("a", "b", { filter: /asd/ }).then(() => {}); + fs.copy("a", "b", { filter: () => true }).then(() => {}); + fs.copy("a", "b", { filter: (a) => a.charCodeAt(0) === 100 }).then(() => {}); + fs.copy("a", "b", { + transform(r, w, file) { + file.atime.getDay(); + file.mtime.getDay(); + file.mode.toExponential(); + file.name.charCodeAt(0); + file.stats.atimeMs.toExponential(); + r.pipe(w); + } + }).then(() => {}); + } + + namespace copyTests { + fs.copyTo("a", "b").then(() => {}); + fs.copyTo("a", "b", {}); + fs.copyTo("a", "b", { cwd: "/tmp" }).then(() => {}); + fs.copyTo("a", "b", { ignoreExisting: true }).then(() => {}); } namespace renameTests { @@ -689,6 +842,7 @@ namespace fsTests { fs.tail("file", 10, {}).then((x: Buffer[]) => {}); fs.tail("file", 10, { separator: "\n" }).then((x: Buffer[]) => {}); fs.tail("file", 10, { chunkLength: 4096 }).then((x: Buffer[]) => {}); + fs.tail("file", 10, { pos: 10 }).then((x: Buffer[]) => {}); } namespace statVFSTests { diff --git a/types/adone/test/glosses/is.ts b/types/adone/test/glosses/is.ts index 2734824822..2065dfe01b 100644 --- a/types/adone/test/glosses/is.ts +++ b/types/adone/test/glosses/is.ts @@ -1,115 +1,423 @@ namespace isTests { - { const a: boolean = adone.is.null({}); } - { const a: boolean = adone.is.undefined({}); } - { const a: boolean = adone.is.exist({}); } - { const a: boolean = adone.is.nil({}); } - { const a: boolean = adone.is.number({}); } - { const a: boolean = adone.is.numeral({}); } - { const a: boolean = adone.is.infinite({}); } - { const a: boolean = adone.is.odd({}); } - { const a: boolean = adone.is.even({}); } - { const a: boolean = adone.is.float({}); } - { const a: boolean = adone.is.negativeZero({}); } - { const a: boolean = adone.is.string({}); } - { const a: boolean = adone.is.emptyString({}); } - { const a: boolean = adone.is.substring("abc", "abcdef"); } - { const a: boolean = adone.is.substring("abc", "abcdef", 0); } - { const a: boolean = adone.is.prefix("abc", "abcdef"); } - { const a: boolean = adone.is.suffix("def", "abbdef"); } - { const a: boolean = adone.is.boolean({}); } - { const a: boolean = adone.is.json({}); } - { const a: boolean = adone.is.object({}); } - { const a: boolean = adone.is.plainObject({}); } - { const a: boolean = adone.is.class({}); } - { const a: boolean = adone.is.emptyObject({}); } - { const a: boolean = adone.is.propertyOwned({}, "a"); } - { const a: boolean = adone.is.propertyDefined({}, "a"); } - { const a: boolean = adone.is.conforms({}, {}); } - { const a: boolean = adone.is.conforms({}, {}, true); } - { const a: boolean = adone.is.arrayLikeObject({}); } - { const a: boolean = adone.is.inArray(1, [1, 2, 3]); } - { const a: boolean = adone.is.inArray(1, [1, 2, 3], 0); } - { const a: boolean = adone.is.inArray(1, [1, 2, 3], 0, (a, b) => a === b); } - { const a: boolean = adone.is.sameType({}, {}); } - { const a: boolean = adone.is.primitive({}); } - { const a: boolean = adone.is.equalArrays([], []); } - { const a: boolean = adone.is.deepEqual({}, {}); } - { const a: boolean = adone.is.shallowEqual({}, {}); } - { const a: boolean = adone.is.stream({}); } - { const a: boolean = adone.is.writableStream({}); } - { const a: boolean = adone.is.readableStream({}); } - { const a: boolean = adone.is.duplexStream({}); } - { const a: boolean = adone.is.transformStream({}); } - { const a: boolean = adone.is.utf8(Buffer.alloc(10)); } - { const a: boolean = adone.is.win32PathAbsolute("abc"); } - { const a: boolean = adone.is.posixPathAbsolute("abc"); } - { const a: boolean = adone.is.pathAbsolute("abc"); } - { const a: boolean = adone.is.glob("abc"); } - { const a: boolean = adone.is.dotfile("abc"); } - { const a: boolean = adone.is.function(() => { }); } - { const a: boolean = adone.is.asyncFunction(async () => { }); } - { const a: boolean = adone.is.promise({}); } - { const a: boolean = adone.is.validDate("07.08.2017"); } - { const a: boolean = adone.is.buffer({}); } - { const a: boolean = adone.is.callback({}); } - { const a: boolean = adone.is.generator({}); } - { const a: boolean = adone.is.nan({}); } - { const a: boolean = adone.is.finite({}); } - { const a: boolean = adone.is.integer({}); } - { const a: boolean = adone.is.safeInteger({}); } - { const a: boolean = adone.is.array({}); } - { const a: boolean = adone.is.uint8Array({}); } - { const a: boolean = adone.is.configuration({}); } - { const a: boolean = adone.is.long({}); } - { const a: boolean = adone.is.bigNumber({}); } - { const a: boolean = adone.is.byteArray({}); } - { const a: boolean = adone.is.datetime({}); } - { const a: boolean = adone.is.transform({}); } - { const a: boolean = adone.is.subsystem({}); } - { const a: boolean = adone.is.application({}); } - { const a: boolean = adone.is.logger({}); } - { const a: boolean = adone.is.coreStream({}); } - { const a: boolean = adone.is.fastStream({}); } - { const a: boolean = adone.is.fastLocalStream({}); } - { const a: boolean = adone.is.fastLocalMapStream({}); } - { const a: boolean = adone.is.genesisNetron({}); } - { const a: boolean = adone.is.genesisPeer({}); } - { const a: boolean = adone.is.netronAdapter({}); } - { const a: boolean = adone.is.netron({}); } - { const a: boolean = adone.is.netronPeer({}); } - { const a: boolean = adone.is.netronDefinition({}); } - { const a: boolean = adone.is.netronDefinitions({}); } - { const a: boolean = adone.is.netronReference({}); } - { const a: boolean = adone.is.netronInterface({}); } - { const a: boolean = adone.is.netronContext({}); } - { const a: boolean = adone.is.netronIMethod({}, "hello"); } - { const a: boolean = adone.is.netronIProperty({}, "hello"); } - { const a: boolean = adone.is.netronStub({}); } - { const a: boolean = adone.is.netronRemoteStub({}); } - { const a: boolean = adone.is.netronStream({}); } - { const a: boolean = adone.is.iterable({}); } - { const a: boolean = adone.is.windows; } - { const a: boolean = adone.is.linux; } - { const a: boolean = adone.is.freebsd; } - { const a: boolean = adone.is.darwin; } - { const a: boolean = adone.is.sunos; } - { const a: boolean = adone.is.uppercase("abc"); } - { const a: boolean = adone.is.lowercase("abc"); } - { const a: boolean = adone.is.digits("012"); } - { const a: boolean = adone.is.identifier("someMethod"); } - { const a: boolean = adone.is.binaryExtension("mp3"); } - { const a: boolean = adone.is.binaryPath("a.mp3"); } - { const a: boolean = adone.is.ip4("192.168.1.1"); } - { const a: boolean = adone.is.ip6("::192.168.1.1"); } - { const a: boolean = adone.is.arrayBuffer({}); } - { const a: boolean = adone.is.arrayBufferView({}); } - { const a: boolean = adone.is.date({}); } - { const a: boolean = adone.is.error({}); } - { const a: boolean = adone.is.map({}); } - { const a: boolean = adone.is.regexp({}); } - { const a: boolean = adone.is.set({}); } - { const a: boolean = adone.is.symbol({}); } - { const a: boolean = adone.is.validUTF8(Buffer.from("hello")); } - { const a: boolean = adone.is.vaultValuable({}); } - { const a: boolean = adone.is.task({}); } + const { + is + } = adone; + { + const a: boolean = is.null({}); + const b: any = 2; + if (is.null(b)) { + const c: null = b; + } + } + { + const a: boolean = is.undefined({}); + const b: any = 2; + if (is.undefined(b)) { + const c: undefined = b; + } + } + { const a: boolean = is.exist({}); } + { + const a: boolean = is.nil({}); + const b: any = 2; + if (is.nil(b)) { + const c: null | undefined = b; + } + } + { + const a: boolean = is.number({}); + const b: any = 2; + if (is.number(b)) { + b.toExponential(); + } + } + { + const a: boolean = is.numeral({}); + const b: any = 2; + if (is.numeral(b)) { + const c: string | number = b; + } + } + { + const a: boolean = is.infinite({}); + const b: any = 2; + if (is.infinite(b)) { + b.toPrecision(); + } + } + { + const a: boolean = is.odd({}); + const b: any = 2; + if (is.odd(b)) { + b.toFixed(2); + } + } + { + const a: boolean = is.even({}); + const b: any = 2; + if (is.even(b)) { + b.toFixed(2); + } + } + { + const a: boolean = is.float({}); + const b: any = 2; + if (is.float(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.negativeZero({}); + const b: any = 2; + if (is.negativeZero(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.string({}); + const b: any = 2; + if (is.string(b)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.emptyString({}); + const b: any = 2; + if (is.emptyString(b)) { + b.charCodeAt(0); + } + } + { const a: boolean = is.substring("abc", "abcdef"); } + { const a: boolean = is.substring("abc", "abcdef", 0); } + { const a: boolean = is.prefix("abc", "abcdef"); } + { const a: boolean = is.suffix("def", "abbdef"); } + { + const a: boolean = is.boolean({}); + const b: any = 2; + if (is.boolean(b)) { + b === true; + } + } + { const a: boolean = is.json({}); } + { const a: boolean = is.object({}); } + { const a: boolean = is.plainObject({}); } + { const a: boolean = is.class({}); } + { const a: boolean = is.emptyObject({}); } + { const a: boolean = is.propertyOwned({}, "a"); } + { const a: boolean = is.propertyDefined({}, "a"); } + { const a: boolean = is.conforms({}, {}); } + { const a: boolean = is.conforms({}, {}, true); } + { const a: boolean = is.arrayLikeObject({}); } + { const a: boolean = is.inArray(1, [1, 2, 3]); } + { const a: boolean = is.inArray(1, [1, 2, 3], 0); } + { const a: boolean = is.inArray(1, [1, 2, 3], 0, (a, b) => a === b); } + { const a: boolean = is.sameType({}, {}); } + { const a: boolean = is.primitive({}); } + { const a: boolean = is.equalArrays([], []); } + { const a: boolean = is.deepEqual({}, {}); } + { const a: boolean = is.shallowEqual({}, {}); } + { const a: boolean = is.stream({}); } + { const a: boolean = is.writableStream({}); } + { const a: boolean = is.readableStream({}); } + { const a: boolean = is.duplexStream({}); } + { const a: boolean = is.transformStream({}); } + { const a: boolean = is.utf8(Buffer.alloc(10)); } + { const a: boolean = is.win32PathAbsolute("abc"); } + { const a: boolean = is.posixPathAbsolute("abc"); } + { const a: boolean = is.pathAbsolute("abc"); } + { + const a: boolean = is.glob("abc"); + const b: any = 2; + if (is.glob(b)) { + b.charCodeAt(0); + } + } + { const a: boolean = is.dotfile("abc"); } + { + const a: boolean = is.function(() => { }); + const b: any = 2; + if (is.function(b)) { + b(); + } + } + { + const a: boolean = is.asyncFunction(async () => { }); + const b: any = 2; + if (is.asyncFunction(b)) { + b().then(() => {}); + } + } + { + const a: boolean = is.promise({}); + const b: any = 2; + if (is.promise(b)) { + b.then(() => {}); + } + const c = Promise.resolve(2); + if (is.promise(c)) { + c.then((x) => x.toFixed(2)); + } + } + { const a: boolean = is.validDate("07.08.2017"); } + { + const a: boolean = is.buffer({}); + const b: any = 2; + if (is.buffer(b)) { + b.writeDoubleBE(10, 10); + } + } + { const a: boolean = is.callback({}); } + { const a: boolean = is.generator({}); } + { const a: boolean = is.nan({}); } + { + const a: boolean = is.finite({}); + const b: any = 2; + if (is.finite(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.integer({}); + const b: any = 2; + if (is.integer(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.safeInteger({}); + const b: any = 2; + if (is.safeInteger(b)) { + b.toFixed(); + } + } + { + const a: boolean = is.array({}); + const b: any = 2; + if (is.array(b)) { + b.length + b[0]; + } + const c = [1, 2, 3]; + if (is.array(c)) { + c[0].toFixed(0); + } + } + { + const a: boolean = is.uint8Array({}); + const b: any = 2; + if (is.uint8Array(b)) { + b.copyWithin(1, 2); + } + } + { const a: boolean = is.configuration({}); } + { + const a: boolean = is.long({}); + const b: any = 2; + if (is.long(b)) { + b.getHighBitsUnsigned(); + } + } + { + const a: boolean = is.bigNumber({}); + const b: any = 2; + if (is.bigNumber(b)) { + b.add(b).isBitSet(10); + } + } + { + const a: boolean = is.byteArray({}); + const b: any = 2; + if (is.byteArray(b)) { + b.toBuffer(); + } + } + { + const a: boolean = is.datetime({}); + const b: any = 2; + if (is.datetime(b)) { + b.add(2, "hours"); + } + } + { const a: boolean = is.transform({}); } + { const a: boolean = is.subsystem({}); } + { const a: boolean = is.application({}); } + { const a: boolean = is.logger({}); } + { const a: boolean = is.coreStream({}); } + { const a: boolean = is.fastStream({}); } + { const a: boolean = is.fastLocalStream({}); } + { const a: boolean = is.fastLocalMapStream({}); } + { const a: boolean = is.genesisNetron({}); } + { const a: boolean = is.genesisPeer({}); } + { const a: boolean = is.netronAdapter({}); } + { const a: boolean = is.netron({}); } + { const a: boolean = is.netronPeer({}); } + { const a: boolean = is.netronDefinition({}); } + { const a: boolean = is.netronDefinitions({}); } + { const a: boolean = is.netronReference({}); } + { const a: boolean = is.netronInterface({}); } + { const a: boolean = is.netronContext({}); } + { const a: boolean = is.netronIMethod({}, "hello"); } + { const a: boolean = is.netronIProperty({}, "hello"); } + { const a: boolean = is.netronStub({}); } + { const a: boolean = is.netronRemoteStub({}); } + { const a: boolean = is.netronStream({}); } + { const a: boolean = is.iterable({}); } + { const a: boolean = is.windows; } + { const a: boolean = is.linux; } + { const a: boolean = is.freebsd; } + { const a: boolean = is.darwin; } + { const a: boolean = is.sunos; } + { const a: boolean = is.uppercase("abc"); } + { const a: boolean = is.lowercase("abc"); } + { const a: boolean = is.digits("012"); } + { const a: boolean = is.identifier("someMethod"); } + { const a: boolean = is.binaryExtension("mp3"); } + { const a: boolean = is.binaryPath("a.mp3"); } + { const a: boolean = is.ip4("192.168.1.1"); } + { const a: boolean = is.ip6("::192.168.1.1"); } + { + const a: boolean = is.arrayBuffer({}); + const b: any = 2; + if (is.arrayBuffer(b)) { + b.slice(10); + } + } + { + const a: boolean = is.arrayBufferView({}); + const b: any = 2; + if (is.arrayBufferView(b)) { + b.byteLength + b.byteOffset; + } + } + { + const a: boolean = is.date({}); + const b: any = 2; + if (is.date(b)) { + b.getMonth() + b.getDate(); + } + } + { const a: boolean = is.error({}); } + { + const a: boolean = is.map({}); + const b: any = 2; + if (is.map(b)) { + b.has("asd"); + b.set(1, 2); + b.set("1", 2); + } + } + { + const a: boolean = is.regexp({}); + const b: any = 2; + if (is.regexp(b)) { + b.test("hello"); + } + } + { + const a: boolean = is.set({}); + const b: any = 2; + if (is.set(b)) { + b.add("h"); + b.has(1); + } + } + { const a: boolean = is.symbol({}); } + { const a: boolean = is.vaultValuable({}); } + { const a: boolean = is.task({}); } + { + const a: boolean = is.fqdn(1); + const b: any = 2; + if (is.fqdn(b)) { + b.charCodeAt(0); + } + if (is.fqdn(b, {})) { + b.charCodeAt(0); + } + is.fqdn(1, { + allowTrailingDot: false + }); + is.fqdn(1, { + allowUnderscores: false + }); + is.fqdn(1, { + requireTld: true + }); + } + { + const a: boolean = is.email(1); + const b: any = 2; + if (is.email(b)) { + b.charCodeAt(0); + } + if (is.email(b, {})) { + b.charCodeAt(0); + } + is.email(1, { + allowDisplayName: false + }); + is.email(1, { + allowUtf8LocalPart: false + }); + is.email(1, { + requireDisplayName: false + }); + is.email(1, { + requireTld: false + }); + } + { + const a: boolean = is.uuid(2); + const b: any = 2; + if (is.uuid(b)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, "all"); + const b: any = 2; + if (is.uuid(b, "all")) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, "all"); + const b: any = 2; + if (is.uuid(b, "all")) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 1); + const b: any = 2; + if (is.uuid(b, 1)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 2); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 3); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 4); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } + { + const a: boolean = is.uuid(2, 5); + const b: any = 2; + if (is.uuid(b, 2)) { + b.charCodeAt(0); + } + } } diff --git a/types/adone/test/glosses/meta.ts b/types/adone/test/glosses/meta.ts new file mode 100644 index 0000000000..fbcde09b1a --- /dev/null +++ b/types/adone/test/glosses/meta.ts @@ -0,0 +1,7 @@ +namespace metaTests { + const { meta } = adone; + + namespace typeOf { + const a: string = meta.typeOf(1); + } +} diff --git a/types/adone/test/glosses/promise.ts b/types/adone/test/glosses/promise.ts index a8866d95a1..9df672cae8 100644 --- a/types/adone/test/glosses/promise.ts +++ b/types/adone/test/glosses/promise.ts @@ -106,4 +106,34 @@ namespace promiseTests { namespace _finally { promise.finally(Promise.resolve(2), () => 2).then((x: number) => {}); } + + namespace props { + promise.props({ a: Promise.resolve(2) }).then((x) => x.a); + } + + namespace retry { + promise.retry((info) => { + { const a: number = info.current; } + }); + + promise.retry(() => {}, {}); + promise.retry(() => {}, { backOffBase: 1000 }); + promise.retry(() => {}, { backOffExponent: 2 }); + promise.retry(() => {}, { match: "a" }); + promise.retry(() => {}, { match: ["a"] }); + promise.retry(() => {}, { match: [/abc/] }); + promise.retry(() => {}, { match: /abc/ }); + promise.retry(() => {}, { match: [new Error()] }); + promise.retry(() => {}, { match: new Error() }); + promise.retry(() => {}, { max: 100 }); + promise.retry(() => {}, { name: "asd" }); + promise.retry(() => {}, { + report(msg: string, opts) { + opts.backOffBase < 100; + } + }); + promise.retry(() => {}, { + timeout: 100 + }); + } } diff --git a/types/adone/test/glosses/streams.ts b/types/adone/test/glosses/streams.ts index bd090dc467..caa278955a 100644 --- a/types/adone/test/glosses/streams.ts +++ b/types/adone/test/glosses/streams.ts @@ -2,82 +2,82 @@ namespace streamsTests { const { stream } = adone; namespace CoreStreamTests { - const { CoreStream } = stream; + const { core: { Stream } } = stream; - new CoreStream(); - new CoreStream(undefined); - new CoreStream(undefined, {}); - new CoreStream(undefined, { async: true }); - new CoreStream(undefined, { sync: true }); - new CoreStream(undefined, { + new Stream(); + new Stream(undefined); + new Stream(undefined, {}); + new Stream(undefined, { async: true }); + new Stream(undefined, { sync: true }); + new Stream(undefined, { transform(x) { this.push(x); } }); - new CoreStream(undefined, { + new Stream(undefined, { flush() { this.push(1); } }); - new CoreStream([]); - new CoreStream(new CoreStream([])); + new Stream([]); + new Stream(new Stream([])); - { const a: boolean = new CoreStream().write(1); } - { const a: boolean = new CoreStream().push(1); } - { const a: adone.stream.CoreStream = new CoreStream().end(); } - { const a: adone.stream.CoreStream = new CoreStream().destroy(); } - { const a: adone.stream.CoreStream = new CoreStream().pause(); } - { const a: adone.stream.CoreStream = new CoreStream().resume(); } - { const a: boolean = new CoreStream().isPaused(); } - { const a: boolean = new CoreStream().isEnded(); } - { const a: nodestd.stream.Transform = new CoreStream().pipe(new adone.std.stream.Transform()); } - { const a: adone.stream.CoreStream = new CoreStream().throughSync(function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().throughSync(function () { this.push(1); }, function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().throughAsync(function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().throughAsync(function () { this.push(1); }, function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream().through(function () { this.push(1); }, function () { this.push(1); }); } - { const a: adone.stream.CoreStream = new CoreStream([1, 2, 3]).map((x) => `${x}`); } - { const a: adone.stream.CoreStream = new CoreStream().mapIf((x) => x === "1", () => 1); } - { const a: adone.stream.CoreStream = new CoreStream().mapIf(async (x) => x === "1", () => 1); } - { const a: adone.stream.CoreStream = new CoreStream().filter((x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().filter(async (x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1, {}); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1, { passthrough: true }); } - { const a: adone.stream.CoreStream = new CoreStream().forEach(async (x) => x === 1, { wait: true }); } - { const a: adone.stream.CoreStream = new CoreStream().done(() => {}); } - { const a: adone.stream.CoreStream = new CoreStream().done(() => {}, {}); } - { const a: adone.stream.CoreStream = new CoreStream().done(() => {}, { passthrough: true }); } - { const a: adone.stream.CoreStream = new CoreStream().toArray((x: any[]) => {}); } - { const a: adone.stream.CoreStream = new CoreStream().toArray((x: any[]) => {}, {}); } - { const a: adone.stream.CoreStream = new CoreStream().toArray((x: any[]) => {}, { passthrough: true }); } - { const a: adone.stream.CoreStream = new CoreStream().unique(); } - { const a: adone.stream.CoreStream = new CoreStream().unique((x) => x + 1); } - { const a: adone.stream.CoreStream = new CoreStream().stash((x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().stash("hello", (x) => x === 1); } - { const a: adone.stream.CoreStream = new CoreStream().unstash("hello"); } - { const a: adone.stream.CoreStream = new CoreStream().unstash(); } - { const a: adone.stream.CoreStream = new CoreStream().flatten(); } - { const a: Promise = new CoreStream().then(); } - { const a: Promise = new CoreStream().then(() => "1"); } - { const a: Promise = new CoreStream().then(() => 1, () => 2); } - { const a: Promise = new CoreStream().catch(); } - { const a: Promise = new CoreStream().catch(() => 1); } - { const a: adone.stream.CoreStream = CoreStream.merge([new CoreStream()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Readable()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Transform()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Transform()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([new adone.std.stream.Duplex()]); } - { const a: adone.stream.CoreStream = CoreStream.merge([], {}); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { end: true }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: {} }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { async: true } }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { sync: false } }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { transform(x) { this.push(x); } } }); } - { const a: adone.stream.CoreStream = CoreStream.merge([], { sourceOptions: { flush() { this.push(1); } } }); } + { const a: boolean = new Stream().write(1); } + { const a: boolean = new Stream().push(1); } + { const a: adone.stream.core.Stream = new Stream().end(); } + { const a: adone.stream.core.Stream = new Stream().destroy(); } + { const a: adone.stream.core.Stream = new Stream().pause(); } + { const a: adone.stream.core.Stream = new Stream().resume(); } + { const a: boolean = new Stream().isPaused(); } + { const a: boolean = new Stream().isEnded(); } + { const a: nodestd.stream.Transform = new Stream().pipe(new adone.std.stream.Transform()); } + { const a: adone.stream.core.Stream = new Stream().throughSync(function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().throughSync(function () { this.push(1); }, function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().throughAsync(function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().throughAsync(function () { this.push(1); }, function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream().through(function () { this.push(1); }, function () { this.push(1); }); } + { const a: adone.stream.core.Stream = new Stream([1, 2, 3]).map((x) => `${x}`); } + { const a: adone.stream.core.Stream = new Stream().mapIf((x) => x === "1", () => 1); } + { const a: adone.stream.core.Stream = new Stream().mapIf(async (x) => x === "1", () => 1); } + { const a: adone.stream.core.Stream = new Stream().filter((x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().filter(async (x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1, {}); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1, { passthrough: true }); } + { const a: adone.stream.core.Stream = new Stream().forEach(async (x) => x === 1, { wait: true }); } + { const a: adone.stream.core.Stream = new Stream().done(() => {}); } + { const a: adone.stream.core.Stream = new Stream().done(() => {}, {}); } + { const a: adone.stream.core.Stream = new Stream().done(() => {}, { passthrough: true }); } + { const a: adone.stream.core.Stream = new Stream().toArray((x: any[]) => {}); } + { const a: adone.stream.core.Stream = new Stream().toArray((x: any[]) => {}, {}); } + { const a: adone.stream.core.Stream = new Stream().toArray((x: any[]) => {}, { passthrough: true }); } + { const a: adone.stream.core.Stream = new Stream().unique(); } + { const a: adone.stream.core.Stream = new Stream().unique((x) => x + 1); } + { const a: adone.stream.core.Stream = new Stream().stash((x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().stash("hello", (x) => x === 1); } + { const a: adone.stream.core.Stream = new Stream().unstash("hello"); } + { const a: adone.stream.core.Stream = new Stream().unstash(); } + { const a: adone.stream.core.Stream = new Stream().flatten(); } + { const a: Promise = new Stream().then(); } + { const a: Promise = new Stream().then(() => "1"); } + { const a: Promise = new Stream().then(() => 1, () => 2); } + { const a: Promise = new Stream().catch(); } + { const a: Promise = new Stream().catch(() => 1); } + { const a: adone.stream.core.Stream = Stream.merge([new Stream()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Readable()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Transform()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Transform()]); } + { const a: adone.stream.core.Stream = Stream.merge([new adone.std.stream.Duplex()]); } + { const a: adone.stream.core.Stream = Stream.merge([], {}); } + { const a: adone.stream.core.Stream = Stream.merge([], { end: true }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: {} }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { async: true } }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { sync: false } }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { transform(x) { this.push(x); } } }); } + { const a: adone.stream.core.Stream = Stream.merge([], { sourceOptions: { flush() { this.push(1); } } }); } (async () => { - const res = await new CoreStream([1, 2, 3, 4, 5]) + const res = await new Stream([1, 2, 3, 4, 5]) .map((x: number) => `${x}`) .mapIf((x: string) => x[0] === "1", (x) => x.slice(1)) .map((x) => [x, x, x]) @@ -91,13 +91,13 @@ namespace streamsTests { } namespace coreTests { - { const a: adone.stream.CoreStream = stream.core(); } - { const a: adone.stream.CoreStream = stream.core([1, 2, 3]); } - { const a: adone.stream.CoreStream = stream.core(stream.core([])); } - { const a: adone.stream.CoreStream = stream.core(undefined, {}); } - { const a: adone.stream.CoreStream = stream.core(undefined, { async: true }); } - { const a: adone.stream.CoreStream = stream.core(undefined, { sync: false }); } - { const a: adone.stream.CoreStream = stream.core(undefined, { transform(x) { this.push(Number(x)); } }); } - { const a: adone.stream.CoreStream = stream.core(undefined, { flush() { this.push(1); } }); } + { const a: adone.stream.core.Stream = stream.core.create(); } + { const a: adone.stream.core.Stream = stream.core.create([1, 2, 3]); } + { const a: adone.stream.core.Stream = stream.core.create(stream.core.create([])); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, {}); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { async: true }); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { sync: false }); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { transform(x) { this.push(Number(x)); } }); } + { const a: adone.stream.core.Stream = stream.core.create(undefined, { flush() { this.push(1); } }); } } } diff --git a/types/adone/test/glosses/utils.ts b/types/adone/test/glosses/utils.ts index 33698bfb29..1ffabbd59b 100644 --- a/types/adone/test/glosses/utils.ts +++ b/types/adone/test/glosses/utils.ts @@ -34,13 +34,6 @@ namespace utilTests { const b: string = util.functionName((a, b, c) => { }); } - namespace mapArguments { - const a: (...args: any[]) => any = util.mapArguments(() => { }); - const b: (...args: T[]) => T[] = util.mapArguments(1); - const c: (...args: any[]) => any = util.mapArguments([1]); - const d: (x: T) => T = util.mapArguments(); - } - namespace parseMs { const result: { days: number; @@ -56,10 +49,6 @@ namespace utilTests { const c: string = util.pluralizeWord("day", "days", 1); } - namespace functionParams { - const a: string[] = util.functionParams((a: any, b: any, c: any) => { }); - } - namespace randomChoice { const a: number = util.randomChoice([1, 2, 3]); const b: string = util.randomChoice(["1", "2", "3"]); @@ -174,19 +163,10 @@ namespace utilTests { const a: string = util.globParent("a/b/c/**"); } - namespace by { - const a: (a: number, b: number) => any = util.by((x: number): number => x); - const b: (a: number, b: number) => number = util.by((x: number): string => `${x}`, (a: string, b: string) => a.length - b.length); - } - namespace toFastProperties { const a: object = util.toFastProperties({}); } - namespace stripBom { - const a: string = util.stripBom("123"); - } - namespace sortKeys { const a: object = util.sortKeys({}); const b: object = util.sortKeys({}, {}); @@ -234,16 +214,27 @@ namespace utilTests { const b: number | null = util.parseSize("123Kb"); } + namespace Cloner { + const a = new util.Cloner(); + a.clone({}); + a.clone({}, {}); + a.clone({}, { deep: true }); + a.clone({}, { nonPlainObjects: false }); + a.clone({}, { onlyEnumerable: true }); + const c = a.binding(); + c({}); + c({}, {}); + c({}, { deep: true }); + c({}, { onlyEnumerable: false }); + c({}, { nonPlainObjects: true }); + } + namespace clone { const a: object = util.clone({}); const b: object = util.clone({}, {}); const c: object = util.clone({}, { deep: true }); } - namespace toUTF8Array { - const a: number[] = util.toUTF8Array("hello"); - } - namespace asyncIter { util.asyncIter([1, 2, 3], () => { }, () => { }); } @@ -298,28 +289,34 @@ namespace utilTests { const a: object = util.assignDeep({ a: 1 }, { a: 2 }); } - namespace match { - const a: number | boolean = util.match(["a", "b", "c"], "a"); - const b: (a: any, b: any) => number | boolean = util.match("a", { index: true }); - const c: number | boolean = util.match(["a", "b", "c"], "a", { dot: true }); - const d: (a: any, b: any) => number | boolean = util.match("a", { end: 2 }); - const e: (a: any, b: any) => number | boolean = util.match("a", { start: 2 }); - const f: (a: any, b: any) => number | boolean = util.match("a"); + namespace matchPath { + const a: number | boolean = util.matchPath(["a", "b", "c"], "a"); + const b: (a: any, b: any) => number | boolean = util.matchPath("a", { index: true }); + const c: number | boolean = util.matchPath(["a", "b", "c"], "a", { dot: true }); + const d: (a: any, b: any) => number | boolean = util.matchPath("a", { end: 2 }); + const e: (a: any, b: any) => number | boolean = util.matchPath("a", { start: 2 }); + const f: (a: any, b: any) => number | boolean = util.matchPath("a"); } namespace toposort { - const a: number[] = util.toposort([ - [0, 1], - [2, 3], - [4, 5], - [6, 7] + const a: string[] = util.toposort([ + ["0", "1"], + ["2", "3"], + ["4", "5"], + ["6", "7"] ]); - const b: number[] = util.toposort.array([0, 1, 2], [ - [0, 1], - [2, 3], - [4, 5], - [6, 7] + const b: string[] = util.toposort.array(["0", "1", "2"], [ + ["0", "1"], + ["2", "3"], + ["4", "5"], + ["6", "7"] ]); + const sorter = new util.toposort.Sorter(); + sorter.add("a", "b"); + sorter.add("a", ["c"]); + const c: string[] = sorter.sort(); + sorter.clear(); + sorter.edges[0][0].charCodeAt(100); } namespace jsesc { @@ -340,10 +337,6 @@ namespace utilTests { const o: string = util.jsesc({ a: 1 }, { __inline2__: true }); } - namespace typeOf { - const a: string = util.typeOf(1); - } - namespace memcpy { const a: number = util.memcpy.utou(Buffer.alloc(10), 0, Buffer.alloc(10), 0, 10); const b: number = util.memcpy.atoa(new ArrayBuffer(10), 0, new ArrayBuffer(10), 0, 10); @@ -394,73 +387,6 @@ namespace utilTests { a.getter("a").access("b").method("c").setter("d"); } - namespace GlobExp { - { - const glob = new util.GlobExp("*.js"); - const a: boolean = glob.hasMagic(); - const b: string[] = glob.expandBraces(); - const c: RegExp = glob.makeRe(); - const d: boolean = glob.test("a.js"); - } - { - const a: boolean = util.GlobExp.hasMagic("*.js"); - const b: string[] = util.GlobExp.expandBraces("*.js"); - const c: RegExp = util.GlobExp.makeRe("*.js"); - const d: boolean = util.GlobExp.test("*.js", "a.js"); - } - new util.GlobExp(""); - new util.GlobExp("", {}); - new util.GlobExp("", { dot: true }); - new util.GlobExp("", { flipNegate: true }); - new util.GlobExp("", { matchBase: true }); - new util.GlobExp("", { nobrace: true }); - new util.GlobExp("", { nocase: true }); - new util.GlobExp("", { nocomment: true }); - new util.GlobExp("", { noext: true }); - new util.GlobExp("", { noglobstar: true }); - new util.GlobExp("", { nonegate: true }); - util.GlobExp.hasMagic("", {}); - util.GlobExp.hasMagic("", { dot: true }); - util.GlobExp.hasMagic("", { flipNegate: true }); - util.GlobExp.hasMagic("", { matchBase: true }); - util.GlobExp.hasMagic("", { nobrace: true }); - util.GlobExp.hasMagic("", { nocase: true }); - util.GlobExp.hasMagic("", { nocomment: true }); - util.GlobExp.hasMagic("", { noext: true }); - util.GlobExp.hasMagic("", { noglobstar: true }); - util.GlobExp.hasMagic("", { nonegate: true }); - util.GlobExp.expandBraces("", {}); - util.GlobExp.expandBraces("", { dot: true }); - util.GlobExp.expandBraces("", { flipNegate: true }); - util.GlobExp.expandBraces("", { matchBase: true }); - util.GlobExp.expandBraces("", { nobrace: true }); - util.GlobExp.expandBraces("", { nocase: true }); - util.GlobExp.expandBraces("", { nocomment: true }); - util.GlobExp.expandBraces("", { noext: true }); - util.GlobExp.expandBraces("", { noglobstar: true }); - util.GlobExp.expandBraces("", { nonegate: true }); - util.GlobExp.makeRe("", {}); - util.GlobExp.makeRe("", { dot: true }); - util.GlobExp.makeRe("", { flipNegate: true }); - util.GlobExp.makeRe("", { matchBase: true }); - util.GlobExp.makeRe("", { nobrace: true }); - util.GlobExp.makeRe("", { nocase: true }); - util.GlobExp.makeRe("", { nocomment: true }); - util.GlobExp.makeRe("", { noext: true }); - util.GlobExp.makeRe("", { noglobstar: true }); - util.GlobExp.makeRe("", { nonegate: true }); - util.GlobExp.test("a", "b", {}); - util.GlobExp.test("a", "b", { dot: true }); - util.GlobExp.test("a", "b", { flipNegate: true }); - util.GlobExp.test("a", "b", { matchBase: true }); - util.GlobExp.test("a", "b", { nobrace: true }); - util.GlobExp.test("a", "b", { nocase: true }); - util.GlobExp.test("a", "b", { nocomment: true }); - util.GlobExp.test("a", "b", { noext: true }); - util.GlobExp.test("a", "b", { noglobstar: true }); - util.GlobExp.test("a", "b", { nonegate: true }); - } - namespace iconv { // TODO } @@ -477,19 +403,6 @@ namespace utilTests { const b: string = util.sqlstring.dateToString(123, "local"); } - namespace arrayToList { - const a: string = util.sqlstring.arrayToList(["1", "a"]); - } - - namespace bufferToString { - const a: string = util.sqlstring.bufferToString(Buffer.alloc(10)); - } - - namespace objectToValues { - const a: string = util.sqlstring.objectToValues({ a: 1 }); - const b: string = util.sqlstring.objectToValues({ a: 1 }, "local"); - } - namespace escape { const a: string = util.sqlstring.escape(1); const b: string = util.sqlstring.escape(1, true); @@ -532,44 +445,55 @@ namespace utilTests { } namespace buffer { - const a: Buffer = util.buffer.concat([Buffer.alloc(10), Buffer.alloc(20)], 30); - util.buffer.mask(Buffer.alloc(10), Buffer.alloc(10), Buffer.alloc(10), 0, 10); - util.buffer.unmask(Buffer.alloc(10), Buffer.alloc(10)); + namespace toArrayBuffer { + const a = util.buffer.toArrayBuffer(Buffer.from("hello")); + a.slice(10); + } + + namespace xor { + const a = util.buffer.xor(Buffer.from("hello"), Buffer.from("world")); + a.writeUInt32LE(20, 1); + } } namespace shebang { const a: string | null = util.shebang("#!/bin/sh"); } - namespace ReInterval { - new util.ReInterval(() => { }, 1000); - new util.ReInterval(() => { }, 1000, [1]); - const a = new util.ReInterval(() => { }, 1000); + namespace reinterval { + util.reinterval(() => { }, 1000); + util.reinterval(() => { }, 1000, [1]); + const a = util.reinterval(() => { }, 1000); a.reschedule(400); a.clear(); a.destroy(); } - namespace RateLimiter { - new util.RateLimiter(); - new util.RateLimiter(1); - new util.RateLimiter(1, 1000); - new util.RateLimiter(1, 1000, true); - const a = new util.RateLimiter(); - a.removeTokens(1).then((x: number) => { }); - const b: boolean = a.tryRemoveTokens(10); - const c: number = a.getTokensRemaining(); - } - namespace throttle { - const a: () => Promise = util.throttle(() => 42); - const b: (a: number) => Promise = util.throttle((a: number) => `${a}`); - const c: (a: number, b: string) => Promise = util.throttle((a: number, b: string) => String(a) + b); - const d = util.throttle(() => { }, {}); - const e = util.throttle(() => { }, { interval: 1000 }); - const f = util.throttle(() => { }, { max: 10 }); - const g = util.throttle(() => { }, { ordered: true }); - const h = util.throttle(() => { }, { waitForReturn: true }); + namespace RateLimiter { + new util.throttle.RateLimiter(); + new util.throttle.RateLimiter(1); + new util.throttle.RateLimiter(1, 1000); + new util.throttle.RateLimiter(1, 1000, true); + const a = new util.throttle.RateLimiter(); + a.removeTokens(1).then((x: number) => { }); + const b: boolean = a.tryRemoveTokens(10); + const c: number = a.getTokensRemaining(); + } + + const a: () => Promise = util.throttle.create(() => 42); + const b: (a: number) => Promise = util.throttle.create((a: number) => `${a}`); + const c: (a: number, b: string) => Promise = util.throttle.create((a: number, b: string) => String(a) + b); + const d = util.throttle.create(() => { }, {}); + const e = util.throttle.create(() => { }, { interval: 1000 }); + const f = util.throttle.create(() => { }, { max: 10 }); + const g = util.throttle.create(() => { }, { ordered: true }); + const h = util.throttle.create(() => { }, { waitForReturn: true }); + const i = util.throttle.create(() => { }, { onDone() {} }); + const j = util.throttle.create(() => { }, { drop: true }); + const k = util.throttle.create(() => { }, { dropLast: true }); + + const l: symbol = util.throttle.DROPPED; } namespace fakeClock { @@ -741,17 +665,6 @@ namespace utilTests { } } - namespace userid { - const { userid } = util; - - { const a: number = userid.uid("someone").gid; } - { const a: number = userid.uid("someone").uid; } - { const a: number = userid.gid("someone"); } - { const a: string = userid.username(1000); } - { const a: string = userid.groupname(1000); } - { const gids: number[] = userid.gids("someone"); } - } - namespace LogRotator { const { LogRotator } = util; new LogRotator("file.log"); @@ -766,4 +679,679 @@ namespace utilTests { new LogRotator("file.log").start(); new LogRotator("file.log").stop(); } + + namespace arrayDiff { + const { arrayDiff } = util; + + arrayDiff([1, 2, 3], [4, 5, 6])[0].toFixed(); + arrayDiff(["1"])[0].charCodeAt(100); + } + + namespace fillRange { + const { fillRange } = util; + + { const a: number[] = fillRange(1, 2); } + { const a: string[] = fillRange(1, 2, { stringify: true }); } + { const a: string = fillRange(1, 2, { toRegex: true }); } + { const a: string[] = fillRange("1", "2"); } + { const a: string = fillRange("1", "2", { toRegex: true }); } + } + + namespace inflection { + const { inflection } = util; + + { const a: string = inflection.singularizeWord("hello"); } + { const a: string = inflection.singularizeWord("hello", "aaaa"); } + { const a: string = inflection.pluralizeWord("hello"); } + { const a: string = inflection.pluralizeWord("hello", "aaaa"); } + { const a: string = inflection.underscore("hello"); } + } + + namespace machineId { + const { machineId } = util; + + (async () => { + const a: string = await machineId(); + }); + } + + namespace merge { + const { merge } = util; + + merge({}, {}); + merge({}, {}, { allowPrototypes: true }); + merge({}, {}, { plainObjects: false }); + } + + namespace omit { + const { omit } = util; + + omit({}, ["a"]); + omit({}, "a"); + omit({}, (x) => x === "a"); + } + + namespace parseTime { + const { parseTime } = util; + + { const a: number = parseTime(123); } + { const a: number | null = parseTime("12"); } + } + + namespace pick { + const { pick } = util; + + pick({}, ["a", "b", "c"]); + pick({}, new Set(["a", "b", "c"])); + } + + namespace querystring { + const { querystring: qs } = util; + + { const a: string = qs.escape("asd"); } + { const a: string = qs.formats.default; } + { const a: string = qs.formats.RFC1738; } + { const a: string = qs.formats.RFC3986; } + { const a: string = qs.formats.formatters.RFC1738("ha"); } + { const a: string = qs.formats.formatters.RFC3986("ha"); } + { const a: object = qs.parse("asdasd"); } + { const a: object = qs.parse("asdasd", {}); } + { const a: object = qs.parse("asdasd", { allowDots: false }); } + { const a: object = qs.parse("asdasd", { allowPrototypes: false }); } + { const a: object = qs.parse("asdasd", { arrayLimit: 100 }); } + { const a: object = qs.parse("asdasd", { decoder: (s) => s }); } + { const a: object = qs.parse("asdasd", { decoder: (s, d) => d(s) }); } + { const a: object = qs.parse("asdasd", { delimiter: "a" }); } + { const a: object = qs.parse("asdasd", { depth: 100 }); } + { const a: object = qs.parse("asdasd", { ignoreQueryPrefix: false }); } + { const a: object = qs.parse("asdasd", { parameterLimit: 100 }); } + { const a: object = qs.parse("asdasd", { parseArrays: false }); } + { const a: object = qs.parse("asdasd", { plainObjects: true }); } + { const a: object = qs.parse("asdasd", { strictNullHandling: false }); } + { const a: string = qs.stringify({}); } + { const a: string = qs.stringify({}, {}); } + { const a: string = qs.stringify({}, { addQueryPrefix: false }); } + { const a: string = qs.stringify({}, { allowDots: false }); } + { const a: string = qs.stringify({}, { arrayFormat: "indices" }); } + { const a: string = qs.stringify({}, { arrayFormat: "brackets" }); } + { const a: string = qs.stringify({}, { arrayFormat: "repeat" }); } + { const a: string = qs.stringify({}, { delimiter: "1" }); } + { const a: string = qs.stringify({}, { encode: true }); } + { const a: string = qs.stringify({}, { encoder: (s) => s }); } + { const a: string = qs.stringify({}, { encodeValuesOnly: false }); } + { const a: string = qs.stringify({}, { filter: [1, 2, 3] }); } + { const a: string = qs.stringify({}, { filter: ["1", "2", "3"] }); } + { const a: string = qs.stringify({}, { filter: (prefix: string, value: any) => value === 1 }); } + { const a: string = qs.stringify({}, { indices: false }); } + { const a: string = qs.stringify({}, { serializeDate(d) { return String(d.getTime()); } }); } + { const a: string = qs.stringify({}, { skipNulls: false }); } + { const a: string = qs.stringify({}, { sort(a, b) { return a - b; } }); } + { const a: string = qs.stringify({}, { strictNullHandling: false }); } + } + + namespace regexNot { + const { regexNot } = util; + + { const a: RegExp = regexNot("a"); } + { const a: RegExp = regexNot("a", {}); } + { const a: RegExp = regexNot("a", { contains: false }); } + } + + namespace repeat { + const { repeat } = util; + { const a: number[] = repeat(1, 10); } + { const a: string[] = repeat("a", 10); } + { const a: number[][] = repeat([2], 10); } + } + + namespace signalNameToCode { + const { signalNameToCode } = util; + signalNameToCode("SIGINT").toFixed(2); + } + + namespace splitBuffer { + const { splitBuffer } = util; + + { const a: Buffer[] = splitBuffer(Buffer.from("asd"), Buffer.from("|")); } + { const a: Buffer[] = splitBuffer(Buffer.from("asd"), Buffer.from("|"), true); } + { const a: Buffer[] = splitBuffer("asd", Buffer.from("|"), true); } + { const a: Buffer[] = splitBuffer("asd", "|"); } + } + + namespace splitString { + const { splitString } = util; + + splitString("a"); + splitString("a", {}); + splitString("a", { braces: false }); + splitString("a", { keepDoubleQuotes: false }); + splitString("a", { keepEscaping: false }); + splitString("a", { keepQuotes: false }); + splitString("a", { keepSingleQuotes: false }); + splitString("a", { separator: "|" }); + splitString("a", { + split(token) { + { const a: string[] = token.arr; } + { const a: number = token.idx; } + { const a: string = token.str; } + { const a: string = token.val; } + } + }); + splitString("a", (token) => { + { const a: string[] = token.arr; } + { const a: number = token.idx; } + { const a: string = token.str; } + { const a: string = token.val; } + }); + splitString("a", {}, (token) => { + { const a: string[] = token.arr; } + { const a: number = token.idx; } + { const a: string = token.str; } + { const a: string = token.val; } + }); + } + + namespace toRegex { + const { toRegex } = util; + + { const a: RegExp = toRegex("a"); } + { const a: RegExp = toRegex(["a"]); } + { const a: RegExp = toRegex(["a"], {}); } + { const a: RegExp = toRegex(["a"], { cache: false }); } + { const a: RegExp = toRegex(["a"], { contains: false }); } + { const a: RegExp = toRegex(["a"], { flags: "i" }); } + { const a: RegExp = toRegex(["a"], { negate: false }); } + { const a: RegExp = toRegex(["a"], { nocase: false }); } + } + + namespace toRegexRange { + const { toRegexRange } = util; + + { const a: RegExp = toRegexRange(1, 10); } + { const a: RegExp = toRegexRange("1", "10"); } + { const a: RegExp = toRegexRange(1, 10, {}); } + { const a: RegExp = toRegexRange(1, 10, { capture: false }); } + { const a: RegExp = toRegexRange(1, 10, { relaxZeros: true }); } + { const a: RegExp = toRegexRange(1, 10, { shorthand: false }); } + } + + namespace xorDistance { + const { compare, create, eq, gt, lt } = util.xorDistance; + + { const a: boolean = compare(Buffer.from("1"), Buffer.from("2")); } + { const a: Buffer = create(Buffer.from("1"), Buffer.from("2")); } + { const a: boolean = gt(Buffer.from("1"), Buffer.from("2")); } + { const a: boolean = lt(Buffer.from("1"), Buffer.from("2")); } + { const a: boolean = eq(Buffer.from("1"), Buffer.from("2")); } + } + + namespace braces { + const { braces } = util; + + { const a: string[] = braces("a"); } + { const a: string[] = braces("a", {}); } + { const a: string[] = braces("a", { expand: false }); } + { const a: string[] = braces("a", { nodupes: false }); } + { const a: string[] = braces("a", { optimize: true }); } + { const a: string[] = braces("a", { quantifiers: false }); } + { const a: string[] = braces("a", { rangeLimit: 100 }); } + { const a: string[] = braces("a", { transform: (s: string) => s }); } + { const a: string[] = braces("a", { unescape: false }); } + + { const a: string[] = braces.expand("a"); } + { const a: string[] = braces.expand("a", {}); } + { const a: string[] = braces.expand("a", { expand: false }); } + { const a: string[] = braces.expand("a", { nodupes: false }); } + { const a: string[] = braces.expand("a", { optimize: true }); } + { const a: string[] = braces.expand("a", { quantifiers: false }); } + { const a: string[] = braces.expand("a", { rangeLimit: 100 }); } + { const a: string[] = braces.expand("a", { transform: (s: string) => s }); } + { const a: string[] = braces.expand("a", { unescape: false }); } + + { const a: RegExp = braces.makeRe("a"); } + { const a: RegExp = braces.makeRe("a", {}); } + { const a: RegExp = braces.makeRe("a", { expand: false }); } + { const a: RegExp = braces.makeRe("a", { nodupes: false }); } + { const a: RegExp = braces.makeRe("a", { optimize: true }); } + { const a: RegExp = braces.makeRe("a", { quantifiers: false }); } + { const a: RegExp = braces.makeRe("a", { rangeLimit: 100 }); } + { const a: RegExp = braces.makeRe("a", { transform: (s: string) => s }); } + { const a: RegExp = braces.makeRe("a", { unescape: false }); } + + { const a: number = braces.MAX_LENGTH; } + { const a: object = braces.getCache(); } + braces.clearCache(); + braces.resizeCache(100500); + } + + namespace match { + const { match } = util; + + { const a: string[] = match(["a"], "a"); } + { const a: string[] = match(["a"], ["a"]); } + { const a: string[] = match(["a"], ["a"], {}); } + { const a: string[] = match(["a"], ["a"], { basename: false }); } + { const a: string[] = match(["a"], ["a"], { bash: false }); } + { const a: string[] = match(["a"], ["a"], { cache: false }); } + { const a: string[] = match(["a"], ["a"], { dot: true }); } + { const a: string[] = match(["a"], ["a"], { failglob: false }); } + { const a: string[] = match(["a"], ["a"], { ignore: "a" }); } + { const a: string[] = match(["a"], ["a"], { ignore: ["a"] }); } + { const a: string[] = match(["a"], ["a"], { matchBase: false }); } + { const a: string[] = match(["a"], ["a"], { nobrace: true }); } + { const a: string[] = match(["a"], ["a"], { nocase: false }); } + { const a: string[] = match(["a"], ["a"], { nodupes: true }); } + { const a: string[] = match(["a"], ["a"], { noext: false }); } + { const a: string[] = match(["a"], ["a"], { noglobstar: true }); } + { const a: string[] = match(["a"], ["a"], { nonegate: false }); } + { const a: string[] = match(["a"], ["a"], { nonull: false }); } + { const a: string[] = match(["a"], ["a"], { nullglob: false }); } + { const a: string[] = match(["a"], ["a"], { snapdragon: {} }); } + { const a: string[] = match(["a"], ["a"], { sourcemap: false }); } + { const a: string[] = match(["a"], ["a"], { unescape: false }); } + { const a: string[] = match(["a"], ["a"], { unixify: false }); } + + { const a: string[] = match.match(["a"], "a"); } + { const a: string[] = match.match(["a"], "a", {}); } + { const a: string[] = match.match(["a"], "a", { basename: false }); } + { const a: string[] = match.match(["a"], "a", { bash: false }); } + { const a: string[] = match.match(["a"], "a", { cache: false }); } + { const a: string[] = match.match(["a"], "a", { dot: true }); } + { const a: string[] = match.match(["a"], "a", { failglob: false }); } + { const a: string[] = match.match(["a"], "a", { ignore: "a" }); } + { const a: string[] = match.match(["a"], "a", { ignore: ["a"] }); } + { const a: string[] = match.match(["a"], "a", { matchBase: false }); } + { const a: string[] = match.match(["a"], "a", { nobrace: true }); } + { const a: string[] = match.match(["a"], "a", { nocase: false }); } + { const a: string[] = match.match(["a"], "a", { nodupes: true }); } + { const a: string[] = match.match(["a"], "a", { noext: false }); } + { const a: string[] = match.match(["a"], "a", { noglobstar: true }); } + { const a: string[] = match.match(["a"], "a", { nonegate: false }); } + { const a: string[] = match.match(["a"], "a", { nonull: false }); } + { const a: string[] = match.match(["a"], "a", { nullglob: false }); } + { const a: string[] = match.match(["a"], "a", { snapdragon: {} }); } + { const a: string[] = match.match(["a"], "a", { sourcemap: false }); } + { const a: string[] = match.match(["a"], "a", { unescape: false }); } + { const a: string[] = match.match(["a"], "a", { unixify: false }); } + + { const a: boolean = match.isMatch("a", "a"); } + { const a: boolean = match.isMatch("a", "a", {}); } + { const a: boolean = match.isMatch("a", "a", { basename: false }); } + { const a: boolean = match.isMatch("a", "a", { bash: false }); } + { const a: boolean = match.isMatch("a", "a", { cache: false }); } + { const a: boolean = match.isMatch("a", "a", { dot: true }); } + { const a: boolean = match.isMatch("a", "a", { failglob: false }); } + { const a: boolean = match.isMatch("a", "a", { ignore: "a" }); } + { const a: boolean = match.isMatch("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.isMatch("a", "a", { matchBase: false }); } + { const a: boolean = match.isMatch("a", "a", { nobrace: true }); } + { const a: boolean = match.isMatch("a", "a", { nocase: false }); } + { const a: boolean = match.isMatch("a", "a", { nodupes: true }); } + { const a: boolean = match.isMatch("a", "a", { noext: false }); } + { const a: boolean = match.isMatch("a", "a", { noglobstar: true }); } + { const a: boolean = match.isMatch("a", "a", { nonegate: false }); } + { const a: boolean = match.isMatch("a", "a", { nonull: false }); } + { const a: boolean = match.isMatch("a", "a", { nullglob: false }); } + { const a: boolean = match.isMatch("a", "a", { snapdragon: {} }); } + { const a: boolean = match.isMatch("a", "a", { sourcemap: false }); } + { const a: boolean = match.isMatch("a", "a", { unescape: false }); } + { const a: boolean = match.isMatch("a", "a", { unixify: false }); } + + { const a: boolean = match.some(["a"], ["a"]); } + { const a: boolean = match.some("a", "a"); } + { const a: boolean = match.some("a", "a", {}); } + { const a: boolean = match.some("a", "a", { basename: false }); } + { const a: boolean = match.some("a", "a", { bash: false }); } + { const a: boolean = match.some("a", "a", { cache: false }); } + { const a: boolean = match.some("a", "a", { dot: true }); } + { const a: boolean = match.some("a", "a", { failglob: false }); } + { const a: boolean = match.some("a", "a", { ignore: "a" }); } + { const a: boolean = match.some("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.some("a", "a", { matchBase: false }); } + { const a: boolean = match.some("a", "a", { nobrace: true }); } + { const a: boolean = match.some("a", "a", { nocase: false }); } + { const a: boolean = match.some("a", "a", { nodupes: true }); } + { const a: boolean = match.some("a", "a", { noext: false }); } + { const a: boolean = match.some("a", "a", { noglobstar: true }); } + { const a: boolean = match.some("a", "a", { nonegate: false }); } + { const a: boolean = match.some("a", "a", { nonull: false }); } + { const a: boolean = match.some("a", "a", { nullglob: false }); } + { const a: boolean = match.some("a", "a", { snapdragon: {} }); } + { const a: boolean = match.some("a", "a", { sourcemap: false }); } + { const a: boolean = match.some("a", "a", { unescape: false }); } + { const a: boolean = match.some("a", "a", { unixify: false }); } + + { const a: boolean = match.every(["a"], ["a"]); } + { const a: boolean = match.every("a", "a"); } + { const a: boolean = match.every("a", "a", {}); } + { const a: boolean = match.every("a", "a", { basename: false }); } + { const a: boolean = match.every("a", "a", { bash: false }); } + { const a: boolean = match.every("a", "a", { cache: false }); } + { const a: boolean = match.every("a", "a", { dot: true }); } + { const a: boolean = match.every("a", "a", { failglob: false }); } + { const a: boolean = match.every("a", "a", { ignore: "a" }); } + { const a: boolean = match.every("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.every("a", "a", { matchBase: false }); } + { const a: boolean = match.every("a", "a", { nobrace: true }); } + { const a: boolean = match.every("a", "a", { nocase: false }); } + { const a: boolean = match.every("a", "a", { nodupes: true }); } + { const a: boolean = match.every("a", "a", { noext: false }); } + { const a: boolean = match.every("a", "a", { noglobstar: true }); } + { const a: boolean = match.every("a", "a", { nonegate: false }); } + { const a: boolean = match.every("a", "a", { nonull: false }); } + { const a: boolean = match.every("a", "a", { nullglob: false }); } + { const a: boolean = match.every("a", "a", { snapdragon: {} }); } + { const a: boolean = match.every("a", "a", { sourcemap: false }); } + { const a: boolean = match.every("a", "a", { unescape: false }); } + { const a: boolean = match.every("a", "a", { unixify: false }); } + + { const a: boolean = match.any(["a"], ["a"]); } + { const a: boolean = match.any("a", "a"); } + { const a: boolean = match.any("a", "a", {}); } + { const a: boolean = match.any("a", "a", { basename: false }); } + { const a: boolean = match.any("a", "a", { bash: false }); } + { const a: boolean = match.any("a", "a", { cache: false }); } + { const a: boolean = match.any("a", "a", { dot: true }); } + { const a: boolean = match.any("a", "a", { failglob: false }); } + { const a: boolean = match.any("a", "a", { ignore: "a" }); } + { const a: boolean = match.any("a", "a", { ignore: ["a"] }); } + { const a: boolean = match.any("a", "a", { matchBase: false }); } + { const a: boolean = match.any("a", "a", { nobrace: true }); } + { const a: boolean = match.any("a", "a", { nocase: false }); } + { const a: boolean = match.any("a", "a", { nodupes: true }); } + { const a: boolean = match.any("a", "a", { noext: false }); } + { const a: boolean = match.any("a", "a", { noglobstar: true }); } + { const a: boolean = match.any("a", "a", { nonegate: false }); } + { const a: boolean = match.any("a", "a", { nonull: false }); } + { const a: boolean = match.any("a", "a", { nullglob: false }); } + { const a: boolean = match.any("a", "a", { snapdragon: {} }); } + { const a: boolean = match.any("a", "a", { sourcemap: false }); } + { const a: boolean = match.any("a", "a", { unescape: false }); } + { const a: boolean = match.any("a", "a", { unixify: false }); } + + { const a: boolean = match.all("a", "a"); } + { const a: boolean = match.all("a", ["a"]); } + { const a: boolean = match.all(["a"], "a"); } + { const a: boolean = match.all(["a"], "a", {}); } + { const a: boolean = match.all(["a"], ["a"], { basename: false }); } + { const a: boolean = match.all(["a"], ["a"], { bash: false }); } + { const a: boolean = match.all(["a"], ["a"], { cache: false }); } + { const a: boolean = match.all(["a"], ["a"], { dot: true }); } + { const a: boolean = match.all(["a"], ["a"], { failglob: false }); } + { const a: boolean = match.all(["a"], ["a"], { ignore: "a" }); } + { const a: boolean = match.all(["a"], ["a"], { ignore: ["a"] }); } + { const a: boolean = match.all(["a"], ["a"], { matchBase: false }); } + { const a: boolean = match.all(["a"], ["a"], { nobrace: true }); } + { const a: boolean = match.all(["a"], ["a"], { nocase: false }); } + { const a: boolean = match.all(["a"], ["a"], { nodupes: true }); } + { const a: boolean = match.all(["a"], ["a"], { noext: false }); } + { const a: boolean = match.all(["a"], ["a"], { noglobstar: true }); } + { const a: boolean = match.all(["a"], ["a"], { nonegate: false }); } + { const a: boolean = match.all(["a"], ["a"], { nonull: false }); } + { const a: boolean = match.all(["a"], ["a"], { nullglob: false }); } + { const a: boolean = match.all(["a"], ["a"], { snapdragon: {} }); } + { const a: boolean = match.all(["a"], ["a"], { sourcemap: false }); } + { const a: boolean = match.all(["a"], ["a"], { unescape: false }); } + { const a: boolean = match.all(["a"], ["a"], { unixify: false }); } + + { const a: string[] = match.not(["a"], ["a"]); } + { const a: string[] = match.not(["a"], "a"); } + { const a: string[] = match.not(["a"], "a", {}); } + { const a: string[] = match.not(["a"], "a", { basename: false }); } + { const a: string[] = match.not(["a"], "a", { bash: false }); } + { const a: string[] = match.not(["a"], "a", { cache: false }); } + { const a: string[] = match.not(["a"], "a", { dot: true }); } + { const a: string[] = match.not(["a"], "a", { failglob: false }); } + { const a: string[] = match.not(["a"], "a", { ignore: "a" }); } + { const a: string[] = match.not(["a"], "a", { ignore: ["a"] }); } + { const a: string[] = match.not(["a"], "a", { matchBase: false }); } + { const a: string[] = match.not(["a"], "a", { nobrace: true }); } + { const a: string[] = match.not(["a"], "a", { nocase: false }); } + { const a: string[] = match.not(["a"], "a", { nodupes: true }); } + { const a: string[] = match.not(["a"], "a", { noext: false }); } + { const a: string[] = match.not(["a"], "a", { noglobstar: true }); } + { const a: string[] = match.not(["a"], "a", { nonegate: false }); } + { const a: string[] = match.not(["a"], "a", { nonull: false }); } + { const a: string[] = match.not(["a"], "a", { nullglob: false }); } + { const a: string[] = match.not(["a"], "a", { snapdragon: {} }); } + { const a: string[] = match.not(["a"], "a", { sourcemap: false }); } + { const a: string[] = match.not(["a"], "a", { unescape: false }); } + { const a: string[] = match.not(["a"], "a", { unixify: false }); } + + { const a: boolean = match.contains("a", "a"); } + { const a: boolean = match.contains("a", ["a"]); } + { const a: boolean = match.contains("a", ["a"], {}); } + { const a: boolean = match.contains("a", ["a"], { basename: false }); } + { const a: boolean = match.contains("a", ["a"], { bash: false }); } + { const a: boolean = match.contains("a", ["a"], { cache: false }); } + { const a: boolean = match.contains("a", ["a"], { dot: true }); } + { const a: boolean = match.contains("a", ["a"], { failglob: false }); } + { const a: boolean = match.contains("a", ["a"], { ignore: "a" }); } + { const a: boolean = match.contains("a", ["a"], { ignore: ["a"] }); } + { const a: boolean = match.contains("a", ["a"], { matchBase: false }); } + { const a: boolean = match.contains("a", ["a"], { nobrace: true }); } + { const a: boolean = match.contains("a", ["a"], { nocase: false }); } + { const a: boolean = match.contains("a", ["a"], { nodupes: true }); } + { const a: boolean = match.contains("a", ["a"], { noext: false }); } + { const a: boolean = match.contains("a", ["a"], { noglobstar: true }); } + { const a: boolean = match.contains("a", ["a"], { nonegate: false }); } + { const a: boolean = match.contains("a", ["a"], { nonull: false }); } + { const a: boolean = match.contains("a", ["a"], { nullglob: false }); } + { const a: boolean = match.contains("a", ["a"], { snapdragon: {} }); } + { const a: boolean = match.contains("a", ["a"], { sourcemap: false }); } + { const a: boolean = match.contains("a", ["a"], { unescape: false }); } + { const a: boolean = match.contains("a", ["a"], { unixify: false }); } + + { const a: object = match.matchKeys({}, "a"); } + { const a: object = match.matchKeys({}, ["a"]); } + { const a: object = match.matchKeys({}, ["a"], {}); } + { const a: object = match.matchKeys({}, ["a"], { basename: false }); } + { const a: object = match.matchKeys({}, ["a"], { bash: false }); } + { const a: object = match.matchKeys({}, ["a"], { cache: false }); } + { const a: object = match.matchKeys({}, ["a"], { dot: true }); } + { const a: object = match.matchKeys({}, ["a"], { failglob: false }); } + { const a: object = match.matchKeys({}, ["a"], { ignore: "a" }); } + { const a: object = match.matchKeys({}, ["a"], { ignore: ["a"] }); } + { const a: object = match.matchKeys({}, ["a"], { matchBase: false }); } + { const a: object = match.matchKeys({}, ["a"], { nobrace: true }); } + { const a: object = match.matchKeys({}, ["a"], { nocase: false }); } + { const a: object = match.matchKeys({}, ["a"], { nodupes: true }); } + { const a: object = match.matchKeys({}, ["a"], { noext: false }); } + { const a: object = match.matchKeys({}, ["a"], { noglobstar: true }); } + { const a: object = match.matchKeys({}, ["a"], { nonegate: false }); } + { const a: object = match.matchKeys({}, ["a"], { nonull: false }); } + { const a: object = match.matchKeys({}, ["a"], { nullglob: false }); } + { const a: object = match.matchKeys({}, ["a"], { snapdragon: {} }); } + { const a: object = match.matchKeys({}, ["a"], { sourcemap: false }); } + { const a: object = match.matchKeys({}, ["a"], { unescape: false }); } + { const a: object = match.matchKeys({}, ["a"], { unixify: false }); } + + { const a: (s: string) => boolean = match.matcher("a"); } + { const a: (s: string) => boolean = match.matcher(["a"]); } + { const a: (s: string) => boolean = match.matcher(["a"], {}); } + { const a: (s: string) => boolean = match.matcher(["a"], { basename: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { bash: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { cache: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { dot: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { failglob: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { ignore: "a" }); } + { const a: (s: string) => boolean = match.matcher(["a"], { ignore: ["a"] }); } + { const a: (s: string) => boolean = match.matcher(["a"], { matchBase: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nobrace: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nocase: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nodupes: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { noext: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { noglobstar: true }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nonegate: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nonull: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { nullglob: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { snapdragon: {} }); } + { const a: (s: string) => boolean = match.matcher(["a"], { sourcemap: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { unescape: false }); } + { const a: (s: string) => boolean = match.matcher(["a"], { unixify: false }); } + + { const a: string[] | null = match.capture("a", "a"); } + { const a: string[] | null = match.capture("a", "a", {}); } + { const a: string[] | null = match.capture("a", "a", { basename: false }); } + { const a: string[] | null = match.capture("a", "a", { bash: false }); } + { const a: string[] | null = match.capture("a", "a", { cache: false }); } + { const a: string[] | null = match.capture("a", "a", { dot: true }); } + { const a: string[] | null = match.capture("a", "a", { failglob: false }); } + { const a: string[] | null = match.capture("a", "a", { ignore: "a" }); } + { const a: string[] | null = match.capture("a", "a", { ignore: ["a"] }); } + { const a: string[] | null = match.capture("a", "a", { matchBase: false }); } + { const a: string[] | null = match.capture("a", "a", { nobrace: true }); } + { const a: string[] | null = match.capture("a", "a", { nocase: false }); } + { const a: string[] | null = match.capture("a", "a", { nodupes: true }); } + { const a: string[] | null = match.capture("a", "a", { noext: false }); } + { const a: string[] | null = match.capture("a", "a", { noglobstar: true }); } + { const a: string[] | null = match.capture("a", "a", { nonegate: false }); } + { const a: string[] | null = match.capture("a", "a", { nonull: false }); } + { const a: string[] | null = match.capture("a", "a", { nullglob: false }); } + { const a: string[] | null = match.capture("a", "a", { snapdragon: {} }); } + { const a: string[] | null = match.capture("a", "a", { sourcemap: false }); } + { const a: string[] | null = match.capture("a", "a", { unescape: false }); } + { const a: string[] | null = match.capture("a", "a", { unixify: false }); } + + { const a: RegExp = match.makeRe("a"); } + { const a: RegExp = match.makeRe("a", {}); } + { const a: RegExp = match.makeRe("a", { basename: false }); } + { const a: RegExp = match.makeRe("a", { bash: false }); } + { const a: RegExp = match.makeRe("a", { cache: false }); } + { const a: RegExp = match.makeRe("a", { dot: true }); } + { const a: RegExp = match.makeRe("a", { failglob: false }); } + { const a: RegExp = match.makeRe("a", { ignore: "a" }); } + { const a: RegExp = match.makeRe("a", { ignore: ["a"] }); } + { const a: RegExp = match.makeRe("a", { matchBase: false }); } + { const a: RegExp = match.makeRe("a", { nobrace: true }); } + { const a: RegExp = match.makeRe("a", { nocase: false }); } + { const a: RegExp = match.makeRe("a", { nodupes: true }); } + { const a: RegExp = match.makeRe("a", { noext: false }); } + { const a: RegExp = match.makeRe("a", { noglobstar: true }); } + { const a: RegExp = match.makeRe("a", { nonegate: false }); } + { const a: RegExp = match.makeRe("a", { nonull: false }); } + { const a: RegExp = match.makeRe("a", { nullglob: false }); } + { const a: RegExp = match.makeRe("a", { snapdragon: {} }); } + { const a: RegExp = match.makeRe("a", { sourcemap: false }); } + { const a: RegExp = match.makeRe("a", { unescape: false }); } + { const a: RegExp = match.makeRe("a", { unixify: false }); } + + { const a: string[] = match.braces("a"); } + { const a: string[] = match.braces("a", {}); } + { const a: string[] = match.braces("a", {}); } + { const a: string[] = match.braces("a", { basename: false }); } + { const a: string[] = match.braces("a", { bash: false }); } + { const a: string[] = match.braces("a", { cache: false }); } + { const a: string[] = match.braces("a", { dot: true }); } + { const a: string[] = match.braces("a", { failglob: false }); } + { const a: string[] = match.braces("a", { ignore: "a" }); } + { const a: string[] = match.braces("a", { ignore: ["a"] }); } + { const a: string[] = match.braces("a", { matchBase: false }); } + { const a: string[] = match.braces("a", { nobrace: true }); } + { const a: string[] = match.braces("a", { nocase: false }); } + { const a: string[] = match.braces("a", { nodupes: true }); } + { const a: string[] = match.braces("a", { noext: false }); } + { const a: string[] = match.braces("a", { noglobstar: true }); } + { const a: string[] = match.braces("a", { nonegate: false }); } + { const a: string[] = match.braces("a", { nonull: false }); } + { const a: string[] = match.braces("a", { nullglob: false }); } + { const a: string[] = match.braces("a", { snapdragon: {} }); } + { const a: string[] = match.braces("a", { sourcemap: false }); } + { const a: string[] = match.braces("a", { unescape: false }); } + { const a: string[] = match.braces("a", { unixify: false }); } + + { const a: object = match.create("a"); } + { const a: object = match.create("a", {}); } + { const a: object = match.create("a", { basename: false }); } + { const a: object = match.create("a", { bash: false }); } + { const a: object = match.create("a", { cache: false }); } + { const a: object = match.create("a", { dot: true }); } + { const a: object = match.create("a", { failglob: false }); } + { const a: object = match.create("a", { ignore: "a" }); } + { const a: object = match.create("a", { ignore: ["a"] }); } + { const a: object = match.create("a", { matchBase: false }); } + { const a: object = match.create("a", { nobrace: true }); } + { const a: object = match.create("a", { nocase: false }); } + { const a: object = match.create("a", { nodupes: true }); } + { const a: object = match.create("a", { noext: false }); } + { const a: object = match.create("a", { noglobstar: true }); } + { const a: object = match.create("a", { nonegate: false }); } + { const a: object = match.create("a", { nonull: false }); } + { const a: object = match.create("a", { nullglob: false }); } + { const a: object = match.create("a", { snapdragon: {} }); } + { const a: object = match.create("a", { sourcemap: false }); } + { const a: object = match.create("a", { unescape: false }); } + { const a: object = match.create("a", { unixify: false }); } + { const a: object = match.create("a"); } + + { const a: object = match.parse("a", {}); } + { const a: object = match.parse("a", { basename: false }); } + { const a: object = match.parse("a", { bash: false }); } + { const a: object = match.parse("a", { cache: false }); } + { const a: object = match.parse("a", { dot: true }); } + { const a: object = match.parse("a", { failglob: false }); } + { const a: object = match.parse("a", { ignore: "a" }); } + { const a: object = match.parse("a", { ignore: ["a"] }); } + { const a: object = match.parse("a", { matchBase: false }); } + { const a: object = match.parse("a", { nobrace: true }); } + { const a: object = match.parse("a", { nocase: false }); } + { const a: object = match.parse("a", { nodupes: true }); } + { const a: object = match.parse("a", { noext: false }); } + { const a: object = match.parse("a", { noglobstar: true }); } + { const a: object = match.parse("a", { nonegate: false }); } + { const a: object = match.parse("a", { nonull: false }); } + { const a: object = match.parse("a", { nullglob: false }); } + { const a: object = match.parse("a", { snapdragon: {} }); } + { const a: object = match.parse("a", { sourcemap: false }); } + { const a: object = match.parse("a", { unescape: false }); } + { const a: object = match.parse("a", { unixify: false }); } + + { const a: object = match.compile("a", {}); } + { const a: object = match.compile({}, {}); } + { const a: object = match.compile("a", { basename: false }); } + { const a: object = match.compile({}, { basename: false }); } + { const a: object = match.compile("a", { bash: false }); } + { const a: object = match.compile({}, { bash: false }); } + { const a: object = match.compile("a", { cache: false }); } + { const a: object = match.compile({}, { cache: false }); } + { const a: object = match.compile("a", { dot: true }); } + { const a: object = match.compile({}, { dot: true }); } + { const a: object = match.compile("a", { failglob: false }); } + { const a: object = match.compile({}, { failglob: false }); } + { const a: object = match.compile("a", { ignore: "a" }); } + { const a: object = match.compile({}, { ignore: "a" }); } + { const a: object = match.compile("a", { ignore: ["a"] }); } + { const a: object = match.compile({}, { ignore: ["a"] }); } + { const a: object = match.compile("a", { matchBase: false }); } + { const a: object = match.compile({}, { matchBase: false }); } + { const a: object = match.compile("a", { nobrace: true }); } + { const a: object = match.compile({}, { nobrace: true }); } + { const a: object = match.compile("a", { nocase: false }); } + { const a: object = match.compile({}, { nocase: false }); } + { const a: object = match.compile("a", { nodupes: true }); } + { const a: object = match.compile({}, { nodupes: true }); } + { const a: object = match.compile("a", { noext: false }); } + { const a: object = match.compile({}, { noext: false }); } + { const a: object = match.compile("a", { noglobstar: true }); } + { const a: object = match.compile({}, { noglobstar: true }); } + { const a: object = match.compile("a", { nonegate: false }); } + { const a: object = match.compile({}, { nonegate: false }); } + { const a: object = match.compile("a", { nonull: false }); } + { const a: object = match.compile({}, { nonull: false }); } + { const a: object = match.compile("a", { nullglob: false }); } + { const a: object = match.compile({}, { nullglob: false }); } + { const a: object = match.compile("a", { snapdragon: {} }); } + { const a: object = match.compile({}, { snapdragon: {} }); } + { const a: object = match.compile("a", { sourcemap: false }); } + { const a: object = match.compile({}, { sourcemap: false }); } + { const a: object = match.compile("a", { unescape: false }); } + { const a: object = match.compile({}, { unescape: false }); } + { const a: object = match.compile("a", { unixify: false }); } + { const a: object = match.compile({}, { unixify: false }); } + + { const a: number = match.MAX_LENGTH; } + match.clearCache(); + match.resizeCache(10050); + { const a: object = match.getCache(); } + } } diff --git a/types/adone/tsconfig.json b/types/adone/tsconfig.json index c23bf82155..e77e755b85 100644 --- a/types/adone/tsconfig.json +++ b/types/adone/tsconfig.json @@ -15,21 +15,44 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "experimentalDecorators": true }, "files": [ "index.d.ts", "adone.d.ts", + "glosses/fake.d.ts", "glosses/math/index.d.ts", "glosses/math/matrix.d.ts", "glosses/math/simd.d.ts", + "glosses/meta.d.ts", "glosses/std.d.ts", "glosses/utils.d.ts", "glosses/assertion.d.ts", "glosses/promise.d.ts", "glosses/shani.d.ts", "glosses/shani-global.d.ts", - "glosses/collections.d.ts", + "glosses/collections/index.d.ts", + "glosses/collections/array_set.d.ts", + "glosses/collections/async_queue.d.ts", + "glosses/collections/avl_tree.d.ts", + "glosses/collections/binary_search_tree.d.ts", + "glosses/collections/buffer_list.d.ts", + "glosses/collections/byte_array.d.ts", + "glosses/collections/default_map.d.ts", + "glosses/collections/fast_lru.d.ts", + "glosses/collections/linked_list.d.ts", + "glosses/collections/lru.d.ts", + "glosses/collections/map_cache.d.ts", + "glosses/collections/ns_cache.d.ts", + "glosses/collections/priority_queue.d.ts", + "glosses/collections/queue.d.ts", + "glosses/collections/rb_tree.d.ts", + "glosses/collections/refcounted_cache.d.ts", + "glosses/collections/set.d.ts", + "glosses/collections/stack.d.ts", + "glosses/collections/timedout_map.d.ts", "glosses/events.d.ts", "glosses/fs.d.ts", "glosses/is.d.ts", @@ -43,16 +66,37 @@ "adone-tests.ts", "test/index.ts", "test/index-import.ts", + "test/glosses/fake.ts", + "test/glosses/application.ts", + "test/glosses/collections/array_set.ts", + "test/glosses/collections/async_queue.ts", + "test/glosses/collections/avl_tree.ts", + "test/glosses/collections/binary_search_tree.ts", + "test/glosses/collections/buffer_list.ts", + "test/glosses/collections/byte_array.ts", + "test/glosses/collections/default_map.ts", + "test/glosses/collections/fast_lru.ts", + "test/glosses/collections/linked_list.ts", + "test/glosses/collections/lru.ts", + "test/glosses/collections/map_cache.ts", + "test/glosses/collections/ns_cache.ts", + "test/glosses/collections/priority_queue.ts", + "test/glosses/collections/queue.ts", + "test/glosses/collections/rb_tree.ts", + "test/glosses/collections/refcounted_cache.ts", + "test/glosses/collections/set.ts", + "test/glosses/collections/stack.ts", + "test/glosses/collections/timedout_map.ts", "test/glosses/math/index.ts", "test/glosses/math/matrix.ts", "test/glosses/math/simd.ts", + "test/glosses/meta.ts", "test/glosses/std.ts", "test/glosses/utils.ts", "test/glosses/assertion.ts", "test/glosses/promise.ts", "test/glosses/shani.ts", "test/glosses/shani-global.ts", - "test/glosses/collections.ts", "test/glosses/events.ts", "test/glosses/fs.ts", "test/glosses/is.ts", diff --git a/types/aframe/tsconfig.json b/types/aframe/tsconfig.json index 3385a8aca7..02c0041107 100755 --- a/types/aframe/tsconfig.json +++ b/types/aframe/tsconfig.json @@ -17,7 +17,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index 964eb1b836..5cd18baf76 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -1,4 +1,4 @@ -import * as Agenda from "agenda"; +import Agenda = require("agenda"); var mongoConnectionString = "mongodb://127.0.0.1/agenda"; diff --git a/types/agenda/tsconfig.json b/types/agenda/tsconfig.json index 0a553809fd..2f448c9517 100644 --- a/types/agenda/tsconfig.json +++ b/types/agenda/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aggregate-error/tsconfig.json b/types/aggregate-error/tsconfig.json index f092ab1c3e..836ac69bbf 100644 --- a/types/aggregate-error/tsconfig.json +++ b/types/aggregate-error/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/alertify/tsconfig.json b/types/alertify/tsconfig.json index 86ae0eac3d..731efc063b 100644 --- a/types/alertify/tsconfig.json +++ b/types/alertify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/alexa-sdk/index.d.ts b/types/alexa-sdk/index.d.ts index 02def0b4d6..56278df11c 100644 --- a/types/alexa-sdk/index.d.ts +++ b/types/alexa-sdk/index.d.ts @@ -1,14 +1,15 @@ -// Type definitions for Alexa SDK for Node.js 1.0 +// Type definitions for Alexa SDK for Node.js 1.1 // Project: https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs // Definitions by: Pete Beegle // Huw // pascalwhoop // Ben // rk-7 +// Alex Malcoci // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -export function handler(event: RequestBody, context: Context, callback?: (err: any, response: any) => void): AlexaObject; +export function handler(event: RequestBody, context: Context, callback?: (err: any, response: any) => void): AlexaObject; export function CreateStateHandler(state: string, obj: any): any; export let StateString: string; export type ConfirmationStatuses = "NONE" | "DENIED" | "CONFIRMED"; @@ -23,6 +24,8 @@ export type CardType = "Standard" | "Simple" | "LinkAccount" | "AskForPermission export type HintType = "PlainText"; export type DirectiveTypes = "AudioPlayer.Play" | "AudioPlayer.Stop" | "AudioPlayer.ClearQueue" | "Display.RenderTemplate" | "Hint" | "VideoApp.Launch"; export type TextContentType = "PlainText" | "RichText"; +export type MediaErrorType = "MEDIA_ERROR_UNKNOWN" | "MEDIA_ERROR_INVALID_REQUEST" | "MEDIA_ERROR_SERVICE_UNAVAILABLE" | "MEDIA_ERROR_INTERNAL_SERVER_ERROR" | "MEDIA_ERROR_INTERNAL_DEVICE_ERROR"; +export type SystemErrorType = "INVALID_RESPONSE" | "DEVICE_COMMUNICATION_ERROR" | "INTERNAL_ERROR"; //#region Types export interface CardImage { @@ -84,7 +87,7 @@ export interface Template { listItems?: ListItem[]; } -export interface AlexaObject extends Handler { +export interface AlexaObject extends Handler { _event: any; _context: any; _callback: any; @@ -98,11 +101,11 @@ export interface AlexaObject extends Handler { execute: () => void; } -export interface Handlers { +export interface Handlers { [intent: string]: (this: Handler) => void; } -export interface Handler { +export interface Handler { on: any; emit(event: string, ...args: any[]): boolean; emitWithState: any; @@ -141,7 +144,7 @@ export interface System { apiEndpoint: string; application: Application; device: any; - user: any; + user: SessionUser; } export interface AudioPlayer { token: string; @@ -151,10 +154,32 @@ export interface AudioPlayer { */ playerActivity: AudioPlayerActivity; } -export interface RequestBody { + +export interface Display { + token: string; +} + +export interface Device { + deviceId: string; + supportedInterfaces: DeviceInterfaces; +} + +export interface DeviceInterfaces { + AudioPlayer: any; + Display: any; +} + +export interface RequestContext { + AudioPlayer?: AudioPlayer; + Display?: Display; + System: System; +} + +export interface RequestBody { version: string; session: Session; request: T; + context: RequestContext; } export interface Session { @@ -187,8 +212,94 @@ export interface SessionEndedRequest extends Request { reason?: string; } +export interface AudioPlayerPlaybackRequest extends Request { + token: string; + offsetInMilliseconds: number; +} + +export interface AudioPlayerPlaybackFailedRequest extends Request { + token: string; + error: MediaError; + currentPlaybackState: AudioPlayer; +} + +export interface MediaError { + type: MediaErrorType; + message: string; +} + +export interface SystemExceptionEncounteredRequest extends Request { + error: SystemError; + cause: ErrorCause; +} + +export interface SystemError { + type: SystemErrorType; + message: string; +} + +export interface ErrorCause { + requestId: string; +} + +export interface SkillAccountRequest extends Request { + body: SkillAccountBody; +} + +export interface SkillAccountBody { + accessToken: string; +} + +export interface SkillPermissionRequest extends Request { + body: SkillPermissionBody; +} + +export interface SkillPermissionBody { + acceptedPermissions: PermissionScope[]; +} + +export interface PermissionScope { + scope: string; +} + +export interface ListEventRequest extends Request { + body: ListEventBody; +} + +export interface ListEventBody { + listId: string; + listItemIds?: string[]; +} + export interface Request { - type: "LaunchRequest" | "IntentRequest" | "SessionEndedRequest"; + type: "LaunchRequest" + | "IntentRequest" + | "SessionEndedRequest" + + | "System.ExceptionEncountered" + + | "AudioPlayer.PlaybackStarted" + | "AudioPlayer.PlaybackFinished" + | "AudioPlayer.PlaybackStopped" + | "AudioPlayer.PlaybackNearlyFinished" + + | "PlaybackController.NextCommandIssued" + | "PlaybackController.PauseCommandIssued" + | "PlaybackController.PlayCommandIssued" + | "PlaybackController.PreviousCommandIssued" + + | "AlexaSkillEvent.SkillAccountLinked" + | "AlexaSkillEvent.SkillEnabled" + | "AlexaSkillEvent.SkillDisabled" + | "AlexaSkillEvent.SkillPermissionAccepted" + | "AlexaSkillEvent.SkillPermissionChanged" + + | "AlexaHouseholdListEvent.ListCreated" + | "AlexaHouseholdListEvent.ListUpdated" + | "AlexaHouseholdListEvent.ListDeleted" + | "AlexaHouseholdListEvent.ItemsCreated" + | "AlexaHouseholdListEvent.ItemsUpdated" + | "AlexaHouseholdListEvent.ItemsDeleted"; requestId: string; timestamp: string; locale?: string; @@ -296,7 +407,7 @@ export interface ListItemObject { /** * item version (Positive integer) */ - version?: number | string; + version: number; /** * created time (ISO 8601 time format with time zone) */ @@ -348,6 +459,38 @@ export interface ListObject { * Items that belong to this list. */ items: ListItemObject[]; + + next?: ListLinks; +} + +export interface ListLinks { + next: string; +} + +export interface ListCollection { + lists: ListObject[]; +} + +export interface CreateListParams { + name: string; + state: "active"; +} + +export interface UpdateListParams { + name: string; + state: ListObjectState; + version: number; +} + +export interface CreateListItemParams { + value: string; + status: ListItemObjectStatus; +} + +export interface UpdateListItemParams { + value: string; + status: ListItemObjectStatus; + version: number; } //#endregion @@ -545,7 +688,7 @@ export namespace templateBuilders { //#region services export namespace services { - interface ApiClient { + class ApiClient { /** * Make a POST API call to the specified uri with headers and optional body * @param uri http(s?) endpoint to call @@ -582,7 +725,7 @@ export namespace services { * Create an instance of DeviceAddressService * @param [apiClient=new ApiClient()] ApiClient */ - constructor(apiClient: ApiClient); + constructor(apiClient?: ApiClient); /** * Get full address information from Alexa Device Address API @@ -607,7 +750,7 @@ export namespace services { * Creates an instance of DirectiveService. * @param [apiClient=new ApiClient()] ApiClient */ - constructor(apiClient: ApiClient); + constructor(apiClient?: ApiClient); /** * Send the specified directiveObj to Alexa directive service @@ -624,7 +767,7 @@ export namespace services { * Create an instance of ListManagementService * @param apiClient apiClient */ - constructor(apiClient: ApiClient); + constructor(apiClient?: ApiClient); /** * Set apiEndpoint address, default is "https://api.amazonalexa.com" @@ -642,80 +785,80 @@ export namespace services { /** * Retrieve the metadata for all customer lists, including the customer's default lists * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - getListsMetadata(token: string): Promise; + getListsMetadata(token: string): Promise; /** * Create a custom list. The new list name must be different than any existing list name - * @param listObject listObject + * @param params params * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - createList(listObject: ListObject, token: string): Promise; + createList(params: CreateListParams, token: string): Promise; /** * Retrieve list metadata including the items in the list with requested status * @param listId unique Id associated with the list * @param itemStatus itemsStatus can be either "active" or "completed" * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - getList(listId: string, itemStatus: ListItemObjectStatus, token: string): Promise; + getList(listId: string, itemStatus: ListItemObjectStatus, token: string): Promise; /** * Update a custom list. Only the list name or state can be updated * @param listId unique Id associated with the list - * @param listObject listObject + * @param params params * @param token bearer token for list management permission * @returns Promise */ - updateList(listId: string, listObject: ListObject, token: string): Promise; + updateList(listId: string, params: UpdateListParams, token: string): Promise; /** * Delete a custom list * @param listId unique Id associated with the list * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - deleteList(listId: string, token: string): Promise; + deleteList(listId: string, token: string): Promise; /** * Create an item in an active list or in a default list * @param listId unique Id associated with the list - * @param listItemObject listItemObject + * @param params params * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - createListItem(listId: string, listItemObject: ListItemObject, token: string): Promise; + createListItem(listId: string, params: CreateListItemParams, token: string): Promise; /** * Retrieve single item within any list by listId and itemId * @param listId unique Id associated with the list * @param itemId unique Id associated with the item * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - getListItem(listId: string, itemId: string, token: string): Promise; + getListItem(listId: string, itemId: string, token: string): Promise; /** * Update an item value or item status * @param listId unique Id associated with the list * @param itemId unique Id associated with the item - * @param listItemObject listItemObject + * @param params params * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - updateListItem(listId: string, itemId: string, listItemObject: ListItemObject, token: string): Promise; + updateListItem(listId: string, itemId: string, params: UpdateListItemParams, token: string): Promise; /** * Delete an item in the specified list * @param listId unique Id associated with the list * @param itemId unique Id associated with the item * @param token bearer token for list management permission - * @returns Promise + * @returns Promise */ - deleteListItem(listId: string, itemId: string, token: string): Promise; + deleteListItem(listId: string, itemId: string, token: string): Promise; } } //#endregion diff --git a/types/alexa-sdk/tsconfig.json b/types/alexa-sdk/tsconfig.json index d1932fa469..0fe3e93a8e 100644 --- a/types/alexa-sdk/tsconfig.json +++ b/types/alexa-sdk/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "alexa-sdk-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/alexa-voice-service/tsconfig.json b/types/alexa-voice-service/tsconfig.json index 737cccf9e6..90b1ec9310 100644 --- a/types/alexa-voice-service/tsconfig.json +++ b/types/alexa-voice-service/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/algebra.js/tsconfig.json b/types/algebra.js/tsconfig.json index e9f585ef8a..db065d64f2 100644 --- a/types/algebra.js/tsconfig.json +++ b/types/algebra.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index eb1cecf2d6..5c7026d70e 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -701,7 +701,7 @@ declare namespace algoliasearch { * return {Promise} * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects */ - addObjects(objects: [{}]): Promise; + addObjects(objects: {}[]): Promise; /** * Add or replace a specific object * @param object @@ -729,7 +729,7 @@ declare namespace algoliasearch { * return {Promise} * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - partialUpdateObjects(objects: [{}]): Promise; + partialUpdateObjects(objects: {}[]): Promise; /** * Delete a specific object * @param objectID @@ -1387,6 +1387,12 @@ Interface describing options available for gettings the logs * https://github.com/algolia/algoliasearch-client-js#unretrievableattributes */ unretrievableAttributes?: string[]; + /** + * List of attributes you want to use for textual search + * default: [] + * https://github.com/algolia/algoliasearch-client-js#searchableattributes + */ + searchableAttributes?: string[]; /** * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer * default: * @@ -1602,7 +1608,7 @@ Interface describing options available for gettings the logs * default: [] * https://github.com/algolia/algoliasearch-client-js#altcorrections */ - altCorrections?: [{}]; + altCorrections?: {}[]; /** * Configure the precision of the proximity ranking criterion * default: 1 diff --git a/types/algoliasearch/tsconfig.json b/types/algoliasearch/tsconfig.json index 4d7e52dd8b..41a2b8341e 100644 --- a/types/algoliasearch/tsconfig.json +++ b/types/algoliasearch/tsconfig.json @@ -1,16 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": ["es6"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": ["index.d.ts", "algoliasearch-tests.ts"] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "algoliasearch-tests.ts" + ] +} \ No newline at end of file diff --git a/types/alt/tsconfig.json b/types/alt/tsconfig.json index 82260e525d..d062b2a515 100644 --- a/types/alt/tsconfig.json +++ b/types/alt/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amazon-product-api/tsconfig.json b/types/amazon-product-api/tsconfig.json index 060741740b..148065775e 100644 --- a/types/amazon-product-api/tsconfig.json +++ b/types/amazon-product-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amcharts/tsconfig.json b/types/amcharts/tsconfig.json index 1d07459b73..83ea10e97c 100644 --- a/types/amcharts/tsconfig.json +++ b/types/amcharts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amplify-deferred/tsconfig.json b/types/amplify-deferred/tsconfig.json index 443772e942..2e8ba65ef8 100644 --- a/types/amplify-deferred/tsconfig.json +++ b/types/amplify-deferred/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amplify/tsconfig.json b/types/amplify/tsconfig.json index 44daa69ba9..f6c250d148 100644 --- a/types/amplify/tsconfig.json +++ b/types/amplify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amplitude-js/tsconfig.json b/types/amplitude-js/tsconfig.json index 0ca8f85efe..78806bc9f3 100644 --- a/types/amplitude-js/tsconfig.json +++ b/types/amplitude-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amqp-rpc/tsconfig.json b/types/amqp-rpc/tsconfig.json index f8bfc7aa64..29eaed2194 100644 --- a/types/amqp-rpc/tsconfig.json +++ b/types/amqp-rpc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amqp/tsconfig.json b/types/amqp/tsconfig.json index e73b54d700..e388306124 100644 --- a/types/amqp/tsconfig.json +++ b/types/amqp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/amqplib/tsconfig.json b/types/amqplib/tsconfig.json index b5b83b84ce..e678b2ed30 100644 --- a/types/amqplib/tsconfig.json +++ b/types/amqplib/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/analytics-node/tsconfig.json b/types/analytics-node/tsconfig.json index 3684577e65..8a01d1d5f7 100644 --- a/types/analytics-node/tsconfig.json +++ b/types/analytics-node/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-agility/tsconfig.json b/types/angular-agility/tsconfig.json index 460060cde0..b0b8a89582 100644 --- a/types/angular-agility/tsconfig.json +++ b/types/angular-agility/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-animate/tsconfig.json b/types/angular-animate/tsconfig.json index d34d6a1d77..19a01dfff9 100644 --- a/types/angular-animate/tsconfig.json +++ b/types/angular-animate/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-block-ui/tsconfig.json b/types/angular-block-ui/tsconfig.json index f5717731be..38788cb14c 100644 --- a/types/angular-block-ui/tsconfig.json +++ b/types/angular-block-ui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-bootstrap-calendar/tsconfig.json b/types/angular-bootstrap-calendar/tsconfig.json index 72a05b7ce7..5bcba1159b 100644 --- a/types/angular-bootstrap-calendar/tsconfig.json +++ b/types/angular-bootstrap-calendar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-bootstrap-lightbox/tsconfig.json b/types/angular-bootstrap-lightbox/tsconfig.json index 3792bc3da5..5e8d01f684 100644 --- a/types/angular-bootstrap-lightbox/tsconfig.json +++ b/types/angular-bootstrap-lightbox/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-breadcrumb/tsconfig.json b/types/angular-breadcrumb/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/angular-breadcrumb/tsconfig.json +++ b/types/angular-breadcrumb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/angular-clipboard/tsconfig.json b/types/angular-clipboard/tsconfig.json index 0c6a1dadaf..504fce5afd 100644 --- a/types/angular-clipboard/tsconfig.json +++ b/types/angular-clipboard/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-cookie/tsconfig.json b/types/angular-cookie/tsconfig.json index ae3ec8dd21..c4dd687a17 100644 --- a/types/angular-cookie/tsconfig.json +++ b/types/angular-cookie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-cookies/tsconfig.json b/types/angular-cookies/tsconfig.json index d34d6a1d77..19a01dfff9 100644 --- a/types/angular-cookies/tsconfig.json +++ b/types/angular-cookies/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-deferred-bootstrap/tsconfig.json b/types/angular-deferred-bootstrap/tsconfig.json index 119199cc5a..48a0fc6c3b 100644 --- a/types/angular-deferred-bootstrap/tsconfig.json +++ b/types/angular-deferred-bootstrap/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-dialog-service/tsconfig.json b/types/angular-dialog-service/tsconfig.json index b6db392406..06a65572bf 100644 --- a/types/angular-dialog-service/tsconfig.json +++ b/types/angular-dialog-service/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-dynamic-locale/tsconfig.json b/types/angular-dynamic-locale/tsconfig.json index b117d5eabe..2669a8f2c1 100644 --- a/types/angular-dynamic-locale/tsconfig.json +++ b/types/angular-dynamic-locale/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-environment/tsconfig.json b/types/angular-environment/tsconfig.json index 35bd754e95..62fb380377 100644 --- a/types/angular-environment/tsconfig.json +++ b/types/angular-environment/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-es/tsconfig.json b/types/angular-es/tsconfig.json index 8eb4ea8925..1ef656103f 100644 --- a/types/angular-es/tsconfig.json +++ b/types/angular-es/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-feature-flags/tsconfig.json b/types/angular-feature-flags/tsconfig.json index 07b352a43c..d90297220f 100644 --- a/types/angular-feature-flags/tsconfig.json +++ b/types/angular-feature-flags/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-file-saver/tsconfig.json b/types/angular-file-saver/tsconfig.json index 60a3fb0eca..c00f267d7d 100644 --- a/types/angular-file-saver/tsconfig.json +++ b/types/angular-file-saver/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-file-upload/tsconfig.json b/types/angular-file-upload/tsconfig.json index 11194d71d0..ac8f890b89 100644 --- a/types/angular-file-upload/tsconfig.json +++ b/types/angular-file-upload/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-formly/tsconfig.json b/types/angular-formly/tsconfig.json index 3812b7cd66..7b6a686160 100644 --- a/types/angular-formly/tsconfig.json +++ b/types/angular-formly/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-fullscreen/tsconfig.json b/types/angular-fullscreen/tsconfig.json index 72a22e0897..03dc1874c4 100644 --- a/types/angular-fullscreen/tsconfig.json +++ b/types/angular-fullscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-gettext/tsconfig.json b/types/angular-gettext/tsconfig.json index 43c7dc3cab..074b1ad11a 100644 --- a/types/angular-gettext/tsconfig.json +++ b/types/angular-gettext/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-google-analytics/tsconfig.json b/types/angular-google-analytics/tsconfig.json index b66432d04c..aff84bc612 100644 --- a/types/angular-google-analytics/tsconfig.json +++ b/types/angular-google-analytics/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-gridster/tsconfig.json b/types/angular-gridster/tsconfig.json index 94b4c6ceff..e722d13578 100644 --- a/types/angular-gridster/tsconfig.json +++ b/types/angular-gridster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-growl-v2/tsconfig.json b/types/angular-growl-v2/tsconfig.json index 16ccffe41f..38d37a5922 100644 --- a/types/angular-growl-v2/tsconfig.json +++ b/types/angular-growl-v2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-hotkeys/tsconfig.json b/types/angular-hotkeys/tsconfig.json index acb11ff247..efb5ab899b 100644 --- a/types/angular-hotkeys/tsconfig.json +++ b/types/angular-hotkeys/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "angular-hotkeys-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/angular-http-auth/tsconfig.json b/types/angular-http-auth/tsconfig.json index 61029fcc00..ac7e064e0e 100644 --- a/types/angular-http-auth/tsconfig.json +++ b/types/angular-http-auth/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-httpi/tsconfig.json b/types/angular-httpi/tsconfig.json index 64c28306cf..ea3d19611c 100644 --- a/types/angular-httpi/tsconfig.json +++ b/types/angular-httpi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-idle/tsconfig.json b/types/angular-idle/tsconfig.json index 57cc641db8..442299d2f1 100644 --- a/types/angular-idle/tsconfig.json +++ b/types/angular-idle/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-jwt/tsconfig.json b/types/angular-jwt/tsconfig.json index b884cbc435..eb96bc8736 100644 --- a/types/angular-jwt/tsconfig.json +++ b/types/angular-jwt/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-load/tsconfig.json b/types/angular-load/tsconfig.json index ee5ee74b72..970cb503e6 100644 --- a/types/angular-load/tsconfig.json +++ b/types/angular-load/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-loading-bar/tsconfig.json b/types/angular-loading-bar/tsconfig.json index f639942629..8311dad9f5 100644 --- a/types/angular-loading-bar/tsconfig.json +++ b/types/angular-loading-bar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-local-storage/tsconfig.json b/types/angular-local-storage/tsconfig.json index 44c357b558..5a73ac26f9 100644 --- a/types/angular-local-storage/tsconfig.json +++ b/types/angular-local-storage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-localforage/tsconfig.json b/types/angular-localforage/tsconfig.json index dc98f1186d..847bbbbda0 100644 --- a/types/angular-localforage/tsconfig.json +++ b/types/angular-localforage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-locker/tsconfig.json b/types/angular-locker/tsconfig.json index 35091c7ea8..d0fbbafb71 100644 --- a/types/angular-locker/tsconfig.json +++ b/types/angular-locker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-material/tsconfig.json b/types/angular-material/tsconfig.json index 3ecdc4851c..7184dc1fb1 100644 --- a/types/angular-material/tsconfig.json +++ b/types/angular-material/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-media-queries/tsconfig.json b/types/angular-media-queries/tsconfig.json index 6a02589dc1..80d3ac3f0c 100644 --- a/types/angular-media-queries/tsconfig.json +++ b/types/angular-media-queries/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-meteor/tsconfig.json b/types/angular-meteor/tsconfig.json index 16d4015269..62d012a4af 100644 --- a/types/angular-meteor/tsconfig.json +++ b/types/angular-meteor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-mocks/tsconfig.json b/types/angular-mocks/tsconfig.json index cfce69a898..84f176c47b 100644 --- a/types/angular-mocks/tsconfig.json +++ b/types/angular-mocks/tsconfig.json @@ -20,6 +20,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-modal/tsconfig.json b/types/angular-modal/tsconfig.json index c727f39fbb..7eb8491cd7 100644 --- a/types/angular-modal/tsconfig.json +++ b/types/angular-modal/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-notifications/tsconfig.json b/types/angular-notifications/tsconfig.json index 7186df8fd5..8914d19761 100644 --- a/types/angular-notifications/tsconfig.json +++ b/types/angular-notifications/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-notify/tsconfig.json b/types/angular-notify/tsconfig.json index a993101ea8..2a45fe4c01 100644 --- a/types/angular-notify/tsconfig.json +++ b/types/angular-notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-oauth2/tsconfig.json b/types/angular-oauth2/tsconfig.json index 253e138f2f..6c8b2cff83 100644 --- a/types/angular-oauth2/tsconfig.json +++ b/types/angular-oauth2/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-odata-resources/tsconfig.json b/types/angular-odata-resources/tsconfig.json index cf8b87b038..bf9ce61633 100644 --- a/types/angular-odata-resources/tsconfig.json +++ b/types/angular-odata-resources/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-pdfjs-viewer/tsconfig.json b/types/angular-pdfjs-viewer/tsconfig.json index bdae87bf50..584aacaaf3 100644 --- a/types/angular-pdfjs-viewer/tsconfig.json +++ b/types/angular-pdfjs-viewer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-permission/tsconfig.json b/types/angular-permission/tsconfig.json index 80dd668340..ccc8ab9ba0 100644 --- a/types/angular-permission/tsconfig.json +++ b/types/angular-permission/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-promise-tracker/tsconfig.json b/types/angular-promise-tracker/tsconfig.json index 2e81cb6ea3..89ba7d321d 100644 --- a/types/angular-promise-tracker/tsconfig.json +++ b/types/angular-promise-tracker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-q-spread/tsconfig.json b/types/angular-q-spread/tsconfig.json index a00f0e4d5f..8b381fb83f 100644 --- a/types/angular-q-spread/tsconfig.json +++ b/types/angular-q-spread/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-resource/tsconfig.json b/types/angular-resource/tsconfig.json index 7599b3e12e..1f4598b8b9 100644 --- a/types/angular-resource/tsconfig.json +++ b/types/angular-resource/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-route/tsconfig.json b/types/angular-route/tsconfig.json index 9960b488ba..12021442e1 100644 --- a/types/angular-route/tsconfig.json +++ b/types/angular-route/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-sanitize/tsconfig.json b/types/angular-sanitize/tsconfig.json index 4ce7848518..2e1212592b 100644 --- a/types/angular-sanitize/tsconfig.json +++ b/types/angular-sanitize/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular-scenario/tsconfig.json b/types/angular-scenario/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/angular-scenario/tsconfig.json +++ b/types/angular-scenario/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/angular-scroll/tsconfig.json b/types/angular-scroll/tsconfig.json index b6d6daecb2..a844a05fd7 100644 --- a/types/angular-scroll/tsconfig.json +++ b/types/angular-scroll/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-signalr-hub/tsconfig.json b/types/angular-signalr-hub/tsconfig.json index d0e69b894d..d81d1cccc6 100644 --- a/types/angular-signalr-hub/tsconfig.json +++ b/types/angular-signalr-hub/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-spinner/tsconfig.json b/types/angular-spinner/tsconfig.json index e09fc93f8e..8eebbd1455 100644 --- a/types/angular-spinner/tsconfig.json +++ b/types/angular-spinner/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-storage/tsconfig.json b/types/angular-storage/tsconfig.json index 07dc148cef..e88846bcec 100644 --- a/types/angular-storage/tsconfig.json +++ b/types/angular-storage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-strap/tsconfig.json b/types/angular-strap/tsconfig.json index 7ac157876b..da95fa04c8 100644 --- a/types/angular-strap/tsconfig.json +++ b/types/angular-strap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-toastr/tsconfig.json b/types/angular-toastr/tsconfig.json index be88b26d08..36a22e1aee 100644 --- a/types/angular-toastr/tsconfig.json +++ b/types/angular-toastr/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-toasty/tsconfig.json b/types/angular-toasty/tsconfig.json index 085335904c..f4e2c1c4d0 100644 --- a/types/angular-toasty/tsconfig.json +++ b/types/angular-toasty/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-tooltips/tsconfig.json b/types/angular-tooltips/tsconfig.json index 8465b76909..84f3606454 100644 --- a/types/angular-tooltips/tsconfig.json +++ b/types/angular-tooltips/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-touchspin/tsconfig.json b/types/angular-touchspin/tsconfig.json index 8c3d5338c4..4084b66480 100644 --- a/types/angular-touchspin/tsconfig.json +++ b/types/angular-touchspin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-translate/tsconfig.json b/types/angular-translate/tsconfig.json index 7b3df3db88..02bb9edf7a 100644 --- a/types/angular-translate/tsconfig.json +++ b/types/angular-translate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-bootstrap/tsconfig.json b/types/angular-ui-bootstrap/tsconfig.json index 62765ca465..36174e37b6 100644 --- a/types/angular-ui-bootstrap/tsconfig.json +++ b/types/angular-ui-bootstrap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-notification/tsconfig.json b/types/angular-ui-notification/tsconfig.json index 25e3769186..2b774ef2ff 100644 --- a/types/angular-ui-notification/tsconfig.json +++ b/types/angular-ui-notification/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-router/tsconfig.json b/types/angular-ui-router/tsconfig.json index 83aeab8d3b..ba18a834ba 100644 --- a/types/angular-ui-router/tsconfig.json +++ b/types/angular-ui-router/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-scroll/tsconfig.json b/types/angular-ui-scroll/tsconfig.json index 8fb95049e4..90fd12c708 100644 --- a/types/angular-ui-scroll/tsconfig.json +++ b/types/angular-ui-scroll/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-sortable/tsconfig.json b/types/angular-ui-sortable/tsconfig.json index b96f69101e..3defe86650 100644 --- a/types/angular-ui-sortable/tsconfig.json +++ b/types/angular-ui-sortable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-ui-tree/tsconfig.json b/types/angular-ui-tree/tsconfig.json index cb2693e910..3c8fa163c7 100644 --- a/types/angular-ui-tree/tsconfig.json +++ b/types/angular-ui-tree/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-websocket/tsconfig.json b/types/angular-websocket/tsconfig.json index 89d5cb9dc3..b24f8dfdf8 100644 --- a/types/angular-websocket/tsconfig.json +++ b/types/angular-websocket/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "angular-websocket-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/angular-wizard/tsconfig.json b/types/angular-wizard/tsconfig.json index a87aedbbe4..2409b05725 100644 --- a/types/angular-wizard/tsconfig.json +++ b/types/angular-wizard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular-xeditable/tsconfig.json b/types/angular-xeditable/tsconfig.json index 44cdeea7bf..de3ba1d092 100644 --- a/types/angular-xeditable/tsconfig.json +++ b/types/angular-xeditable/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/angular.throttle/tsconfig.json b/types/angular.throttle/tsconfig.json index bcee04a06f..11865e0ab8 100644 --- a/types/angular.throttle/tsconfig.json +++ b/types/angular.throttle/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 795e74a058..0b05400f6d 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -289,25 +289,25 @@ foo.then((x) => { // $q signature tests namespace TestQ { - interface TResult { + interface AbcObject { a: number; b: string; c: boolean; } - interface TValue { + interface EfObject { e: number; f: boolean; } - interface TOther { + interface GhObject { g: string; h: number; } - const tResult: TResult = null; - const promiseTResult: angular.IPromise = null; - const tValue: TValue = null; - const promiseTValue: angular.IPromise = null; - const tOther: TOther = null; - const promiseTOther: angular.IPromise = null; + const abcObject: AbcObject = null; + const abcObjectPromise: angular.IPromise = null; + const efObject: EfObject = null; + const efObjectPromise: angular.IPromise = null; + const ghObject: GhObject = null; + const ghObjectPromise: angular.IPromise = null; const $q: angular.IQService = null; const promiseAny: angular.IPromise = null; @@ -316,11 +316,11 @@ namespace TestQ { // $q constructor { - let result: angular.IPromise; - result = new $q((resolve: (value: TResult) => any) => {}); - result = new $q((resolve: (value: TResult) => any, reject: (value: any) => any) => {}); - result = $q((resolve: (value: TResult) => any) => {}); - result = $q((resolve: (value: TResult) => any, reject: (value: any) => any) => {}); + let result: angular.IPromise; + result = new $q((resolve: (value: AbcObject) => any) => {}); + result = new $q((resolve: (value: AbcObject) => any, reject: (value: any) => any) => {}); + result = $q((resolve: (value: AbcObject) => any) => {}); + result = $q((resolve: (value: AbcObject) => any, reject: (value: any) => any) => {}); } // $q.all @@ -332,8 +332,8 @@ namespace TestQ { $q.all([1, $q.when(2), '3']).then(([ n1, n2, n3 ]) => n1.toFixed() + n2.toFixed() + n3.slice(1)); } { - let result: angular.IPromise; - result = $q.all([promiseAny, promiseAny]); + let result: angular.IPromise; + result = $q.all([promiseAny, promiseAny]); } { let result: angular.IPromise<{[id: string]: any; }>; @@ -356,13 +356,13 @@ namespace TestQ { // $q.defer { - let result: angular.IDeferred; - result = $q.defer(); - result.resolve(tResult); + let result: angular.IDeferred; + result = $q.defer(); + result.resolve(abcObject); const anyValue: any = null; result.reject(anyValue); result.promise.then(result => { - return $q.resolve(result); + return $q.resolve(result); }); } @@ -380,10 +380,10 @@ namespace TestQ { result = $q.resolve(); } { - let result: angular.IPromise; - result = $q.resolve(tResult); - result = $q.resolve(promiseTResult); - const result2: angular.IPromise = $q.resolve(Math.random() > 0.5 ? tResult : promiseTOther); + let result: angular.IPromise; + result = $q.resolve(abcObject); + result = $q.resolve(abcObjectPromise); + const result2: angular.IPromise = $q.resolve(Math.random() > 0.5 ? abcObject : ghObjectPromise); } // $q.when @@ -392,32 +392,32 @@ namespace TestQ { result = $q.when(); } { - let result: angular.IPromise; - let resultOther: angular.IPromise; + let result: angular.IPromise; + let resultOther: angular.IPromise; - result = $q.when(tResult); - result = $q.when(promiseTResult); + result = $q.when(abcObject); + result = $q.when(abcObjectPromise); - result = $q.when(tValue, (result: TValue) => tResult); - result = $q.when(tValue, (result: TValue) => tResult, (any) => any); - result = $q.when(tValue, (result: TValue) => tResult, (any) => any, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObject); + result = $q.when(efObject, (result: EfObject) => abcObject, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObject, (any) => any, (any) => any); - result = $q.when(promiseTValue, (result: TValue) => tResult); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => tOther); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => tOther); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => tOther, (any) => any); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => promiseTOther); - resultOther = $q.when(promiseTValue, (result: TValue) => tResult, (any) => promiseTOther, (any) => any); + result = $q.when(efObjectPromise, (result: EfObject) => abcObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObject, (any) => any); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); - result = $q.when(tValue, (result: TValue) => promiseTResult); - result = $q.when(tValue, (result: TValue) => promiseTResult, (any) => any); - result = $q.when(tValue, (result: TValue) => promiseTResult, (any) => any, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any, (any) => any); - result = $q.when(promiseTValue, (result: TValue) => promiseTResult); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => tOther); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => tOther, (any) => any); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => promiseTOther); - resultOther = $q.when(promiseTValue, (result: TValue) => promiseTResult, (any) => promiseTOther, (any) => any); + result = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject, (any) => any); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObjectPromise); + resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObjectPromise, (any) => any); } } @@ -440,41 +440,41 @@ httpFoo.then((response: ng.IHttpResponse) => { // Deferred signature tests namespace TestDeferred { - const any: any = null; + const anything: any = null; - interface TResult { + interface AbcObject { a: number; b: string; c: boolean; } - const tResult: TResult = null; + const abcObject: AbcObject = null; - const deferred: angular.IDeferred = null; + const deferred: angular.IDeferred = null; // deferred.resolve { let result: void; result = deferred.resolve(); - result = deferred.resolve(tResult); + result = deferred.resolve(abcObject); } // deferred.reject { let result: void; result = deferred.reject(); - result = deferred.reject(any); + result = deferred.reject(anything); } // deferred.notify { let result: void; result = deferred.notify(); - result = deferred.notify(any); + result = deferred.notify(anything); } // deferred.promise { - let result: angular.IPromise; + let result: angular.IPromise; result = deferred.promise; } } @@ -517,111 +517,189 @@ namespace TestInjector { // Promise signature tests namespace TestPromise { - const any: any = null; + const anything: any = null; - interface TResult { - kind: 'result'; + interface AbcObject { + kind: 'abc'; a: number; b: string; c: boolean; } - interface TOther { - kind: 'other'; + interface DefObject { + kind: 'def'; d: number; e: string; f: boolean; } - function isTResult(x: TResult | TOther): x is TResult { - return x.kind === 'result'; + function isAbcObject(x: AbcObject | DefObject): x is AbcObject { + return x.kind === 'abc'; } - const tresult: TResult = null; - const tresultPromise: ng.IPromise = null; - const tresultHttpPromise: ng.IHttpPromise = null; + const abcObject: AbcObject = null; + const abcObjectPromise: ng.IPromise = null; + const abcObjectHttpPromise: ng.IHttpPromise = null; - const tother: TOther = null; - const totherPromise: ng.IPromise = null; - const totherHttpPromise: ng.IHttpPromise = null; + const defObject: DefObject = null; + const defObjectPromise: ng.IPromise = null; + const defObjectHttpPromise: ng.IHttpPromise = null; - const promise: angular.IPromise = null; + const promise: angular.IPromise = null; const $q: angular.IQService = null; - const assertPromiseType = (arg: angular.IPromise) => arg; - const reject = $q.reject(); + const rejectedPromise = $q.reject(); // promise.then - assertPromiseType(promise.then((result) => any)); - assertPromiseType(promise.then((result) => any, (any) => any)); - assertPromiseType(promise.then((result) => any, (any) => any, (any) => any)); + // $ExpectType IPromise + promise.then(result => anything); + // $ExpectType IPromise + promise.then(result => anything, any => any); + // $ExpectType IPromise + promise.then(result => anything, any => any, any => any); - assertPromiseType(promise.then((result) => reject)); - assertPromiseType(promise.then((result) => reject, (any) => reject)); - assertPromiseType(promise.then((result) => reject, (any) => reject, (any) => any)); + // $ExpectType IPromise + promise.then(result => rejectedPromise); + // $ExpectType IPromise + promise.then(result => rejectedPromise, any => rejectedPromise); + // $ExpectType IPromise + promise.then(result => rejectedPromise, any => rejectedPromise, any => any); - assertPromiseType(promise.then((result) => result)); - assertPromiseType(promise.then((result) => tresult)); - assertPromiseType(promise.then((result) => tresultPromise)); - assertPromiseType(promise.then((result) => result, (any) => any)); - assertPromiseType(promise.then((result) => result, (any) => any, (any) => any)); - assertPromiseType(promise.then((result) => result, (any) => reject, (any) => any)); + // $ExpectType IPromise + promise.then(result => result); + // $ExpectType IPromise + promise.then(result => abcObject); + // $ExpectType IPromise + promise.then(result => abcObjectPromise); + // $ExpectType IPromise + promise.then(result => result, any => any); + // $ExpectType IPromise + promise.then(result => result, any => Math.random()); + // $ExpectType IPromise + promise.then(result => result, any => any, any => any); + // $ExpectType IPromise + promise.then(result => result, any => Math.random(), any => any); + // $ExpectType IPromise + promise.then(result => result, any => rejectedPromise, any => any); - assertPromiseType | TResult>(promise.then((result) => anyOf2(reject, result))); - assertPromiseType(promise.then((result) => anyOf3(result, tresultPromise, reject))); - assertPromiseType(promise.then( - (result) => anyOf3(reject, result, tresultPromise), - (reason) => anyOf3(reject, tresult, tresultPromise) - )); + // $ExpectType IPromise + promise.then(result => anyOf2(rejectedPromise, result)); + // $ExpectType IPromise + promise.then(result => anyOf3(result, abcObjectPromise, rejectedPromise)); + // $ExpectType IPromise + promise.then( + result => anyOf3(rejectedPromise, result, abcObjectPromise), + reason => anyOf3(rejectedPromise, abcObject, abcObjectPromise) + ); - assertPromiseType>(promise.then((result) => tresultHttpPromise)); + // $ExpectType IPromise> + promise.then(result => abcObjectHttpPromise); - assertPromiseType(promise.then((result) => result, (any) => tother)); - assertPromiseType | angular.IPromise | TOther | angular.IPromise>(promise.then( - (result) => anyOf3(reject, result, totherPromise), - (reason) => anyOf3(reject, tother, tresultPromise) - )); + // $ExpectType IPromise + promise.then(result => result, any => defObject); - assertPromiseType(promise.then( - (result) => anyOf3(tresultPromise, result, totherPromise) - )); + // These are broken and seemingly can't be made to work + // with the current limitations of TypeScript. - assertPromiseType(promise.then((result) => result, (any) => tother, (any) => any)); - assertPromiseType(promise.then((result) => tresultPromise, (any) => totherPromise)); - assertPromiseType(promise.then((result) => tresultPromise, (any) => totherPromise, (any) => any)); - assertPromiseType>(promise.then((result) => tresultHttpPromise, (any) => totherHttpPromise)); - assertPromiseType>(promise.then((result) => tresultHttpPromise, (any) => totherHttpPromise, (any) => any)); + // xExpectType IPromise + // promise.then(result => anyOf2(result, defObjectPromise)); + // xExpectType IPromise + // promise.then(result => anyOf3(rejectedPromise, result, defObjectPromise)); + // xExpectType IPromise + // const a4 = promise.then( + // result => anyOf3(rejectedPromise, result, defObjectPromise), + // reason => anyOf3(rejectedPromise, defObject, abcObjectPromise) + // ); - assertPromiseType(promise.then((result) => tother)); - assertPromiseType(promise.then((result) => tother, (any) => any)); - assertPromiseType(promise.then((result) => tother, (any) => any, (any) => any)); - assertPromiseType(promise.then((result) => totherPromise)); - assertPromiseType(promise.then((result) => totherPromise, (any) => any)); - assertPromiseType(promise.then((result) => totherPromise, (any) => any, (any) => any)); - assertPromiseType>(promise.then((result) => totherHttpPromise)); - assertPromiseType>(promise.then((result) => totherHttpPromise, (any) => any)); - assertPromiseType>(promise.then((result) => totherHttpPromise, (any) => any, (any) => any)); + // $ExpectType IPromise + promise.then(result => + anyOf3(abcObjectPromise, result, defObjectPromise) + ); - assertPromiseType(promise.then((result) => tresult, (any) => tother).then(ambiguous => isTResult(ambiguous) ? ambiguous.c : ambiguous.f)); + // $ExpectType IPromise + promise.then(result => result, any => defObject, any => any); + // $ExpectType IPromise + promise.then(result => abcObjectPromise, any => defObjectPromise); + // $ExpectType IPromise + promise.then(result => abcObjectPromise, any => defObjectPromise, any => any); + // $ExpectType IPromise | IHttpResponse> + promise.then(result => abcObjectHttpPromise, any => defObjectHttpPromise); + // $ExpectType IPromise | IHttpResponse> + promise.then(result => abcObjectHttpPromise, any => defObjectHttpPromise, any => any); + + // $ExpectType IPromise + promise.then(result => defObject); + // $ExpectType IPromise + promise.then(result => defObject, any => any); + // $ExpectType IPromise + promise.then(result => defObject, any => any, any => any); + // $ExpectType IPromise + promise.then(result => defObjectPromise); + // $ExpectType IPromise + promise.then(result => defObjectPromise, any => any); + // $ExpectType IPromise + promise.then(result => defObjectPromise, any => any, any => any); + // $ExpectType IPromise> + promise.then(result => defObjectHttpPromise); + // $ExpectType IPromise + promise.then(result => defObjectHttpPromise, any => any); + // $ExpectType IPromise + promise.then(result => defObjectHttpPromise, any => any, any => any); + + // $ExpectType IPromise + promise + .then(result => abcObject, any => defObject) + .then(ambiguous => (isAbcObject(ambiguous) ? ambiguous.c : ambiguous.f)); + + // promise.then + $q.reject: + + // $ExpectType IPromise + $q.resolve(true).then(result => Math.random() > 0.5 ? Math.random() : $q.reject()); + // $ExpectType IPromise + $q.resolve(true).then(result => Math.random() > 0.5 ? Math.random() : $q.reject('a')); + // $ExpectType IPromise + $q.resolve().then(() => $q.reject('a')); + // $ExpectType IPromise + $q.resolve().then(() => { + if (Math.random() > 0.5) $q.reject(); + }); // promise.catch - assertPromiseType(promise.catch((err) => err)); - assertPromiseType(promise.catch((err) => any)); - assertPromiseType(promise.catch((err) => tresult)); - assertPromiseType>(promise.catch((err) => anyOf2(tresult, reject))); - assertPromiseType(promise.catch((err) => anyOf3(tresult, tresultPromise, reject))); - assertPromiseType(promise.catch((err) => tresultPromise)); - assertPromiseType>(promise.catch((err) => tresultHttpPromise)); - assertPromiseType(promise.catch((err) => tother)); - assertPromiseType(promise.catch((err) => totherPromise)); - assertPromiseType>(promise.catch((err) => totherHttpPromise)); + // $ExpectType IPromise + promise.catch(err => err); + // $ExpectType IPromise + promise.catch(err => anything); + // $ExpectType IPromise + promise.catch(err => abcObject); + // $ExpectType IPromise + promise.catch(err => anyOf2(abcObject, rejectedPromise)); + // $ExpectType IPromise + promise.catch(err => anyOf3(abcObject, abcObjectPromise, rejectedPromise)); + // $ExpectType IPromise + promise.catch(err => abcObjectPromise); + // $ExpectType IPromise> + promise.catch(err => abcObjectHttpPromise); + // $ExpectType IPromise + promise.catch(err => defObject); + // $ExpectType IPromise + promise.catch(err => defObjectPromise); + // $ExpectType IPromise> + promise.catch(err => defObjectHttpPromise); - assertPromiseType(promise.catch((err) => tother).then(ambiguous => isTResult(ambiguous) ? ambiguous.c : ambiguous.f)); + // $ExpectType IPromise + promise + .catch(err => defObject) + .then( + ambiguous => (isAbcObject(ambiguous) ? ambiguous.c : ambiguous.f) + ); // promise.finally - assertPromiseType(promise.finally(() => any)); - assertPromiseType(promise.finally(() => tresult)); - assertPromiseType(promise.finally(() => tother)); + // $ExpectType IPromise + promise.finally(() => anything); + // $ExpectType IPromise + promise.finally(() => abcObject); + // $ExpectType IPromise + promise.finally(() => defObject); } function test_angular_forEach() { @@ -648,12 +726,12 @@ let elementReadyFn = angular.element(() => { // $timeout signature tests namespace TestTimeout { - interface TResult { + interface AbcObject { a: number; b: string; c: boolean; } - const fnTResult: (...args: any[]) => TResult = null; + const abcObjectFn: (...args: any[]) => AbcObject = null; const promiseAny: angular.IPromise = null; const $timeout: angular.ITimeoutService = null; @@ -668,13 +746,13 @@ namespace TestTimeout { result = $timeout(1, true); } { - let result: angular.IPromise; - result = $timeout(fnTResult); - result = $timeout(fnTResult, 1); - result = $timeout(fnTResult, 1, true); - result = $timeout(fnTResult, 1, true, 1); - result = $timeout(fnTResult, 1, true, 1, ''); - result = $timeout(fnTResult, 1, true, 1, '', true); + let result: angular.IPromise; + result = $timeout(abcObjectFn); + result = $timeout(abcObjectFn, 1); + result = $timeout(abcObjectFn, 1, true); + result = $timeout(abcObjectFn, 1, true, 1); + result = $timeout(abcObjectFn, 1, true, 1, ''); + result = $timeout(abcObjectFn, 1, true, 1, '', true); } // $timeout.cancel @@ -1187,6 +1265,24 @@ function NgModelControllerTyping() { }; } +// FormController +angular.module('app').directive('formDebugChecker', () => { + return { + require: '^^form', + link: (scope, el, attrs, ctrl) => { + const form = ctrl as angular.IFormController; + el.on('click', () => { + const report = [] as string[]; + angular.forEach(form.$error, (controls, validationErrorKey) => { + const names = controls.map(control => control.$name); + report.push(`${validationErrorKey}: ${controls.length} control(s) (${names.join(', ')})`); + }); + console.log(`This form has ${report.length} error(s).\n${report.join('\n')}`); + }); + } + }; +}); + let $filter: angular.IFilterService; function testFilter() { diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 5d8b6315b0..32a5c74b52 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -357,9 +357,9 @@ declare namespace angular { $valid: boolean; $invalid: boolean; $submitted: boolean; - $error: any; - $name: string; - $pending: any; + $error: { [validationErrorKey: string]: Array }; + $name?: string; + $pending?: { [validationErrorKey: string]: Array }; $addControl(control: INgModelController | IFormController): void; $removeControl(control: INgModelController | IFormController): void; $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController | IFormController): void; @@ -388,6 +388,7 @@ declare namespace angular { $setUntouched(): void; $rollbackViewValue(): void; $commitViewValue(): void; + $processModelValue(): void; $isEmpty(value: any): boolean; $overrideModelOptions(options: INgModelOptions): void; @@ -398,8 +399,8 @@ declare namespace angular { $parsers: IModelParser[]; $formatters: IModelFormatter[]; $viewChangeListeners: IModelViewChangeListener[]; - $error: any; - $name: string; + $error: { [validationErrorKey: string]: boolean }; + $name?: string; $touched: boolean; $untouched: boolean; @@ -407,7 +408,7 @@ declare namespace angular { $validators: IModelValidators; $asyncValidators: IAsyncModelValidators; - $pending: any; + $pending?: { [validationErrorKey: string]: boolean }; $pristine: boolean; $dirty: boolean; $valid: boolean; @@ -1102,28 +1103,43 @@ declare namespace angular { interface IPromise { /** - * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected. - * The successCallBack may return IPromise for when a $q.reject() needs to be returned - * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. + * Regardless of when the promise was or will be resolved or rejected, then calls one of + * the success or error callbacks asynchronously as soon as the result is available. The + * callbacks are called with a single argument: the result or rejection reason. + * Additionally, the notify callback may be called zero or more times to provide a + * progress indication, before the promise is resolved or rejected. + * The `successCallBack` may return `IPromise` for when a `$q.reject()` needs to + * be returned. + * This method returns a new promise which is resolved or rejected via the return value + * of the `successCallback`, `errorCallback`. It also notifies via the return value of + * the `notifyCallback` method. The promise can not be resolved or rejected from the + * `notifyCallback` method. */ - then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: null, notifyCallback?: (state: any) => any): IPromise; - then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback?: null, notifyCallback?: (state: any) => any): IPromise; - - then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => IPromise|TCatch, notifyCallback?: (state: any) => any): IPromise; - then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback: (reason: any) => IPromise|TCatch2, notifyCallback?: (state: any) => any): IPromise; + then( + successCallback?: + | ((value: T) => IPromise | IPromise | TResult1) + | null, + errorCallback?: + | ((reason: any) => IPromise | IPromise | TResult2) + | null, + notifyCallback?: (state: any) => any + ): IPromise; /** * Shorthand for promise.then(null, errorCallback) */ - catch(onRejected: (reason: any) => IPromise|TCatch): IPromise; - catch(onRejected: (reason: any) => IPromise|TCatch2): IPromise; + catch( + onRejected?: + | ((reason: any) => IPromise | IPromise | TResult) + | null + ): IPromise; /** * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information. * * Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible. */ - finally(finallyCallback: () => any): IPromise; + finally(finallyCallback: () => void): IPromise; } interface IDeferred { diff --git a/types/angular/tsconfig.json b/types/angular/tsconfig.json index 5ce810f938..c8e218ccd3 100644 --- a/types/angular/tsconfig.json +++ b/types/angular/tsconfig.json @@ -23,6 +23,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } -} +} \ No newline at end of file diff --git a/types/angularfire/tsconfig.json b/types/angularfire/tsconfig.json index 79526d1d23..05a89bc308 100644 --- a/types/angularfire/tsconfig.json +++ b/types/angularfire/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angularlocalstorage/tsconfig.json b/types/angularlocalstorage/tsconfig.json index 18cbe35651..c3ce44e55b 100644 --- a/types/angularlocalstorage/tsconfig.json +++ b/types/angularlocalstorage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/angulartics/tsconfig.json b/types/angulartics/tsconfig.json index 2cfa5bb6a9..18593f0b9c 100644 --- a/types/angulartics/tsconfig.json +++ b/types/angulartics/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/animation-frame/tsconfig.json b/types/animation-frame/tsconfig.json index 50f3aa0703..b1ec9c5358 100644 --- a/types/animation-frame/tsconfig.json +++ b/types/animation-frame/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/animejs/tsconfig.json b/types/animejs/tsconfig.json index 02c5552371..084939a4f9 100644 --- a/types/animejs/tsconfig.json +++ b/types/animejs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/annyang/tsconfig.json b/types/annyang/tsconfig.json index f16b627fac..8087bb565e 100644 --- a/types/annyang/tsconfig.json +++ b/types/annyang/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ansi-colors/tsconfig.json b/types/ansi-colors/tsconfig.json index 8a0f980cbc..7ee743c176 100644 --- a/types/ansi-colors/tsconfig.json +++ b/types/ansi-colors/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ansi-colors-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ansi-regex/tsconfig.json b/types/ansi-regex/tsconfig.json index cf1ac84a5c..67d64d91c2 100644 --- a/types/ansi-regex/tsconfig.json +++ b/types/ansi-regex/tsconfig.json @@ -7,17 +7,18 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ansi-regex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ansi-styles/tsconfig.json b/types/ansi-styles/tsconfig.json index daf091f6ce..052e258a64 100644 --- a/types/ansi-styles/tsconfig.json +++ b/types/ansi-styles/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ansicolors/tsconfig.json b/types/ansicolors/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/ansicolors/tsconfig.json +++ b/types/ansicolors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/any-db-transaction/tsconfig.json b/types/any-db-transaction/tsconfig.json index 70db166ef8..1eb8e09d43 100644 --- a/types/any-db-transaction/tsconfig.json +++ b/types/any-db-transaction/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/any-db/tsconfig.json b/types/any-db/tsconfig.json index 21170c7c68..b78a69c22c 100644 --- a/types/any-db/tsconfig.json +++ b/types/any-db/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/anybar/tsconfig.json b/types/anybar/tsconfig.json index 1dd62548e6..17fc096621 100644 --- a/types/anybar/tsconfig.json +++ b/types/anybar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/anymatch/tsconfig.json b/types/anymatch/tsconfig.json index d30a18ba98..921e277144 100644 --- a/types/anymatch/tsconfig.json +++ b/types/anymatch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/apex.js/tsconfig.json b/types/apex.js/tsconfig.json index 2a67c3005a..d254229f4e 100644 --- a/types/apex.js/tsconfig.json +++ b/types/apex.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aphrodite/tsconfig.json b/types/aphrodite/tsconfig.json index 733098707c..0794c0ff34 100644 --- a/types/aphrodite/tsconfig.json +++ b/types/aphrodite/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "preserve" }, "files": [ diff --git a/types/api-error-handler/api-error-handler-tests.ts b/types/api-error-handler/api-error-handler-tests.ts index 67afbb0fce..aa72342d75 100644 --- a/types/api-error-handler/api-error-handler-tests.ts +++ b/types/api-error-handler/api-error-handler-tests.ts @@ -1,4 +1,4 @@ -import * as errorHandler from 'api-error-handler'; +import errorHandler = require('api-error-handler'); import * as express from 'express'; var api = express.Router(); diff --git a/types/api-error-handler/tsconfig.json b/types/api-error-handler/tsconfig.json index 343e9007e9..7c46d54e64 100644 --- a/types/api-error-handler/tsconfig.json +++ b/types/api-error-handler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/apigee-access/tsconfig.json b/types/apigee-access/tsconfig.json index 3a18c6594a..fabc7bafac 100644 --- a/types/apigee-access/tsconfig.json +++ b/types/apigee-access/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/apollo-codegen/tsconfig.json b/types/apollo-codegen/tsconfig.json index a793b04d75..da8da1b4e9 100644 --- a/types/apollo-codegen/tsconfig.json +++ b/types/apollo-codegen/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/app-root-path/tsconfig.json b/types/app-root-path/tsconfig.json index 0786aa8b6c..c32fe9ae27 100644 --- a/types/app-root-path/tsconfig.json +++ b/types/app-root-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/appdmg/tsconfig.json b/types/appdmg/tsconfig.json index f4ca0f95c5..6d729c863b 100644 --- a/types/appdmg/tsconfig.json +++ b/types/appdmg/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "appdmg-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/appframework/tsconfig.json b/types/appframework/tsconfig.json index 8ed9e604ca..aa6405cffa 100644 --- a/types/appframework/tsconfig.json +++ b/types/appframework/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/applepayjs/tsconfig.json b/types/applepayjs/tsconfig.json index 892c52bd37..b2fb66fe6e 100644 --- a/types/applepayjs/tsconfig.json +++ b/types/applepayjs/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "baseUrl": "../", "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "lib": [ "dom", "es6" diff --git a/types/appletvjs/tsconfig.json b/types/appletvjs/tsconfig.json index 44dc1a34db..e1ad39d576 100644 --- a/types/appletvjs/tsconfig.json +++ b/types/appletvjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/applicationinsights-js/tsconfig.json b/types/applicationinsights-js/tsconfig.json index db2a137f6b..8eeecc5c0f 100644 --- a/types/applicationinsights-js/tsconfig.json +++ b/types/applicationinsights-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aqb/aqb-tests.ts b/types/aqb/aqb-tests.ts new file mode 100644 index 0000000000..5e186126fe --- /dev/null +++ b/types/aqb/aqb-tests.ts @@ -0,0 +1,151 @@ +import QB = require("aqb"); + +/* + * Most of these tests are taken directly from the examples + * in the aqbjs Github documentation. + * + * https://github.com/arangodb/aqbjs + */ + +/* + * section aqb.js + * https://github.com/arangodb/aqbjs#auto-casting-raw-data + */ +const doc = { + aString: "hello", + aDate: new Date(), + aNumber: 23, + anArray: [1, 2, 3, "potato"] +}; + +QB(doc); +QB.for('x').in('1..5').return('x'); +QB.insert(QB(doc)).into('my_collection'); + +/* + * section aqb.js + * https://github.com/arangodb/aqbjs#aql-types + */ +QB.bool(true); +QB.num("12"); +QB.int("1"); +QB.str(23); +QB.list([ 1 , 2 , 3 , 4 , 5]); +QB.obj({'some.name': 'value'}); +QB.ref("users"); + +/* + * section aqb.js + * https://github.com/arangodb/aqbjs#aql-expressions + */ +QB.range(1 , 5); +QB.get("property"); +QB.ref("user").get("property"); +QB.expr(QB.for('x').in('1..5').return('x').toAQL()); + +/* + * section aqb.js + * https://github.com/arangodb/aqbjs#aql-operations + */ +QB.and("a", "b"); +QB.ref("a").and("b"); +QB.or("a" , "b"); +QB.ref("a").or("b"); +QB.add("a" , "b"); +QB.ref("a").add("b"); +QB.plus("a" , "b"); +QB.ref("a").plus("b"); +QB.sub("a" , "b"); +QB.ref("a").sub("b"); +QB.minus("a" , "b"); +QB.ref("a").minus("b"); +QB.mul("a" , "b"); +QB.ref("a").mul("b"); +QB.times("a" , "b"); +QB.ref("a").times("b"); +QB.div("a" , "b"); +QB.ref("a").div("b"); +QB.mod("a", "b"); +QB.ref("a").mod("b"); +QB.eq("a" , "b"); +QB.ref("a").eq("b"); +QB.neq("a", "b"); +QB.ref("a").neq("b"); +QB.gt("a" , "b"); +QB.ref("a").gt("b"); +QB.gte("a" , "b"); +QB.ref("a").gte("b"); +QB.lt("a" , "b"); +QB.ref("a").lt("b"); +QB.lte("a" , "b"); +QB.ref("a").lte("b"); +QB.in("a" , "b"); +QB.ref("a").in("b"); +QB.not("a"); +QB.ref("a").not(); +QB.notIn("a" , "b"); +QB.ref("a").notIn("b"); +QB.neg("a"); +QB.ref("a").neg(); +QB.if("x" , "y" , "z"); +QB.ref("x").then("y").else("z"); +QB.fn('MY::USER::FUNC')(1, 2, 3); +QB.fn('hello')(); + +/* + * section aqb.js + * https://github.com/arangodb/aqbjs#aql-statements + */ +QB.for('doc').in('my_collection'); +QB.for('doc').in('my_collection').let('foo' , 23); +QB.for('doc').in('my_collection').let('foo' , 23); +// QB.for('doc').in('my_collection').let({a: 1, b: 2, c: 3}); +QB.for('doc').in('my_collection').return('x'); +QB.for('doc').in('my_collection').return({x: 'x'}); +QB.for('doc').in('my_collection').returnDistinct('x'); +QB.for('doc').in('my_collection').filter(QB.eq('a', 'b')); +QB.for('doc').in('my_collection').collectWithCountInto('x'); +QB.for('doc').in('my_collection').collect('x', 'y'); +// QB.for('doc').in('my_collection').collect({x: 'a', y: 'b'}); +QB.for('doc').in('my_collection').collect('x' , 'y').withCountInto('z'); +QB.for('doc').in('my_collection').collect('x' , 'y').into('z').keep('a' , 'b'); +QB.for('doc').in('my_collection').collect('x' , 'y').into('z' , 'Z'); +QB.for('doc').in('my_collection').collect('x' , 'y').into('z'); +QB.for('doc').in('my_collection').collect('x' , 'y').into('z').options('opts'); +QB.for('doc').in('my_collection').collect('x' , 'y').options('opts'); +QB.for('doc').in('my_collection').collect('x' , 'y').keep('a' , 'b'); +QB.for('doc').in('my_collection').collect('x' , 'y').sort('x', 'DESC', 'y', 'ASC'); +QB.for('doc').in('my_collection').collect('x' , 'y').limit(20); +QB.for('doc').in('my_collection').collect('x' , 'y').limit(20 , 20); +QB.for('doc').in('my_collection').remove('x'); +QB.for('doc').in('my_collection').remove('x').in('y'); +QB.for('doc').in('my_collection').remove('x').in('y').returnOld('a'); +QB.for('doc').in('my_collection').remove('x').in('y').options('opts'); +QB.upsert('x').insert('y').replace('z').in('c'); +QB.upsert('x').insert('y').replace('z').in('c').options('opts'); +QB.upsert('x').insert('y').update('z').in('c'); +QB.upsert('x').insert('y').update('z').in('c').options('opts'); +QB.insert('x').into('y'); +QB.insert('x').into('y').options('opts'); +QB.insert('x').into('y').returnNew('z'); +QB.update('x').in('y'); +QB.update('x').into('y'); +QB.update('x').with('y').in('z'); +QB.update('x').with('y').into('z'); +QB.update('x').with('y').into('z').options('opts'); +QB.update('x').in('y').options('opts'); +QB.update('x').with('y').into('z').returnNew('v'); +QB.update('x').with('y').into('z').returnOld('v'); +QB.update('x').in('y').options('opts').returnNew('v'); +QB.update('x').in('y').options('opts').returnOld('v'); + +QB.replace('x').in('y'); +QB.replace('x').into('y'); +QB.replace('x').with('y').in('z'); +QB.replace('x').with('y').into('z'); +QB.replace('x').with('y').into('z').options('opts'); +QB.replace('x').in('y').options('opts'); +QB.replace('x').with('y').into('z').returnNew('v'); +QB.replace('x').with('y').into('z').returnOld('v'); +QB.replace('x').in('y').options('opts').returnNew('v'); +QB.replace('x').in('y').options('opts').returnOld('v'); diff --git a/types/aqb/index.d.ts b/types/aqb/index.d.ts new file mode 100644 index 0000000000..eb529e9c97 --- /dev/null +++ b/types/aqb/index.d.ts @@ -0,0 +1,1105 @@ +// Type definitions for aqbjs 2.1 +// Project: https://github.com/arangodb/aqbjs +// Definitions by: Athenkosi Mase +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 +interface AqlError extends Error { + new(message: string): Error; + name: string; +} +interface Operation extends Expression { + new(): Expression; +} +interface BinaryOperation extends Operation { + new(operator: string, value1: any, value2: any): Operation; + toAQL(): string; + _operator: string; +} +interface UnaryOperation extends Expression { + new(operator: string, value: any): Expression; + toAQL(): string; + _operator: string; +} +interface SimpleReference extends Expression { + new(value: string): Expression; + toAQL(): string; + re: RegExp; + _value: string; +} +interface RawExpression extends Expression { + new(value: any): Expression; + toAQL(): string; +} +interface BooleanLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; + _value: boolean; +} +interface NumberLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; + re: RegExp; +} +interface IntegerLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; + _value: number; +} +interface StringLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; +} +interface ListLiteral extends Expression { + new(...value: any[]): Expression; + toAQL(): string; +} +interface ObjectLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; + _value: object; +} +interface NAryOperation extends Operation { + new(operator: string, values: any[]): Operation; + toAQL(): string; + _operator: string; + _values: Expression[]; +} +interface RangeExpression extends Expression { + new(start: any, end?: any): Expression; + toAQL(): string; + _start: number; + _end: number; + re: RegExp; +} +interface PropertyAccess extends Expression { + new(obj: any, keys: any[]): Expression; + toAQL(): string; + _obj: Expression; + _keys: Expression[]; +} +interface TernaryOperation extends Operation { + new(operator1: string, operator2: string, value1: Expression, value2: any, value3: any): Operation; + toAQL(): string; + _operator1: string; + _operator2: string; +} +interface NullLiteral extends Expression { + new(value: any): Expression; + toAQL(): string; +} +interface Keyword extends Expression { + new(value: any): Expression; + toAQL(): string; + _value: string; + re: RegExp; +} +interface Identifier extends Expression { + new(value: any): Expression; + toAQL(): string; + _value: string; +} +interface FunctionCall extends Expression { + new(functionName: string, ...args: any[]): Expression; + toAQL(): string; + _re: RegExp; + _functionName: string; + _args: any[]; +} +interface ForExpression extends PartialStatement { + new(prev: PartialStatement, varname: any, expr: any): PartialStatement; + toAQL(): string; + _varname: Identifier; +} +interface FilterExpression extends PartialStatement { + new(prev: PartialStatement, expr: any): PartialStatement; + toAQL(): string; +} +interface Definitions { + new(...dfns: any[]): any; + toAQL(): string; + _dfns: any[]; +} +interface LetExpression extends PartialStatement { + new(prev: PartialStatement, ...dfns: any[]): PartialStatement; + toAQL(): string; + _prev: PartialStatement; + _dfns: Definitions; +} +interface CollectExpression extends PartialStatement { + new(prev: PartialStatement, dfns: any[], varname: any, intoExpr: any, keepNames: any[], options: any): PartialStatement; + toAQL(): string; + into(...newVarname: any[]): CollectExpression; + keep(...x: any[]): any; + _keep: Identifier[]; + options(newOpts: any): any; + _options: ObjectLiteral; + withCountInto(newVarname: any): CollectWithCountIntoExpression; +} +interface CollectWithCountIntoExpression extends PartialStatement { + new(prev: PartialStatement, dfns: any[], varname: any, options: any): PartialStatement; + toAQL(): string; + options(newOpts: any): any; +} +interface SortExpression extends PartialStatement { + new(prev: PartialStatement, ...args: any[]): PartialStatement; + toAQL(): string; + keywords: string[]; + _args: Keyword[]; +} +interface LimitExpression extends PartialStatement { + new(prev: PartialStatement, offset: any, count?: any): PartialStatement; + toAQL(): string; +} +interface ReturnExpression extends Expression { + new(prev: LetExpression, value: any, distinct: boolean): Expression; + toAQL(): string; + _prev: LetExpression; + _distinct: boolean; +} +interface RemoveExpression extends PartialStatement { + new(prev: PartialStatement, expr: any, collection: any, options: any): PartialStatement; + returnOld(x: any): ReturnExpression; + toAQL(): string; + options(newOpts: any): RemoveExpression; +} +interface UpsertExpression extends PartialStatement { + new(prev: PartialStatement, upsertExpr: any, insertExpr: any, replace: boolean, updateOrReplaceExpr: any, collection: any, options: any): PartialStatement; + returnNew(x: any): ReturnExpression; + returnOld(x: any): ReturnExpression; + toAQL(): string; + _updateOrReplace: string; + options(newOpts: any): UpsertExpression; +} +interface InsertExpression extends PartialStatement { + new(prev: PartialStatement, expr: any, collection: any, options: any): PartialStatement; + returnNew(x: any): ReturnExpression; + toAQL(): string; + options(newOpts: any): InsertExpression; +} +interface UpdateExpression extends PartialStatement { + new(prev: PartialStatement, expr: any, withExpr: any, collection: any, options: any): PartialStatement; + returnNew(x: any): ReturnExpression; + returnOld(x: any): ReturnExpression; + toAQL(): string; + options(newOpts: any): UpdateExpression; +} +interface ReplaceExpression extends PartialStatement { + new(prev: PartialStatement, expr: any, withExpr: any, collection: any, options: any): PartialStatement; + returnNew(x: any): ReturnExpression; + returnOld(x: any): ReturnExpression; + toAQL(): string; + options(newOpts: any): ReplaceExpression; +} +interface Expression extends PartialStatement { + /** + * Equality + * + * Creates an equality comparison from the given values. + * + * qb.eq(a, b): (a == b) + * OR: + * qbValue.eq(b): (a == b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').eq('y'): (x == y) + * + * + */ + eq(x: any, y?: any): BinaryOperation; + /** + * Inequality + * + * Creates an inequality comparison from the given values. + * + * qb.neq(a, b): (a != b) + * OR: + * qbValue.neq(b): (a != b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').neq('y'): (x != y) + * + */ + neq(x: any, y?: any): BinaryOperation; + /** + * Greater Than + * + * Creates a greater-than comparison from the given values. + * + * qb.gt(a, b): (a > b) + * OR + * qbValue.gt(b): (a > b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').gt('y'): (x > y) + * + * + */ + gt(x: any, y?: any): BinaryOperation; + /** + * Greater Than Or Equal To + * + * Creates a greater-than-or-equal-to comparison from the given values. + * + * qb.gte(a, b): (a >= b) + * OR + * qbValue.gte(b): (a >= b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').gte('y'): (x >= y) + * + * + */ + gte(x: any, y?: any): BinaryOperation; + /** + * Less Than + * + * Creates a less-than comparison from the given values. + * + * qb.lt(a, b): (a < b) + * OR + * qbValue.lt(b): (a < b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').lt('y'): (x < y) + * + */ + lt(x: any, y?: any): BinaryOperation; + /** + * Less Than Or Equal To + * + * Creates a less-than-or-equal-to comparison from the given values. + * + * qb.lte(a, b): (a <= b) + * OR + * qbValue.lte(b): (a <= b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').lte('y'): (x <= y) + * + */ + lte(x: any, y?: any): BinaryOperation; + /** + * Contains + * + * Creates an "in" comparison from the given values. + * + * qb.in(a, b): (a in b) + * OR: + * qbValue.in(b): (a in b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * qb.ref('x').in('y'): (x in y) + */ + in(...x: any[]): BinaryOperation; + /** + * Negation + * + * Creates a negation from the given value. + * + * qb.not(a) => !(a) + * OR: + * qbValue.not() => !(a) + * + * If the value is not already an value, it will be converted automatically. + * + * Examples + * + * qb.not('x') => !(x) + */ + not(x?: any): UnaryOperation; + /** + * Negative Value + * + * Creates a negative value expression from the given value. + * + * qb.neg(a) => -(a) + * OR: + * qbValue.neg() => -(a) + * + * If the value is not already an AQL value, it will be converted automatically. + * + * Examples + * + * qb.neg('x') => -(x) + */ + neg(x?: any): UnaryOperation; + /** + * Negated Contains + * + * Creates a "not in" comparison from the given values. + * + * qb.notIn(a, b): (a not in b) + * OR: + * qbValue.notIn(b): (a not in b) + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * + * qb.ref('x').notIn('y'): (x not in y) + */ + notIn(...x: any[]): BinaryOperation; + /** + * Boolean And + * + * Creates an "and" operation from the given values. + * + * qb.and(a, b) =>(a && b) + * OR: + * aqlValue.and(b) =>(a && b) + * + * If the values are not already AQL values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Examples + * + * qb.ref('x').and('y') =>(x && y) + */ + and(...x: any[]): NAryOperation; + /** + * Boolean Or + * + * Creates an "or" operation from the given values. + * + * qb.or(a, b): (a || b) + * OR: + * Value.or(b): (a || b) + * + * If the values are not already values, they will be converted automatically. + * + * This declare function can take any number of arguments. + */ + or(...x: any[]): NAryOperation; + /** + * Addition + * + * Creates an addition operation from the given values. + * + * qb.add(a, b): (a + b) + * OR: + * Value.add(b): (a + b) + * + * If the values are not already values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Alias: qb.plus(a, b) + * + * Examples + * + * qb.ref('x').plus('y'): (x + y) + */ + add(...x: any[]): NAryOperation; + plus(...x: any[]): NAryOperation; + /** + * Subtraction + * + * Creates a subtraction operation from the given values. + * + * qb.sub(a, b): (a - b) + * OR: + * Value.sub(b): (a - b) + * + * If the values are not already values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Alias: qb.minus(a, b) + * + * Examples + * + * qb.ref('x').minus('y'): (x - y) + */ + sub(...x: any[]): NAryOperation; + minus(...x: any[]): NAryOperation; + /** + * Multiplication + * + * Creates a multiplication operation from the given values. + * + * qb.mul(a, b): (a * b) + * OR: + * Value.mul(b): (a * b) + * + * If the values are not already values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Alias: qb.times(a, b) + * + * Examples + * + * qb.ref('x').times('y'): (x * y) + */ + mul(...x: any[]): NAryOperation; + times(...x: any[]): NAryOperation; + /** + * Division + * + * Creates a division operation from the given values. + * + * qb.div(a, b): (a / b) + * OR: + * Value.div(b): (a / b) + * + * If the values are not already values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Examples + * qb.ref('x').div('y'): (x / y) + */ + div(...x: any[]): NAryOperation; + /** + * Modulus + * + * Creates a modulus operation from the given values. + * + * qb.mod(a, b): (a % b) + * OR: + * Value.mod(b): (a % b) + * + * If the values are not already values, they will be converted automatically. + * This declare function can take any number of arguments. + * + * Examples + * qb.ref('x').mod('y'): (x % y) + */ + mod(...x: any[]): NAryOperation; + /** + * Range + * + * Creates a range expression from the given values. + * + * qb.range(value1, value2): value1..value2 + * + * OR: + * + * Value.range(value2): value1..value2 + * + * If the values are not already values, they will be converted automatically. + * Alias: qb.to(value1, value2) + * + * Examples + * + * qb(2).to(5): 2..5 + * + */ + range(...value: number[]): RangeExpression; + /** + * Property Access + * + * Creates a property access expression from the given values. + * + * qb.get(obj, key): obj[key] + * OR: + * Obj.get(key): obj[key] + * + * If the values are not already values, they will be converted automatically. + * + * Examples + * qb.ref('x').get('y'): x[y]` + * + */ + get(value: any): PropertyAccess; + /** + * Ternary(if / else) + * + * Creates a ternary expression from the given values. + * + * qb.if(condition, thenDo, elseDo): (condition ? thenDo: elseDo) + * OR: + * qbValue.then(thenDo).else(elseDo): (condition ? thenDo: elseDo) + * + * If the values are not already values, they will be converted automatically. + * + * Alias: qbValue.then(thenDo).otherwise(elseDo) + * + * Examples + * qb.ref('x').then('y').else('z'): (x ? y: z) + * + */ + then(value: any): ThenRet; +} +interface ThenRet { + else(y: any): TernaryOperation; + else_: TernaryOperation; + otherwise(y: any): TernaryOperation; +} +interface ForRet { + in(expr: any): ForExpression; + in_: ForRet["in"]; +} +/** + * PartialStatement + * + * In addition to the methods documented above, the query builder provides all methods of PartialStatement objects. + * Statement objects have a method toAQL() which returns their representation as a JavaScript string. + * + * Examples + * + * qb.for('doc').in('my_collection').return('doc._key').toAQL() + * // => FOR doc IN my_collection RETURN doc._key + */ +interface PartialStatement { + /** + * FOR expression IN collection + * + * PartialStatement::for(expression).in(collection): PartialStatement + * + * Examples + * + * _.for('doc').in('my_collection'): FOR doc IN my_collection + * + */ + for(varname: any): ForRet; + /** + * FILTER expression + * + * PartialStatement::filter(expression): PartialStatement + * + * Examples + * + * _.filter(qb.eq('a', 'b')): FILTER a == b + * + */ + filter(varname: any): FilterExpression; + /** + * LET varname = expression + * + * PartialStatement::let(varname, expression): PartialStatement + * + * Examples + * + * _.let('foo', 23): LET foo = 23 + * + * LET var1 = expr1, var2 = expr2, …, varn = exprn + * + * PartialStatement::let(definitions): PartialStatement + * + */ + let(varname: {}, expr: any): LetExpression; + /** + * COLLECT + * + * COLLECT WITH COUNT INTO varname + * PartialStatement::collectWithCountInto(varname): CollectExpression + * + * Examples + * + * _.collectWithCountInto('x'): COLLECT WITH COUNT INTO x COLLECT varname = expression + * PartialStatement::collect(varname, expression): CollectExpression + * + * _.collect('x', 'y'): COLLECT x = y COLLECT var1 = expr1, var2 = expr2, …, varn = exprn + * PartialStatement::collect(definitions): CollectExpression + * + * _.collect({x: 'a', y: 'b'}): COLLECT x = a, y = b WITH COUNT INTO varname + * CollectExpression::withCountInto(varname): CollectExpression + * + * _.withCountInto('x'): WITH COUNT INTO x INTO varname + * CollectExpression::into(varname): CollectExpression + * + * _.into('z'): INTO z KEEP ...vars + * CollectExpression::keep(...vars): CollectExpression + * + * _.into('z').keep('a', 'b'): INTO z KEEP a, b INTO varname = expression + * CollectExpression::into(varname, expression): CollectExpression + * + * _.into('x', 'y'): INTO x = y OPTIONS options + * CollectExpression::options(options): CollectExpression + * + * _.options('opts'): OPTIONS opts + * + */ + collect(varname: any, expr: any): CollectExpression; + /** + * COLLECT + * + * COLLECT WITH COUNT INTO varname + * PartialStatement::collectWithCountInto(varname): CollectExpression + * + * Examples + * + * _.collectWithCountInto('x'): COLLECT WITH COUNT INTO x COLLECT varname = expression + * PartialStatement::collect(varname, expression): CollectExpression + * + * _.collect('x', 'y'): COLLECT x = y COLLECT var1 = expr1, var2 = expr2, …, varn = exprn + * PartialStatement::collect(definitions): CollectExpression + * + * _.collect({x: 'a', y: 'b'}): COLLECT x = a, y = b WITH COUNT INTO varname + * CollectExpression::withCountInto(varname): CollectExpression + * + * _.withCountInto('x'): WITH COUNT INTO x INTO varname + * CollectExpression::into(varname): CollectExpression + * + * _.into('z'): INTO z KEEP ...vars + * CollectExpression::keep(...vars): CollectExpression + * + * _.into('z').keep('a', 'b'): INTO z KEEP a, b INTO varname = expression + * CollectExpression::into(varname, expression): CollectExpression + * + * _.into('x', 'y'): INTO x = y OPTIONS options + * CollectExpression::options(options): CollectExpression + * + * _.options('opts'): OPTIONS opts + * + */ + collectWithCountInto(varname: any): CollectWithCountIntoExpression; + /** + * SORT ...args + * + * PartialStatement::sort(...args): PartialStatement + * + * Examples + * + * _.sort('x', 'DESC', 'y', 'ASC'): SORT x DESC, y ASC + * + */ + sort(...args: any[]): SortExpression; + /** + * LIMIT offset, count + * + * PartialStatement::limit([offset,] count): PartialStatement + * + * Examples + * + * _.limit(20): LIMIT 20 + * + * _.limit(20, 20): LIMIT 20, 20 + * + */ + limit(offset: any, count?: any): LimitExpression; + /** + * RETURN expression + * + * PartialStatement::return(expression): ReturnExpression + * + * Examples + * + * _.return('x'): RETURN x + * _.return({x: 'x'}): RETURN {x: x} + * + */ + return(x: any): ReturnExpression; + /** + * RETURN DISTINCT expression + * + * PartialStatement::returnDistinct(expression): ReturnExpression + * + * Examples + * + * _.returnDistinct('x'): RETURN DISTINCT x + * + */ + returnDistinct(x: any): ReturnExpression; + /** + * REMOVE + * + * REMOVE expression IN collection + * PartialStatement::remove(expression).in(collection): RemoveExpression + * + * Alias: remove(expression).into(collection) + * + * Examples + * + * _.remove('x').in('y'): REMOVE x IN y LET varname = OLD RETURN varname + * RemoveExpression::returnOld(varname): ReturnExpression + * + * _.returnOld('z'): LET z = OLD RETURN z OPTIONS options + * RemoveExpression::options(options): RemoveExpression + * + * _.options('opts'): OPTIONS opts + * + */ + remove(expr: any): RemoveRet; + /** + * UPSERT + * + * UPSERT expression1 INSERT expression2 REPLACE expression3 IN collection + * PartialStatement::upsert(expression1).insert(expression2).replace(expression3).in(collection): UpsertExpression + * + * Alias: ….into(collection) + * + * Examples + * + * _.upsert('x').insert('y').replace('z').in('c'): UPSERT x INSERT y REPLACE z IN c + * + * UPSERT expression1 INSERT expression2 UPDATE expression3 IN collection + * PartialStatement::upsert(expression1).insert(expression2).update(expression3).in(collection): UpsertExpression + * + * Alias: ….into(collection) + * + * _.upsert('x').insert('y').update('z').in('c'): UPSERT x INSERT y UPDATE z IN c OPTIONS options + * UpsertExpression::options(options): UpsertExpression + * + * _.options('opts'): OPTIONS opts + * + */ + upsert(expr: any): UpsertRet; + /** + * INSERT + * + * INSERT expression INTO collection + * PartialStatement::insert(expression).into(collection): InsertExpression + * + * Alias: insert(expression).in(collection) + * + * Examples + * + * _.insert('x').into('y'): INSERT x INTO y OPTIONS options + * InsertExpression::options(options): InsertExpression + * + * _.options('opts'): OPTIONS opts LET varname = NEW RETURN varname + * InsertExpression::returnNew(varname): ReturnExpression + * + * _.returnNew('z'): LET z = NEW RETURN z + * + */ + insert(expr: any): InsertRet; + /** + * UPDATE + * + * UPDATE expression IN collection + * PartialStatement::update(expression).in(collection): UpdateExpression + * + * Alias: update(expression).into(collection) + * + * Examples + * + * _.update('x').in('y'): UPDATE x IN y + * + * UPDATE expression1 WITH expression2 IN collection + * PartialStatement::update(expression1).with(expression2).in(collection): UpdateExpression + * + * Alias: update(expression1).with(expression2).into(collection) + * + * _.update('x').with('y').in('z'): UPDATE x WITH y IN z OPTIONS options + * UpdateExpression::options(options): UpdateExpression + * + * _.options('opts'): OPTIONS opts LET varname = NEW RETURN varname + * UpdateExpression::returnNew(varname): ReturnExpression + * + * _.returnNew('z'): LET z = NEW RETURN z LET varname = OLD RETURN varname + * UpdateExpression::returnOld(varname): ReturnExpression + * + * _.returnOld('z'): LET z = OLD RETURN z + * + */ + update(expr: any): UpdateRetWithRet; + /** + * REPLACE + * + * REPLACE expression IN collection + * PartialStatement::replace(expression).in(collection): ReplaceExpression + * + * Alias: replace(expression).into(collection) + * + * Examples + * + * _.replace('x').in('y'): REPLACE x IN y REPLACE expression1 WITH expression2 IN collection + * PartialStatement::replace(expression1).with(expression2).in(collection): ReplaceExpression + * + * Alias: replace(expression1).with(expression2).into(collection) + * + * _.replace('x').with('y').in('z'): REPLACE x WITH y IN z OPTIONS options + * ReplaceExpression::options(options): ReplaceExpression + * + * _.options('opts'): OPTIONS opts LET varname = NEW RETURN varname + * ReplaceExpression::returnOld(varname): ReturnExpression + * + * _.returnNew('z'): LET z = NEW RETURN z LET varname = OLD RETURN varname + * ReplaceExpression::returnNew(varname): ReturnExpression + * + * _.returnOld('z'): LET z = OLD RETURN z + * + */ + replace(expr: any): ReplaceRetWithRet; +} +interface RemoveRet { + into(collection: any): RemoveExpression; + in: RemoveRet["into"]; + in_: RemoveRet["into"]; +} +interface UpsertRet { + insert(insertExpr: any): UpsertRetInsertRet; +} +interface UpsertRetInsertRet { + update(updateOrReplaceExpr: any): UpsertRetInsertRetUpdateRet; + replace: UpsertRetInsertRet["update"]; +} +interface UpsertRetInsertRetUpdateRet { + into(inCollection: any): UpsertExpression; + in: UpsertRetInsertRetUpdateRet["into"]; + in_: UpsertRetInsertRetUpdateRet["into"]; +} +interface InsertRet { + into(collection: any): InsertExpression; + in: InsertRet["into"]; + in_: InsertRet["into"]; +} +interface UpdateRetWithRet { + into(collection: any): UpdateExpression; + in: UpdateRetWithRet["into"]; + in_: UpdateRetWithRet["into"]; +} +interface ReplaceRetWithRet { + into(collection: any): ReplaceExpression; + in: ReplaceRetWithRet["into"]; + in_: ReplaceRetWithRet["into"]; +} +interface RemoveRet { + into(collection: any): RemoveExpression; + in: RemoveRet["into"]; + in_: RemoveRet["into"]; +} +interface UpsertRet { + insert(insertExpr: any): UpsertRetInsertRet; +} +interface UpsertRetInsertRet { + update(updateOrReplaceExpr: any): UpsertRetInsertRetUpdateRet; + replace: UpsertRetInsertRet["update"]; +} +interface UpsertRetInsertRetUpdateRet { + into(inCollection: any): UpsertExpression; + in: UpsertRetInsertRetUpdateRet["into"]; + in_: UpsertRetInsertRetUpdateRet["into"]; +} +interface InsertRet { + into(collection: any): InsertExpression; + in: InsertRet["into"]; + in_: InsertRet["into"]; +} +interface UpdateRetWithRet { + into(collection: any): UpdateExpression; + with(collection: any): UpdateRetWithRet; + in: UpdateRetWithRet["into"]; + in_: UpdateRetWithRet["into"]; +} +interface ReplaceRetWithRet { + into(collection: any): ReplaceExpression; + with(collection: any): ReplaceRetWithRet; + in: ReplaceRetWithRet["into"]; + in_: ReplaceRetWithRet["into"]; +} +declare function toArray(self: Expression, ...args: any[]): any[]; +declare function isQuotedString(str: string): boolean; +declare function wrapAQL(expr: Keyword): string; +declare function isValidNumber(number: number): boolean; +declare function castNumber(number: any): NumberLiteral; +declare function castBoolean(bool: any): BooleanLiteral; +declare function castString(str: any): SimpleReference | Identifier | RangeExpression | StringLiteral | Expression | PartialStatement | NullLiteral; +declare function castObject(obj: any): ObjectLiteral | ListLiteral | Identifier; +declare function autoCastToken(token: any): Expression | PartialStatement | NullLiteral; +/** + * AQLfunctions + * + * If raw JavaScript values are passed to statements, they will be wrapped in a matching declare function automatically. + * JavaScript strings wrapped in quotation marks will be wrapped in strings, all other JavaScript strings will be wrapped as simple references(see ref) + * and throw an Error if they are not well-formed. + */ +interface AQLfunctions extends Expression { + /** + * Boolean + * + * Wraps the given value as an Boolean literal. + * + * qb.bool(value) + * + * If the value is truthy, it will be converted to the Boolean true, otherwise it will be converted to the Boolean false. + * If the value is already an Boolean, its own value will be wrapped instead. + * + */ + bool(value: any): BooleanLiteral; + /** + * Number + * + * Wraps the given value as an Number literal. + * + * qb.num(value) + * + * If the value is not a JavaScript Number, it will be converted first. + * If the value does not represent a finite number, an Error will be thrown. + * If the value is already an Number or Integer, its own value will be wrapped instead. + * + */ + num(value: any): NumberLiteral; + /** + * Integer + * + * Wraps the given value as an Integer literal. + * + * qb.int(value) + * + * If the value is not a JavaScript Number, it will be converted first. + * If the value does not represent a finite integer, an Error will be thrown. + * If the value is already an Number or Integer, its own value will be wrapped instead. + * + */ + int(value: any): IntegerLiteral; + /** + * String + * + * Wraps the given value as an String literal. + * + * qb.str(value) + * + * If the value is not a JavaScript String, it will be converted first. + * If the value is a quoted string, it will be treated as a string literal. + * If the value is an object with a toAQL method, the result of calling that method will be wrapped instead. + * + * Examples + * + * 23 => "23" + * + * "some string" => "some string" + * + * '"some string"' => "\"some string\"" + * + */ + str(value: any): StringLiteral; + /** + * List + * + * Wraps the given value as an List(Array) literal. + * + * qb.list(value) + * + * If the value is not a JavaScript Array, an Error will be thrown. + * If the value is already an List, its own value will be wrapped instead. + * Any list elements that are not already values will be converted automatically. + * + */ + list(value: any[]): ListLiteral; + /** + * Object + * + * Wraps the given value as an Object literal. + * + * qb.obj(value) + * + * If the value is not a JavaScript Object, an Error will be thrown. + * If the value is already an Object, its own value will be wrapped instead. + * Any property values that are not already values will be converted automatically. + * Any keys that are quoted strings will be treated as string literals. + * Any keys that start with the character ":" will be treated as dynamic properties and must be well-formed simple references. + * Any other keys that need escaping will be quoted if necessary. + * If you need to pass in raw JavaScript objects that shouldn't be converted according to these rules, you can use the qb declare function directly instead. + * + * Examples + * + * qb.obj({'some.name': 'value'}): {"some.name": value} + * + * qb.obj({hello: world}): {hello: world} + * + * qb.obj({'"hello"': world}): {"hello": world} + * + * qb.obj({':dynamic': 'props'}): {[dynamic]: props} + * + * qb.obj({': invalid': 'key'}): throws an error(invalid is not a well-formed reference) + * + */ + obj(obj: object): ObjectLiteral; + /** + * Simple Reference + * + * Wraps a given value in an Simple Reference. + * + * qb.ref(value) + * + * If the value is not a JavaScript string or not a well-formed simple reference, an Error will be thrown. + * If the value is an ArangoCollection, its name property will be used instead. + * If the value is already an Simple Reference, its value is wrapped instead. + * + * Examples + * + * Valid values: + * + * foo + * + * foo.bar + * + * foo[*].bar + * + * foo.bar.QUX + * + * _foo._bar._qux + * + * foo1.bar2 + * + * `foo`.bar + * + * foo.`bar` + * + * Invalid values: + * + * 1foo + * + * föö + * + * foo bar + * + * foo[bar] + * + */ + ref(value: string): SimpleReference; + expr(value: any): RawExpression; + /** + * Ternary(if / else) + * + * Creates a ternary expression from the given values. + * + * qb.if(condition, thenDo, elseDo): (condition ? thenDo: elseDo) + * OR: + * qbValue.then(thenDo).else(elseDo): (condition ? thenDo: elseDo) + * + * If the values are not already values, they will be converted automatically. + * + * Alias: qbValue.then(thenDo).otherwise(elseDo) + * + * Examples + * qb.ref('x').then('y').else('z'): (x ? y: z) + * + */ + if(cond: any, then: any, otherwise: any): Expression | number; + /** + * declare Function Call + * + * Creates a functon call for the given name and arguments. + * + * qb.fn(name)(...args) + * + * If the values are not already values, they will be converted automatically. + * For built-in AQLfunctions, methods with the relevant declare function name are already provided by the query builder. + * + * Examples + * + * qb.fn('MY::USER::FUNC')(1, 2, 3): MY::USER::FUNC(1, 2, 3) + * + * qb.fn('hello')(): hello() + * + * qb.RANDOM(): RANDOM() + * + * qb.FLOOR(qb.div(5, 2)): FLOOR((5 / 2)) + * + */ + fn(functionName: string): (...arity: any[]) => FunctionCall; +} +type QBfunc = (obj: any) => AQLfunctions; +declare const QB: AQLfunctions & QBfunc; +export = QB; diff --git a/types/aqb/tsconfig.json b/types/aqb/tsconfig.json new file mode 100644 index 0000000000..09b73d3cfa --- /dev/null +++ b/types/aqb/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "lib": [ + "es2015" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "aqb-tests.ts" + ] +} \ No newline at end of file diff --git a/types/aqb/tslint.json b/types/aqb/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/aqb/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/arbiter/tsconfig.json b/types/arbiter/tsconfig.json index 674951954e..dafaff86db 100644 --- a/types/arbiter/tsconfig.json +++ b/types/arbiter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arcgis-js-api/tsconfig.json b/types/arcgis-js-api/tsconfig.json index 8a696a3a1e..815352a45c 100644 --- a/types/arcgis-js-api/tsconfig.json +++ b/types/arcgis-js-api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arcgis-js-api/v3/tsconfig.json b/types/arcgis-js-api/v3/tsconfig.json index 320cb582e1..63b40a8d0a 100644 --- a/types/arcgis-js-api/v3/tsconfig.json +++ b/types/arcgis-js-api/v3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arcgis-rest-api/tsconfig.json b/types/arcgis-rest-api/tsconfig.json index 346b0c1ea3..f65b0c47c2 100644 --- a/types/arcgis-rest-api/tsconfig.json +++ b/types/arcgis-rest-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arcgis-to-geojson-utils/tsconfig.json b/types/arcgis-to-geojson-utils/tsconfig.json index c2ef5bf641..09d3eda55e 100644 --- a/types/arcgis-to-geojson-utils/tsconfig.json +++ b/types/arcgis-to-geojson-utils/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/archiver/archiver-tests.ts b/types/archiver/archiver-tests.ts index fc2e481330..752d9cc944 100644 --- a/types/archiver/archiver-tests.ts +++ b/types/archiver/archiver-tests.ts @@ -1,4 +1,4 @@ -import * as Archiver from 'archiver'; +import Archiver = require('archiver'); import * as fs from 'fs'; const options: Archiver.ArchiverOptions = { diff --git a/types/archiver/tsconfig.json b/types/archiver/tsconfig.json index 71db696c82..fc2d8192fe 100644 --- a/types/archiver/tsconfig.json +++ b/types/archiver/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/archy/tsconfig.json b/types/archy/tsconfig.json index d26c849987..34f8c99625 100644 --- a/types/archy/tsconfig.json +++ b/types/archy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/are-we-there-yet/tsconfig.json b/types/are-we-there-yet/tsconfig.json index 9df0996daa..06a8973b97 100644 --- a/types/are-we-there-yet/tsconfig.json +++ b/types/are-we-there-yet/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/argon2-browser/tsconfig.json b/types/argon2-browser/tsconfig.json index a380778b29..3faa9d5cba 100644 --- a/types/argon2-browser/tsconfig.json +++ b/types/argon2-browser/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "argon2-browser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/argparse/tsconfig.json b/types/argparse/tsconfig.json index 49e7b03ca8..f3aac6f2d4 100644 --- a/types/argparse/tsconfig.json +++ b/types/argparse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/args/tsconfig.json b/types/args/tsconfig.json index d287417769..7b53eb08e5 100644 --- a/types/args/tsconfig.json +++ b/types/args/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/argv/tsconfig.json b/types/argv/tsconfig.json index 2a123030fa..5158b5969d 100644 --- a/types/argv/tsconfig.json +++ b/types/argv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arr-union/tsconfig.json b/types/arr-union/tsconfig.json index 64a3b1efed..a5fb2d419f 100644 --- a/types/arr-union/tsconfig.json +++ b/types/arr-union/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "arr-union-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/array-find-index/tsconfig.json b/types/array-find-index/tsconfig.json index 41c6183cbe..0de263e4f3 100644 --- a/types/array-find-index/tsconfig.json +++ b/types/array-find-index/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/array-foreach/tsconfig.json b/types/array-foreach/tsconfig.json index bacc698e34..3a83dc7215 100644 --- a/types/array-foreach/tsconfig.json +++ b/types/array-foreach/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/array-uniq/tsconfig.json b/types/array-uniq/tsconfig.json index 71557f6481..ca86571124 100644 --- a/types/array-uniq/tsconfig.json +++ b/types/array-uniq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/arrify/tsconfig.json b/types/arrify/tsconfig.json index 63d89a9c7f..2bbc02b851 100644 --- a/types/arrify/tsconfig.json +++ b/types/arrify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/artillery/tsconfig.json b/types/artillery/tsconfig.json index 0ad4bae0ee..6f8e79fafa 100644 --- a/types/artillery/tsconfig.json +++ b/types/artillery/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "artillery-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/asana/tsconfig.json b/types/asana/tsconfig.json index 452aade0b1..d4d565e8e3 100644 --- a/types/asana/tsconfig.json +++ b/types/asana/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ascii2mathml/tsconfig.json b/types/ascii2mathml/tsconfig.json index b4c4b0a21b..e41fd0d954 100644 --- a/types/ascii2mathml/tsconfig.json +++ b/types/ascii2mathml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/asciify/tsconfig.json b/types/asciify/tsconfig.json index 5f84d92e80..08737c3b21 100644 --- a/types/asciify/tsconfig.json +++ b/types/asciify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/asenv/tsconfig.json b/types/asenv/tsconfig.json index c779998e24..d58b835636 100644 --- a/types/asenv/tsconfig.json +++ b/types/asenv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/asn1js/tsconfig.json b/types/asn1js/tsconfig.json index 59420b595d..2a8fff0568 100644 --- a/types/asn1js/tsconfig.json +++ b/types/asn1js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aspnet-identity-pw/tsconfig.json b/types/aspnet-identity-pw/tsconfig.json index 2d2ba0ec28..ba41002410 100644 --- a/types/aspnet-identity-pw/tsconfig.json +++ b/types/aspnet-identity-pw/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/assert-equal-jsx/tsconfig.json b/types/assert-equal-jsx/tsconfig.json index 3f476135f8..1a14c64d1c 100644 --- a/types/assert-equal-jsx/tsconfig.json +++ b/types/assert-equal-jsx/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/assert-plus/tsconfig.json b/types/assert-plus/tsconfig.json index 5c89ae8c31..8c8ef3cd0a 100644 --- a/types/assert-plus/tsconfig.json +++ b/types/assert-plus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/assertsharp/tsconfig.json b/types/assertsharp/tsconfig.json index bc2779726e..febbb6ed84 100644 --- a/types/assertsharp/tsconfig.json +++ b/types/assertsharp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts b/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts index 6851f853f2..b02c707d81 100644 --- a/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts +++ b/types/assets-webpack-plugin/assets-webpack-plugin-tests.ts @@ -1,5 +1,5 @@ import * as webpack from 'webpack'; -import * as AssetsPlugin from 'assets-webpack-plugin'; +import AssetsPlugin = require('assets-webpack-plugin'); const config: webpack.Configuration = { plugins: [ diff --git a/types/assets-webpack-plugin/tsconfig.json b/types/assets-webpack-plugin/tsconfig.json index 3c08912345..91c958ed40 100644 --- a/types/assets-webpack-plugin/tsconfig.json +++ b/types/assets-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async-cache/tsconfig.json b/types/async-cache/tsconfig.json index 21657ef518..6a2cbf5f82 100644 --- a/types/async-cache/tsconfig.json +++ b/types/async-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async-lock/async-lock-tests.ts b/types/async-lock/async-lock-tests.ts index 259749d4f0..c6866d270b 100644 --- a/types/async-lock/async-lock-tests.ts +++ b/types/async-lock/async-lock-tests.ts @@ -10,6 +10,14 @@ lock.acquire("key", (done) => { done(); }).then(() => { /* ... */ }); +lock.acquire("key", () => "stringValue") +// Check returned value's type is inherited properly + .then((str) => str.replace("s", "S")); + +lock.acquire("key", async () => "stringValue") +// Check returned value's type is inherited properly + .then((str) => str.replace("s", "S")); + lock.acquire([ "key1", "key2" ], (done) => { done(); }, (err, ret) => { /* ... */ }); diff --git a/types/async-lock/index.d.ts b/types/async-lock/index.d.ts index 4a19590d73..5527482748 100644 --- a/types/async-lock/index.d.ts +++ b/types/async-lock/index.d.ts @@ -1,11 +1,12 @@ // Type definitions for async-lock // Project: https://github.com/rain1017/async-lock -// Definitions by: Elisée MAURER +// Definitions by: Elisée MAURER , Alejandro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -interface AsyncLockDoneCallback { - (err?: Error, ret?: any): void; +interface AsyncLockDoneCallback { + (err?: Error, ret?: T): void; } interface AsyncLockOptions { @@ -18,8 +19,13 @@ interface AsyncLockOptions { declare class AsyncLock { constructor(options?: AsyncLockOptions); - acquire(key: string | string[], fn: (done: AsyncLockDoneCallback) => any, cb: AsyncLockDoneCallback, opts?: AsyncLockOptions): void; - acquire(key: string | string[], fn: (done: AsyncLockDoneCallback) => any, opts?: AsyncLockOptions): PromiseLike; + acquire(key: string | string[], + fn: (() => T | PromiseLike) | ((done: AsyncLockDoneCallback) => any), + opts?: AsyncLockOptions): PromiseLike; + acquire(key: string | string[], + fn: (done: AsyncLockDoneCallback) => any, + cb: AsyncLockDoneCallback, + opts?: AsyncLockOptions): void; isBusy(): boolean; } diff --git a/types/async-lock/tsconfig.json b/types/async-lock/tsconfig.json index 1bc997ef73..22b7c33b0b 100644 --- a/types/async-lock/tsconfig.json +++ b/types/async-lock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async-lock/tslint.json b/types/async-lock/tslint.json index a41bf5d19a..35039ba334 100644 --- a/types/async-lock/tslint.json +++ b/types/async-lock/tslint.json @@ -8,13 +8,11 @@ "callable-types": false, "comment-format": false, "dt-header": false, - "eofline": false, "export-just-namespace": false, "import-spacing": false, "interface-name": false, "interface-over-type-literal": false, "jsdoc-format": false, - "max-line-length": false, "member-access": false, "new-parens": false, "no-any-union": false, diff --git a/types/async-polling/tsconfig.json b/types/async-polling/tsconfig.json index 5bcccb20f2..d3f9246be9 100644 --- a/types/async-polling/tsconfig.json +++ b/types/async-polling/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async-retry/async-retry-tests.ts b/types/async-retry/async-retry-tests.ts new file mode 100644 index 0000000000..29c90b36c8 --- /dev/null +++ b/types/async-retry/async-retry-tests.ts @@ -0,0 +1,20 @@ +import { Options, RetryFunction, retry } from 'async-retry'; + +const o: Options = { + retries: 1, + factor: 2, + minTimeout: 3, + maxTimeout: 4, + randomize: true, + onRetry: (e: Error) => 42 +}; + +retry( + bail => 'hello', + { retries: 3 } +); + +retry( + bail => Promise.resolve(42), + { retries: 3 } +); diff --git a/types/async-retry/index.d.ts b/types/async-retry/index.d.ts new file mode 100644 index 0000000000..38d0d8aeec --- /dev/null +++ b/types/async-retry/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for async-retry 1.1 +// Project: https://github.com/zeit/async-retry#readme +// Definitions by: Albert Wu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function retry(fn: RetryFunction, opts: Options): Promise; + +export interface Options { + retries?: number; + factor?: number; + minTimeout?: number; + maxTimeout?: number; + randomize?: boolean; + onRetry?: (e: Error) => any; +} + +export type RetryFunction = (bail: (e: Error) => A, attempt: number) => A|Promise; diff --git a/types/async-retry/tsconfig.json b/types/async-retry/tsconfig.json new file mode 100644 index 0000000000..e371a3e4d6 --- /dev/null +++ b/types/async-retry/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "async-retry-tests.ts" + ] +} \ No newline at end of file diff --git a/types/async-retry/tslint.json b/types/async-retry/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/async-retry/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/async-writer/tsconfig.json b/types/async-writer/tsconfig.json index 2b8771e48c..565754dbb5 100644 --- a/types/async-writer/tsconfig.json +++ b/types/async-writer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async.nexttick/tsconfig.json b/types/async.nexttick/tsconfig.json index b824f94a44..71de47e764 100644 --- a/types/async.nexttick/tsconfig.json +++ b/types/async.nexttick/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/async/tsconfig.json b/types/async/tsconfig.json index 153a5471fb..3834ff925d 100644 --- a/types/async/tsconfig.json +++ b/types/async/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/asynciterator/tsconfig.json b/types/asynciterator/tsconfig.json index 8b8b919abc..345f06297a 100644 --- a/types/asynciterator/tsconfig.json +++ b/types/asynciterator/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "asynciterator-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/atmosphere.js/tsconfig.json b/types/atmosphere.js/tsconfig.json index f06f28e8f7..7c135528bc 100644 --- a/types/atmosphere.js/tsconfig.json +++ b/types/atmosphere.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/atom-keymap/tsconfig.json b/types/atom-keymap/tsconfig.json index 8a17cc061c..0da99e34c6 100644 --- a/types/atom-keymap/tsconfig.json +++ b/types/atom-keymap/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "atom-keymap-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/atom-mocha-test-runner/tsconfig.json b/types/atom-mocha-test-runner/tsconfig.json index c6e9fb20c0..78526855a4 100644 --- a/types/atom-mocha-test-runner/tsconfig.json +++ b/types/atom-mocha-test-runner/tsconfig.json @@ -16,10 +16,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "atom-mocha-test-runner-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index 5fc92880f4..fbd5f6d0d8 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -1459,6 +1459,14 @@ function testPackageManager() { bool = atom.packages.isPackageDisabled("Test"); + // Activating and deactivating packages + atom.packages.activatePackage("Test").then((activePack) => { + pack = activePack; + }); + atom.packages.deactivatePackage("Test", true).then(() => { + // package is deactivated + }); + // Accessing active packages packs = atom.packages.getActivePackages(); diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index a261661144..f83f751657 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -4111,6 +4111,9 @@ export interface PackageManager { /** Activate a single package by name or path. */ activatePackage(nameOrPath: string): Promise; + /** Deactivate a single package by name or path. */ + deactivatePackage(nameOrPath: string, suppressSerialization?: boolean): Promise; + /** Triggers the given package activation hook. */ triggerActivationHook(hook: string): void; diff --git a/types/atom/tsconfig.json b/types/atom/tsconfig.json index a58ec7b74c..255161da5d 100644 --- a/types/atom/tsconfig.json +++ b/types/atom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -24,4 +25,4 @@ "linter/index.d.ts", "status-bar/index.d.ts" ] -} +} \ No newline at end of file diff --git a/types/atpl/tsconfig.json b/types/atpl/tsconfig.json index 24f7da314f..29701793a6 100644 --- a/types/atpl/tsconfig.json +++ b/types/atpl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/audiosprite/tsconfig.json b/types/audiosprite/tsconfig.json index b761c9572e..b62f115d3e 100644 --- a/types/audiosprite/tsconfig.json +++ b/types/audiosprite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0-angular/tsconfig.json b/types/auth0-angular/tsconfig.json index 42ee707301..7ebb721b12 100644 --- a/types/auth0-angular/tsconfig.json +++ b/types/auth0-angular/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0-js/tsconfig.json b/types/auth0-js/tsconfig.json index a813aae68d..94352610d5 100644 --- a/types/auth0-js/tsconfig.json +++ b/types/auth0-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0-js/v7/tsconfig.json b/types/auth0-js/v7/tsconfig.json index e76b7d7dd8..a545bdd735 100644 --- a/types/auth0-js/v7/tsconfig.json +++ b/types/auth0-js/v7/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts index c2107b11e4..119bbb3c37 100644 --- a/types/auth0-lock/auth0-lock-tests.ts +++ b/types/auth0-lock/auth0-lock-tests.ts @@ -204,6 +204,19 @@ const selectFieldOptionsWithCallbacks : Auth0LockConstructorOptions = { new Auth0Lock(CLIENT_ID, DOMAIN, selectFieldOptionsWithCallbacks); +// test checkbox-field additional sign up field + +const checkboxFieldOptions : Auth0LockConstructorOptions = { + additionalSignUpFields: [{ + type: "checkbox", + name: "remember", + placeholder: "Remember Me", + prefill: "false" + }] + }; + + new Auth0Lock(CLIENT_ID, DOMAIN, checkboxFieldOptions); + // test Avatar options const avatarOptions : Auth0LockConstructorOptions = { diff --git a/types/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts index 8ed6b50c87..352d9c71a9 100644 --- a/types/auth0-lock/index.d.ts +++ b/types/auth0-lock/index.d.ts @@ -2,6 +2,7 @@ // Project: http://auth0.com // Definitions by: Brian Caruso // Dan Caddigan +// Larry Faudree // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -23,16 +24,37 @@ type Auth0LockAdditionalSignUpFieldPrefillCallback = type Auth0LockAdditionalSignUpFieldPrefillFunction = (callback: Auth0LockAdditionalSignUpFieldPrefillCallback) => void; -interface Auth0LockAdditionalSignUpField { +interface Auth0LockAdditionalTextSignUpField { + type?: "text"; icon?: string; name: string; options?: Auth0LockAdditionalSignUpFieldOption[] | Auth0LockAdditionalSignUpFieldOptionsFunction; placeholder: string; prefill?: string | Auth0LockAdditionalSignUpFieldPrefillFunction; - type?: "select" | "text"; validator?: (input: string) => { valid: boolean; hint?: string }; } +interface Auth0LockAdditionalSelectSignUpField { + type?: "select"; + icon?: string; + name: string; + options?: Auth0LockAdditionalSignUpFieldOption[] | Auth0LockAdditionalSignUpFieldOptionsFunction; + placeholder: string; + prefill?: string | Auth0LockAdditionalSignUpFieldPrefillFunction; + validator?: (input: string) => { valid: boolean; hint?: string }; +} + +interface Auth0LockAdditionalCheckboxSignUpField { + type?: "checkbox"; + icon?: string; + name: string; + placeholder: string; + prefill: "true" | "false"; + validator?: (input: string) => { valid: boolean, hint?: string }; +} + +type Auth0LockAdditionalSignUpField = Auth0LockAdditionalSelectSignUpField |Auth0LockAdditionalTextSignUpField |Auth0LockAdditionalCheckboxSignUpField; + type Auth0LockAvatarUrlCallback = (error: auth0.Auth0Error, url: string) => void; type Auth0LockAvatarDisplayNameCallback = (error: auth0.Auth0Error, displayName: string) => void; diff --git a/types/auth0-lock/tsconfig.json b/types/auth0-lock/tsconfig.json index 2e008d7c0d..4f1a4777b1 100644 --- a/types/auth0-lock/tsconfig.json +++ b/types/auth0-lock/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0.widget/tsconfig.json b/types/auth0.widget/tsconfig.json index d18a18213b..bcf85a4971 100644 --- a/types/auth0.widget/tsconfig.json +++ b/types/auth0.widget/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index e9e347cc69..0572c2b0e7 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -131,3 +131,13 @@ const retryableManagementClient = new auth0.ManagementClient({ enabled : true } }); + +management.createPasswordChangeTicket({ + connection_id: 'con_id', + email: 'test@me.co', + new_password: 'password', + result_url: 'https://www.google.com/', + ttl_sec: 86400, +}, (err: Error, data) => { + console.log(data.ticket); +}); diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 609c1ecf0d..58013848f8 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -488,10 +488,16 @@ export interface UserIdParams { } export interface PasswordChangeTicketParams { - result_url: string; - user_id: string; - email: string; - new_password: string; + result_url?: string; + user_id?: string; + new_password?: string; + connection_id?: string; + email?: string; + ttl_sec?: number; +} + +export interface PasswordChangeTicketResponse { + ticket: string; } export interface EmailVerificationTicketOptions { @@ -711,8 +717,8 @@ export class ManagementClient { sendEmailVerification(data: UserIdParams, cb?: (err: Error, data: any) => void): void; // Tickets - createPasswordChangeTicket(params: PasswordChangeTicketParams): Promise; - createPasswordChangeTicket(params: PasswordChangeTicketParams, cb?: (err: Error, data: any) => void): void; + createPasswordChangeTicket(params: PasswordChangeTicketParams): Promise; + createPasswordChangeTicket(params: PasswordChangeTicketParams, cb?: (err: Error, data: PasswordChangeTicketResponse) => void): void; createEmailVerificationTicket(data: EmailVerificationTicketOptions): Promise; createEmailVerificationTicket(data: EmailVerificationTicketOptions, cb?: (err: Error, data: any) => void): void; diff --git a/types/auth0/tsconfig.json b/types/auth0/tsconfig.json index dd7c60796c..035f06fa53 100644 --- a/types/auth0/tsconfig.json +++ b/types/auth0/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auto-launch/tsconfig.json b/types/auto-launch/tsconfig.json index 952d3c0c5d..ae1120e02d 100644 --- a/types/auto-launch/tsconfig.json +++ b/types/auto-launch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/auto-sni/auto-sni-tests.ts b/types/auto-sni/auto-sni-tests.ts index 6be54148fb..8cd17af850 100644 --- a/types/auto-sni/auto-sni-tests.ts +++ b/types/auto-sni/auto-sni-tests.ts @@ -1,4 +1,4 @@ -import * as autosni from "auto-sni"; +import autosni = require("auto-sni"); const a = autosni({ agreeTos: true, email: '', diff --git a/types/auto-sni/tsconfig.json b/types/auto-sni/tsconfig.json index 9c03900b72..9a339b5439 100644 --- a/types/auto-sni/tsconfig.json +++ b/types/auto-sni/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/autobahn/tsconfig.json b/types/autobahn/tsconfig.json index 35ca105b25..a3b68fe8fd 100644 --- a/types/autobahn/tsconfig.json +++ b/types/autobahn/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/autolinker/tsconfig.json b/types/autolinker/tsconfig.json index 7d8068c47c..14a6b796bf 100644 --- a/types/autolinker/tsconfig.json +++ b/types/autolinker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/autoprefixer-core/tsconfig.json b/types/autoprefixer-core/tsconfig.json index 91b4bc2e7c..ec4c2ed5c6 100644 --- a/types/autoprefixer-core/tsconfig.json +++ b/types/autoprefixer-core/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/autoprefixer/tsconfig.json b/types/autoprefixer/tsconfig.json index 92adece604..526589c957 100644 --- a/types/autoprefixer/tsconfig.json +++ b/types/autoprefixer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/autosize/tsconfig.json b/types/autosize/tsconfig.json index d74b3d9c37..40eb47cb0e 100644 --- a/types/autosize/tsconfig.json +++ b/types/autosize/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/avoscloud-sdk/tsconfig.json b/types/avoscloud-sdk/tsconfig.json index 2d3d9589f4..4500518b48 100644 --- a/types/avoscloud-sdk/tsconfig.json +++ b/types/avoscloud-sdk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/awesomplete/tsconfig.json b/types/awesomplete/tsconfig.json index 74f690ea77..c7d261fded 100644 --- a/types/awesomplete/tsconfig.json +++ b/types/awesomplete/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aws-iot-device-sdk/tsconfig.json b/types/aws-iot-device-sdk/tsconfig.json index 3fdd4b0f28..4b938cc66f 100644 --- a/types/aws-iot-device-sdk/tsconfig.json +++ b/types/aws-iot-device-sdk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aws-lambda-mock-context/tsconfig.json b/types/aws-lambda-mock-context/tsconfig.json index 5d1dfe3f1f..8587235c8a 100644 --- a/types/aws-lambda-mock-context/tsconfig.json +++ b/types/aws-lambda-mock-context/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 1d756f21e0..6d0d83b210 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -1,29 +1,29 @@ -var str: string = "any string"; -var date: Date = new Date(); -var anyObj: any = { abc: 123 }; -var num: number = 5; -var error: Error = new Error(); -var b: boolean = true; -var apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext; -var apiGwEvt: AWSLambda.APIGatewayEvent; -var customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent; -var clientCtx: AWSLambda.ClientContext; -var clientContextEnv: AWSLambda.ClientContextEnv; -var clientContextClient: AWSLambda.ClientContextClient; -var context: AWSLambda.Context; -var identity: AWSLambda.CognitoIdentity; -var proxyResult: AWSLambda.ProxyResult; -var authResponse: AWSLambda.AuthResponse; -var policyDocument: AWSLambda.PolicyDocument; -var statement: AWSLambda.Statement; -var authResponseContext: AWSLambda.AuthResponseContext; -var snsEvt: AWSLambda.SNSEvent; -var snsEvtRecs: AWSLambda.SNSEventRecord[]; -var snsEvtRec: AWSLambda.SNSEventRecord; -var snsMsg: AWSLambda.SNSMessage; -var snsMsgAttr: AWSLambda.SNSMessageAttribute; -var snsMsgAttrs: AWSLambda.SNSMessageAttributes; -var S3EvtRec: AWSLambda.S3EventRecord = { +let str: string; +let date: Date; +let anyObj: any; +let num: number; +let error: Error; +let b: boolean; +let apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext; +let apiGwEvt: AWSLambda.APIGatewayEvent; +let customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent; +let clientCtx: AWSLambda.ClientContext; +let clientContextEnv: AWSLambda.ClientContextEnv; +let clientContextClient: AWSLambda.ClientContextClient; +let context: AWSLambda.Context; +let identity: AWSLambda.CognitoIdentity; +let proxyResult: AWSLambda.ProxyResult; +let authResponse: AWSLambda.AuthResponse; +let policyDocument: AWSLambda.PolicyDocument; +let statement: AWSLambda.Statement; +let authResponseContext: AWSLambda.AuthResponseContext; +let snsEvt: AWSLambda.SNSEvent; +let snsEvtRecs: AWSLambda.SNSEventRecord[]; +let snsEvtRec: AWSLambda.SNSEventRecord; +let snsMsg: AWSLambda.SNSMessage; +let snsMsgAttr: AWSLambda.SNSMessageAttribute; +let snsMsgAttrs: AWSLambda.SNSMessageAttributes; +const S3EvtRec: AWSLambda.S3EventRecord = { eventVersion: '2.0', eventSource: 'aws:s3', awsRegion: 'us-east-1', @@ -32,7 +32,7 @@ var S3EvtRec: AWSLambda.S3EventRecord = { userIdentity: { principalId: 'AIDAJDPLRKLG7UEXAMPLE' }, - requestParameters:{ + requestParameters: { sourceIPAddress: '127.0.0.1' }, responseElements: { @@ -59,14 +59,15 @@ var S3EvtRec: AWSLambda.S3EventRecord = { } }; -var S3CreateEvent: AWSLambda.S3CreateEvent = { +const S3CreateEvent: AWSLambda.S3CreateEvent = { Records: [S3EvtRec] }; -var cognitoUserPoolEvent: AWSLambda.CognitoUserPoolEvent; -var cloudformationCustomResourceEvent: AWSLambda.CloudFormationCustomResourceEvent; -var cloudformationCustomResourceResponse: AWSLambda.CloudFormationCustomResourceResponse; -var cloudwatchLogsEvent: AWSLambda.CloudWatchLogsEvent; -var cloudwatchLogsDecodedData: AWSLambda.CloudWatchLogsDecodedData; +declare const cognitoUserPoolEvent: AWSLambda.CognitoUserPoolEvent; +declare const cloudformationCustomResourceEvent: AWSLambda.CloudFormationCustomResourceEvent; +declare const cloudformationCustomResourceResponse: AWSLambda.CloudFormationCustomResourceResponse; +declare const cloudwatchLogsEvent: AWSLambda.CloudWatchLogsEvent; +declare const cloudwatchLogsDecodedData: AWSLambda.CloudWatchLogsDecodedData; +declare const scheduledEvent: AWSLambda.ScheduledEvent; /* API Gateway Event request context */ str = apiGwEvtReqCtx.accountId; @@ -112,7 +113,7 @@ str = apiGwEvt.stageVariables["example"]; apiGwEvtReqCtx = apiGwEvt.requestContext; /* DynamoDB Stream Event */ -var dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = { +const dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = { Records: [ { eventID: '1', @@ -265,13 +266,13 @@ policyDocument = { authResponse = { principalId: str, - policyDocument: policyDocument, + policyDocument, context: authResponseContext }; authResponse = { principalId: str, - policyDocument: policyDocument + policyDocument, }; // CognitoUserPoolEvent @@ -290,6 +291,13 @@ cognitoUserPoolEvent.triggerSource === "CustomMessage_Authentication"; cognitoUserPoolEvent.triggerSource === "DefineAuthChallenge_Authentication"; cognitoUserPoolEvent.triggerSource === "CreateAuthChallenge_Authentication"; cognitoUserPoolEvent.triggerSource === "VerifyAuthChallengeResponse_Authentication"; +cognitoUserPoolEvent.triggerSource === "PreSignUp_AdminCreateUser"; +cognitoUserPoolEvent.triggerSource === "PostConfirmation_ConfirmForgotPassword"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_HostedAuth"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_Authentication"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_NewPasswordChallenge"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_AuthenticateDevice"; +cognitoUserPoolEvent.triggerSource === "TokenGeneration_RefreshTokens"; str = cognitoUserPoolEvent.region; str = cognitoUserPoolEvent.userPoolId; str = cognitoUserPoolEvent.userName; @@ -350,6 +358,15 @@ str = cloudformationCustomResourceResponse.RequestId; str = cloudformationCustomResourceResponse.StackId; str = cloudformationCustomResourceResponse.Status; +/* ScheduledEvent */ +str = scheduledEvent.account; +anyObj = scheduledEvent.detail; +str = scheduledEvent.id; +str = scheduledEvent.region; +str = scheduledEvent.resources[0]; +str = scheduledEvent.source; +str = scheduledEvent.time; + /* Context */ b = context.callbackWaitsForEmptyEventLoop; str = context.functionName; @@ -425,67 +442,67 @@ function customAuthorizerCallback(cb: AWSLambda.CustomAuthorizerCallback) { } /* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */ -var CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { - "Records": [ +const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { + Records: [ { - "cf": { - "config": { - "distributionId": "EDFDVBD6EXAMPLE", - "requestId": "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE==" + cf: { + config: { + distributionId: "EDFDVBD6EXAMPLE", + requestId: "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE==" }, - "request": { - "clientIp": "2001:0db8:85a3:0:0:8a2e:0370:7334", - "method": "GET", - "uri": "/picture.jpg", - "querystring": "size=large", - "headers": { - "host": [ + request: { + clientIp: "2001:0db8:85a3:0:0:8a2e:0370:7334", + method: "GET", + uri: "/picture.jpg", + querystring: "size=large", + headers: { + host: [ { - "key": "Host", - "value": "d111111abcdef8.cloudfront.net" + key: "Host", + value: "d111111abcdef8.cloudfront.net" } ], "user-agent": [ { - "key": "User-Agent", - "value": "curl/7.51.0" + key: "User-Agent", + value: "curl/7.51.0" } ] }, - "origin": { - "custom": { - "customHeaders": { + origin: { + custom: { + customHeaders: { "my-origin-custom-header": [ { - "key": "My-Origin-Custom-Header", - "value": "Test" + key: "My-Origin-Custom-Header", + value: "Test" } ] }, - "domainName": "example.com", - "keepaliveTimeout": 5, - "path": "/custom_path", - "port": 443, - "protocol": "https", - "readTimeout": 5, - "sslProtocols": [ + domainName: "example.com", + keepaliveTimeout: 5, + path: "/custom_path", + port: 443, + protocol: "https", + readTimeout: 5, + sslProtocols: [ "TLSv1", "TLSv1.1" ] }, - "s3": { - "authMethod": "origin-access-identity", - "customHeaders": { + s3: { + authMethod: "origin-access-identity", + customHeaders: { "my-origin-custom-header": [ { - "key": "My-Origin-Custom-Header", - "value": "Test" + key: "My-Origin-Custom-Header", + value: "Test" } ] }, - "domainName": "my-bucket.s3.amazonaws.com", - "path": "/s3_path", - "region": "us-east-1" + domainName: "my-bucket.s3.amazonaws.com", + path: "/s3_path", + region: "us-east-1" } } } @@ -494,52 +511,52 @@ var CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { ] }; -var CloudFrontResponseEvent: AWSLambda.CloudFrontResponseEvent = { - "Records": [ +const CloudFrontResponseEvent: AWSLambda.CloudFrontResponseEvent = { + Records: [ { - "cf": { - "config": { - "distributionId": "EDFDVBD6EXAMPLE", - "requestId": "xGN7KWpVEmB9Dp7ctcVFQC4E-nrcOcEKS3QyAez--06dV7TEXAMPLE==" + cf: { + config: { + distributionId: "EDFDVBD6EXAMPLE", + requestId: "xGN7KWpVEmB9Dp7ctcVFQC4E-nrcOcEKS3QyAez--06dV7TEXAMPLE==" }, - "request": { - "clientIp": "2001:0db8:85a3:0:0:8a2e:0370:7334", - "method": "GET", - "uri": "/picture.jpg", - "querystring": "size=large", - "headers": { - "host": [ + request: { + clientIp: "2001:0db8:85a3:0:0:8a2e:0370:7334", + method: "GET", + uri: "/picture.jpg", + querystring: "size=large", + headers: { + host: [ { - "key": "Host", - "value": "d111111abcdef8.cloudfront.net" + key: "Host", + value: "d111111abcdef8.cloudfront.net" } ], "user-agent": [ { - "key": "User-Agent", - "value": "curl/7.18.1" + key: "User-Agent", + value: "curl/7.18.1" } ] } }, - "response": { - "status": "200", - "statusDescription": "OK", - "headers": { - "server": [ + response: { + status: "200", + statusDescription: "OK", + headers: { + server: [ { - "key": "Server", - "value": "MyCustomOrigin" + key: "Server", + value: "MyCustomOrigin" } ], "set-cookie": [ { - "key": "Set-Cookie", - "value": "theme=light" + key: "Set-Cookie", + value: "theme=light" }, { - "key": "Set-Cookie", - "value": "sessionToken=abc123; Expires=Wed, 09 Jun 2021 10:18:14 GMT" + key: "Set-Cookie", + value: "sessionToken=abc123; Expires=Wed, 09 Jun 2021 10:18:14 GMT" } ] } diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 320cf562f8..09070fb13c 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -12,14 +12,16 @@ // Daniel Cottone // Kostya Misura // Markus Tacker +// Palmi Valgeirsson +// Danilo Raisi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 // API Gateway "event" request context -interface APIGatewayEventRequestContext { +export interface APIGatewayEventRequestContext { accountId: string; apiId: string; - authorizer?: AuthResponseContext | null | undefined; + authorizer?: AuthResponseContext | null; httpMethod: string; identity: { accessKey: string | null; @@ -34,15 +36,16 @@ interface APIGatewayEventRequestContext { user: string | null; userAgent: string | null; userArn: string | null; - }, + }; stage: string; requestId: string; + requestTimeEpoch: number; resourceId: string; resourcePath: string; } // API Gateway "event" -interface APIGatewayEvent { +export interface APIGatewayEvent { body: string | null; headers: { [name: string]: string }; httpMethod: string; @@ -56,7 +59,7 @@ interface APIGatewayEvent { } // API Gateway CustomAuthorizer "event" -interface CustomAuthorizerEvent { +export interface CustomAuthorizerEvent { type: string; methodArn: string; authorizationToken?: string; @@ -68,22 +71,22 @@ interface CustomAuthorizerEvent { // Context // http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_AttributeValue.html -interface AttributeValue { +export interface AttributeValue { B?: string; - BS?: Array; + BS?: string[]; BOOL?: boolean; - L?: Array; + L?: AttributeValue[]; M?: { [id: string]: AttributeValue }; N?: string; - NS?: Array; + NS?: string[]; NULL?: boolean; S?: string; - SS?: Array; + SS?: string[]; } // Context // http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_StreamRecord.html -interface StreamRecord { +export interface StreamRecord { ApproximateCreationTime?: number; Keys?: { [key: string]: AttributeValue }; NewImage?: { [key: string]: AttributeValue }; @@ -95,7 +98,7 @@ interface StreamRecord { // Context // http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_Record.html -interface DynamoDBRecord { +export interface DynamoDBRecord { awsRegion?: string; dynamodb?: StreamRecord; eventID?: string; @@ -109,21 +112,21 @@ interface DynamoDBRecord { // AWS Lambda Stream event // Context // http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-ddb-update -interface DynamoDBStreamEvent { - Records: Array; +export interface DynamoDBStreamEvent { + Records: DynamoDBRecord[]; } // SNS "event" -interface SNSMessageAttribute { +export interface SNSMessageAttribute { Type: string; Value: string; } -interface SNSMessageAttributes { +export interface SNSMessageAttributes { [name: string]: SNSMessageAttribute; } -interface SNSMessage { +export interface SNSMessage { SignatureVersion: string; Timestamp: string; Signature: string; @@ -137,37 +140,37 @@ interface SNSMessage { Subject: string; } -interface SNSEventRecord { +export interface SNSEventRecord { EventVersion: string; EventSubscriptionArn: string; EventSource: string; Sns: SNSMessage; } -interface SNSEvent { - Records: Array; +export interface SNSEvent { + Records: SNSEventRecord[]; } /** * S3Create event * https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html */ -interface S3EventRecord { +export interface S3EventRecord { eventVersion: string; eventSource: string; - awsRegion: string + awsRegion: string; eventTime: string; eventName: string; userIdentity: { principalId: string; - }, + }; requestParameters: { sourceIPAddress: string; - }, + }; responseElements: { 'x-amz-request-id': string; 'x-amz-id-2': string; - }, + }; s3: { s3SchemaVersion: string; configurationId: string; @@ -185,20 +188,41 @@ interface S3EventRecord { versionId: string; sequencer: string; } - } + }; } -interface S3CreateEvent { - Records: Array; +export interface S3CreateEvent { + Records: S3EventRecord[]; } /** * Cognito User Pool event * http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html */ -interface CognitoUserPoolEvent { +export interface CognitoUserPoolEvent { version: number; - triggerSource: "PreSignUp_SignUp" | "PostConfirmation_ConfirmSignUp" | "PreAuthentication_Authentication" | "PostAuthentication_Authentication" | "CustomMessage_SignUp" | "CustomMessage_AdminCreateUser" | "CustomMessage_ResendCode" | "CustomMessage_ForgotPassword" | "CustomMessage_UpdateUserAttribute" | "CustomMessage_VerifyUserAttribute" | "CustomMessage_Authentication" | "DefineAuthChallenge_Authentication" | "CreateAuthChallenge_Authentication" | "VerifyAuthChallengeResponse_Authentication"; + triggerSource: + | "PreSignUp_SignUp" + | "PostConfirmation_ConfirmSignUp" + | "PreAuthentication_Authentication" + | "PostAuthentication_Authentication" + | "CustomMessage_SignUp" + | "CustomMessage_AdminCreateUser" + | "CustomMessage_ResendCode" + | "CustomMessage_ForgotPassword" + | "CustomMessage_UpdateUserAttribute" + | "CustomMessage_VerifyUserAttribute" + | "CustomMessage_Authentication" + | "DefineAuthChallenge_Authentication" + | "CreateAuthChallenge_Authentication" + | "VerifyAuthChallengeResponse_Authentication" + | "PreSignUp_AdminCreateUser" + | "PostConfirmation_ConfirmForgotPassword" + | "TokenGeneration_HostedAuth" + | "TokenGeneration_Authentication" + | "TokenGeneration_NewPasswordChallenge" + | "TokenGeneration_AuthenticateDevice" + | "TokenGeneration_RefreshTokens"; region: string; userPoolId: string; userName?: string; @@ -212,11 +236,11 @@ interface CognitoUserPoolEvent { codeParameter?: string; usernameParameter?: string; newDeviceUsed?: boolean; - session?: { + session?: Array<{ challengeName: "CUSTOM_CHALLENGE" | "PASSWORD_VERIFIER" | "SMS_MFA" | "DEVICE_SRP_AUTH" | "DEVICE_PASSWORD_VERIFIER" | "ADMIN_NO_SRP_AUTH"; challengeResult: boolean; challengeMetaData?: string; - }[]; + }>; challengeName?: string; privateChallengeParameters?: {[key: string]: string}; challengeAnswer?: {[key: string]: string}; @@ -240,7 +264,7 @@ interface CognitoUserPoolEvent { * CloudFormation Custom Resource event and response * http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref.html */ -type CloudFormationCustomResourceEventCommon = { +export interface CloudFormationCustomResourceEventCommon { ServiceToken: string; ResponseURL: string; StackId: string; @@ -250,14 +274,14 @@ type CloudFormationCustomResourceEventCommon = { ResourceProperties: { ServiceToken: string; [Key: string]: any; - } + }; } -type CloudFormationCustomResourceCreateEvent = CloudFormationCustomResourceEventCommon & { +export interface CloudFormationCustomResourceCreateEvent extends CloudFormationCustomResourceEventCommon { RequestType: "Create"; } -type CloudFormationCustomResourceUpdateEvent = CloudFormationCustomResourceEventCommon & { +export interface CloudFormationCustomResourceUpdateEvent extends CloudFormationCustomResourceEventCommon { RequestType: "Update"; PhysicalResourceId: string; OldResourceProperties: { @@ -265,47 +289,61 @@ type CloudFormationCustomResourceUpdateEvent = CloudFormationCustomResourceEvent }; } -type CloudFormationCustomResourceDeleteEvent = CloudFormationCustomResourceEventCommon & { +export interface CloudFormationCustomResourceDeleteEvent extends CloudFormationCustomResourceEventCommon { RequestType: "Delete"; PhysicalResourceId: string; } export type CloudFormationCustomResourceEvent = CloudFormationCustomResourceCreateEvent | CloudFormationCustomResourceUpdateEvent | CloudFormationCustomResourceDeleteEvent; -type CloudFormationCustomResourceResponseCommon = { +export interface CloudFormationCustomResourceResponseCommon { PhysicalResourceId: string; StackId: string; RequestId: string; LogicalResourceId: string; Data?: { [Key: string]: any; - } + }; } -type CloudFormationCustomResourceSuccessResponse = CloudFormationCustomResourceResponseCommon & { +export interface CloudFormationCustomResourceSuccessResponse extends CloudFormationCustomResourceResponseCommon { Status: "SUCCESS"; Reason?: string; } -type CloudFormationCustomResourceFailedResponse = CloudFormationCustomResourceResponseCommon & { +export interface CloudFormationCustomResourceFailedResponse extends CloudFormationCustomResourceResponseCommon { Status: "FAILED"; Reason: string; } export type CloudFormationCustomResourceResponse = CloudFormationCustomResourceSuccessResponse | CloudFormationCustomResourceFailedResponse; +/** + * See https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-scheduled-event + */ +export interface ScheduledEvent { + account: string; + region: string; + detail: any; + "detail-type": string; + source: string; + time: string; + id: string; + resources: string[]; +} + /** * See http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-cloudwatch-logs */ -interface CloudWatchLogsEvent { +export interface CloudWatchLogsEvent { awslogs: CloudWatchLogsEventData; } -interface CloudWatchLogsEventData { +export interface CloudWatchLogsEventData { data: string; } -interface CloudWatchLogsDecodedData { +export interface CloudWatchLogsDecodedData { owner: string; logGroup: string; logStream: string; @@ -317,17 +355,15 @@ interface CloudWatchLogsDecodedData { /** * See http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#LambdaFunctionExample */ -interface CloudWatchLogsLogEvent { +export interface CloudWatchLogsLogEvent { id: string; timestamp: number; message: string; } - - // Context // http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html -interface Context { +export interface Context { // Properties callbackWaitsForEmptyEventLoop: boolean; functionName: string; @@ -346,25 +382,23 @@ interface Context { // Functions for compatibility with earlier Node.js Runtime v0.10.42 // For more details see http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html#nodejs-prog-model-oldruntime-context-methods done(error?: Error, result?: any): void; - fail(error: Error): void; - fail(message: string): void; - succeed(message: string): void; - succeed(object: any): void; + fail(error: Error | string): void; + succeed(messageOrObject: any): void; succeed(message: string, object: any): void; } -interface CognitoIdentity { +export interface CognitoIdentity { cognitoIdentityId: string; cognitoIdentityPoolId: string; } -interface ClientContext { +export interface ClientContext { client: ClientContextClient; Custom?: any; env: ClientContextEnv; } -interface ClientContextClient { +export interface ClientContextClient { installationId: string; appTitle: string; appVersionName: string; @@ -372,7 +406,7 @@ interface ClientContextClient { appPackageName: string; } -interface ClientContextEnv { +export interface ClientContextEnv { platformVersion: string; platform: string; make: string; @@ -380,11 +414,11 @@ interface ClientContextEnv { locale: string; } -interface ProxyResult { +export interface ProxyResult { statusCode: number; headers?: { [header: string]: boolean | number | string; - }, + }; body: string; isBase64Encoded?: boolean; } @@ -393,7 +427,7 @@ interface ProxyResult { * API Gateway CustomAuthorizer AuthResponse. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */ -interface AuthResponse { +export interface AuthResponse { principalId: string; policyDocument: PolicyDocument; context?: AuthResponseContext; @@ -403,7 +437,7 @@ interface AuthResponse { * API Gateway CustomAuthorizer AuthResponse.PolicyDocument. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */ -interface PolicyDocument { +export interface PolicyDocument { Version: string; Statement: [Statement]; } @@ -412,7 +446,7 @@ interface PolicyDocument { * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */ -interface Statement { +export interface Statement { Action: string | string[]; Effect: string; Resource: string | string[]; @@ -422,58 +456,58 @@ interface Statement { * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */ -interface AuthResponseContext { - [name: string]: string | number | boolean; +export interface AuthResponseContext { + [name: string]: any; } /** * CloudFront events * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */ -type CloudFrontHeaders = { - [name: string]: { - key: string; - value: string; - }[] -}; +export interface CloudFrontHeaders { + [name: string]: Array<{ + key: string; + value: string; + }>; +} -type CloudFrontResponse = { +export interface CloudFrontResponse { status: string; statusDescription: string; headers: CloudFrontHeaders; -}; +} -type CloudFrontRequest = { +export interface CloudFrontRequest { clientIp: string; method: string; uri: string; querystring: string; headers: CloudFrontHeaders; -}; +} -type CloudFrontEvent = { +export interface CloudFrontEvent { config: { distributionId: string; requestId: string; - } + }; } -export type CloudFrontResponseEvent = { - Records: { +export interface CloudFrontResponseEvent { + Records: Array<{ cf: CloudFrontEvent & { request: CloudFrontRequest; response: CloudFrontResponse; } - }[] -}; + }>; +} -export type CloudFrontRequestEvent = { - Records: { +export interface CloudFrontRequestEvent { + Records: Array<{ cf: CloudFrontEvent & { request: CloudFrontRequest; } - }[] -}; + }>; +} /** * AWS Lambda handler function. diff --git a/types/aws-lambda/tsconfig.json b/types/aws-lambda/tsconfig.json index f4f2cc28f6..37e2690d7e 100644 --- a/types/aws-lambda/tsconfig.json +++ b/types/aws-lambda/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aws-lambda/tslint.json b/types/aws-lambda/tslint.json index a41bf5d19a..bafaae7817 100644 --- a/types/aws-lambda/tslint.json +++ b/types/aws-lambda/tslint.json @@ -1,79 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + // TODO + "dt-header": false } } diff --git a/types/aws-serverless-express/aws-serverless-express-tests.ts b/types/aws-serverless-express/aws-serverless-express-tests.ts index 4770163b3b..9bfd1b0e99 100644 --- a/types/aws-serverless-express/aws-serverless-express-tests.ts +++ b/types/aws-serverless-express/aws-serverless-express-tests.ts @@ -1,5 +1,5 @@ import * as awsServerlessExpress from 'aws-serverless-express'; -import * as express from 'express'; +import express = require('express'); import { eventContext } from 'aws-serverless-express/middleware'; const app = express(); diff --git a/types/aws-serverless-express/tsconfig.json b/types/aws-serverless-express/tsconfig.json index be920785f5..6c4cceb55a 100644 --- a/types/aws-serverless-express/tsconfig.json +++ b/types/aws-serverless-express/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/aws4/tsconfig.json b/types/aws4/tsconfig.json index a0bcbfa73e..014d560bbd 100644 --- a/types/aws4/tsconfig.json +++ b/types/aws4/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/axel/tsconfig.json b/types/axel/tsconfig.json index a3e2b5e015..ef8d480470 100644 --- a/types/axel/tsconfig.json +++ b/types/axel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "axel-tests.ts", diff --git a/types/azure-mobile-services-client/tsconfig.json b/types/azure-mobile-services-client/tsconfig.json index 1d424df8c4..a31791ed92 100644 --- a/types/azure-mobile-services-client/tsconfig.json +++ b/types/azure-mobile-services-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/azure-sb/tsconfig.json b/types/azure-sb/tsconfig.json index 09c9a2a9e4..d111d611fb 100644 --- a/types/azure-sb/tsconfig.json +++ b/types/azure-sb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "lib/servicebusservice.d.ts", @@ -38,5 +39,4 @@ "azure-sb-tests.ts", "index.d.ts" ] -} - +} \ No newline at end of file diff --git a/types/azure/tsconfig.json b/types/azure/tsconfig.json index 0c4b536df2..df0f82f64b 100644 --- a/types/azure/tsconfig.json +++ b/types/azure/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/b_/tsconfig.json b/types/b_/tsconfig.json index 9227b30bf1..6dfab1f4a1 100644 --- a/types/b_/tsconfig.json +++ b/types/b_/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-code-frame/tsconfig.json b/types/babel-code-frame/tsconfig.json index 48e33ae829..57a0a8bb26 100644 --- a/types/babel-code-frame/tsconfig.json +++ b/types/babel-code-frame/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-core/tsconfig.json b/types/babel-core/tsconfig.json index 41aee71205..11a8a8f40c 100644 --- a/types/babel-core/tsconfig.json +++ b/types/babel-core/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-generator/tsconfig.json b/types/babel-generator/tsconfig.json index 76d138f54d..3024006f80 100644 --- a/types/babel-generator/tsconfig.json +++ b/types/babel-generator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-plugin-react-pug/tsconfig.json b/types/babel-plugin-react-pug/tsconfig.json index 6cb3ae3ee1..b29df5be30 100644 --- a/types/babel-plugin-react-pug/tsconfig.json +++ b/types/babel-plugin-react-pug/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ diff --git a/types/babel-plugin-syntax-jsx/tsconfig.json b/types/babel-plugin-syntax-jsx/tsconfig.json index 6b52644488..c139912293 100644 --- a/types/babel-plugin-syntax-jsx/tsconfig.json +++ b/types/babel-plugin-syntax-jsx/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-template/tsconfig.json b/types/babel-template/tsconfig.json index 96de23cec7..4dc5b17820 100644 --- a/types/babel-template/tsconfig.json +++ b/types/babel-template/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-traverse/tsconfig.json b/types/babel-traverse/tsconfig.json index 03dfa6ea51..dfbed1aef9 100644 --- a/types/babel-traverse/tsconfig.json +++ b/types/babel-traverse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-types/tsconfig.json b/types/babel-types/tsconfig.json index 92d7d6442e..ec251d52b2 100644 --- a/types/babel-types/tsconfig.json +++ b/types/babel-types/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babel-webpack-plugin/tsconfig.json b/types/babel-webpack-plugin/tsconfig.json index 3e73343283..78fccc30bc 100644 --- a/types/babel-webpack-plugin/tsconfig.json +++ b/types/babel-webpack-plugin/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "babel-webpack-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/babelify/tsconfig.json b/types/babelify/tsconfig.json index 9e07702ef2..e54236cdd6 100644 --- a/types/babelify/tsconfig.json +++ b/types/babelify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babylon-walk/tsconfig.json b/types/babylon-walk/tsconfig.json index 9e1d7c33b7..b92a49ec5e 100644 --- a/types/babylon-walk/tsconfig.json +++ b/types/babylon-walk/tsconfig.json @@ -14,6 +14,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/babylon/tsconfig.json b/types/babylon/tsconfig.json index 94d5c0bd59..750f9357ac 100644 --- a/types/babylon/tsconfig.json +++ b/types/babylon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/babyparse/tsconfig.json b/types/babyparse/tsconfig.json index da28a97d29..86af41a356 100644 --- a/types/babyparse/tsconfig.json +++ b/types/babyparse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone-associations/tsconfig.json b/types/backbone-associations/tsconfig.json index 7f905ff541..b822a91a70 100644 --- a/types/backbone-associations/tsconfig.json +++ b/types/backbone-associations/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone-fetch-cache/tsconfig.json b/types/backbone-fetch-cache/tsconfig.json index 28c3240abc..bf3efc040a 100644 --- a/types/backbone-fetch-cache/tsconfig.json +++ b/types/backbone-fetch-cache/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone-relational/tsconfig.json b/types/backbone-relational/tsconfig.json index 961582a08f..d0b124e315 100644 --- a/types/backbone-relational/tsconfig.json +++ b/types/backbone-relational/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone.layoutmanager/tsconfig.json b/types/backbone.layoutmanager/tsconfig.json index 85b5e97b31..be801dd5e2 100644 --- a/types/backbone.layoutmanager/tsconfig.json +++ b/types/backbone.layoutmanager/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone.localstorage/tsconfig.json b/types/backbone.localstorage/tsconfig.json index 65302c1d16..f745e8beb4 100644 --- a/types/backbone.localstorage/tsconfig.json +++ b/types/backbone.localstorage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone.marionette/tsconfig.json b/types/backbone.marionette/tsconfig.json index b31d3cbfa4..a9396b0e55 100644 --- a/types/backbone.marionette/tsconfig.json +++ b/types/backbone.marionette/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone.paginator/tsconfig.json b/types/backbone.paginator/tsconfig.json index 453c5e2861..fc77167b76 100644 --- a/types/backbone.paginator/tsconfig.json +++ b/types/backbone.paginator/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone.radio/tsconfig.json b/types/backbone.radio/tsconfig.json index 024840f373..ebf120cfac 100644 --- a/types/backbone.radio/tsconfig.json +++ b/types/backbone.radio/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backbone/tsconfig.json b/types/backbone/tsconfig.json index c1185d6adf..227a495055 100644 --- a/types/backbone/tsconfig.json +++ b/types/backbone/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backgrid/tsconfig.json b/types/backgrid/tsconfig.json index f2db8efd4c..e7449e8481 100644 --- a/types/backgrid/tsconfig.json +++ b/types/backgrid/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backlog-js/tsconfig.json b/types/backlog-js/tsconfig.json index 360392d4ca..5e2cfc0b1c 100644 --- a/types/backlog-js/tsconfig.json +++ b/types/backlog-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/backoff/tsconfig.json b/types/backoff/tsconfig.json index 1946d82f81..71a863de5b 100644 --- a/types/backoff/tsconfig.json +++ b/types/backoff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/baconjs/tsconfig.json b/types/baconjs/tsconfig.json index c9d82e16f7..4da0a4158f 100644 --- a/types/baconjs/tsconfig.json +++ b/types/baconjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bagpipes/tsconfig.json b/types/bagpipes/tsconfig.json index 56d9d43a52..db3bcb65b2 100755 --- a/types/bagpipes/tsconfig.json +++ b/types/bagpipes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/baidumap-web-sdk/tsconfig.json b/types/baidumap-web-sdk/tsconfig.json index 6504c4665a..a0ee2590d8 100644 --- a/types/baidumap-web-sdk/tsconfig.json +++ b/types/baidumap-web-sdk/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/barcode/tsconfig.json b/types/barcode/tsconfig.json index a66d2ab178..f608cf0384 100644 --- a/types/barcode/tsconfig.json +++ b/types/barcode/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bardjs/tsconfig.json b/types/bardjs/tsconfig.json index bd5226a586..bf1bcdf426 100644 --- a/types/bardjs/tsconfig.json +++ b/types/bardjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/base-64/tsconfig.json b/types/base-64/tsconfig.json index 49de73c3ef..a4ca7d05ca 100644 --- a/types/base-64/tsconfig.json +++ b/types/base-64/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/base-x/tsconfig.json b/types/base-x/tsconfig.json index d69790c7d6..42a2d63c40 100644 --- a/types/base-x/tsconfig.json +++ b/types/base-x/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/base16/tsconfig.json b/types/base16/tsconfig.json index d354b0ba01..01e600fe79 100644 --- a/types/base16/tsconfig.json +++ b/types/base16/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/base64-js/tsconfig.json b/types/base64-js/tsconfig.json index 3a65d8af45..0199f01efa 100644 --- a/types/base64-js/tsconfig.json +++ b/types/base64-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bases/tsconfig.json b/types/bases/tsconfig.json index 4b8912ac99..97e27e72e2 100644 --- a/types/bases/tsconfig.json +++ b/types/bases/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bash-glob/tsconfig.json b/types/bash-glob/tsconfig.json index 6a45a2d74d..0fdaf237e6 100644 --- a/types/bash-glob/tsconfig.json +++ b/types/bash-glob/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bash-glob-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/basic-auth/tsconfig.json b/types/basic-auth/tsconfig.json index 7c49ef4d01..09bfa7fda6 100644 --- a/types/basic-auth/tsconfig.json +++ b/types/basic-auth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/batch-stream/tsconfig.json b/types/batch-stream/tsconfig.json index e99f40b376..e746a4a8a2 100644 --- a/types/batch-stream/tsconfig.json +++ b/types/batch-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bazinga-translator/tsconfig.json b/types/bazinga-translator/tsconfig.json index 1ca08ada9b..22d98fdda3 100644 --- a/types/bazinga-translator/tsconfig.json +++ b/types/bazinga-translator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bcrypt-nodejs/tsconfig.json b/types/bcrypt-nodejs/tsconfig.json index 1d7991ff5f..ffce95575f 100644 --- a/types/bcrypt-nodejs/tsconfig.json +++ b/types/bcrypt-nodejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bcrypt/tsconfig.json b/types/bcrypt/tsconfig.json index 97c8808944..484a20da18 100644 --- a/types/bcrypt/tsconfig.json +++ b/types/bcrypt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bcryptjs/tsconfig.json b/types/bcryptjs/tsconfig.json index 094f87744c..f20bc8f4bf 100644 --- a/types/bcryptjs/tsconfig.json +++ b/types/bcryptjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/beats/tsconfig.json b/types/beats/tsconfig.json index 89bd0b5995..51a7504c29 100644 --- a/types/beats/tsconfig.json +++ b/types/beats/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "beats-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bech32/tsconfig.json b/types/bech32/tsconfig.json index 886ec79796..6fd17c5386 100644 --- a/types/bech32/tsconfig.json +++ b/types/bech32/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bech32-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bem-cn/tsconfig.json b/types/bem-cn/tsconfig.json index e9212d8d91..fcef3bbd2f 100644 --- a/types/bem-cn/tsconfig.json +++ b/types/bem-cn/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/benchmark/tsconfig.json b/types/benchmark/tsconfig.json index ba1b6a3e55..252c53edbf 100644 --- a/types/benchmark/tsconfig.json +++ b/types/benchmark/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/better-curry/tsconfig.json b/types/better-curry/tsconfig.json index e5ceee43fc..ca9c7198ad 100644 --- a/types/better-curry/tsconfig.json +++ b/types/better-curry/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/better-sqlite3/better-sqlite3-tests.ts b/types/better-sqlite3/better-sqlite3-tests.ts index 43d78e1503..34ee6808c3 100644 --- a/types/better-sqlite3/better-sqlite3-tests.ts +++ b/types/better-sqlite3/better-sqlite3-tests.ts @@ -1,4 +1,4 @@ -import * as Database from 'better-sqlite3'; +import Database = require('better-sqlite3'); const integer = Database.Integer(1); const err = new Database.SqliteError('ok', 'ok'); diff --git a/types/better-sqlite3/index.d.ts b/types/better-sqlite3/index.d.ts index 530f5c3e53..899a85a2e2 100644 --- a/types/better-sqlite3/index.d.ts +++ b/types/better-sqlite3/index.d.ts @@ -4,9 +4,7 @@ // Mathew Rumsey // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - -import * as Integer from 'integer'; +import Integer = require('integer'); interface RunResult { changes: number; diff --git a/types/better-sqlite3/tsconfig.json b/types/better-sqlite3/tsconfig.json index 30a480355b..498fdb02b0 100644 --- a/types/better-sqlite3/tsconfig.json +++ b/types/better-sqlite3/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bezier-easing/tsconfig.json b/types/bezier-easing/tsconfig.json index 2603e9bae8..cb1796c552 100644 --- a/types/bezier-easing/tsconfig.json +++ b/types/bezier-easing/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bezier-js/tsconfig.json b/types/bezier-js/tsconfig.json index 02796cc09c..ed32c02bde 100644 --- a/types/bezier-js/tsconfig.json +++ b/types/bezier-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bgiframe/tsconfig.json b/types/bgiframe/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/bgiframe/tsconfig.json +++ b/types/bgiframe/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/big.js/tsconfig.json b/types/big.js/tsconfig.json index 950e8b410f..f0a159d0df 100644 --- a/types/big.js/tsconfig.json +++ b/types/big.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/bigi/tsconfig.json b/types/bigi/tsconfig.json index de6aa90a97..d2a61fc6d4 100644 --- a/types/bigi/tsconfig.json +++ b/types/bigi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bigint/tsconfig.json b/types/bigint/tsconfig.json index 37005189a4..37b2fc8ffe 100644 --- a/types/bigint/tsconfig.json +++ b/types/bigint/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bignum/tsconfig.json b/types/bignum/tsconfig.json index 15cb8a7b4f..64fc11893f 100644 --- a/types/bignum/tsconfig.json +++ b/types/bignum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bigscreen/tsconfig.json b/types/bigscreen/tsconfig.json index 71230cc8e1..16e554a953 100644 --- a/types/bigscreen/tsconfig.json +++ b/types/bigscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/binary-parser/tsconfig.json b/types/binary-parser/tsconfig.json index cb361f52c5..5f5844d984 100644 --- a/types/binary-parser/tsconfig.json +++ b/types/binary-parser/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "binary-parser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bind-ponyfill/tsconfig.json b/types/bind-ponyfill/tsconfig.json index 29d2a7cac2..bc3d132161 100644 --- a/types/bind-ponyfill/tsconfig.json +++ b/types/bind-ponyfill/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bindings/tsconfig.json b/types/bindings/tsconfig.json index fb9350642a..885e8058e8 100644 --- a/types/bindings/tsconfig.json +++ b/types/bindings/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bindings-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bingmaps/tsconfig.json b/types/bingmaps/tsconfig.json index 421876221b..f3efc20f2b 100644 --- a/types/bingmaps/tsconfig.json +++ b/types/bingmaps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bintrees/tsconfig.json b/types/bintrees/tsconfig.json index d21ec38c1e..13adede158 100644 --- a/types/bintrees/tsconfig.json +++ b/types/bintrees/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bip21/tsconfig.json b/types/bip21/tsconfig.json index be0b017722..c487184fe8 100644 --- a/types/bip21/tsconfig.json +++ b/types/bip21/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bip38/tsconfig.json b/types/bip38/tsconfig.json index 6ce875b1d1..b490f75d5b 100644 --- a/types/bip38/tsconfig.json +++ b/types/bip38/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bip38-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bip39/tsconfig.json b/types/bip39/tsconfig.json index d44c1197ad..d3452a293a 100644 --- a/types/bip39/tsconfig.json +++ b/types/bip39/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bip39-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bit-array/tsconfig.json b/types/bit-array/tsconfig.json index ba2e9e32a2..589e137b19 100644 --- a/types/bit-array/tsconfig.json +++ b/types/bit-array/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bitcoinjs-lib/tsconfig.json b/types/bitcoinjs-lib/tsconfig.json index f874ae9858..35de2c3aab 100644 --- a/types/bitcoinjs-lib/tsconfig.json +++ b/types/bitcoinjs-lib/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bittorrent-protocol/bittorrent-protocol-tests.ts b/types/bittorrent-protocol/bittorrent-protocol-tests.ts index c32b2af368..2faca76a5e 100644 --- a/types/bittorrent-protocol/bittorrent-protocol-tests.ts +++ b/types/bittorrent-protocol/bittorrent-protocol-tests.ts @@ -1,4 +1,4 @@ -import * as Protocol from 'bittorrent-protocol'; +import Protocol = require('bittorrent-protocol'); import * as net from 'net'; class TestExtension implements Protocol.Extension { diff --git a/types/bittorrent-protocol/tsconfig.json b/types/bittorrent-protocol/tsconfig.json index f128669698..311ea796cb 100644 --- a/types/bittorrent-protocol/tsconfig.json +++ b/types/bittorrent-protocol/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bitwise-xor/tsconfig.json b/types/bitwise-xor/tsconfig.json index a6b66cda37..35574c6254 100644 --- a/types/bitwise-xor/tsconfig.json +++ b/types/bitwise-xor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bl/tsconfig.json b/types/bl/tsconfig.json index 0f7c861ce8..96ce63bb4e 100644 --- a/types/bl/tsconfig.json +++ b/types/bl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blacklist/tsconfig.json b/types/blacklist/tsconfig.json index 76cb49e40f..4e45bff651 100644 --- a/types/blacklist/tsconfig.json +++ b/types/blacklist/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blazy/tsconfig.json b/types/blazy/tsconfig.json index e452d910ec..8e6b8be63e 100644 --- a/types/blazy/tsconfig.json +++ b/types/blazy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bleno/tsconfig.json b/types/bleno/tsconfig.json index 338f3e3d24..ddc7332cf7 100644 --- a/types/bleno/tsconfig.json +++ b/types/bleno/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blessed/blessed-tests.ts b/types/blessed/blessed-tests.ts index c5f857146f..aa38af8985 100644 --- a/types/blessed/blessed-tests.ts +++ b/types/blessed/blessed-tests.ts @@ -1,5 +1,6 @@ import * as blessed from "blessed"; import { readFileSync } from "fs"; +import { inspect } from "util"; let screen: blessed.Widgets.Screen = null; @@ -743,3 +744,71 @@ setTimeout(() => { table.setData(data1); screen.render(); }, 3000); + +// https://github.com/chjj/blessed/blob/master/test/program-mouse.js + +const program = blessed.program({ + dump: __dirname + '/logs/mouse.log' +}); + +// program.setMouse({ +// allMotion: true, +// //utfMouse: true +// urxvtMouse: true +// }, true); + +program.alternateBuffer(); +program.enableMouse(); +program.hideCursor(); + +program.setMouse({ sendFocus: true }, true); + +program.on('mouse', function(data) { + program.cup(data.y, data.x); + program.write(' '); + program.cup(0, 0); + program.write(inspect(data)); +}); + +program.on('resize', function(data) { + setTimeout(function() { + program.clear(); + program.cup(0, 0); + program.write(inspect({ cols: program.cols, rows: program.rows })); + }, 200); +}); + +process.on('SIGWINCH', function(data) { + setTimeout(function() { + program.cup(1, 0); + program.write(inspect({ winch: true, cols: program.cols, rows: program.rows })); + }, 200); +}); + +program.on('focus', function(data) { + program.clear(); + program.cup(0, 0); + program.write('FOCUSIN'); +}); + +program.on('blur', function(data) { + program.clear(); + program.cup(0, 0); + program.write('FOCUSOUT'); +}); + +program.key(['q', 'escape', 'C-c'], function() { + program.showCursor(); + program.disableMouse(); + program.normalBuffer(); + process.exit(0); +}); + +program.on('keypress', function(ch, data) { + if (data.name === 'mouse') return; + program.clear(); + program.cup(0, 0); + program.write(inspect(data)); +}); + +program.clear(); diff --git a/types/blessed/index.d.ts b/types/blessed/index.d.ts index 9098648240..7dae1709d2 100644 --- a/types/blessed/index.d.ts +++ b/types/blessed/index.d.ts @@ -7,13 +7,433 @@ /// import { EventEmitter } from "events"; +import { Writable, Readable } from "stream"; import * as stream from "stream"; import * as child_process from "child_process"; -export class BlessedProgram { - hideCursor: () => void; - move: any; - showCursor: any; +export interface IBlessedProgramOptions { + input?: Readable; + output?: Writable; + log?: string; + dump?: boolean; + zero?: boolean; + buffer?: boolean; + terminal?: string; + term?: string; + tput?: string; + debug?: boolean; + resizeTimeout?: boolean; +} + +export class BlessedProgram extends EventEmitter { + type: string; + options: IBlessedProgramOptions; + input: Readable; + output: Writable; + zero: boolean; + useBuffer: boolean; + x: number; + y: number; + savedX: number; + savedY: number; + cols: number; + rows: number; + scrollTop: number; + scrollBottom: number; + isOSXTerm: boolean; + isiTerm2: boolean; + isXFCE: boolean; + isTerminator: boolean; + isLXDE: boolean; + isVTE: boolean; + isRxvt: boolean; + isXterm: boolean; + tmux: boolean; + tmuxVersion: number; + + constructor(options?: IBlessedProgramOptions); + + log(): boolean; + debug(): boolean; + setupDump(): void; + setupTput(): void; + setTerminal(terminal: string): void; + has(name: string): boolean; + term(is: string): boolean; + + listen(): void; + destroy(): void; + + key(key: string|string[], listener: Function): void; + onceKey(key: string|string[], listener: Function): void; + + unKey(key: string|string[], listener: Function): void; + removeKey(key: string|string[], listener: Function): void; + + bindMouse(): void; + enableGpm(): void; + disableGpm(): void; + bindResponse(): void; + + response(name: string, text: string, callback: Function, noBypass?: boolean): boolean; + response(name: string, callback?: Function): boolean; + + write(text: string): boolean; + flush(): void; + print(text: string, attr?: boolean): boolean; + echo(text: string, attr?: boolean): boolean; + + setx(x: number): boolean; + sety(y: number): boolean; + move(x: number, y: number): boolean; + omove(x: number, y: number): void; + rsetx(x: number): boolean; + rsety(y: number): boolean; + rmove(x: number, y: number): void; + + simpleInsert(ch: string, i?: number, attr?: boolean): boolean; + repeat(ch: string, i?: number): string; + copyToClipboard(text: string): boolean; + + cursorShape(shape: string, blink?: boolean): boolean; + cursorColor(color: string): boolean; + cursorReset(): boolean; + resetCursor(): boolean; + + getTextParams(param: string, callback: Function): boolean; + getCursorColor(callback: Function): boolean; + + nul(): boolean; + + bell(): boolean; + bel(): boolean; + + vtab(): boolean; + + form(): boolean; + ff(): boolean; + + backspace(): boolean; + kbs(): boolean; + + tab(): boolean; + ht(): boolean; + + shiftOut(): boolean; + shiftIn(): boolean; + + return(): boolean; + cr(): boolean; + + feed(): boolean; + newline(): boolean; + nl(): boolean; + + index(): boolean; + ind(): boolean; + + reverseIndex(): boolean; + reverse(): boolean; + ri(): boolean; + + nextLine(): boolean; + reset(): boolean; + tabSet(): boolean; + + saveCursor(key: string): boolean; + sc(key: string): boolean; + + restoreCursor(key?: string, hide?: boolean): boolean; + rc(key?: string, hide?: boolean): boolean; + + lsaveCursor(key?: string): void; + lrestoreCursor(key?: string, hide?: boolean): void; + + lineHeight(): boolean; + + charset(val?: string, level?: number): boolean; + + enter_alt_charset_mode(): boolean; + as(): boolean; + smacs(): boolean; + + exit_alt_charset_mode(): boolean; + ae(): boolean; + rmacs(): boolean; + + setG(val: number): boolean; + + setTitle(title: string): boolean; + + resetColors(param?: string): boolean; + + dynamicColors(param?: string): boolean; + + selData(a: string, b: string): boolean; + + cursorUp(param?: number): boolean; + cuu(param?: number): boolean; + up(param?: number): boolean; + + cursorDown(param?: number): boolean; + cud(param?: number): boolean; + down(param?: number): boolean; + + cursorForward(param?: number): boolean; + cuf(param?: number): boolean; + right(param?: number): boolean; + forward(param?: number): boolean; + + cursorBackward(param?: number): boolean; + cub(param?: number): boolean; + left(param?: number): boolean; + back(param?: number): boolean; + + cursorPos(row?: number, col?: number): boolean; + cup(row?: number, col?: number): boolean; + pos(row?: number, col?: number): boolean; + + eraseInDisplay(param?: string): boolean; + ed(param?: string): boolean; + + clear(): boolean; + + eraseInLine(param?: string): boolean; + el(param?: string): boolean; + + charAttributes(param: string, val?: boolean): boolean; + charAttributes(param: string[], val?: boolean): boolean; + + setForeground(color: string, val?: boolean): boolean; + fg(color: string, val?: boolean): boolean; + + setBackground(color: string, val?: boolean): boolean; + bg(color: string, val?: boolean): boolean; + + deviceStatuses(param?: string, callback?: Function, dec?: boolean, noBypass?: boolean): boolean; + dsr(param?: string, callback?: Function, dec?: boolean, noBypass?: boolean): boolean; + + getCursor(callback: Function): boolean; + saveReportedCursor(callback: Function): void; + + restoreReportedCursor: () => boolean; + + insertChars(param?: number): boolean; + ich(param?: number): boolean; + + cursorNextLine(param?: number): boolean; + cnl(param?: number): boolean; + + cursorPrecedingLine(param?: number): boolean; + cpl(param?: number): boolean; + + cursorCharAbsolute(param?: number): boolean; + cha(param?: number): boolean; + + insertLines(param?: number): boolean; + il(param?: number): boolean; + + deleteLines(param?: number): boolean; + dl(param?: number): boolean; + + deleteChars(param?: number): boolean; + dch(param?: number): boolean; + + eraseChars(param?: number): boolean; + ech(param?: number): boolean; + + charPosAbsolute(param?: number): boolean; + hpa(param?: number): boolean; + + HPositionRelative(param?: number): boolean; + + sendDeviceAttributes(param?: number, callback?: Function): boolean; + da(param?: number, callback?: Function): boolean; + + linePosAbsolute(param?: number): boolean; + vpa(param?: number): boolean; + + VPositionRelative(param?: number): boolean; + vpr(param?: number): boolean; + + HVPosition(row?: number, col?: number): boolean; + hvp(row?: number, col?: number): boolean; + + setMode(...args: string[]): boolean; + sm(...args: string[]): boolean; + + decset(...args: string[]): boolean; + + showCursor(): boolean; + + alternateBuffer(): boolean; + smcup(): boolean; + alternate(): boolean; + + resetMode(...args: string[]): boolean; + rm(...args: string[]): boolean; + + decrst(...args: string[]): boolean; + + hideCursor(): boolean; + civis(): boolean; + vi(): boolean; + cursor_invisible(): boolean; + dectcemh(): boolean; + + normalBuffer(): boolean; + rmcup(): boolean; + + enableMouse(): void; + disableMouse(): void; + + setMouse(opt?: {}, enable?: boolean): void; + + setScrollRegion(top: number, bottom: number): boolean; + csr(top: number, bottom: number): boolean; + decstbm(top: number, bottom: number): boolean; + + saveCursorA(): boolean; + scA(): boolean; + + restoreCursorA(): boolean; + rcA(): boolean; + + cursorForwardTab(param?: number): boolean; + cht(param?: number): boolean; + + scrollUp(param?: number): boolean; + su(param?: number): boolean; + + scrollDown(param?: number): boolean; + sd(param?: number): boolean; + + initMouseTracking(...args: string[]): boolean; + + resetTitleModes(...args: string[]): boolean; + + cursorBackwardTab(param?: number): boolean; + cbt(param?: number): boolean; + + repeatPrecedingCharacter(param?: number): boolean; + rep(param?: number): boolean; + + tabClear(param?: number): boolean; + tbc(param?: number): boolean; + + mediaCopy(...args: string[]): boolean; + mc(...args: string[]): boolean; + + mc0(): boolean; + print_screen(): boolean; + ps(): boolean; + + mc5(): boolean; + prtr_on(): boolean; + po(): boolean; + + mc4(): boolean; + prtr_off(): boolean; + pf(): boolean; + + mc5p(): boolean; + prtr_non(): boolean; + p0(): boolean; + + setResources(...args: string[]): boolean; + + disableModifieres(...args: string[]): boolean; + + setPointerMode(...args: string[]): boolean; + + softReset(): boolean; + rs2(): boolean; + decstr(): boolean; + + requestAnsiMode(param?: number): boolean; + decrqm(param?: number): boolean; + + requestPrivateMode(param?: number): boolean; + decrqmp(param?: number): boolean; + + setConformanceLevel(...args: string[]): boolean; + decscl(...args: string[]): boolean; + + loadLEDs(param?: number): boolean; + decll(param?: number): boolean; + + setCursorStyle(param?: string): boolean; + decscursr(param?: string): boolean; + + setCharProtectionAttr(param?: number): boolean; + decsca(param?: number): boolean; + + restorePrivateValues(...args: string[]): boolean; + + setAttrInRectangle(...args: string[]): boolean; + deccara(...args: string[]): boolean; + + savePrivateValues(...args: string[]): boolean; + + manipulateWindow(...args: any[]): boolean; + + getWindowSize(callback?: Function): boolean; + + reverseAttrInRectangle(...args: string[]): boolean; + decrara(...args: string[]): boolean; + + setTitleModeFeature(...args: string[]): boolean; + + setWarningBellVolume(param?: number): boolean; + decswbv(param?: number): boolean; + + setMarginBellVolume(param?: number): boolean; + + copyRectangle(...args: string[]): boolean; + deccra(...args: string[]): boolean; + + enableFilterRectangle(...args: string[]): boolean; + decefr(...args: string[]): boolean; + + requestParameters(param?: number): boolean; + decreqtparm(param: number): boolean; + + selectChangeExtent(param?: number): boolean; + decsace(param?: number): boolean; + + fillRectangle(...args: string[]): boolean; + decfra(...args: string[]): boolean; + + enableLocatorReporting(...args: string[]): boolean; + decelr(...args: string[]): boolean; + + eraseRectangle(...args: string[]): boolean; + decera(...args: string[]): boolean; + + setLocatorEvents(...args: string[]): boolean; + decsle(...args: string[]): boolean; + + selectiveEraseRectangle(...args: string[]): boolean; + decsera(...args: string[]): boolean; + + requestLocatorPosition(param?: string, callback?: Function): boolean; + reqmp(param?: string, callback?: Function): boolean; + req_mouse_pos(param?: string, callback?: Function): boolean; + decrqlp(param?: string, callback?: Function): boolean; + + insertColumns(...args: string[]): boolean; + decic(...args: string[]): boolean; + + deleteColumns(...args: string[]): boolean; + decdc(...args: string[]): boolean; + + out(param: string, ...args: any[]): boolean; + + sigtstp(callback?: Function): boolean; + + pause(callback?: Function): Function; + + resume: () => void; } export namespace Widgets { @@ -516,7 +936,7 @@ export namespace Widgets { * Debug mode. Enables usage of the debug method. Also creates a debug console which will display when * pressing F12. It will display all log and debug messages. */ - debug?(...msg: string[]): void; + debug?: boolean; /** * Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful @@ -963,7 +1383,7 @@ export namespace Widgets { /** * Spawn a process in the foreground, return to blessed app after exit. */ - spawn(file: string, args: string[], options: NodeChildProcessExecOptions): child_process.ChildProcess; + spawn(file: string, args?: string[], options?: NodeChildProcessExecOptions): child_process.ChildProcess; /** * Spawn a process in the foreground, return to blessed app after exit. Executes callback on error or exit. @@ -3024,6 +3444,7 @@ export function message(options?: Widgets.MessageOptions): Widgets.MessageElemen export function loading(options?: Widgets.LoadingOptions): Widgets.LoadingElement; export function log(options?: Widgets.LogOptions): Widgets.Log; export function progressbar(options?: Widgets.ProgressBarOptions): Widgets.ProgressBarElement; +export function program(options?: Widgets.IScreenOptions): BlessedProgram; export function terminal(options?: Widgets.TerminalOptions): Widgets.TerminalElement; export function layout(options?: Widgets.LayoutOptions): Widgets.LayoutElement; export function escape(item: any): any; diff --git a/types/blessed/tsconfig.json b/types/blessed/tsconfig.json index e57d4b78d6..663cf64ce8 100644 --- a/types/blessed/tsconfig.json +++ b/types/blessed/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blissfuljs/tsconfig.json b/types/blissfuljs/tsconfig.json index 42087d76ef..16201714f3 100644 --- a/types/blissfuljs/tsconfig.json +++ b/types/blissfuljs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blob-stream/tsconfig.json b/types/blob-stream/tsconfig.json index 2ebe6cacb9..c8ae5c3565 100644 --- a/types/blob-stream/tsconfig.json +++ b/types/blob-stream/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blob-to-buffer/tsconfig.json b/types/blob-to-buffer/tsconfig.json index 2421ce2493..ed4fc69e7b 100644 --- a/types/blob-to-buffer/tsconfig.json +++ b/types/blob-to-buffer/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "blob-to-buffer-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/blob-util/tsconfig.json b/types/blob-util/tsconfig.json index 7f7970ab0b..2f53f29186 100644 --- a/types/blob-util/tsconfig.json +++ b/types/blob-util/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blocks/tsconfig.json b/types/blocks/tsconfig.json index 85da699a13..4203094315 100644 --- a/types/blocks/tsconfig.json +++ b/types/blocks/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bloomfilter/tsconfig.json b/types/bloomfilter/tsconfig.json index 76ea34c251..578ee0b36b 100644 --- a/types/bloomfilter/tsconfig.json +++ b/types/bloomfilter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blue-tape/tsconfig.json b/types/blue-tape/tsconfig.json index a4fc12b9e1..5271d69567 100644 --- a/types/blue-tape/tsconfig.json +++ b/types/blue-tape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts index c0e220ce07..c3f0fd9d43 100644 --- a/types/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -44,7 +44,7 @@ * d. target es6, latest "es20xx", e.g. "es2017" */ -import * as Bluebird from "bluebird"; +import Bluebird = require("bluebird"); declare global { /* diff --git a/types/bluebird-global/tsconfig.json b/types/bluebird-global/tsconfig.json index d037429e0d..5256c6c206 100644 --- a/types/bluebird-global/tsconfig.json +++ b/types/bluebird-global/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bluebird-retry/tsconfig.json b/types/bluebird-retry/tsconfig.json index 5ae2b487db..ea6622b197 100644 --- a/types/bluebird-retry/tsconfig.json +++ b/types/bluebird-retry/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index b28f821e12..8ad57050f6 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -47,7 +47,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Promises/A+ `.then()`. Returns a new promise chained from this promise. * - * The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. + * The new promise will be rejected or resolved depending on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. */ // Based on PromiseLike.then, but returns a Bluebird instance. then(onFulfill?: (value: R) => U | PromiseLike, onReject?: (error: any) => U | PromiseLike): Bluebird; // For simpler signature help. @@ -192,34 +192,34 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { */ tapCatch(onReject: (error?: any) => U | PromiseLike): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, + tapCatch( + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, + filter5: CatchFilter, onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, + tapCatch( + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + tapCatch( + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, onReject: (error: E1 | E2 | E3) => U | PromiseLike, ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + tapCatch( + filter1: CatchFilter, + filter2: CatchFilter, onReject: (error: E1 | E2) => U | PromiseLike, ): Bluebird; - tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + tapCatch( + filter1: CatchFilter, onReject: (error: E1) => U | PromiseLike, ): Bluebird; @@ -364,34 +364,35 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { */ catchReturn(value: U): Bluebird; + // No need to be specific about Error types in these overrides, since there's no handler function catchReturn( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, + filter5: CatchFilter, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, value: U, ): Bluebird; catchReturn( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, value: U, ): Bluebird; @@ -407,34 +408,35 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { */ catchThrow(reason: Error): Bluebird; + // No need to be specific about Error types in these overrides, since there's no handler function catchThrow( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, + filter5: CatchFilter, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, + filter2: CatchFilter, reason: Error, ): Bluebird; catchThrow( - filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter1: CatchFilter, reason: Error, ): Bluebird; @@ -761,7 +763,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static race(values: PromiseLike | R>> | Iterable | R>): Bluebird; /** - * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). + * Initiate a competitive race between multiple promises or values (values will become immediately fulfilled promises). * When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. * * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. @@ -835,7 +837,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. * - * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. + * *The original array is not modified. If no `initialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. * If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* */ static reduce( @@ -1053,7 +1055,7 @@ declare namespace Bluebird { * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. * The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. * - * If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values. + * If the the callback is called with multiple success values, the resolver fulfills its promise with an array of the values. */ // TODO specify resolver callback callback(err: any, value: R, ...values: R[]): void; diff --git a/types/bluebird/tsconfig.json b/types/bluebird/tsconfig.json index 909dae3771..b0b641abfd 100644 --- a/types/bluebird/tsconfig.json +++ b/types/bluebird/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } -} +} \ No newline at end of file diff --git a/types/bluebird/v1/tsconfig.json b/types/bluebird/v1/tsconfig.json index 3e22a6a885..1a61a9f82c 100644 --- a/types/bluebird/v1/tsconfig.json +++ b/types/bluebird/v1/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bluebird/v2/tsconfig.json b/types/bluebird/v2/tsconfig.json index 773747fb4a..e58ea42703 100644 --- a/types/bluebird/v2/tsconfig.json +++ b/types/bluebird/v2/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/blueimp-md5/tsconfig.json b/types/blueimp-md5/tsconfig.json index 286b0abda2..84d291ab5f 100644 --- a/types/blueimp-md5/tsconfig.json +++ b/types/blueimp-md5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/body-parser/body-parser-tests.ts b/types/body-parser/body-parser-tests.ts index fa18cad13b..2f6a33ea72 100644 --- a/types/body-parser/body-parser-tests.ts +++ b/types/body-parser/body-parser-tests.ts @@ -1,4 +1,4 @@ -import * as express from 'express'; +import express = require('express'); import { json, raw, diff --git a/types/body-parser/tsconfig.json b/types/body-parser/tsconfig.json index 9c0314a557..fcab8a9b2c 100644 --- a/types/body-parser/tsconfig.json +++ b/types/body-parser/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bonjour/bonjour-tests.ts b/types/bonjour/bonjour-tests.ts index 61e7373f01..aff3226eba 100644 --- a/types/bonjour/bonjour-tests.ts +++ b/types/bonjour/bonjour-tests.ts @@ -1,4 +1,4 @@ -import * as bonjour from 'bonjour'; +import bonjour = require('bonjour'); let bonjourOptions: bonjour.BonjourOptions; let bonjourInstance: bonjour.Bonjour; diff --git a/types/bonjour/tsconfig.json b/types/bonjour/tsconfig.json index 8cc7d3f823..8840a855b0 100644 --- a/types/bonjour/tsconfig.json +++ b/types/bonjour/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bookshelf/bookshelf-tests.ts b/types/bookshelf/bookshelf-tests.ts index 77af31461b..81c42f7680 100644 --- a/types/bookshelf/bookshelf-tests.ts +++ b/types/bookshelf/bookshelf-tests.ts @@ -1,6 +1,6 @@ -import * as Knex from 'knex'; -import * as Bookshelf from 'bookshelf'; -import * as assert from 'assert'; +import Knex = require('knex'); +import Bookshelf = require('bookshelf'); +import assert = require('assert'); import * as express from 'express'; import * as _ from "lodash"; @@ -1124,7 +1124,7 @@ ships.on('fetched', (collection, response) => { User.collection() .orderBy('-name') .fetch() - .then((users: Bookshelf.Collection) => { + .then((users: Bookshelf.Collection>) => { console.log(users); }) } diff --git a/types/bookshelf/index.d.ts b/types/bookshelf/index.d.ts index dca8d5fad2..c151e81624 100644 --- a/types/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -250,7 +250,7 @@ declare namespace Bookshelf { detach(options?: SyncOptions): BlueBird; fetchOne(options?: CollectionFetchOneOptions): BlueBird; load(relations: string | string[], options?: SyncOptions): BlueBird>; - orderBy(column: string, order?: SortOrder): T; + orderBy(column: string, order?: SortOrder): Collection; // Declaration order matters otherwise TypeScript gets confused between query() and query(...query: string[]) query(): Knex.QueryBuilder; diff --git a/types/bookshelf/tsconfig.json b/types/bookshelf/tsconfig.json index e983e9b53c..97c8b4593f 100644 --- a/types/bookshelf/tsconfig.json +++ b/types/bookshelf/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/boolify-string/tsconfig.json b/types/boolify-string/tsconfig.json index fcc1b15038..dee33294ce 100644 --- a/types/boolify-string/tsconfig.json +++ b/types/boolify-string/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/boom/tsconfig.json b/types/boom/tsconfig.json index 81f6f5cacf..dc98c5e8dd 100644 --- a/types/boom/tsconfig.json +++ b/types/boom/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/boom/v3/tsconfig.json b/types/boom/v3/tsconfig.json index 1f8b8e7f4a..5e710a4782 100644 --- a/types/boom/v3/tsconfig.json +++ b/types/boom/v3/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/boom/v4/tsconfig.json b/types/boom/v4/tsconfig.json index 58f1109eee..0a547414fb 100644 --- a/types/boom/v4/tsconfig.json +++ b/types/boom/v4/tsconfig.json @@ -19,10 +19,11 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "boom-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bootbox/tsconfig.json b/types/bootbox/tsconfig.json index 75da35b2bc..c5edc1ed75 100644 --- a/types/bootbox/tsconfig.json +++ b/types/bootbox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootpag/tsconfig.json b/types/bootpag/tsconfig.json index 69b09cc3a6..6861920942 100644 --- a/types/bootpag/tsconfig.json +++ b/types/bootpag/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-datepicker/tsconfig.json b/types/bootstrap-datepicker/tsconfig.json index 6770944b42..a8fed647e2 100644 --- a/types/bootstrap-datepicker/tsconfig.json +++ b/types/bootstrap-datepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-fileinput/tsconfig.json b/types/bootstrap-fileinput/tsconfig.json index fa1c069762..b4076b50e2 100644 --- a/types/bootstrap-fileinput/tsconfig.json +++ b/types/bootstrap-fileinput/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts b/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts new file mode 100644 index 0000000000..78f92fcf71 --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/bootstrap-growl-ifightcrime-tests.ts @@ -0,0 +1,25 @@ +// basic usage +$(document).ready(() => { + $.bootstrapGrowl('Message to show in alert'); +}); + +// with options example +let offsetOptions: BootstrapGrowlIfightcrime.OffsetOption = { + from: 'top', + amount: 20 +}; + +let options: BootstrapGrowlIfightcrime.Options = { + ele: 'body', + type: 'info', + offset: offsetOptions, + align: 'right', + width: 250, + delay: 4000, + allow_dismiss: true, + stackup_spacing: 10 +}; + +$(document).ready(() => { + $.bootstrapGrowl('Alert with options', options); +}); diff --git a/types/bootstrap-growl-ifightcrime/index.d.ts b/types/bootstrap-growl-ifightcrime/index.d.ts new file mode 100644 index 0000000000..45755682ea --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/index.d.ts @@ -0,0 +1,78 @@ +// Type definitions for Bootstrap Growl Ifightcrime 1.1 +// Project: https://github.com/ifightcrime/bootstrap-growl +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +declare namespace BootstrapGrowlIfightcrime { + type OffsetPositionType = 'top' | 'bottom'; + + type AlertType = 'info' | 'danger' | 'success' | 'warning' | string | null; + + type AlignType = 'left' | 'center' | 'right'; + + interface OffsetOption { + /** + * Position: top or bottom + */ + from?: OffsetPositionType; + + /** + * Offset amount + */ + amount?: number; + } + + interface Options { + /** + * Which element to append to + */ + ele?: string; + + /** + * Values of (null, 'info', 'danger', 'success', 'warning') or another value + */ + type?: AlertType; + + /** + * Offset Options + */ + offset?: OffsetOption; + + /** + * 'left', 'right', or 'center' + */ + align?: AlignType; + + /** + * Integer + */ + width?: number; + + /** + * Time while the message will be displayed. It's not equivalent to the *demo* timeOut! + */ + delay?: number; + + /** + * If true then will display a cross to close the popup. + */ + allow_dismiss?: boolean; + + /** + * Spacing between consecutively stacked growls. + */ + stackup_spacing?: number; + } +} +interface JQueryStatic { + /** + * Show standard Bootstrap alerts into hovering "Growl-like" notifications + * @param message to show. + * @param options should be an options object. + * @returns The element. + */ + bootstrapGrowl: (message: string, options?: BootstrapGrowlIfightcrime.Options) => JQuery; +} diff --git a/types/bootstrap-growl-ifightcrime/tsconfig.json b/types/bootstrap-growl-ifightcrime/tsconfig.json new file mode 100644 index 0000000000..fc7523d1ed --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "bootstrap-growl-ifightcrime-tests.ts" + ] +} \ No newline at end of file diff --git a/types/bootstrap-growl-ifightcrime/tslint.json b/types/bootstrap-growl-ifightcrime/tslint.json new file mode 100644 index 0000000000..4e88071852 --- /dev/null +++ b/types/bootstrap-growl-ifightcrime/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} diff --git a/types/bootstrap-maxlength/tsconfig.json b/types/bootstrap-maxlength/tsconfig.json index 403883963c..e4b44ea983 100644 --- a/types/bootstrap-maxlength/tsconfig.json +++ b/types/bootstrap-maxlength/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-notify/tsconfig.json b/types/bootstrap-notify/tsconfig.json index f833291433..655e25aee4 100644 --- a/types/bootstrap-notify/tsconfig.json +++ b/types/bootstrap-notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-select/tsconfig.json b/types/bootstrap-select/tsconfig.json index 108bd0a43f..5e091020b7 100644 --- a/types/bootstrap-select/tsconfig.json +++ b/types/bootstrap-select/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-slider/tsconfig.json b/types/bootstrap-slider/tsconfig.json index 7400a08d09..290df45757 100644 --- a/types/bootstrap-slider/tsconfig.json +++ b/types/bootstrap-slider/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-switch/tsconfig.json b/types/bootstrap-switch/tsconfig.json index 794d73cac9..12b39ceee9 100644 --- a/types/bootstrap-switch/tsconfig.json +++ b/types/bootstrap-switch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-table/tsconfig.json b/types/bootstrap-table/tsconfig.json index b38fb73330..8ce2a4f120 100644 --- a/types/bootstrap-table/tsconfig.json +++ b/types/bootstrap-table/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-touchspin/tsconfig.json b/types/bootstrap-touchspin/tsconfig.json index 1ce86dec76..dd3a9a264f 100644 --- a/types/bootstrap-touchspin/tsconfig.json +++ b/types/bootstrap-touchspin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-treeview/tsconfig.json b/types/bootstrap-treeview/tsconfig.json index 30898529bb..07ec80679b 100644 --- a/types/bootstrap-treeview/tsconfig.json +++ b/types/bootstrap-treeview/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap-validator/tsconfig.json b/types/bootstrap-validator/tsconfig.json index 4f61ae94f9..c2fe1d7649 100644 --- a/types/bootstrap-validator/tsconfig.json +++ b/types/bootstrap-validator/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bootstrap.paginator/tsconfig.json b/types/bootstrap.paginator/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/bootstrap.paginator/tsconfig.json +++ b/types/bootstrap.paginator/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/bootstrap.timepicker/tsconfig.json b/types/bootstrap.timepicker/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/bootstrap.timepicker/tsconfig.json +++ b/types/bootstrap.timepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/bootstrap.v3.datetimepicker/tsconfig.json b/types/bootstrap.v3.datetimepicker/tsconfig.json index 36febd5a8f..07477e55ee 100644 --- a/types/bootstrap.v3.datetimepicker/tsconfig.json +++ b/types/bootstrap.v3.datetimepicker/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/bootstrap.v3.datetimepicker/v3/tsconfig.json b/types/bootstrap.v3.datetimepicker/v3/tsconfig.json index 3dcc23bdff..2647486a31 100644 --- a/types/bootstrap.v3.datetimepicker/v3/tsconfig.json +++ b/types/bootstrap.v3.datetimepicker/v3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" 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; diff --git a/types/bootstrap/tsconfig.json b/types/bootstrap/tsconfig.json index 536901e8a6..69b44a5acc 100644 --- a/types/bootstrap/tsconfig.json +++ b/types/bootstrap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bounce.js/tsconfig.json b/types/bounce.js/tsconfig.json index a0f7048729..e98358df0d 100644 --- a/types/bounce.js/tsconfig.json +++ b/types/bounce.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/box2d/tsconfig.json b/types/box2d/tsconfig.json index 9fae5e8326..d2792ff0aa 100644 --- a/types/box2d/tsconfig.json +++ b/types/box2d/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/brace-expansion/tsconfig.json b/types/brace-expansion/tsconfig.json index a64fa9ea3b..5bf38b657e 100644 --- a/types/brace-expansion/tsconfig.json +++ b/types/brace-expansion/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/braces/tsconfig.json b/types/braces/tsconfig.json index bdacb750ad..4cea273caa 100644 --- a/types/braces/tsconfig.json +++ b/types/braces/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/braft-editor/braft-editor-tests.tsx b/types/braft-editor/braft-editor-tests.tsx index 584927e0bd..999850acaa 100644 --- a/types/braft-editor/braft-editor-tests.tsx +++ b/types/braft-editor/braft-editor-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import * as BraftEditor from "braft-editor"; +import BraftEditor = require("braft-editor"); import { RawDraftContentState, } from 'draft-js'; diff --git a/types/braft-editor/tsconfig.json b/types/braft-editor/tsconfig.json index f04b8febfe..f944ddb136 100644 --- a/types/braft-editor/tsconfig.json +++ b/types/braft-editor/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/braintree-web/tsconfig.json b/types/braintree-web/tsconfig.json index 3a39178d0e..8ebecd3737 100644 --- a/types/braintree-web/tsconfig.json +++ b/types/braintree-web/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/breeze/tsconfig.json b/types/breeze/tsconfig.json index 236bcba327..6960f68bf4 100644 --- a/types/breeze/tsconfig.json +++ b/types/breeze/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bricks.js/tsconfig.json b/types/bricks.js/tsconfig.json index 5f265430a3..af736ecb51 100644 --- a/types/bricks.js/tsconfig.json +++ b/types/bricks.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/brorand/brorand-tests.ts b/types/brorand/brorand-tests.ts index ac090e8724..eb7bf16570 100644 --- a/types/brorand/brorand-tests.ts +++ b/types/brorand/brorand-tests.ts @@ -1,5 +1,4 @@ - -import * as brorand from 'brorand'; +import brorand = require('brorand'); { let result: Buffer|Uint8Array = brorand(42); diff --git a/types/brorand/tsconfig.json b/types/brorand/tsconfig.json index 52e7dbf24c..46bf46253f 100644 --- a/types/brorand/tsconfig.json +++ b/types/brorand/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-bunyan/tsconfig.json b/types/browser-bunyan/tsconfig.json index ab3fb51bd2..258572b639 100644 --- a/types/browser-bunyan/tsconfig.json +++ b/types/browser-bunyan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-fingerprint/tsconfig.json b/types/browser-fingerprint/tsconfig.json index 7f34a8f380..b542891e6d 100644 --- a/types/browser-fingerprint/tsconfig.json +++ b/types/browser-fingerprint/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-harness/tsconfig.json b/types/browser-harness/tsconfig.json index 1694e52c08..94f44fa93e 100644 --- a/types/browser-harness/tsconfig.json +++ b/types/browser-harness/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-pack/tsconfig.json b/types/browser-pack/tsconfig.json index 1dc87a2e2d..23cf069267 100644 --- a/types/browser-pack/tsconfig.json +++ b/types/browser-pack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-report/tsconfig.json b/types/browser-report/tsconfig.json index f0bb076ca9..d356e5aa89 100644 --- a/types/browser-report/tsconfig.json +++ b/types/browser-report/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-resolve/browser-resolve-tests.ts b/types/browser-resolve/browser-resolve-tests.ts index 7d08de726f..25872b4b07 100644 --- a/types/browser-resolve/browser-resolve-tests.ts +++ b/types/browser-resolve/browser-resolve-tests.ts @@ -1,4 +1,4 @@ -import * as browserResolve from 'browser-resolve'; +import browserResolve = require('browser-resolve'); function basic_test_async(callback: (err?: Error, resolved?: string) => void) { browserResolve('typescript', function(error, resolved) { diff --git a/types/browser-resolve/tsconfig.json b/types/browser-resolve/tsconfig.json index 5f873c7ee5..82c5c037ca 100644 --- a/types/browser-resolve/tsconfig.json +++ b/types/browser-resolve/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browser-sync/browser-sync-tests.ts b/types/browser-sync/browser-sync-tests.ts index 85cd464a21..bcd829367a 100644 --- a/types/browser-sync/browser-sync-tests.ts +++ b/types/browser-sync/browser-sync-tests.ts @@ -1,4 +1,4 @@ -import * as browserSync from "browser-sync"; +import browserSync = require("browser-sync"); (() => { //make sure that the interfaces are correctly exposed diff --git a/types/browser-sync/tsconfig.json b/types/browser-sync/tsconfig.json index 830268a3a6..0984bd5d70 100644 --- a/types/browser-sync/tsconfig.json +++ b/types/browser-sync/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/browserify/tsconfig.json b/types/browserify/tsconfig.json index df71b7fb3b..f0588d71c8 100644 --- a/types/browserify/tsconfig.json +++ b/types/browserify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bs58/tsconfig.json b/types/bs58/tsconfig.json index 9e0ed25701..3c8b90f97d 100644 --- a/types/bs58/tsconfig.json +++ b/types/bs58/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bson/tsconfig.json b/types/bson/tsconfig.json index aa4936d595..684c19c644 100644 --- a/types/bson/tsconfig.json +++ b/types/bson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bucks/tsconfig.json b/types/bucks/tsconfig.json index f06df83926..fe5a89bfe7 100644 --- a/types/bucks/tsconfig.json +++ b/types/bucks/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/buffer-compare/tsconfig.json b/types/buffer-compare/tsconfig.json index 76638cae6e..0c58396698 100644 --- a/types/buffer-compare/tsconfig.json +++ b/types/buffer-compare/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/buffer-equal/tsconfig.json b/types/buffer-equal/tsconfig.json index 5576be8e43..d6b1d1f588 100644 --- a/types/buffer-equal/tsconfig.json +++ b/types/buffer-equal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/buffers/tsconfig.json b/types/buffers/tsconfig.json index 148f3d1dbb..26bb76ee44 100644 --- a/types/buffers/tsconfig.json +++ b/types/buffers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bufferstream/tsconfig.json b/types/bufferstream/tsconfig.json index 000bd2d09c..be892dede3 100644 --- a/types/bufferstream/tsconfig.json +++ b/types/bufferstream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index cbdcc83e0a..765be54733 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -2,8 +2,8 @@ * Created by Bruno Grieder */ -import * as Redis from "ioredis"; -import * as Queue from "bull"; +import Redis = require("ioredis"); +import Queue = require("bull"); const videoQueue = new Queue('video transcoding', 'redis://127.0.0.1:6379'); const audioQueue = new Queue('audio transcoding', {redis: {port: 6379, host: '127.0.0.1'}}); // Specify Redis connection using object diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 28070ad44f..6cc4f5ed1d 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -228,11 +228,11 @@ declare namespace Bull { } interface JobCounts { - wait: number; active: number; completed: number; failed: number; delayed: number; + waiting: number; } interface JobInformation { @@ -384,21 +384,27 @@ declare namespace Bull { /** * Returns a promise that resolves when the queue is paused. - * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. - * A paused queue will not process new jobs until resumed, - * but current jobs being processed will continue until they are finalized. + * + * A paused queue will not process new jobs until resumed, but current jobs being processed will continue until + * they are finalized. The pause can be either global or local. If global, all workers in all queue instances + * for a given queue will be paused. If local, just this worker will stop processing new jobs after the current + * lock expires. This can be useful to stop a worker from taking new jobs prior to shutting down. * * Pausing a queue that is already paused does nothing. */ - pause(): Promise; + pause(isLocal?: boolean): Promise; /** * Returns a promise that resolves when the queue is resumed after being paused. - * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. + * + * The resume can be either local or global. If global, all workers in all queue instances for a given queue + * will be resumed. If local, only this worker will be resumed. Note that resuming a queue globally will not + * resume workers that have been paused locally; for those, resume(true) must be called directly on their + * instances. * * Resuming a queue that is not paused does nothing. */ - resume(): Promise; + resume(isLocal?: boolean): Promise; /** * Returns a promise that returns the number of jobs in the queue, waiting or paused. @@ -445,6 +451,11 @@ declare namespace Bull { */ getFailed(start?: number, end?: number): Promise; + /** + * Returns a promise that will return an array with the waiting jobs between start and end. + */ + getWaiting(start?: number, end?: number): Promise; + /** * Returns JobInformation of repeatable jobs (ordered descending). Provide a start and/or an end * index to limit the number of results. Start defaults to 0, end to -1 and asc to false. diff --git a/types/bull/tsconfig.json b/types/bull/tsconfig.json index 3ce6f08792..6027d4730a 100644 --- a/types/bull/tsconfig.json +++ b/types/bull/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bull/v2/bull-tests.tsx b/types/bull/v2/bull-tests.tsx index fcf339b3c3..e6c82fe4f9 100644 --- a/types/bull/v2/bull-tests.tsx +++ b/types/bull/v2/bull-tests.tsx @@ -2,7 +2,7 @@ * Created by Bruno Grieder */ -import * as Queue from "bull" +import Queue = require("bull"); var videoQueue = Queue( 'video transcoding', 6379, '127.0.0.1' ); var audioQueue = Queue( 'audio transcoding', 6379, '127.0.0.1' ); diff --git a/types/bull/v2/tsconfig.json b/types/bull/v2/tsconfig.json index c0b2369568..980cf8d0cf 100644 --- a/types/bull/v2/tsconfig.json +++ b/types/bull/v2/tsconfig.json @@ -22,7 +22,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bump-regex/tsconfig.json b/types/bump-regex/tsconfig.json index 001effea6a..404f062975 100644 --- a/types/bump-regex/tsconfig.json +++ b/types/bump-regex/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bump-regex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bunnymq/tsconfig.json b/types/bunnymq/tsconfig.json index d1a470e451..10ba808afe 100644 --- a/types/bunnymq/tsconfig.json +++ b/types/bunnymq/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-blackhole/tsconfig.json b/types/bunyan-blackhole/tsconfig.json index 0266e86bae..21feb4a051 100644 --- a/types/bunyan-blackhole/tsconfig.json +++ b/types/bunyan-blackhole/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-bugsnag/bunyan-bugsnag-tests.ts b/types/bunyan-bugsnag/bunyan-bugsnag-tests.ts index 3c46089690..39a4c14cf5 100644 --- a/types/bunyan-bugsnag/bunyan-bugsnag-tests.ts +++ b/types/bunyan-bugsnag/bunyan-bugsnag-tests.ts @@ -1,4 +1,4 @@ -import * as bunyanBugsnag from 'bunyan-bugsnag'; +import bunyanBugsnag = require('bunyan-bugsnag'); import * as bunyan from 'bunyan'; const stream1 = bunyanBugsnag(); diff --git a/types/bunyan-bugsnag/tsconfig.json b/types/bunyan-bugsnag/tsconfig.json index 1910cbaf79..ddfbaa92ab 100644 --- a/types/bunyan-bugsnag/tsconfig.json +++ b/types/bunyan-bugsnag/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-config/tsconfig.json b/types/bunyan-config/tsconfig.json index 7866deb22e..818c7dad3f 100644 --- a/types/bunyan-config/tsconfig.json +++ b/types/bunyan-config/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-format/tsconfig.json b/types/bunyan-format/tsconfig.json index c26359cdb6..a40e9a48e5 100644 --- a/types/bunyan-format/tsconfig.json +++ b/types/bunyan-format/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "bunyan-format-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/bunyan-logentries/tsconfig.json b/types/bunyan-logentries/tsconfig.json index f367f2fff8..0f9234b499 100644 --- a/types/bunyan-logentries/tsconfig.json +++ b/types/bunyan-logentries/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-prettystream/tsconfig.json b/types/bunyan-prettystream/tsconfig.json index ac589169ba..8cbd62ba10 100644 --- a/types/bunyan-prettystream/tsconfig.json +++ b/types/bunyan-prettystream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan-winston-adapter/tsconfig.json b/types/bunyan-winston-adapter/tsconfig.json index 7278f5ac72..44b0bf2a41 100644 --- a/types/bunyan-winston-adapter/tsconfig.json +++ b/types/bunyan-winston-adapter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bunyan/tsconfig.json b/types/bunyan/tsconfig.json index 290ffc3a6d..dfda2cef0e 100644 --- a/types/bunyan/tsconfig.json +++ b/types/bunyan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/busboy/busboy-tests.ts b/types/busboy/busboy-tests.ts index 24291621a5..309572a37c 100644 --- a/types/busboy/busboy-tests.ts +++ b/types/busboy/busboy-tests.ts @@ -1,4 +1,4 @@ -import * as Busboy from 'busboy'; +import Busboy = require('busboy'); import * as http from 'http'; import * as util from 'util'; diff --git a/types/busboy/tsconfig.json b/types/busboy/tsconfig.json index 6e60377b23..8e894f9794 100644 --- a/types/busboy/tsconfig.json +++ b/types/busboy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/business-rules-engine/tsconfig.json b/types/business-rules-engine/tsconfig.json index 385150055b..5a5b7469c1 100644 --- a/types/business-rules-engine/tsconfig.json +++ b/types/business-rules-engine/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bwip-js/bwip-js-tests.ts b/types/bwip-js/bwip-js-tests.ts index 29cc419d2c..d016b81ae5 100644 --- a/types/bwip-js/bwip-js-tests.ts +++ b/types/bwip-js/bwip-js-tests.ts @@ -1,4 +1,4 @@ -import * as bwipjs from 'bwip-js'; +import bwipjs = require('bwip-js'); import * as http from 'http'; import * as fs from 'fs'; diff --git a/types/bwip-js/tsconfig.json b/types/bwip-js/tsconfig.json index c421a4a7b6..8695c19f9f 100644 --- a/types/bwip-js/tsconfig.json +++ b/types/bwip-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/byline/tsconfig.json b/types/byline/tsconfig.json index f21fc8983d..d4322a5534 100644 --- a/types/byline/tsconfig.json +++ b/types/byline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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. */ diff --git a/types/bytebuffer/tsconfig.json b/types/bytebuffer/tsconfig.json index 5fdc833e9b..580d7bc39a 100644 --- a/types/bytebuffer/tsconfig.json +++ b/types/bytebuffer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/bytes/tsconfig.json b/types/bytes/tsconfig.json index 4de1fdb57a..b541397abf 100644 --- a/types/bytes/tsconfig.json +++ b/types/bytes/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/c3/c3-tests.ts b/types/c3/c3-tests.ts index 8ac8a4b93e..7ac2f0ccd8 100644 --- a/types/c3/c3-tests.ts +++ b/types/c3/c3-tests.ts @@ -152,7 +152,8 @@ function axis_examples() { fit: true, values: [1, 2, 4, 8, 16, 32], rotate: 60, - outer: false + outer: false, + width: 100 }, max: 100, min: -100, @@ -940,6 +941,26 @@ function axes_x_tick_fit() { }); } +function axes_x_tick_width() { + const chart = c3.generate({ + data: { + x: "x", + columns: [ + ["x", "2013-10-31", "2013-12-31", "2014-01-31", "2014-02-28"], + ["sample", 30, 100, 400, 150], + ] + }, + axis: { + x: { + type: "bar", + tick: { + width: 100 + } + } + } + }); +} + function axes_x_localtime() { const chart = c3.generate({ data: { @@ -1847,6 +1868,37 @@ function tooltip_format() { }); } +function tooltip_order() { + const chart = c3.generate({ + data: { + columns: [ + ["data1", 30, 200, 100, 400, 150, 250], + ["data2", 50, 20, 10, 40, 15, 25] + ] + }, + tooltip: { + order: 'asc' + } + }); +} + +function tooltip_order_function() { + const chart = c3.generate({ + data: { + columns: [ + ["data1", 30, 200, 100, 400, 150, 250], + ["data2", 50, 20, 10, 40, 15, 25] + ] + }, + tooltip: { + order: (data1, data2) => { + return data1.id - data2.id; + // return data2.id - data2.id in case we want desc order + } + } + }); +} + //////////////////////// // Chart options Tests //////////////////////// diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index 322adce77d..d68027f7d5 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Marc Climent // Gerin Jacob // Bernd Hacker +// Dzmitry Shyndzin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -585,6 +586,10 @@ export interface XTickConfiguration { * Show x axis outer tick. */ outer?: boolean; + /** + * Set width of x axis tick. + */ + width?: number; multiline?: boolean; // Undocumented } @@ -737,6 +742,11 @@ export interface TooltipOptions { * Specified function receives data, defaultTitleFormat, defaultValueFormat and color of the data point to show. If tooltip.grouped is true, data includes multiple data points. */ contents?(data: any, defaultTitleFormat: string, defaultValueFormat: string, color: any): string; + /** + * Set tooltip values order + * Available Values: desc, asc, any[], function (data1, data2) { ... }, null + */ + order?: string | any[] | ((data1: any, data2: any) => number) | null; } export interface SubchartOptions { diff --git a/types/c3/tsconfig.json b/types/c3/tsconfig.json index fe3b00c503..6ec75e8352 100644 --- a/types/c3/tsconfig.json +++ b/types/c3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cache-manager/tsconfig.json b/types/cache-manager/tsconfig.json index f754de4a67..68cda85b6b 100644 --- a/types/cache-manager/tsconfig.json +++ b/types/cache-manager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cal-heatmap/tsconfig.json b/types/cal-heatmap/tsconfig.json index ff8d65a2e2..b803ce055b 100644 --- a/types/cal-heatmap/tsconfig.json +++ b/types/cal-heatmap/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/callsite/tsconfig.json b/types/callsite/tsconfig.json index 473c5c08fd..3210df01f9 100644 --- a/types/callsite/tsconfig.json +++ b/types/callsite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/callsites/tsconfig.json b/types/callsites/tsconfig.json index 010199b740..6551532b88 100644 --- a/types/callsites/tsconfig.json +++ b/types/callsites/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/calq/tsconfig.json b/types/calq/tsconfig.json index 595f095f74..cecaa097cd 100644 --- a/types/calq/tsconfig.json +++ b/types/calq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/camelcase-keys/tsconfig.json b/types/camelcase-keys/tsconfig.json index f99870f8d9..0774991702 100644 --- a/types/camelcase-keys/tsconfig.json +++ b/types/camelcase-keys/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/camelcase/tsconfig.json b/types/camelcase/tsconfig.json index bcc1b505e1..28d8446c42 100644 --- a/types/camelcase/tsconfig.json +++ b/types/camelcase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/camljs/tsconfig.json b/types/camljs/tsconfig.json index 5fbe5605e9..ed88508fc3 100644 --- a/types/camljs/tsconfig.json +++ b/types/camljs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/camo/tsconfig.json b/types/camo/tsconfig.json index 46a6a2814c..089ef0623c 100644 --- a/types/camo/tsconfig.json +++ b/types/camo/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cancan/tsconfig.json b/types/cancan/tsconfig.json index 8aace9dd52..f746eff819 100644 --- a/types/cancan/tsconfig.json +++ b/types/cancan/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cancan-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cannon/tsconfig.json b/types/cannon/tsconfig.json index ca5618a8a0..b75a303b0c 100644 --- a/types/cannon/tsconfig.json +++ b/types/cannon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/canvas-gauges/tsconfig.json b/types/canvas-gauges/tsconfig.json index 07055c34bb..88a7c53ae5 100644 --- a/types/canvas-gauges/tsconfig.json +++ b/types/canvas-gauges/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/canvasjs/tsconfig.json b/types/canvasjs/tsconfig.json index 57f76052a9..3d14bb3e07 100644 --- a/types/canvasjs/tsconfig.json +++ b/types/canvasjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/capitalize/tsconfig.json b/types/capitalize/tsconfig.json index 463b6ca645..14a386e76d 100644 --- a/types/capitalize/tsconfig.json +++ b/types/capitalize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/card-validator/tsconfig.json b/types/card-validator/tsconfig.json index 685e0c4bbe..cc89881539 100644 --- a/types/card-validator/tsconfig.json +++ b/types/card-validator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/case-sensitive-paths-webpack-plugin/tsconfig.json b/types/case-sensitive-paths-webpack-plugin/tsconfig.json index b8cb05390a..bddcd8721e 100644 --- a/types/case-sensitive-paths-webpack-plugin/tsconfig.json +++ b/types/case-sensitive-paths-webpack-plugin/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "case-sensitive-paths-webpack-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/caseless/tsconfig.json b/types/caseless/tsconfig.json index c7dace4424..c153bc58d3 100644 --- a/types/caseless/tsconfig.json +++ b/types/caseless/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "caseless-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cash/tsconfig.json b/types/cash/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/cash/tsconfig.json +++ b/types/cash/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/casperjs/tsconfig.json b/types/casperjs/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/casperjs/tsconfig.json +++ b/types/casperjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/cassandra-driver/tsconfig.json b/types/cassandra-driver/tsconfig.json index e47bfd4444..5f7dffd9f9 100644 --- a/types/cassandra-driver/tsconfig.json +++ b/types/cassandra-driver/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/catalog/catalog-tests.tsx b/types/catalog/catalog-tests.tsx new file mode 100644 index 0000000000..c77c0c1667 --- /dev/null +++ b/types/catalog/catalog-tests.tsx @@ -0,0 +1,42 @@ +import * as React from "react"; +import { Config, render, markdown, Catalog, ReactSpecimen, Page } from "catalog"; + +const config: Config = { + title: 'Test', + pages: [ + { + path: '/', + title: 'Introduction', + content: '/patd/to/file.md', + }, + { + path: '/materials', + title: 'Materials', + pages: [ + { + path: '/materials/typeface', + title: 'Typeface', + component: , + }, + ], + }, + ], + useBrowserHistory: true, + basePath: '/doc', + responsiveSizes: [ + { name: 'large', width: 978, height: 1100 }, + { name: 'medium', width: 640, height: 900 }, + { name: 'small', width: 471, height: 700 }, + ], +}; + +render(config, document.body); +; + +markdown` +# Test + +${ +
+} +`; diff --git a/types/catalog/index.d.ts b/types/catalog/index.d.ts new file mode 100644 index 0000000000..515008d7de --- /dev/null +++ b/types/catalog/index.d.ts @@ -0,0 +1,108 @@ +// Type definitions for catalog 2.1 +// Project: https://github.com/interactivethings/catalog/ +// Definitions by: Peter Gassner , Tomas Carnecky +// Definitions: https://github.com/interactivethings/catalog/ +// TypeScript Version: 2.3 + +import * as React from "react"; + +// Configuration + +// XXX: Can not name this 'Page' because there's already a 'Page' +// component here. +export interface ConfigPage { + path: string; + title: string; + + content?: any; + component?: any; + pages?: ConfigPage[]; +} + +export interface ConfigResponsiveSize { + name: string; + width: number; + height: number; +} + +export interface Config { + title: string; + pages: ConfigPage[]; + + useBrowserHistory?: boolean; + basePath?: string; + responsiveSizes?: ConfigResponsiveSize[]; +} + +export function render(config: Config, element: HTMLElement): void; +export function configure(config: any): any; +export function configureRoutes(config: any): any; +export function configureJSXRoutes(config: any): any; + +export function pageLoader(f: () => Promise): any; +export function markdown(...x: any[]): JSX.Element; + +// Components +export interface DefaultCatalogProps extends React.Props<{}> { + span?: number; + theme?: any; +} + +export class Card extends React.Component {} +export class Page extends React.Component {} +export interface SpanProps extends DefaultCatalogProps { + style?: any; +} +export class Span extends React.Component {} + +// Specimens +export class AudioSpecimen extends React.Component {} + +export interface CodeSpecimenProps extends DefaultCatalogProps { + rawBody: string; + collapsed: boolean; + lang: string; + raw: boolean; +} +export class CodeSpecimen extends React.Component {} + +export interface ColorSpecimenProps extends DefaultCatalogProps { + value: string; + name: string; +} +export class ColorSpecimen extends React.Component {} + +export interface ColorPaletteSpecimenProps extends DefaultCatalogProps { + colors: Array<{name?: string, value: string}>; + horizontal?: boolean; +} +export class ColorPaletteSpecimen extends React.Component {} + +export class HtmlSpecimen extends React.Component {} +export class HintSpecimen extends React.Component {} +export class ImageSpecimen extends React.Component {} + +export interface TypeSpecimenProps extends DefaultCatalogProps { + color?: string; + font: string; + headings: string[] | number[]; + style?: string; + weight: string; +} +export class TypeSpecimen extends React.Component {} +export class DownloadSpecimen extends React.Component {} + +export interface ReactSpecimenProps extends DefaultCatalogProps { + noSource?: boolean; + plain?: boolean; + light?: boolean; + dark?: boolean; + frame?: boolean; + state?: any; + responsive?: boolean | string | string[]; +} +export class ReactSpecimen extends React.Component {} + +export class VideoSpecimen extends React.Component {} + +export class Catalog extends React.Component {} diff --git a/types/catalog/tsconfig.json b/types/catalog/tsconfig.json new file mode 100644 index 0000000000..00e00ca7a7 --- /dev/null +++ b/types/catalog/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "catalog-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/catalog/tslint.json b/types/catalog/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/catalog/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/catbox/tsconfig.json b/types/catbox/tsconfig.json index 16f6fb780e..424dece7ec 100644 --- a/types/catbox/tsconfig.json +++ b/types/catbox/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "catbox-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cbor/tsconfig.json b/types/cbor/tsconfig.json index 199ead141d..1211823d22 100644 --- a/types/cbor/tsconfig.json +++ b/types/cbor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ccap/ccap-tests.ts b/types/ccap/ccap-tests.ts index 12a38a9f60..111fa2f457 100644 --- a/types/ccap/ccap-tests.ts +++ b/types/ccap/ccap-tests.ts @@ -1,4 +1,4 @@ -import * as ccap from 'ccap'; +import ccap = require('ccap'); const captcha1 = ccap(); diff --git a/types/ccap/tsconfig.json b/types/ccap/tsconfig.json index e4fa68a956..a043df5754 100644 --- a/types/ccap/tsconfig.json +++ b/types/ccap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-arrays/tsconfig.json b/types/chai-arrays/tsconfig.json index 84b3de823b..f1d8d90394 100644 --- a/types/chai-arrays/tsconfig.json +++ b/types/chai-arrays/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-as-promised/tsconfig.json b/types/chai-as-promised/tsconfig.json index 2d1a15b6eb..002750f2df 100644 --- a/types/chai-as-promised/tsconfig.json +++ b/types/chai-as-promised/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-datetime/tsconfig.json b/types/chai-datetime/tsconfig.json index 93d28d082f..be6e164724 100644 --- a/types/chai-datetime/tsconfig.json +++ b/types/chai-datetime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-dom/chai-dom-tests.ts b/types/chai-dom/chai-dom-tests.ts index 61b3b3c600..2cc7b0f232 100644 --- a/types/chai-dom/chai-dom-tests.ts +++ b/types/chai-dom/chai-dom-tests.ts @@ -1,5 +1,5 @@ import * as chai from 'chai'; -import * as chaiDom from 'chai-dom'; +import chaiDom = require('chai-dom'); chai.use(chaiDom); var expect = chai.expect; 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-dom/tsconfig.json b/types/chai-dom/tsconfig.json index 8840510c78..e6c3147faf 100644 --- a/types/chai-dom/tsconfig.json +++ b/types/chai-dom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-enzyme/chai-enzyme-tests.tsx b/types/chai-enzyme/chai-enzyme-tests.tsx index 4b88d077aa..70cd34f2fd 100644 --- a/types/chai-enzyme/chai-enzyme-tests.tsx +++ b/types/chai-enzyme/chai-enzyme-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import * as chaiEnzyme from "chai-enzyme"; +import chaiEnzyme = require("chai-enzyme"); import { expect } from "chai"; import { shallow } from "enzyme"; diff --git a/types/chai-enzyme/tsconfig.json b/types/chai-enzyme/tsconfig.json index 4b7cdcf075..0beb02ded3 100644 --- a/types/chai-enzyme/tsconfig.json +++ b/types/chai-enzyme/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ diff --git a/types/chai-fuzzy/tsconfig.json b/types/chai-fuzzy/tsconfig.json index c6254dc8d8..13b8041e55 100644 --- a/types/chai-fuzzy/tsconfig.json +++ b/types/chai-fuzzy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-http/tsconfig.json b/types/chai-http/tsconfig.json index 3554b4ab09..0f73b862cd 100644 --- a/types/chai-http/tsconfig.json +++ b/types/chai-http/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-jest-snapshot/tsconfig.json b/types/chai-jest-snapshot/tsconfig.json index ae15eb95a0..d466996d29 100644 --- a/types/chai-jest-snapshot/tsconfig.json +++ b/types/chai-jest-snapshot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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-jquery/tsconfig.json b/types/chai-jquery/tsconfig.json index b26a07d06d..b7a09dd6fd 100644 --- a/types/chai-jquery/tsconfig.json +++ b/types/chai-jquery/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-json-schema/tsconfig.json b/types/chai-json-schema/tsconfig.json index 9c8408ae05..fe54d634bf 100644 --- a/types/chai-json-schema/tsconfig.json +++ b/types/chai-json-schema/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-oequal/tsconfig.json b/types/chai-oequal/tsconfig.json index 0e63915d75..a2f5f9697e 100644 --- a/types/chai-oequal/tsconfig.json +++ b/types/chai-oequal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-spies/tsconfig.json b/types/chai-spies/tsconfig.json index a439cf07a4..0125b21a90 100644 --- a/types/chai-spies/tsconfig.json +++ b/types/chai-spies/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-string/chai-string-tests.ts b/types/chai-string/chai-string-tests.ts index 615a6c1f95..dc798c102a 100644 --- a/types/chai-string/chai-string-tests.ts +++ b/types/chai-string/chai-string-tests.ts @@ -51,6 +51,90 @@ describe('chai-string', function() { }); + + describe('#containIgnoreSpaces', function () { + + it('should return true', function () { + var str1 = '1234abcdef56', + str2 = '1234a\nb\tc\r d ef56'; + str1.should.containIgnoreSpaces(str2); + }); + + it('should return true (2)', function () { + var str1 = 'abcdef', + str2 = 'a\nb\tc\r d ef'; + str1.should.containIgnoreSpaces(str2); + }); + + it('should return false', function () { + var str1 = 'abdef', + str2 = 'a\nb\tc\r d ef'; + str1.should.not.containIgnoreSpaces(str2); + }); + }); + + describe('#containIgnoreCase', function () { + + it('should return true', function () { + var str1 = 'abcdef', + str2 = 'cDe'; + str1.should.containIgnoreCase(str2); + }); + + it('should return true (2)', function () { + 'abcdef'.should.containIgnoreCase('cDe'); + }); + + it('should return true (3)', function () { + var str1 = 'abcdef', + str2 = 'AbCdeF'; + str1.should.containIgnoreCase(str2); + }); + + it('should return false', function () { + var str1 = 'abcdef', + str2 = 'efg'; + str1.should.not.containIgnoreCase(str2); + }); + + it('should return false (3)', function () { + var str1 = 'abcdef', + str2 = 'zabcd'; + str1.should.not.containIgnoreCase(str2); + }); + }); + + describe('#indexOf', function () { + + it('should return true', function () { + var str = 'abcabd', + substr = 'ab', + index = 0; + str.indexOf(substr, index).should.be.true; + }); + + it('should return true (2)', function () { + var str = 'abcabd', + substr = 'ca', + index = 2; + str.indexOf(substr, index).should.be.true; + }); + + it('should return true (3)', function () { + var str = 'ababab', + substr = 'ba', + index = 1; + str.indexOf(substr, index).should.be.true; + }); + + it('should return false', function () { + var str = 'abcaab', + substr = 'da', + index = 1; + str.indexOf(substr, index).should.be.false; + }); + }); + describe('tdd alias', function() { let str: string; let str2: string; @@ -92,6 +176,14 @@ describe('chai-string', function() { assert.notEqualIgnoreSpaces(str, str2 + 'g'); }); + it('.containIgnoreSpaces', function () { + assert.containIgnoreSpaces(str, str2); + }); + + it('.notContainIgnoreSpaces', function () { + assert.notContainIgnoreSpaces(str, str2 + 'g'); + }); + it('.singleLine', function() { assert.singleLine(str); }); @@ -125,5 +217,13 @@ describe('chai-string', function() { assert.entriesCount('', 'ab', 0); }); + it('.indexOf', function () { + assert.indexOf('abcabd', 'ab', 0); + assert.indexOf('abcabd', 'ca', 2); + assert.indexOf('ababab', 'ba', 1); + assert.indexOf('ababab', 'ba', 1); + 'ababab'.indexOf('ba', 1).should.be.true; + }); + }); }); diff --git a/types/chai-string/index.d.ts b/types/chai-string/index.d.ts index fad380cf07..bc990104be 100644 --- a/types/chai-string/index.d.ts +++ b/types/chai-string/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for chai-string 1.1.4 +// Type definitions for chai-string 1.4.0 // Project: https://github.com/onechiporenko/chai-string // Definitions by: Nick Malaguti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -14,10 +14,13 @@ declare global { endWith(expected: string, message?: string): Assertion; equalIgnoreCase(expected: string, message?: string): Assertion; equalIgnoreSpaces(expected: string, message?: string): Assertion; + containIgnoreCase(expected: string, msg?: string): Assertion; + containIgnoreSpaces(expected: string, msg?: string): Assertion; singleLine(message?: string): Assertion; reverseOf(message?: string): Assertion; palindrome(message?: string): Assertion; entriesCount(substr: string, expected: number, message?: string): Assertion; + indexOf(str: string, substr: string, index: number, msg?: string): Assertion; } interface Assert { @@ -29,6 +32,10 @@ declare global { notEqualIgnoreCase(val: string, exp: string, msg?: string): void; equalIgnoreSpaces(val: string, exp: string, msg?: string): void; notEqualIgnoreSpaces(val: string, exp: string, msg?: string): void; + containIgnoreCase(val: string, exp: string, msg?: string): void; + notContainIgnoreCase(val: string, exp: string, msg?: string): void; + containIgnoreSpaces(val: string, exp: string, msg?: string): void; + notContainIgnoreSpaces(val: string, exp: string, msg?: string): void; singleLine(val: string, msg?: string): void; notSingleLine(val: string, msg?: string): void; reverseOf(val: string, exp: string, msg?: string): void; @@ -36,6 +43,7 @@ declare global { palindrome(val: string, msg?: string): void; notPalindrome(val: string, msg?: string): void; entriesCount(str: string, substr: string, count: number, msg?: string): void; + indexOf(str: string, substr: string, index: number, msg?: string): void; } } } diff --git a/types/chai-string/tsconfig.json b/types/chai-string/tsconfig.json index 1227af23ab..bfea2831a3 100644 --- a/types/chai-string/tsconfig.json +++ b/types/chai-string/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-subset/tsconfig.json b/types/chai-subset/tsconfig.json index c79fad5e82..3c4fceea1e 100644 --- a/types/chai-subset/tsconfig.json +++ b/types/chai-subset/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-things/tsconfig.json b/types/chai-things/tsconfig.json index 84e31abe2f..451820be5f 100644 --- a/types/chai-things/tsconfig.json +++ b/types/chai-things/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-webdriverio/tsconfig.json b/types/chai-webdriverio/tsconfig.json index c44958af89..6f99050ed5 100644 --- a/types/chai-webdriverio/tsconfig.json +++ b/types/chai-webdriverio/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chai-xml/tsconfig.json b/types/chai-xml/tsconfig.json index 95a0d68969..5c6cb3e360 100644 --- a/types/chai-xml/tsconfig.json +++ b/types/chai-xml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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 { diff --git a/types/chai/tsconfig.json b/types/chai/tsconfig.json index 4e0c687060..eb0c557006 100644 --- a/types/chai/tsconfig.json +++ b/types/chai/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/chai/v2/tsconfig.json b/types/chai/v2/tsconfig.json index 927a017f3d..e2efdb7c51 100644 --- a/types/chai/v2/tsconfig.json +++ b/types/chai/v2/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/chance/tsconfig.json b/types/chance/tsconfig.json index f05e6076cc..660b15aed2 100644 --- a/types/chance/tsconfig.json +++ b/types/chance/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/change-emitter/tsconfig.json b/types/change-emitter/tsconfig.json index 208441aafa..e0c6ea9a00 100644 --- a/types/change-emitter/tsconfig.json +++ b/types/change-emitter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/charm/tsconfig.json b/types/charm/tsconfig.json index 40eba0a076..8e481fdee8 100644 --- a/types/charm/tsconfig.json +++ b/types/charm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/charset/tsconfig.json b/types/charset/tsconfig.json index 52652c8e44..089cfffc1c 100644 --- a/types/charset/tsconfig.json +++ b/types/charset/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "charset-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index d1e86fd317..8ba81e8747 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -1,4 +1,4 @@ -import { Chart, ChartData } from 'chart.js'; +import { Chart, ChartData, Point } from 'chart.js'; // alternative: // import chartjs = require('chart.js'); @@ -45,7 +45,14 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { } }] }, - plugins: { arbitraryPlugin: {option: "value"} } + plugins: { arbitraryPlugin: {option: "value"} }, + legend: { + display: true, + labels: { + usePointStyle: true, + padding: 40 + } + }, } }); chart.update(); @@ -58,3 +65,11 @@ if (chart.chartArea) { console.log(chart.chartArea.bottom); console.log(chart.chartArea.left); } + +// http://www.chartjs.org/docs/latest/configuration/tooltip.html#position-modes +Chart.Tooltip.positioners.custom = (elements: any[], eventPosition: Point) => { + return { + x: eventPosition.x, + y: eventPosition.y + 10 + }; +}; diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 614fbe26ef..9a8269bee4 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -7,6 +7,8 @@ // Daniel Luz // Joseph Page // Dan Manastireanu +// Guillaume Rodriguez +// Sergey Rubanov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -36,10 +38,19 @@ declare class Chart { static defaults: { global: Chart.ChartOptions & Chart.ChartFontOptions; + [key: string]: any; }; + + static controllers: { + [key: string]: any; + }; + + // Tooltip Static Options + static Tooltip: Chart.ChartTooltipsStaticConfiguration; } declare class PluginServiceStatic { - register(plugin?: PluginServiceRegistrationOptions): void; + register(plugin: PluginServiceRegistrationOptions): void; + unregister(plugin: PluginServiceRegistrationOptions): void; } interface PluginServiceRegistrationOptions { @@ -65,6 +76,13 @@ interface PluginServiceRegistrationOptions { beforeDatasetsDraw?(chartInstance: Chart, easing: string): void; afterDatasetsDraw?(chartInstance: Chart, easing: string): void; + // Called before drawing the `tooltip`. If any plugin returns `false`, + // the tooltip drawing is cancelled until another `render` is triggered. + beforeTooltipDraw?(chartInstance: Chart): void; + // Called after drawing the `tooltip`. Note that this hook will not, + // be called if the tooltip drawing has been previously cancelled. + afterTooltipDraw?(chartInstance: Chart): void; + destroy?(chartInstance: Chart): void; // Called when an event occurs on the chart @@ -105,6 +123,7 @@ declare namespace Chart { lineJoin?: string; lineWidth?: number; strokeStyle?: string; + pointStyle?: PointStyle; } interface ChartTooltipItem { @@ -217,6 +236,8 @@ declare namespace Chart { fontFamily?: string; padding?: number; generateLabels?(chart: any): any; + filter?(item: ChartLegendItem, data: ChartData): any; + usePointStyle?: boolean; } interface ChartTooltipOptions { @@ -250,13 +271,19 @@ declare namespace Chart { callbacks?: ChartTooltipCallback; filter?(item: ChartTooltipItem): boolean; itemSort?(itemA: ChartTooltipItem, itemB: ChartTooltipItem): number; - position?: "average"|"nearest"; + position?: string; caretPadding?: number; displayColors?: boolean; borderColor?: ChartColor; borderWidth?: number; } + interface ChartTooltipsStaticConfiguration { + positioners: {[mode: string]: ChartTooltipPositioner}; + } + + type ChartTooltipPositioner = (elements: any[], eventPosition: Point) => Point; + interface ChartHoverOptions { mode?: string; animationDuration?: number; @@ -533,6 +560,7 @@ declare namespace Chart { tooltipFormat?: string; unit?: TimeUnit; unitStepSize?: number; + stepSize?: number; minUnit?: TimeUnit; } @@ -542,6 +570,11 @@ declare namespace Chart { pointLabels?: PointLabelOptions; ticks?: TickOptions; } + + interface Point { + x: number; + y: number; + } } export = Chart; diff --git a/types/chart.js/tsconfig.json b/types/chart.js/tsconfig.json index 3b5b6bffed..eb4278aa82 100644 --- a/types/chart.js/tsconfig.json +++ b/types/chart.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chartist/tsconfig.json b/types/chartist/tsconfig.json index afe951be86..d4b563655d 100644 --- a/types/chartist/tsconfig.json +++ b/types/chartist/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chayns/tsconfig.json b/types/chayns/tsconfig.json index 4ac301174a..b5b318b647 100644 --- a/types/chayns/tsconfig.json +++ b/types/chayns/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/check-sum/tsconfig.json b/types/check-sum/tsconfig.json index 5d2955a50f..655aac3937 100644 --- a/types/check-sum/tsconfig.json +++ b/types/check-sum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/check-types/tsconfig.json b/types/check-types/tsconfig.json index d3c89a7ac7..95a7ed6992 100644 --- a/types/check-types/tsconfig.json +++ b/types/check-types/tsconfig.json @@ -1,21 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": ["es6"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "check-types-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "check-types-tests.ts" + ] } \ No newline at end of file diff --git a/types/checkstyle-formatter/tsconfig.json b/types/checkstyle-formatter/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/checkstyle-formatter/tsconfig.json +++ b/types/checkstyle-formatter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/checksum/tsconfig.json b/types/checksum/tsconfig.json index 21e5de17ab..7ef760cb8b 100644 --- a/types/checksum/tsconfig.json +++ b/types/checksum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cheerio/cheerio-tests.ts b/types/cheerio/cheerio-tests.ts index 1a9821a6bb..d686951213 100644 --- a/types/cheerio/cheerio-tests.ts +++ b/types/cheerio/cheerio-tests.ts @@ -1,6 +1,4 @@ - - -import * as cheerio from 'cheerio'; +import cheerio = require('cheerio'); /* * LOADING diff --git a/types/cheerio/tsconfig.json b/types/cheerio/tsconfig.json index 63c3aed57c..772ae1fb47 100644 --- a/types/cheerio/tsconfig.json +++ b/types/cheerio/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chmodr/tsconfig.json b/types/chmodr/tsconfig.json index 44e07784ac..a5832362a1 100644 --- a/types/chmodr/tsconfig.json +++ b/types/chmodr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chocolatechipjs/tsconfig.json b/types/chocolatechipjs/tsconfig.json index d56dd67e2d..158cf322ee 100644 --- a/types/chocolatechipjs/tsconfig.json +++ b/types/chocolatechipjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chokidar/tsconfig.json b/types/chokidar/tsconfig.json index 77a34a3964..b425370a98 100644 --- a/types/chokidar/tsconfig.json +++ b/types/chokidar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chosen-js/tsconfig.json b/types/chosen-js/tsconfig.json index 9f4ce049cb..64efa066d5 100644 --- a/types/chosen-js/tsconfig.json +++ b/types/chosen-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chownr/tsconfig.json b/types/chownr/tsconfig.json index 7b20bfde66..9a71fc1aa4 100644 --- a/types/chownr/tsconfig.json +++ b/types/chownr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chroma-js/tsconfig.json b/types/chroma-js/tsconfig.json index af142ac45e..efa5a84ce3 100644 --- a/types/chroma-js/tsconfig.json +++ b/types/chroma-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chroma-js/v0/tsconfig.json b/types/chroma-js/v0/tsconfig.json index 93226eedaf..2b91bad45b 100644 --- a/types/chroma-js/v0/tsconfig.json +++ b/types/chroma-js/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 3d85d3be14..cd12179213 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -6050,6 +6050,12 @@ declare namespace chrome.tabs { * @since Chrome 39. */ matchAboutBlank?: boolean; + /** + * Optional. The origin of the CSS to inject. This may only be specified for CSS, not JavaScript. Defaults to "author". + * One of: "author", or "user" + * @since Chrome 66. + */ + cssOrigin?: string; } export interface CreateProperties { diff --git a/types/chrome/tsconfig.json b/types/chrome/tsconfig.json index 57e4524e5a..96b0958f3b 100644 --- a/types/chrome/tsconfig.json +++ b/types/chrome/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -26,4 +27,4 @@ "test/chrome-app.ts", "test/chrome-webview.ts" ] -} +} \ No newline at end of file diff --git a/types/chui/tsconfig.json b/types/chui/tsconfig.json index 5463478868..49c70bca09 100644 --- a/types/chui/tsconfig.json +++ b/types/chui/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/circular-json/tsconfig.json b/types/circular-json/tsconfig.json index 65bd131757..b64620dc44 100644 --- a/types/circular-json/tsconfig.json +++ b/types/circular-json/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index 20882269fd..cf7cd0cc27 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -24,6 +24,8 @@ declare namespace CKEDITOR { var DIALOG_RESIZE_HEIGHT: number; var DIALOG_RESIZE_NONE: number; var DIALOG_RESIZE_WIDTH: number; + var DIALOG_STATE_IDLE: number; + var DIALOG_STATE_BUSY: number; var ELEMENT_MODE_APPENDTO: number; var ELEMENT_MODE_INLINE: number; var ELEMENT_MODE_NONE: number; @@ -42,6 +44,10 @@ declare namespace CKEDITOR { var NODE_DOCUMENT_FRAGMENT: number; var NODE_ELEMENT: number; var NODE_TEXT: number; + var POSITION_BEFORE_START: number; + var POSITION_BEFORE_END: number; + var POSITION_AFTER_START: number; + var POSITION_AFTER_END: number; var SELECTION_ELEMENT: number; var SELECTION_NONE: number; var SELECTION_TEXT: number; @@ -49,6 +55,9 @@ declare namespace CKEDITOR { var SHRINK_ELEMENT: number; var SHRINK_TEXT: number; var START: number; + var STYLE_BLOCK: string; + var STYLE_INLINE: string; + var STYLE_OBJECT: string; var TRISTATE_DISABLED: number; var TRISTATE_OFF: number; var TRISTATE_ON: number; @@ -62,7 +71,7 @@ declare namespace CKEDITOR { var currentInstance: editor; var document: dom.document; var env: environmentConfig; - var instances: editor[]; + var instances: { [id: string]: editor | undefined }; var loadFullCoreTimeout: number; var revision: string; var rnd: number; @@ -92,9 +101,19 @@ declare namespace CKEDITOR { function replaceAll(className?: string): void; function replaceAll(assertionFunction: (textarea: HTMLTextAreaElement, config: config) => boolean): void; + type listenerRegistration = { + removeListener: () => void; + } namespace dom { + interface bookmark { + startNode: dom.node | string; + endNode: dom.node | string; + serializable: boolean; + collapsed: boolean; + } + class comment { // Properties @@ -269,16 +288,17 @@ declare namespace CKEDITOR { class elementPath { constructor(startNode: element, root: element); + constructor(startNode: element); block: element; blockLimit: element; root: element; elements: element[]; compare(otherPath: elementPath): boolean; - contains(query: string, excludeRoot: boolean, fromTop: boolean): element; - contains(query: string[], excludeRoot: boolean, fromTop: boolean): element; - contains(query: (element: element) => boolean, excludeRoot: boolean, fromTop: boolean): element; - contains(query: Object, excludeRoot: boolean, fromTop: boolean): element; - contains(query: element, excludeRoot: boolean, fromTop: boolean): element; + contains(query: string, excludeRoot?: boolean, fromTop?: boolean): element; + contains(query: string[], excludeRoot?: boolean, fromTop?: boolean): element; + contains(query: (element: element) => boolean, excludeRoot?: boolean, fromTop?: boolean): element; + contains(query: Object, excludeRoot?: boolean, fromTop?: boolean): element; + contains(query: element, excludeRoot?: boolean, fromTop?: boolean): element; isContextFor(tag: string): boolean; direction(): string; } @@ -300,7 +320,7 @@ declare namespace CKEDITOR { cloneContents(): documentFragment; deleteContents(mergeThen?: boolean): void; extractContents(mergeThen?: boolean): documentFragment; - createBookmark(serializable: boolean): Object; + createBookmark(serializable?: boolean): bookmark; createBookmark2(normalized: boolean): Object; createIterator(): iterator; moveToBookmark(bookmark: Object): void; @@ -322,6 +342,7 @@ declare namespace CKEDITOR { setStartAt(node: node, position: number): void; setEndAt(node: node, position: number): void; fixBlock(isStart: boolean, blockTag: Object): Object; + select(): selection; splitBlock(blockTag: Object): Object; splitElement(toSplit: element): element; removeEmptyBlocksAtEnd(atEnd: boolean): void; @@ -815,7 +836,7 @@ declare namespace CKEDITOR { templates_files?: Object; templates_replaceContent?: boolean; title?: string | boolean; - toolbar?: string | (string | string[])[]; + toolbar?: string | (string | string[] | { name: string, items?: string[], groups?: string[] })[] | null; toolbarCanCollapse?: boolean; toolbarGroupCycling?: boolean; toolbarGroups?: (toolbarGroups | string)[]; @@ -847,14 +868,20 @@ declare namespace CKEDITOR { bottom?: string | HTMLElement; } + module skin { + var icons: { [name: string]: { path: string } }; + function addIcon(name: string, path: string, offset?: number, bgsize?: string): void; + } - interface style { - - } - - - interface editable { + class style { + constructor(something: { element: string, attributes: { [att: string]: string } }); + applyToRange(range: Range, editor: editor): void; + } + interface editable extends dom.element { + hasFocus: boolean; + attachListener(obj: event | editable, eventName: string, listenerFunction: (ei: eventInfo) => void, + scopeobj?: {}, listenerData?: any, priority?: number): listenerRegistration; } @@ -951,11 +978,14 @@ declare namespace CKEDITOR { destroy(widget: CKEDITOR.plugins.widget, offline?: boolean): void; destroyAll(offline?: boolean): void; finalizeCreation(container: any): void; + focused: widget; fire(eventName: string, data: Object, editor: editor): any; // should be boolean | Object getByElement(element: any, checkWrapperOnly: boolean): CKEDITOR.plugins.widget; hasListeners(eventName: string): boolean; - initOn(element: any, widgetDef?: CKEDITOR.plugins.widget.definition, startupData?: Object): CKEDITOR.plugins.widget; - initOnAll(container?: any): CKEDITOR.plugins.widget[]; + initOn(element: dom.element, widgetDef?: CKEDITOR.plugins.widget.definition, startupData?: Object): CKEDITOR.plugins.widget; + initOn(element: dom.element, widgetDef?: string, startupData?: Object): CKEDITOR.plugins.widget; + initOnAll(container?: dom.element): CKEDITOR.plugins.widget[]; + instances: { [id: string]: widget }; on(eventName: string, listenerFunction: Function, scopeObj?: Object, listenerData?: Object, priority?: number): any; once(): void; parseElementClasses(classes: string): any; @@ -1040,12 +1070,13 @@ declare namespace CKEDITOR { requires?: string | string[]; afterInit?(editor: editor): any; beforeInit?(editor: editor): any; - init?(editor: editor): any; + init?(editor: editor): void; onLoad?(): any; icons?: string; } - function add(name: string, definition?: IPluginDefinition): void; + function add(name: string, definition: IPluginDefinition): void; + function add(name: string): void; function addExternal(name: string, path: string, fileName: string): void; function get(name: string): any; function getFilePath(name: string): string; @@ -1058,6 +1089,7 @@ declare namespace CKEDITOR { interface IMenuItemDefinition { label:string, command:string, + icon: string group:string, order:number } @@ -1110,6 +1142,7 @@ declare namespace CKEDITOR { createFakeParserElement(realElement: Object, className: Object, realElementType: Object, isResizable: Object): void; createRange(): dom.range; destroy(noUpdate?: boolean): void; + editable(): editable | null; editable(elementOrEditable: dom.element): void; editable(elementOrEditable: editable): void; elementPath(startNode?: dom.node): dom.elementPath; @@ -1267,8 +1300,14 @@ declare namespace CKEDITOR { stop(): void; } + module filter { + interface allowedContentRules { + + } + } class filter { + allow(newRules: CKEDITOR.filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; } @@ -1309,8 +1348,8 @@ declare namespace CKEDITOR { fire(eventName: string, data?: Object, editor?: editor): any; fireOnce(eventName: string, data?: Object, editor?: editor): any; hasListeners(eventName: string): boolean; - on(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object, listenerData?: Object, priority?: number): void; - once(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object, listenerData?: Object, priority?: number): void; + on(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object | null, listenerData?: Object | null, priority?: number): listenerRegistration; + once(eventName: string, listenerFunction: (eventInfo: eventInfo) => void, scopeObj?: Object | null, listenerData?: Object | null, priority?: number): listenerRegistration; removeAllListeners(): void; removeListener(eventName: string, listenerFunction: (eventInfo: eventInfo) => void): void; static implementOn(targetObject: Object): void; @@ -1768,6 +1807,7 @@ declare namespace CKEDITOR { constructor(value: string); type: number; filter(filter: filter): boolean; + value: string; writeHtml(writer: basicWriter, filter: filter): void; } @@ -1779,6 +1819,7 @@ declare namespace CKEDITOR { children: any[]; type: number; add(node: node): number; + add(node: node, index: number): void; clone(): element; filter(filter: filter): boolean; filterChildren(filter: filter): void; @@ -1803,10 +1844,12 @@ declare namespace CKEDITOR { children: any[]; parent: any; type: number; - fromHtml(fragmentHtml: string, parent?: element, fixingBlock?: string): void; - fromHtml(fragmentHtml: string, parent?: string, fixingBlock?: string): void; - fromHtml(fragmentHtml: string, parent?: element, fixingBlock?: boolean): void; - fromHtml(fragmentHtml: string, parent?: string, fixingBlock?: boolean): void; + static fromHtml(fragmentHtml: string): fragment; + static fromHtml(fragmentHtml: string, parent?: element, fixingBlock?: string): fragment | element; + static fromHtml(fragmentHtml: string, parent: null, fixingBlock?: string): fragment; + static fromHtml(fragmentHtml: string, parent?: string, fixingBlock?: string): fragment | element; + static fromHtml(fragmentHtml: string, parent?: element, fixingBlock?: boolean): fragment | element; + static fromHtml(fragmentHtml: string, parent?: string, fixingBlock?: boolean): fragment | element; add(node: node, index?: number): void; filter(filter: filter): void; filterChildren(filter: filter, filterRoot?: boolean): void; @@ -1847,7 +1890,9 @@ declare namespace CKEDITOR { namespace tools { var callFunction: Function; - function enableHtml5Elements(doc: Object, withAppend? : Boolean) : void; + function enableHtml5Elements(doc: Object, withAppend?: Boolean): void; + function parseCssText(styleText: string, normalize?: Boolean, nativeNormalize?: Boolean): { [key: string]: string } + function writeCssText(style: { [key: string]: string }, sort?: Boolean): string; } diff --git a/types/ckeditor/tsconfig.json b/types/ckeditor/tsconfig.json index e845e96c0a..5d44d8a447 100644 --- a/types/ckeditor/tsconfig.json +++ b/types/ckeditor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clamp-js-main/tsconfig.json b/types/clamp-js-main/tsconfig.json index 5c05321afc..716247df25 100644 --- a/types/clamp-js-main/tsconfig.json +++ b/types/clamp-js-main/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "clamp-js-main-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/clamp-js/tsconfig.json b/types/clamp-js/tsconfig.json index d858957f4b..3df9b8641f 100644 --- a/types/clamp-js/tsconfig.json +++ b/types/clamp-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/classnames/tsconfig.json b/types/classnames/tsconfig.json index f9b03432fc..2e41facc15 100644 --- a/types/classnames/tsconfig.json +++ b/types/classnames/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cldrjs/tsconfig.json b/types/cldrjs/tsconfig.json index b17ea4c0a9..9ae399aafb 100644 --- a/types/cldrjs/tsconfig.json +++ b/types/cldrjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clean-css/tsconfig.json b/types/clean-css/tsconfig.json index fe65b21c11..0d5b17fb3b 100644 --- a/types/clean-css/tsconfig.json +++ b/types/clean-css/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clean-stack/tsconfig.json b/types/clean-stack/tsconfig.json index e1fa33ac6c..e4e4814fe9 100644 --- a/types/clean-stack/tsconfig.json +++ b/types/clean-stack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clean-webpack-plugin/tsconfig.json b/types/clean-webpack-plugin/tsconfig.json index 2f342b4d42..c53b713f88 100644 --- a/types/clean-webpack-plugin/tsconfig.json +++ b/types/clean-webpack-plugin/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "clean-webpack-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/clear-require/tsconfig.json b/types/clear-require/tsconfig.json index 538fbe385e..806bd7fc11 100644 --- a/types/clear-require/tsconfig.json +++ b/types/clear-require/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cleave.js/index.d.ts b/types/cleave.js/index.d.ts index 27fe7d8c41..eae6bc75b9 100644 --- a/types/cleave.js/index.d.ts +++ b/types/cleave.js/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for cleave.js 1.0 +// Type definitions for cleave.js 1.1 // Project: https://github.com/nosir/cleave.js -// Definitions by: C Lentfort , J Giancono +// Definitions by: C Lentfort , +// J Giancono , +// Alex Shakun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/cleave.js/react/index.d.ts b/types/cleave.js/react/index.d.ts index 6d40ea4ed5..1f50cbdbf3 100644 --- a/types/cleave.js/react/index.d.ts +++ b/types/cleave.js/react/index.d.ts @@ -6,6 +6,7 @@ type InitHandler = (owner: React.ReactInstance) => void; interface Props extends React.InputHTMLAttributes { onInit?: InitHandler; options: CleaveOptions; + htmlRef?: (i: any) => void; } declare var Cleave: React.ComponentClass; diff --git a/types/cleave.js/tsconfig.json b/types/cleave.js/tsconfig.json index 40e69541bc..40b7d000c9 100644 --- a/types/cleave.js/tsconfig.json +++ b/types/cleave.js/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ @@ -24,4 +25,4 @@ "options.d.ts", "react/index.d.ts" ] -} +} \ No newline at end of file diff --git a/types/cli-color/tsconfig.json b/types/cli-color/tsconfig.json index 4e8bceb94b..933f6db918 100644 --- a/types/cli-color/tsconfig.json +++ b/types/cli-color/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cli-spinner/tsconfig.json b/types/cli-spinner/tsconfig.json index 61c966becc..316be5cb01 100644 --- a/types/cli-spinner/tsconfig.json +++ b/types/cli-spinner/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cli-spinner-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cli-table2/tsconfig.json b/types/cli-table2/tsconfig.json index 4d5bea5b9d..40718ddc19 100644 --- a/types/cli-table2/tsconfig.json +++ b/types/cli-table2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cli/tsconfig.json b/types/cli/tsconfig.json index 2a1b78ae92..6713e9be0c 100644 --- a/types/cli/tsconfig.json +++ b/types/cli/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/client-sessions/tsconfig.json b/types/client-sessions/tsconfig.json index c1556587bc..07f4f1048c 100644 --- a/types/client-sessions/tsconfig.json +++ b/types/client-sessions/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cliff/tsconfig.json b/types/cliff/tsconfig.json index 8c59f5c533..3edd8ddc45 100644 --- a/types/cliff/tsconfig.json +++ b/types/cliff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clipboard-js/tsconfig.json b/types/clipboard-js/tsconfig.json index 8927797525..ed9c969743 100644 --- a/types/clipboard-js/tsconfig.json +++ b/types/clipboard-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clipboard/tsconfig.json b/types/clipboard/tsconfig.json index 5d960d2fd4..96e74d7bbc 100644 --- a/types/clipboard/tsconfig.json +++ b/types/clipboard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clipboardy/tsconfig.json b/types/clipboardy/tsconfig.json index 6d6bfcc76a..34c70f2c86 100644 --- a/types/clipboardy/tsconfig.json +++ b/types/clipboardy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clndr/tsconfig.json b/types/clndr/tsconfig.json index df25d1b075..9708a8b2b4 100644 --- a/types/clndr/tsconfig.json +++ b/types/clndr/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clockpicker/tsconfig.json b/types/clockpicker/tsconfig.json index 64b80a0278..61aa239cea 100644 --- a/types/clockpicker/tsconfig.json +++ b/types/clockpicker/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "clockpicker-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/clone/tsconfig.json b/types/clone/tsconfig.json index 65bd178331..024e8a97fa 100644 --- a/types/clone/tsconfig.json +++ b/types/clone/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/closure-compiler/tsconfig.json b/types/closure-compiler/tsconfig.json index 4a15360b18..5f78d4927e 100644 --- a/types/closure-compiler/tsconfig.json +++ b/types/closure-compiler/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cloud-env/tsconfig.json b/types/cloud-env/tsconfig.json index 0972bef4e5..bbdc4f5f5c 100644 --- a/types/cloud-env/tsconfig.json +++ b/types/cloud-env/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cloudflare-apps/tsconfig.json b/types/cloudflare-apps/tsconfig.json index b521ed0aca..0dcc8d43cd 100644 --- a/types/cloudflare-apps/tsconfig.json +++ b/types/cloudflare-apps/tsconfig.json @@ -20,6 +20,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "preserve" } } \ No newline at end of file diff --git a/types/cls-hooked/tsconfig.json b/types/cls-hooked/tsconfig.json index 2e4da612f6..55af57a7cd 100644 --- a/types/cls-hooked/tsconfig.json +++ b/types/cls-hooked/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/clusterize.js/tsconfig.json b/types/clusterize.js/tsconfig.json index 10ca5c2a1a..dd8e3e7899 100644 --- a/types/clusterize.js/tsconfig.json +++ b/types/clusterize.js/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "clusterize.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cmd-shim/tsconfig.json b/types/cmd-shim/tsconfig.json index 753e3b8c58..cb447abdcb 100644 --- a/types/cmd-shim/tsconfig.json +++ b/types/cmd-shim/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cmd-shim-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/co-body/co-body-tests.ts b/types/co-body/co-body-tests.ts index 944cadd394..0b15f2bcc5 100644 --- a/types/co-body/co-body-tests.ts +++ b/types/co-body/co-body-tests.ts @@ -1,5 +1,5 @@ -import * as koa from 'koa'; -import * as parse from 'co-body'; +import koa = require('koa'); +import parse = require('co-body'); var app = new koa(); diff --git a/types/co-body/tsconfig.json b/types/co-body/tsconfig.json index 295cfcd7cd..3c6c8ea708 100644 --- a/types/co-body/tsconfig.json +++ b/types/co-body/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/co-views/tsconfig.json b/types/co-views/tsconfig.json index 8b129766a5..388ba1bd29 100644 --- a/types/co-views/tsconfig.json +++ b/types/co-views/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/code/tsconfig.json b/types/code/tsconfig.json index ae86da199a..610eae1463 100644 --- a/types/code/tsconfig.json +++ b/types/code/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/codemirror/tsconfig.json b/types/codemirror/tsconfig.json index 2ff349d98e..fdf3bf2d28 100644 --- a/types/codemirror/tsconfig.json +++ b/types/codemirror/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/codependency/tsconfig.json b/types/codependency/tsconfig.json index 990aecea5d..f770e7ed61 100644 --- a/types/codependency/tsconfig.json +++ b/types/codependency/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/coffeeify/tsconfig.json b/types/coffeeify/tsconfig.json index 0ed14ee2f2..2ab8b32406 100644 --- a/types/coffeeify/tsconfig.json +++ b/types/coffeeify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/coinbase/tsconfig.json b/types/coinbase/tsconfig.json index 6f8b261d27..3732908a04 100644 --- a/types/coinbase/tsconfig.json +++ b/types/coinbase/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "coinbase-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/coinstring/tsconfig.json b/types/coinstring/tsconfig.json index 43ca980dbb..902dc00b80 100644 --- a/types/coinstring/tsconfig.json +++ b/types/coinstring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/collections/tsconfig.json b/types/collections/tsconfig.json index 466c5b12c4..2916e1a806 100644 --- a/types/collections/tsconfig.json +++ b/types/collections/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color-convert/tsconfig.json b/types/color-convert/tsconfig.json index 52c14017a1..3ce21ead77 100644 --- a/types/color-convert/tsconfig.json +++ b/types/color-convert/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color-name/tsconfig.json b/types/color-name/tsconfig.json index 56777b5a12..a88783ad70 100644 --- a/types/color-name/tsconfig.json +++ b/types/color-name/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "baseUrl": "../", "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "lib": [ "es6" ], diff --git a/types/color-string/tsconfig.json b/types/color-string/tsconfig.json index 27f7f9f5f1..a9ef4a043c 100644 --- a/types/color-string/tsconfig.json +++ b/types/color-string/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color/color-tests.ts b/types/color/color-tests.ts index 4e475a0ce0..ac79ea42e9 100644 --- a/types/color/color-tests.ts +++ b/types/color/color-tests.ts @@ -25,8 +25,8 @@ const yellow: number = color.yellow(); const black: number = color.black(); const luminosity: number = color.luminosity(); const contrast: number = color.contrast(colorOther); -const dark: boolean = color.dark(); -const light: boolean = color.light(); +const isDark: boolean = color.isDark(); +const isLight: boolean = color.isLight(); const level: string = color.level(colorOther); const x: number = color.x(); diff --git a/types/color/index.d.ts b/types/color/index.d.ts index 8290b78129..716b8a9dcf 100644 --- a/types/color/index.d.ts +++ b/types/color/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for color 2.0 +// Type definitions for color 3.0 // Project: https://github.com/qix-/color#readme -// Definitions by: Junyoung Clare Jang +// Definitions by: Junyoung Clare Jang , James W. Lane // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -72,8 +72,8 @@ interface Color { luminosity(): number; contrast(color2: Color): number; level(color2: Color): 'AAA' | 'AA' | ''; - dark(): boolean; - light(): boolean; + isDark(): boolean; + isLight(): boolean; negate(): Color; lighten(ratio: number): Color; darken(ratio: number): Color; diff --git a/types/color/tsconfig.json b/types/color/tsconfig.json index 0924b02ae0..2cd717e58a 100644 --- a/types/color/tsconfig.json +++ b/types/color/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color/v0/tsconfig.json b/types/color/v0/tsconfig.json index 73f49d6375..f73dc07711 100644 --- a/types/color/v0/tsconfig.json +++ b/types/color/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color/v1/tsconfig.json b/types/color/v1/tsconfig.json index 8d8204cf87..1e8e29f876 100644 --- a/types/color/v1/tsconfig.json +++ b/types/color/v1/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/color/v2/color-tests.ts b/types/color/v2/color-tests.ts new file mode 100644 index 0000000000..4e475a0ce0 --- /dev/null +++ b/types/color/v2/color-tests.ts @@ -0,0 +1,65 @@ +import Color = require('color'); + +const color: Color = new Color("white"); +const colorOther: Color = new Color("black"); +const colorRGB: Color = new Color({ r: 0, g: 0, b: 0 }, "rgb"); +const colorInt: Color = new Color(0x000000); +const colorWithoutNew: Color = Color(0x000000); +const colorByStaticMethod: Color = Color.rgb({ r: 0, g: 0, b: 0 }); + +const hex: string = color.hex(); +const percent: string = color.percentString(); +const keyword: string = color.keyword(); +const alpha: number = color.alpha(); +const red: number = color.red(); +const green: number = color.green(); +const blue: number = color.blue(); +const hue: number = color.hue(); +const saturationl: number = color.saturationl(); +const lightness: number = color.lightness(); +const saturationv: number = color.saturationv(); +const value: number = color.value(); +const cyan: number = color.cyan(); +const magenta: number = color.magenta(); +const yellow: number = color.yellow(); +const black: number = color.black(); +const luminosity: number = color.luminosity(); +const contrast: number = color.contrast(colorOther); +const dark: boolean = color.dark(); +const light: boolean = color.light(); +const level: string = color.level(colorOther); + +const x: number = color.x(); +const y: number = color.y(); +const z: number = color.z(); +const l: number = color.l(); +const a: number = color.a(); +const b: number = color.b(); +const rgbNumber: number = color.rgbNumber(); + +const chain: Color = color + .alpha(0) + .red(0) + .green(0) + .blue(0) + .hue(0) + .saturationl(0) + .lightness(0) + .saturationv(0) + .value(0) + .cyan(0) + .magenta(0) + .yellow(0) + .black(0) + .negate() + .lighten(0) + .darken(0) + .saturate(0) + .desaturate(0) + .grayscale() + .whiten(0) + .blacken(0) + .opaquer(0) + .rotate(0) + .mix(colorOther, 0) + .hsl(); diff --git a/types/color/v2/index.d.ts b/types/color/v2/index.d.ts new file mode 100644 index 0000000000..8290b78129 --- /dev/null +++ b/types/color/v2/index.d.ts @@ -0,0 +1,135 @@ +// Type definitions for color 2.0 +// Project: https://github.com/qix-/color#readme +// Definitions by: Junyoung Clare Jang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import convert = require('color-convert'); + +type ColorParam = Color | string | ArrayLike | number | { [key: string]: any }; + +interface Color { + toString(): string; + toJSON(): Color; + string(places?: number): string; + percentString(places?: number): string; + array(): number[]; + object(): { alpha?: number } & { [key: string]: number }; + unitArray(): number[]; + unitObject(): { r: number, g: number, b: number, alpha?: number }; + round(places?: number): Color; + alpha(): number; + alpha(val: number): Color; + red(): number; + red(val: number): Color; + green(): number; + green(val: number): Color; + blue(): number; + blue(val: number): Color; + hue(): number; + hue(val: number): Color; + saturationl(): number; + saturationl(val: number): Color; + lightness(): number; + lightness(val: number): Color; + saturationv(): number; + saturationv(val: number): Color; + value(): number; + value(val: number): Color; + chroma(): number; + chroma(val: number): Color; + gray(): number; + gray(val: number): Color; + white(): number; + white(val: number): Color; + wblack(): number; + wblack(val: number): Color; + cyan(): number; + cyan(val: number): Color; + magenta(): number; + magenta(val: number): Color; + yellow(): number; + yellow(val: number): Color; + black(): number; + black(val: number): Color; + x(): number; + x(val: number): Color; + y(): number; + y(val: number): Color; + z(): number; + z(val: number): Color; + l(): number; + l(val: number): Color; + a(): number; + a(val: number): Color; + b(): number; + b(val: number): Color; + keyword(): string; + keyword(val: string): Color; + hex(): string; + hex(val: string): Color; + rgbNumber(): number; + luminosity(): number; + contrast(color2: Color): number; + level(color2: Color): 'AAA' | 'AA' | ''; + dark(): boolean; + light(): boolean; + negate(): Color; + lighten(ratio: number): Color; + darken(ratio: number): Color; + saturate(ratio: number): Color; + desaturate(ratio: number): Color; + whiten(ratio: number): Color; + blacken(ratio: number): Color; + grayscale(): Color; + fade(ratio: number): Color; + opaquer(ratio: number): Color; + rotate(degrees: number): Color; + mix(mixinColor: Color, weight?: number): Color; + + rgb(...args: number[]): Color; + hsl(...args: number[]): Color; + hsv(...args: number[]): Color; + hwb(...args: number[]): Color; + cmyk(...args: number[]): Color; + xyz(...args: number[]): Color; + lab(...args: number[]): Color; + lch(...args: number[]): Color; + ansi16(...args: number[]): Color; + ansi256(...args: number[]): Color; + hcg(...args: number[]): Color; + apple(...args: number[]): Color; +} + +interface ColorConstructor { + (obj?: ColorParam, model?: keyof (typeof convert)): Color; + new(obj?: ColorParam, model?: keyof (typeof convert)): Color; + rgb(...val: number[]): Color; + rgb(color: ColorParam): Color; + hsl(...val: number[]): Color; + hsl(color: ColorParam): Color; + hsv(...val: number[]): Color; + hsv(color: ColorParam): Color; + hwb(...val: number[]): Color; + hwb(color: ColorParam): Color; + cmyk(...val: number[]): Color; + cmyk(color: ColorParam): Color; + xyz(...val: number[]): Color; + xyz(color: ColorParam): Color; + lab(...val: number[]): Color; + lab(color: ColorParam): Color; + lch(...val: number[]): Color; + lch(color: ColorParam): Color; + ansi16(...val: number[]): Color; + ansi16(color: ColorParam): Color; + ansi256(...val: number[]): Color; + ansi256(color: ColorParam): Color; + hcg(...val: number[]): Color; + hcg(color: ColorParam): Color; + apple(...val: number[]): Color; + apple(color: ColorParam): Color; +} + +declare const Color: ColorConstructor; + +export = Color; diff --git a/types/color/v2/tsconfig.json b/types/color/v2/tsconfig.json new file mode 100644 index 0000000000..fef027287c --- /dev/null +++ b/types/color/v2/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "color": [ + "color/v2" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "color-tests.ts" + ] +} \ No newline at end of file diff --git a/types/color/v2/tslint.json b/types/color/v2/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/color/v2/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/colorbrewer/tsconfig.json b/types/colorbrewer/tsconfig.json index 561a5d114e..da629b0ce4 100644 --- a/types/colorbrewer/tsconfig.json +++ b/types/colorbrewer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/colors/tsconfig.json b/types/colors/tsconfig.json index 99d78ad72d..7b92f3a446 100644 --- a/types/colors/tsconfig.json +++ b/types/colors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/com.darktalker.cordova.screenshot/tsconfig.json b/types/com.darktalker.cordova.screenshot/tsconfig.json index d2b5aabb00..80a6fbfe64 100644 --- a/types/com.darktalker.cordova.screenshot/tsconfig.json +++ b/types/com.darktalker.cordova.screenshot/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/combine-source-map/tsconfig.json b/types/combine-source-map/tsconfig.json index dfb725b738..0c89da9ae0 100644 --- a/types/combine-source-map/tsconfig.json +++ b/types/combine-source-map/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/combined-stream/combined-stream-tests.ts b/types/combined-stream/combined-stream-tests.ts index 776e530e63..ffdc0eaac7 100644 --- a/types/combined-stream/combined-stream-tests.ts +++ b/types/combined-stream/combined-stream-tests.ts @@ -1,4 +1,4 @@ -import * as CombinedStream from "combined-stream"; +import CombinedStream = require("combined-stream"); import { createReadStream, createWriteStream } from "fs"; const stream1 = new CombinedStream(); diff --git a/types/combined-stream/tsconfig.json b/types/combined-stream/tsconfig.json index bc69eb2505..6d88a54646 100644 --- a/types/combined-stream/tsconfig.json +++ b/types/combined-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/combokeys/tsconfig.json b/types/combokeys/tsconfig.json index b1fecec3b7..0c36d58c5a 100644 --- a/types/combokeys/tsconfig.json +++ b/types/combokeys/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cometd/tsconfig.json b/types/cometd/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/cometd/tsconfig.json +++ b/types/cometd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/command-line-args/tsconfig.json b/types/command-line-args/tsconfig.json index 92c02160ae..742434add7 100644 --- a/types/command-line-args/tsconfig.json +++ b/types/command-line-args/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/command-line-commands/tsconfig.json b/types/command-line-commands/tsconfig.json index fd8670e4a1..43a82ddc71 100644 --- a/types/command-line-commands/tsconfig.json +++ b/types/command-line-commands/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/commangular/tsconfig.json b/types/commangular/tsconfig.json index bd900bd300..f2d837d87a 100644 --- a/types/commangular/tsconfig.json +++ b/types/commangular/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/comment-json/comment-json-tests.ts b/types/comment-json/comment-json-tests.ts index af91ff422f..56aa8453fe 100644 --- a/types/comment-json/comment-json-tests.ts +++ b/types/comment-json/comment-json-tests.ts @@ -14,3 +14,11 @@ const result = commentJson.parse(` // comment at the bottom `); const str = commentJson.stringify(result); + +const numericallyIndexed = commentJson.stringify(result, (key, value) => { +return key && Number.isInteger(Number(key)) + ? value + : undefined; +}); + +const whiteListed = commentJson.stringify(result, ['a', 1]); diff --git a/types/comment-json/index.d.ts b/types/comment-json/index.d.ts index 9c2652f34e..0aad1934ff 100644 --- a/types/comment-json/index.d.ts +++ b/types/comment-json/index.d.ts @@ -4,5 +4,20 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export type Reviver = (k: number | string, v: any) => any; + +/** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param json A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * @param removes_comments If true, the comments won't be maintained, which is often used when we want to get a clean object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ export function parse(json: string, reviver?: Reviver, removes_comments?: boolean): any; -export function stringify(value: any, replacer?: any, space?: string | number): string; + +/** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results or an array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ +export function stringify(value: any, replacer?: ((key: string, value: any) => any) | Array | null, space?: string | number): string; diff --git a/types/comment-json/tsconfig.json b/types/comment-json/tsconfig.json index 0745d1cfc0..4512d870b9 100644 --- a/types/comment-json/tsconfig.json +++ b/types/comment-json/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/common-tags/tsconfig.json b/types/common-tags/tsconfig.json index 21158de285..84732128c2 100644 --- a/types/common-tags/tsconfig.json +++ b/types/common-tags/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/commonmark/tsconfig.json b/types/commonmark/tsconfig.json index 682d69fed4..f25b7b8e9d 100644 --- a/types/commonmark/tsconfig.json +++ b/types/commonmark/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compare-version/tsconfig.json b/types/compare-version/tsconfig.json index 5dcb7c3156..28e391540f 100644 --- a/types/compare-version/tsconfig.json +++ b/types/compare-version/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/complex/tsconfig.json b/types/complex/tsconfig.json index b8a54e716a..ec9be90750 100644 --- a/types/complex/tsconfig.json +++ b/types/complex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/component-emitter/tsconfig.json b/types/component-emitter/tsconfig.json index 71ded6be82..e6a5fec6c6 100644 --- a/types/component-emitter/tsconfig.json +++ b/types/component-emitter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compose-function/tsconfig.json b/types/compose-function/tsconfig.json index cdbf9e9709..8a4ad44fa7 100644 --- a/types/compose-function/tsconfig.json +++ b/types/compose-function/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compressible/tsconfig.json b/types/compressible/tsconfig.json index 8e036c88d9..c2ab1306cc 100644 --- a/types/compressible/tsconfig.json +++ b/types/compressible/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compression-webpack-plugin/tsconfig.json b/types/compression-webpack-plugin/tsconfig.json index b80c7a1977..1e166ce2bc 100644 --- a/types/compression-webpack-plugin/tsconfig.json +++ b/types/compression-webpack-plugin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compression/tsconfig.json b/types/compression/tsconfig.json index 63ff5e3bc8..c0102986f8 100644 --- a/types/compression/tsconfig.json +++ b/types/compression/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/compute-stdev/tsconfig.json b/types/compute-stdev/tsconfig.json index f622c386a3..aa0baf9c99 100644 --- a/types/compute-stdev/tsconfig.json +++ b/types/compute-stdev/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "compute-stdev-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/concat-stream/tsconfig.json b/types/concat-stream/tsconfig.json index 20373a2de3..0cba6d2e70 100644 --- a/types/concat-stream/tsconfig.json +++ b/types/concat-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/concaveman/tsconfig.json b/types/concaveman/tsconfig.json index 6312321a70..392fb91c60 100644 --- a/types/concaveman/tsconfig.json +++ b/types/concaveman/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/conf/index.d.ts b/types/conf/index.d.ts index 9f88a88355..e58dc3ede7 100644 --- a/types/conf/index.d.ts +++ b/types/conf/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for conf 1.1 +// Type definitions for conf 1.4 // Project: https://github.com/sindresorhus/conf // Definitions by: Sam Verschueren // BendingBender @@ -24,6 +24,7 @@ declare class Conf implements Iterable<[string, T]> { has(key: string): boolean; delete(key: string): void; clear(): void; + onDidChange(key: string, callback: (oldVal: any, newVal: any) => void): void; [Symbol.iterator](): Iterator<[string, T]>; } diff --git a/types/conf/tsconfig.json b/types/conf/tsconfig.json index 84d6bf7657..aa03ea90e1 100644 --- a/types/conf/tsconfig.json +++ b/types/conf/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/conf/v0/tsconfig.json b/types/conf/v0/tsconfig.json index 004bd4a1b5..8b4a8695b8 100644 --- a/types/conf/v0/tsconfig.json +++ b/types/conf/v0/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/confidence/tsconfig.json b/types/confidence/tsconfig.json index 8996cbd660..7504130a82 100644 --- a/types/confidence/tsconfig.json +++ b/types/confidence/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/config/index.d.ts b/types/config/index.d.ts index ea5e5a940a..a18e765012 100644 --- a/types/config/index.d.ts +++ b/types/config/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Roman Korneev // Forrest Bice // James Donald +// Alberto Vasquez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -39,6 +40,9 @@ declare namespace c { // Return the sources for the configurations getConfigSources(): IConfigSource[]; + + // Returns a new deep copy of the current config object, or any part of the config if provided. + toObject(config?: any): any; /** * This allows module developers to attach their configurations onto diff --git a/types/config/tsconfig.json b/types/config/tsconfig.json index a595ffb10c..2717a0380e 100644 --- a/types/config/tsconfig.json +++ b/types/config/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/configstore/tsconfig.json b/types/configstore/tsconfig.json index 8479846189..3401254406 100644 --- a/types/configstore/tsconfig.json +++ b/types/configstore/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/confit/tsconfig.json b/types/confit/tsconfig.json index 6d141ea715..ab805bf10d 100644 --- a/types/confit/tsconfig.json +++ b/types/confit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-busboy/connect-busboy-tests.ts b/types/connect-busboy/connect-busboy-tests.ts index 2bbb832070..2db8cd45d7 100644 --- a/types/connect-busboy/connect-busboy-tests.ts +++ b/types/connect-busboy/connect-busboy-tests.ts @@ -1,4 +1,4 @@ -import * as connectBusboy from 'connect-busboy'; +import connectBusboy = require('connect-busboy'); import * as express from 'express'; diff --git a/types/connect-busboy/tsconfig.json b/types/connect-busboy/tsconfig.json index 112c160f2b..cb2e739029 100644 --- a/types/connect-busboy/tsconfig.json +++ b/types/connect-busboy/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "connect-busboy-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/connect-ensure-login/tsconfig.json b/types/connect-ensure-login/tsconfig.json index 95f39e8bf0..7351d8357b 100644 --- a/types/connect-ensure-login/tsconfig.json +++ b/types/connect-ensure-login/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-flash/tsconfig.json b/types/connect-flash/tsconfig.json index 0d8c04c7de..fa58928986 100644 --- a/types/connect-flash/tsconfig.json +++ b/types/connect-flash/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-history-api-fallback/connect-history-api-fallback-tests.ts b/types/connect-history-api-fallback/connect-history-api-fallback-tests.ts index 6095d2fecb..dc53a3b86f 100644 --- a/types/connect-history-api-fallback/connect-history-api-fallback-tests.ts +++ b/types/connect-history-api-fallback/connect-history-api-fallback-tests.ts @@ -1,6 +1,5 @@ -import * as historyApiFallback from 'connect-history-api-fallback'; - -import * as express from "express"; +import historyApiFallback = require('connect-history-api-fallback'); +import express = require('express'); const app = express(); app.use(historyApiFallback()); diff --git a/types/connect-history-api-fallback/tsconfig.json b/types/connect-history-api-fallback/tsconfig.json index ad8919e94e..dff6edbdd1 100644 --- a/types/connect-history-api-fallback/tsconfig.json +++ b/types/connect-history-api-fallback/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-livereload/connect-livereload-tests.ts b/types/connect-livereload/connect-livereload-tests.ts index 26a09a2983..9049fa147c 100644 --- a/types/connect-livereload/connect-livereload-tests.ts +++ b/types/connect-livereload/connect-livereload-tests.ts @@ -1,6 +1,5 @@ - -import * as connect from "connect"; -import * as livereload from "connect-livereload"; +import connect = require("connect"); +import livereload = require("connect-livereload"); const app = connect(); @@ -28,13 +27,13 @@ app.use(livereload({ // include all urls by default include: [/.*/], - + // this function is used to determine if the content of `res.write` or `res.end` is html. html: function (str) { if (!str) return false; return /<[:_-\w\s\!\/\=\"\']+>/i.test(str); }, - + // rules are provided to find the place where the snippet should be inserted. // the main problem is that on the server side it can be tricky to determine if a string will be valid html on the client. // the function `fn` of the first `match` is executed like this `body.replace(rule.match, rule.fn);` @@ -49,13 +48,13 @@ app.use(livereload({ match: /<\!DOCTYPE.+?>/i, fn: append }], - + // port where the script is loaded port: 35729, - + // location where the script is provided (not by connect-livereload). Change this e.g. when serving livereload with a proxy. src: "http://localhost:35729/livereload.js?snipver=1", - + // Set this option to `true` to set `req.headers['accept-encoding']` to 'identity' (disabling compression) disableCompression: false })); diff --git a/types/connect-livereload/tsconfig.json b/types/connect-livereload/tsconfig.json index 599ea294bf..92d8c225c2 100644 --- a/types/connect-livereload/tsconfig.json +++ b/types/connect-livereload/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-modrewrite/tsconfig.json b/types/connect-modrewrite/tsconfig.json index 235df5d93e..be62ccb0d3 100644 --- a/types/connect-modrewrite/tsconfig.json +++ b/types/connect-modrewrite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-mongo/connect-mongo-tests.ts b/types/connect-mongo/connect-mongo-tests.ts index 67caed7c27..351975d84c 100644 --- a/types/connect-mongo/connect-mongo-tests.ts +++ b/types/connect-mongo/connect-mongo-tests.ts @@ -1,8 +1,7 @@ - -import * as express from 'express'; +import express = require('express'); import * as mongoose from 'mongoose'; -import * as session from 'express-session'; -import * as connectMongo from 'connect-mongo'; +import session = require('express-session'); +import connectMongo = require('connect-mongo'); import * as mongodb from 'mongodb'; var app = express(); diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json index ca12068b57..cb44c8c3ed 100644 --- a/types/connect-mongo/tsconfig.json +++ b/types/connect-mongo/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-pg-simple/connect-pg-simple-tests.ts b/types/connect-pg-simple/connect-pg-simple-tests.ts index 1e90c9b4e5..6f7d629a59 100644 --- a/types/connect-pg-simple/connect-pg-simple-tests.ts +++ b/types/connect-pg-simple/connect-pg-simple-tests.ts @@ -1,7 +1,7 @@ import connectPgSimple = require("connect-pg-simple"); -import * as session from "express-session"; +import session = require("express-session"); import * as pg from "pg"; -import * as express from "express"; +import express = require('express'); const pgSession = connectPgSimple(session); diff --git a/types/connect-pg-simple/tsconfig.json b/types/connect-pg-simple/tsconfig.json index ed22faf257..e2194628bc 100644 --- a/types/connect-pg-simple/tsconfig.json +++ b/types/connect-pg-simple/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-redis/connect-redis-tests.ts b/types/connect-redis/connect-redis-tests.ts index 11cd583a74..a312ffd3ca 100644 --- a/types/connect-redis/connect-redis-tests.ts +++ b/types/connect-redis/connect-redis-tests.ts @@ -1,5 +1,5 @@ -import * as connectRedis from "connect-redis"; -import * as session from "express-session"; +import connectRedis = require("connect-redis"); +import session = require("express-session"); let RedisStore = connectRedis(session); const store = new RedisStore({ diff --git a/types/connect-redis/tsconfig.json b/types/connect-redis/tsconfig.json index b47af7235d..69af94ebe8 100644 --- a/types/connect-redis/tsconfig.json +++ b/types/connect-redis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-slashes/tsconfig.json b/types/connect-slashes/tsconfig.json index 18eed04f1a..a07f0a4477 100644 --- a/types/connect-slashes/tsconfig.json +++ b/types/connect-slashes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect-timeout/connect-timeout-tests.ts b/types/connect-timeout/connect-timeout-tests.ts index aa93ea179e..31342d7491 100644 --- a/types/connect-timeout/connect-timeout-tests.ts +++ b/types/connect-timeout/connect-timeout-tests.ts @@ -1,9 +1,7 @@ - - -import * as express from "express"; -import * as timeout from "connect-timeout"; -import * as bodyParser from "body-parser"; -import * as cookieParser from "cookie-parser"; +import express = require("express"); +import timeout = require("connect-timeout"); +import bodyParser = require("body-parser"); +import cookieParser = require("cookie-parser"); // example of using this top-level; note the use of haltOnTimedout // after every middleware; it will stop the request flow on a timeout diff --git a/types/connect-timeout/tsconfig.json b/types/connect-timeout/tsconfig.json index 79082f279a..701d7beedf 100644 --- a/types/connect-timeout/tsconfig.json +++ b/types/connect-timeout/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/connect/connect-tests.ts b/types/connect/connect-tests.ts index 627017a7e4..5a7590a9a0 100644 --- a/types/connect/connect-tests.ts +++ b/types/connect/connect-tests.ts @@ -1,6 +1,5 @@ - import * as http from "http"; -import * as connect from "connect"; +import connect = require("connect"); const app = connect(); @@ -15,7 +14,7 @@ app.use((err: Error, req: http.IncomingMessage, res: http.ServerResponse, next: if (err) { return res.end(`Error: ${err}`); } - + next(); }); diff --git a/types/connect/tsconfig.json b/types/connect/tsconfig.json index bcd813bc77..9fdfae264f 100644 --- a/types/connect/tsconfig.json +++ b/types/connect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/console-stamp/tsconfig.json b/types/console-stamp/tsconfig.json index e4112e2035..c18c0edc84 100644 --- a/types/console-stamp/tsconfig.json +++ b/types/console-stamp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/consolidate/tsconfig.json b/types/consolidate/tsconfig.json index aab02b23e5..2ed641f4b3 100644 --- a/types/consolidate/tsconfig.json +++ b/types/consolidate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/consul/consul-tests.ts b/types/consul/consul-tests.ts index f749ef0a5d..988890766d 100644 --- a/types/consul/consul-tests.ts +++ b/types/consul/consul-tests.ts @@ -1,5 +1,4 @@ - -import * as Consul from "consul"; +import Consul = require("consul"); let ConsulStatic: Consul.ConsulStatic; let AclStatic: Consul.AclStatic = ConsulStatic.Acl; diff --git a/types/consul/tsconfig.json b/types/consul/tsconfig.json index 9401826c02..96142fb5d0 100644 --- a/types/consul/tsconfig.json +++ b/types/consul/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/content-disposition/tsconfig.json b/types/content-disposition/tsconfig.json index 25125c4ab6..b0c721f43f 100644 --- a/types/content-disposition/tsconfig.json +++ b/types/content-disposition/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/content-type/tsconfig.json b/types/content-type/tsconfig.json index 139851cbde..40c18138d3 100644 --- a/types/content-type/tsconfig.json +++ b/types/content-type/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/contentful-resolve-response/tsconfig.json b/types/contentful-resolve-response/tsconfig.json index f15c47db0a..09811fc7ba 100644 --- a/types/contentful-resolve-response/tsconfig.json +++ b/types/contentful-resolve-response/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/contextjs/tsconfig.json b/types/contextjs/tsconfig.json index 3054b8f3ca..ba45f1d91a 100644 --- a/types/contextjs/tsconfig.json +++ b/types/contextjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/continuation-local-storage/tsconfig.json b/types/continuation-local-storage/tsconfig.json index f1305a49af..7ff6d996f3 100644 --- a/types/continuation-local-storage/tsconfig.json +++ b/types/continuation-local-storage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/convert-hrtime/tsconfig.json b/types/convert-hrtime/tsconfig.json index 9d2b304763..8ca78a7377 100644 --- a/types/convert-hrtime/tsconfig.json +++ b/types/convert-hrtime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/convert-layout/tsconfig.json b/types/convert-layout/tsconfig.json index e9ef959215..4dda95576b 100644 --- a/types/convert-layout/tsconfig.json +++ b/types/convert-layout/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/convert-source-map/tsconfig.json b/types/convert-source-map/tsconfig.json index a9125c586c..e7fb07ca0c 100644 --- a/types/convert-source-map/tsconfig.json +++ b/types/convert-source-map/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/convict/tsconfig.json b/types/convict/tsconfig.json index 75e1402283..7177956370 100644 --- a/types/convict/tsconfig.json +++ b/types/convict/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookie-parser/tsconfig.json b/types/cookie-parser/tsconfig.json index 20cf8359b5..a182eeaaa3 100644 --- a/types/cookie-parser/tsconfig.json +++ b/types/cookie-parser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookie-session/tsconfig.json b/types/cookie-session/tsconfig.json index bacf93c9f4..a046c14075 100644 --- a/types/cookie-session/tsconfig.json +++ b/types/cookie-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookie-signature/tsconfig.json b/types/cookie-signature/tsconfig.json index 38aab055c7..04c9a9bc73 100644 --- a/types/cookie-signature/tsconfig.json +++ b/types/cookie-signature/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookie/tsconfig.json b/types/cookie/tsconfig.json index f1a68c4f57..2c101fadf8 100644 --- a/types/cookie/tsconfig.json +++ b/types/cookie/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookie_js/tsconfig.json b/types/cookie_js/tsconfig.json index d181ce7661..cfb0fd4eb8 100644 --- a/types/cookie_js/tsconfig.json +++ b/types/cookie_js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cookies/cookies-tests.ts b/types/cookies/cookies-tests.ts index 2f78f8ad49..cd46e0987b 100644 --- a/types/cookies/cookies-tests.ts +++ b/types/cookies/cookies-tests.ts @@ -1,8 +1,8 @@ -import * as Cookies from 'cookies'; +import Cookies = require('cookies'); import * as http from 'http'; -import * as Keygrip from 'keygrip'; -import * as express from 'express'; -import * as connect from 'connect'; +import Keygrip = require('keygrip'); +import express = require('express'); +import connect = require('connect'); const server = http.createServer((req, res) => { const cookies = new Cookies(req, res); diff --git a/types/cookies/tsconfig.json b/types/cookies/tsconfig.json index d7a17c23bc..6cbd9c2cff 100644 --- a/types/cookies/tsconfig.json +++ b/types/cookies/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/copy-paste/tsconfig.json b/types/copy-paste/tsconfig.json index 7c78f81542..ae30962d67 100644 --- a/types/copy-paste/tsconfig.json +++ b/types/copy-paste/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/copy-text-to-clipboard/tsconfig.json b/types/copy-text-to-clipboard/tsconfig.json index 2889d9fdc6..a04fdc0b8e 100644 --- a/types/copy-text-to-clipboard/tsconfig.json +++ b/types/copy-text-to-clipboard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/copy-webpack-plugin/copy-webpack-plugin-tests.ts b/types/copy-webpack-plugin/copy-webpack-plugin-tests.ts index 022a734261..b58b242fc2 100644 --- a/types/copy-webpack-plugin/copy-webpack-plugin-tests.ts +++ b/types/copy-webpack-plugin/copy-webpack-plugin-tests.ts @@ -1,27 +1,27 @@ import { Configuration } from 'webpack' -import * as CopyWebpackPlugin from 'copy-webpack-plugin' +import CopyWebpackPlugin = require('copy-webpack-plugin'); const c: Configuration = { plugins: [ new CopyWebpackPlugin([ // {output}/file.txt { from: 'from/file.txt' }, - + // {output}/to/file.txt { from: 'from/file.txt', to: 'to/file.txt' }, - + // {output}/to/directory/file.txt { from: 'from/file.txt', to: 'to/directory' }, - + // Copy directory contents to {output}/ { from: 'from/directory' }, - + // Copy directory contents to {output}/to/directory/ { from: 'from/directory', to: 'to/directory' }, - + // Copy glob results to /absolute/path/ { from: 'from/directory/**/*', to: '/absolute/path' }, - + // Copy glob results (with dot files) to /absolute/path/ { from: { @@ -30,21 +30,21 @@ const c: Configuration = { }, to: '/absolute/path' }, - + // Copy glob results, relative to context { context: 'from/directory', from: '**/*', to: '/absolute/path' }, - + // {output}/file/without/extension { from: 'path/to/file.txt', to: 'file/without/extension', toType: 'file' }, - + // {output}/directory/with/extension.ext/file.txt { from: 'path/to/file.txt', @@ -53,16 +53,16 @@ const c: Configuration = { }, ], { ignore: [ - // Doesn't copy any files with a txt extension + // Doesn't copy any files with a txt extension '*.txt', - + // Doesn't copy any file, even if they start with a dot '**/*', - + // Doesn't copy any file, except if they start with a dot { glob: '**/*', dot: false } ], - + // By default, we only copy modified files during // a watch or webpack-dev-server build. Setting this // to `true` copies all files. diff --git a/types/copy-webpack-plugin/tsconfig.json b/types/copy-webpack-plugin/tsconfig.json index 026508651e..8bb618a386 100644 --- a/types/copy-webpack-plugin/tsconfig.json +++ b/types/copy-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-ionic/tsconfig.json b/types/cordova-ionic/tsconfig.json index 52153dc3a6..67164add65 100644 --- a/types/cordova-ionic/tsconfig.json +++ b/types/cordova-ionic/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-app-version/tsconfig.json b/types/cordova-plugin-app-version/tsconfig.json index bf9fa4b727..22d3a48e1d 100644 --- a/types/cordova-plugin-app-version/tsconfig.json +++ b/types/cordova-plugin-app-version/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-background-mode/tsconfig.json b/types/cordova-plugin-background-mode/tsconfig.json index 2f4b1be013..9a2df069f6 100644 --- a/types/cordova-plugin-background-mode/tsconfig.json +++ b/types/cordova-plugin-background-mode/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-badge/tsconfig.json b/types/cordova-plugin-badge/tsconfig.json index 1354c708fd..8fd3f33576 100644 --- a/types/cordova-plugin-badge/tsconfig.json +++ b/types/cordova-plugin-badge/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-ble-central/tsconfig.json b/types/cordova-plugin-ble-central/tsconfig.json index 84cd1205c3..3c31e21f9e 100644 --- a/types/cordova-plugin-ble-central/tsconfig.json +++ b/types/cordova-plugin-ble-central/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-canvascamera/tsconfig.json b/types/cordova-plugin-canvascamera/tsconfig.json index dcc6bf63a2..487b814e24 100644 --- a/types/cordova-plugin-canvascamera/tsconfig.json +++ b/types/cordova-plugin-canvascamera/tsconfig.json @@ -11,6 +11,7 @@ "strictFunctionTypes": true, "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/cordova-plugin-device-name/tsconfig.json b/types/cordova-plugin-device-name/tsconfig.json index c74e58b914..a1c3a4bf29 100644 --- a/types/cordova-plugin-device-name/tsconfig.json +++ b/types/cordova-plugin-device-name/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-email-composer/tsconfig.json b/types/cordova-plugin-email-composer/tsconfig.json index 9de9930ed1..44cd31aecf 100644 --- a/types/cordova-plugin-email-composer/tsconfig.json +++ b/types/cordova-plugin-email-composer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-file-opener2/tsconfig.json b/types/cordova-plugin-file-opener2/tsconfig.json index 0b84dfe84e..25d0779575 100644 --- a/types/cordova-plugin-file-opener2/tsconfig.json +++ b/types/cordova-plugin-file-opener2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-ibeacon/tsconfig.json b/types/cordova-plugin-ibeacon/tsconfig.json index ba0aa9b7cf..b5423bd3ce 100644 --- a/types/cordova-plugin-ibeacon/tsconfig.json +++ b/types/cordova-plugin-ibeacon/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-insomnia/tsconfig.json b/types/cordova-plugin-insomnia/tsconfig.json index 9704e7c020..63dbb10719 100644 --- a/types/cordova-plugin-insomnia/tsconfig.json +++ b/types/cordova-plugin-insomnia/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-keyboard/tsconfig.json b/types/cordova-plugin-keyboard/tsconfig.json index 730b84c530..dd15c4b9c0 100644 --- a/types/cordova-plugin-keyboard/tsconfig.json +++ b/types/cordova-plugin-keyboard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-mapsforge/tsconfig.json b/types/cordova-plugin-mapsforge/tsconfig.json index 2be513a0d3..589214939d 100644 --- a/types/cordova-plugin-mapsforge/tsconfig.json +++ b/types/cordova-plugin-mapsforge/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-ms-adal/tsconfig.json b/types/cordova-plugin-ms-adal/tsconfig.json index 9ebb3fca10..c49b79dbbc 100644 --- a/types/cordova-plugin-ms-adal/tsconfig.json +++ b/types/cordova-plugin-ms-adal/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-native-keyboard/tsconfig.json b/types/cordova-plugin-native-keyboard/tsconfig.json index 72ec2f6371..7d6b7d30ab 100644 --- a/types/cordova-plugin-native-keyboard/tsconfig.json +++ b/types/cordova-plugin-native-keyboard/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-ouralabs/tsconfig.json b/types/cordova-plugin-ouralabs/tsconfig.json index 2cbd8ea053..4a333de1ae 100644 --- a/types/cordova-plugin-ouralabs/tsconfig.json +++ b/types/cordova-plugin-ouralabs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-qrscanner/tsconfig.json b/types/cordova-plugin-qrscanner/tsconfig.json index e2ef38fa17..729bd22650 100644 --- a/types/cordova-plugin-qrscanner/tsconfig.json +++ b/types/cordova-plugin-qrscanner/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-spinner/tsconfig.json b/types/cordova-plugin-spinner/tsconfig.json index 19ec9b294f..4beead8631 100644 --- a/types/cordova-plugin-spinner/tsconfig.json +++ b/types/cordova-plugin-spinner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-websql/tsconfig.json b/types/cordova-plugin-websql/tsconfig.json index db8d59bbe6..35d55b1bcb 100644 --- a/types/cordova-plugin-websql/tsconfig.json +++ b/types/cordova-plugin-websql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-plugin-x-socialsharing/tsconfig.json b/types/cordova-plugin-x-socialsharing/tsconfig.json index e2c4bc63d9..d5ae67f587 100644 --- a/types/cordova-plugin-x-socialsharing/tsconfig.json +++ b/types/cordova-plugin-x-socialsharing/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-sqlite-storage/tsconfig.json b/types/cordova-sqlite-storage/tsconfig.json index a9eb2af0ad..1cd9548087 100644 --- a/types/cordova-sqlite-storage/tsconfig.json +++ b/types/cordova-sqlite-storage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova-universal-links-plugin/tsconfig.json b/types/cordova-universal-links-plugin/tsconfig.json index 69322a9265..29ccaf6d57 100644 --- a/types/cordova-universal-links-plugin/tsconfig.json +++ b/types/cordova-universal-links-plugin/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cordova-universal-links-plugin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cordova/tsconfig.json b/types/cordova/tsconfig.json index 591c25a1bb..11e7c87397 100644 --- a/types/cordova/tsconfig.json +++ b/types/cordova/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordova_app_version_plugin/tsconfig.json b/types/cordova_app_version_plugin/tsconfig.json index 2f439d4979..c0f2279ce6 100644 --- a/types/cordova_app_version_plugin/tsconfig.json +++ b/types/cordova_app_version_plugin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cordovarduino/tsconfig.json b/types/cordovarduino/tsconfig.json index cb0cf33a1a..bfd40c8cee 100644 --- a/types/cordovarduino/tsconfig.json +++ b/types/cordovarduino/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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[]; diff --git a/types/core-js/tsconfig.json b/types/core-js/tsconfig.json index a342d6c1bd..ce3411f183 100644 --- a/types/core-js/tsconfig.json +++ b/types/core-js/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cors/tsconfig.json b/types/cors/tsconfig.json index e9e1db77eb..c0a8ce0c52 100644 --- a/types/cors/tsconfig.json +++ b/types/cors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cote/tsconfig.json b/types/cote/tsconfig.json index c25e78e090..4790b11aa5 100644 --- a/types/cote/tsconfig.json +++ b/types/cote/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/couchbase/tsconfig.json b/types/couchbase/tsconfig.json index 66ef360c2c..cf19e79d12 100644 --- a/types/couchbase/tsconfig.json +++ b/types/couchbase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/countdown/tsconfig.json b/types/countdown/tsconfig.json index bf1074d820..21aa002443 100644 --- a/types/countdown/tsconfig.json +++ b/types/countdown/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/counterpart/tsconfig.json b/types/counterpart/tsconfig.json index 1a771cd73c..9a07a722df 100644 --- a/types/counterpart/tsconfig.json +++ b/types/counterpart/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/countries-and-timezones/tsconfig.json b/types/countries-and-timezones/tsconfig.json index e5f7728b57..ef7c8d2eb0 100644 --- a/types/countries-and-timezones/tsconfig.json +++ b/types/countries-and-timezones/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/country-list/tsconfig.json b/types/country-list/tsconfig.json index 30433764bf..12c80648b7 100644 --- a/types/country-list/tsconfig.json +++ b/types/country-list/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/country-select-js/tsconfig.json b/types/country-select-js/tsconfig.json index 56cb852a6d..a7bf843a06 100644 --- a/types/country-select-js/tsconfig.json +++ b/types/country-select-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/coverup/tsconfig.json b/types/coverup/tsconfig.json index 6102ad61b3..fbef238950 100644 --- a/types/coverup/tsconfig.json +++ b/types/coverup/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "coverup-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cp-file/tsconfig.json b/types/cp-file/tsconfig.json index 12138d0002..e91ced1737 100644 --- a/types/cp-file/tsconfig.json +++ b/types/cp-file/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cpx/tsconfig.json b/types/cpx/tsconfig.json index d22546d432..8001a3fdea 100644 --- a/types/cpx/tsconfig.json +++ b/types/cpx/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cpx-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cpy/tsconfig.json b/types/cpy/tsconfig.json index 90098461b2..f7a536d8b5 100644 --- a/types/cpy/tsconfig.json +++ b/types/cpy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cqrs-domain/tsconfig.json b/types/cqrs-domain/tsconfig.json index 7ea1caa8ec..8a2e98724d 100644 --- a/types/cqrs-domain/tsconfig.json +++ b/types/cqrs-domain/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "cqrs-domain-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/cradle/tsconfig.json b/types/cradle/tsconfig.json index 694d713edf..ea956b2e2f 100644 --- a/types/cradle/tsconfig.json +++ b/types/cradle/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/crc/tsconfig.json b/types/crc/tsconfig.json index 96511b6609..2b2be4c34d 100644 --- a/types/crc/tsconfig.json +++ b/types/crc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/create-error/tsconfig.json b/types/create-error/tsconfig.json index 7ff8a82807..c5351c2e5a 100644 --- a/types/create-error/tsconfig.json +++ b/types/create-error/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/create-react-class/create-react-class-tests.ts b/types/create-react-class/create-react-class-tests.ts index c3f7c620ef..b8025b23f0 100644 --- a/types/create-react-class/create-react-class-tests.ts +++ b/types/create-react-class/create-react-class-tests.ts @@ -1,7 +1,7 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; import * as DOM from "react-dom-factories"; -import * as createReactClass from "create-react-class"; +import createReactClass = require("create-react-class"); interface Props { foo: string; @@ -73,6 +73,12 @@ const ClassicComponent: React.ClassicComponentClass = createReactClass = React.createFactory(ClassicComponent); @@ -81,6 +87,7 @@ const classicFactoryElement: React.ClassicElement = // React.createElement const classicElement: React.ClassicElement = React.createElement(ClassicComponent, props); +const classicElementNullProps: React.ClassicElement<{}> = React.createElement(ClassicComponentNoProps, null); // React.cloneElement const clonedClassicElement: React.ClassicElement = diff --git a/types/create-react-class/tsconfig.json b/types/create-react-class/tsconfig.json index b003c69e53..71314e3d35 100644 --- a/types/create-react-class/tsconfig.json +++ b/types/create-react-class/tsconfig.json @@ -16,10 +16,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "preserve" }, "files": [ "index.d.ts", "create-react-class-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/createjs-lib/tsconfig.json b/types/createjs-lib/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/createjs-lib/tsconfig.json +++ b/types/createjs-lib/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/createjs/tsconfig.json b/types/createjs/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/createjs/tsconfig.json +++ b/types/createjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/credential/tsconfig.json b/types/credential/tsconfig.json index fb8e758820..f2866ca2d6 100644 --- a/types/credential/tsconfig.json +++ b/types/credential/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/credit-card-type/tsconfig.json b/types/credit-card-type/tsconfig.json index 0a3b957a29..9af8700b89 100644 --- a/types/credit-card-type/tsconfig.json +++ b/types/credit-card-type/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cron/tsconfig.json b/types/cron/tsconfig.json index 19a72853db..ce814daac4 100644 --- a/types/cron/tsconfig.json +++ b/types/cron/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cropperjs/index.d.ts b/types/cropperjs/index.d.ts index cca1d6a39b..60b508dd8f 100644 --- a/types/cropperjs/index.d.ts +++ b/types/cropperjs/index.d.ts @@ -488,6 +488,21 @@ declare class cropperjs { */ rotateTo(degree: number): void; + /** + * Scale the image. + */ + scale(scaleX: number, scaleY?: number): void; + + /** + * Scale the abscissa of the image. + */ + scaleX(scaleX: number): void; + + /** + * Scale the ordinate of the image. + */ + scaleY(scaleY: number): void; + /** * Clear the crop box. */ diff --git a/types/cropperjs/tsconfig.json b/types/cropperjs/tsconfig.json index ea6b7edb26..928c16ebf8 100644 --- a/types/cropperjs/tsconfig.json +++ b/types/cropperjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/croppie/tsconfig.json b/types/croppie/tsconfig.json index aa4a07017d..f0bbbaaad6 100644 --- a/types/croppie/tsconfig.json +++ b/types/croppie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cross-spawn/cross-spawn-tests.ts b/types/cross-spawn/cross-spawn-tests.ts new file mode 100644 index 0000000000..6cb36510d8 --- /dev/null +++ b/types/cross-spawn/cross-spawn-tests.ts @@ -0,0 +1,20 @@ +import spawn = require('cross-spawn'); +import * as cp from 'child_process'; + +const p1: cp.ChildProcess = spawn('my-cmd', ['foo', 'bar']); +const pw: cp.ChildProcess = spawn('my-cmd', ['foo', 'bar'], {env: process.env}); + +pw.on('error', (err: Error) => { + console.log(err); +}); + +const r1: Error = spawn.sync('foo').error; +const r2: string[] = spawn.sync('foo').output; +const r3: Buffer = spawn.sync('foo').stdout; +const r4: Buffer = spawn.sync('foo').stderr; +const r5: number = spawn.sync('foo').status; +const r6: string = spawn.sync('foo').signal; +const r7: string = spawn.sync('foo', {encoding: 'utf8'}).stdout; + +spawn.sync('foo', ['bar']); +spawn.sync('foo', ['bar'], {stdio: 'inherit'}); diff --git a/types/cross-spawn/index.d.ts b/types/cross-spawn/index.d.ts new file mode 100644 index 0000000000..8544b37528 --- /dev/null +++ b/types/cross-spawn/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for cross-spawn 6.0 +// Project: https://github.com/moxystudio/node-cross-spawn +// Definitions by: Alorel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as child_process from 'child_process'; + +declare function spawn(command: string, args?: string[], options?: child_process.SpawnOptions): child_process.ChildProcess; + +declare namespace spawn { + const sync: typeof child_process.spawnSync; +} + +export = spawn; diff --git a/types/cross-spawn/tsconfig.json b/types/cross-spawn/tsconfig.json new file mode 100644 index 0000000000..6e4bd2b252 --- /dev/null +++ b/types/cross-spawn/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "cross-spawn-tests.ts" + ] +} \ No newline at end of file diff --git a/types/cross-spawn/tslint.json b/types/cross-spawn/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cross-spawn/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cross-storage/tsconfig.json b/types/cross-storage/tsconfig.json index eb05417639..dc6b6a3c54 100644 --- a/types/cross-storage/tsconfig.json +++ b/types/cross-storage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/crossfilter/tsconfig.json b/types/crossfilter/tsconfig.json index bc0573220f..8a107d0e84 100644 --- a/types/crossfilter/tsconfig.json +++ b/types/crossfilter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/crossroads/tsconfig.json b/types/crossroads/tsconfig.json index b948857129..e1bb7591ed 100644 --- a/types/crossroads/tsconfig.json +++ b/types/crossroads/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cryptiles/tsconfig.json b/types/cryptiles/tsconfig.json index 6ae78bacb4..5309e478b8 100644 --- a/types/cryptiles/tsconfig.json +++ b/types/cryptiles/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/crypto-js/tsconfig.json b/types/crypto-js/tsconfig.json index 62ec3d1e40..04f4de4b4e 100644 --- a/types/crypto-js/tsconfig.json +++ b/types/crypto-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cryptojs/tsconfig.json b/types/cryptojs/tsconfig.json index 6747ffb9c5..63a696b449 100644 --- a/types/cryptojs/tsconfig.json +++ b/types/cryptojs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cson/tsconfig.json b/types/cson/tsconfig.json index a5ca0a8041..b7012ed2ba 100644 --- a/types/cson/tsconfig.json +++ b/types/cson/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/csprng/tsconfig.json b/types/csprng/tsconfig.json index b921bb3b7c..20e30e0d3c 100644 --- a/types/csprng/tsconfig.json +++ b/types/csprng/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/csrf/tsconfig.json b/types/csrf/tsconfig.json index 423d71f3c2..57efe7e073 100644 --- a/types/csrf/tsconfig.json +++ b/types/csrf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/css-font-loading-module/tsconfig.json b/types/css-font-loading-module/tsconfig.json index b45d115596..2c64ee6074 100644 --- a/types/css-font-loading-module/tsconfig.json +++ b/types/css-font-loading-module/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/css-modules-require-hook/tsconfig.json b/types/css-modules-require-hook/tsconfig.json index e7f91df2f8..269853fbce 100644 --- a/types/css-modules-require-hook/tsconfig.json +++ b/types/css-modules-require-hook/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/css-modules/tsconfig.json b/types/css-modules/tsconfig.json index e079616b1d..c6294d2857 100644 --- a/types/css-modules/tsconfig.json +++ b/types/css-modules/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/css/tsconfig.json b/types/css/tsconfig.json index 7a69ddb612..50451f88d4 100644 --- a/types/css/tsconfig.json +++ b/types/css/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cssbeautify/tsconfig.json b/types/cssbeautify/tsconfig.json index a8c452dc97..627f481a2b 100644 --- a/types/cssbeautify/tsconfig.json +++ b/types/cssbeautify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/csurf/tsconfig.json b/types/csurf/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/csurf/tsconfig.json +++ b/types/csurf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/csv-parse/tsconfig.json b/types/csv-parse/tsconfig.json index 2b52f434a2..fe155d7602 100644 --- a/types/csv-parse/tsconfig.json +++ b/types/csv-parse/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/csv-stringify/tsconfig.json b/types/csv-stringify/tsconfig.json index 766e9c084e..8c66a29cda 100644 --- a/types/csv-stringify/tsconfig.json +++ b/types/csv-stringify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/csvrow/tsconfig.json b/types/csvrow/tsconfig.json index 7fc1637725..76cb98cf19 100644 --- a/types/csvrow/tsconfig.json +++ b/types/csvrow/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "strictFunctionTypes" : true + "esModuleInterop": true, + "strictFunctionTypes": true }, "files": [ "index.d.ts", "csvrow-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/csvtojson/tsconfig.json b/types/csvtojson/tsconfig.json index 91b15a3856..3dde8e70e7 100644 --- a/types/csvtojson/tsconfig.json +++ b/types/csvtojson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cucumber/cucumber-tests.ts b/types/cucumber/cucumber-tests.ts index f2aed9aec4..b7fa675095 100644 --- a/types/cucumber/cucumber-tests.ts +++ b/types/cucumber/cucumber-tests.ts @@ -1,6 +1,12 @@ import * as assert from "power-assert"; +import { setWorldConstructor, defineParameterType, After, AfterAll, Before, BeforeAll, Given, When, Then } from "cucumber"; import cucumber = require("cucumber"); +type Callback = cucumber.CallbackStepDefinition; +type Table = cucumber.TableDefinition; +type HookScenarioResult = cucumber.HookScenarioResult; +const Status = cucumber.Status; + // You can optionally declare your own world properties declare module "cucumber" { interface World { @@ -8,190 +14,166 @@ declare module "cucumber" { } } -function StepSample() { - type Callback = cucumber.CallbackStepDefinition; - type Table = cucumber.TableDefinition; - type HookScenarioResult = cucumber.HookScenarioResult; - const Status = cucumber.Status; - - cucumber.defineSupportCode(({setWorldConstructor, defineParameterType, After, AfterAll, Around, Before, BeforeAll, registerHandler, Given, When, Then}) => { - setWorldConstructor(function({attach, parameters}) { - this.attach = attach; - this.parameters = parameters; - this.visit = (url: string, callback: Callback) => { - callback(null, 'pending'); - }; - }); - - Before((scenarioResult: HookScenarioResult, callback: Callback) => { - console.log(scenarioResult.result.status === Status.FAILED); - callback(); - }); - - Before({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { - console.log(scenarioResult.result.status === Status.FAILED); - callback(); - }); - - Before('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { - console.log(scenarioResult.result.status === Status.FAILED); - callback(); - }); - - BeforeAll((callback: Callback) => { - console.log("Before all"); - callback(); - }); - - BeforeAll({ timeout: 1000 }, (callback: Callback) => { - console.log("Before all"); - callback(); - }); - - BeforeAll('@tag', (callback: Callback) => { - console.log("Before all"); - callback(); - }); - - Around((scenarioResult: HookScenarioResult, runScenario: (error: string | null, callback?: () => void) => void) => { - if (scenarioResult.result.status === Status.FAILED) { - runScenario(null, () => { - console.log('finish tasks'); - }); - } - }); - - After((scenarioResult: HookScenarioResult, callback: Callback) => { - console.log("After"); - callback(); - }); - - After({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { - console.log("After"); - callback(); - }); - - After('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { - console.log("After"); - callback(); - }); - - AfterAll((callback: Callback) => { - console.log("After all"); - callback(); - }); - - AfterAll({ timeout: 1000 }, (callback: Callback) => { - console.log("After all"); - callback(); - }); - - AfterAll('@tag', (callback: Callback) => { - console.log("After all"); - callback(); - }); - - registerHandler('AfterFeatures', (event: any, callback: () => void) => { - callback(); - }); - - Given(/^a variable set to (\d+)$/, (x: string) => { - console.log("the number is: " + x); - }); - - Given(/^a variable set to (\d+)$/, (x: number) => { - console.log(typeof x); - }); - - Given(/^I am on the Cucumber.js GitHub repository$/, function(callback: Callback) { - this.visit('https://github.com/cucumber/cucumber-js', callback); - }); - - When(/^I go to the README file$/, (title: string, callback: Callback) => { +function StepSampleWithoutDefineSupportCode() { + setWorldConstructor(function({attach, parameters}) { + this.attach = attach; + this.parameters = parameters; + this.visit = (url: string, callback: Callback) => { callback(null, 'pending'); - }); - - Then(/^I should see "(.*)" as the page title$/, {timeout: 60 * 1000}, function(title: string, callback: Callback) { - const pageTitle = this.browser.text('title'); - - if (title === pageTitle) { - callback(); - } else { - callback(new Error("Expected to be on page with title " + title)); - } - }); - - // Type for data_table.js on - // https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js - - Given(/^a table step with Table raw$/, (table: Table) => { - const expected = [ - ['Cucumber', 'Cucumis sativus'], - ['Burr Gherkin', 'Cucumis anguria'] - ]; - const actual: string[][] = table.raw(); - assert.deepEqual(actual, expected); - }); - - Given(/^a table step with Table rows$/, (table: Table) => { - const expected = [ - ['Apricot', '5'], - ['Brocolli', '2'], - ['Cucumber', '10'] - ]; - const actual: string[][] = table.rows(); - assert.deepEqual(actual, expected); - }); - - Given(/^a table step with Table rowHash$/, (table: Table) => { - const expected = { - Cucumber: 'Cucumis sativus', - 'Burr Gherkin': 'Cucumis anguria' - }; - const actual: { [firstCol: string]: string } = table.rowsHash(); - assert.deepEqual(actual, expected); - }); - - Given(/^a table step$/, (table: Table) => { - const expected = [ - {Vegetable: 'Apricot', Rating: '5'}, - {Vegetable: 'Brocolli', Rating: '2'}, - {Vegetable: 'Cucumber', Rating: '10'} - ]; - const actual: Array<{ [colName: string]: string }> = table.hashes(); - assert.deepEqual(actual, expected); - }); - - defineParameterType({ - regexp: /particular/, - transformer: s => s.toUpperCase(), - typeName: 'param' // deprecated but still supported - }); - - defineParameterType({ - regexp: /particularly/, - transformer: s => s.toUpperCase(), - name: 'param' - }); - - Given('a {param} step', param => { - assert.equal(param, 'PARTICULAR'); - }); + }; }); - const fns: cucumber.SupportCodeConsumer[] = cucumber.getSupportCodeFns(); + Before((scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); - cucumber.clearSupportCodeFns(); -} + Before({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); -function registerListener(): cucumber.EventListener { - const listener = Object.assign(cucumber.Listener(), { - handleBeforeScenarioEvent: (scenario: cucumber.events.ScenarioPayload, callback: () => void) => { - // do some interesting stuff ... + Before('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); + BeforeAll((callback: Callback) => { + console.log("Before all"); + callback(); + }); + + BeforeAll({ timeout: 1000 }, (callback: Callback) => { + console.log("Before all"); + callback(); + }); + + BeforeAll('@tag', (callback: Callback) => { + console.log("Before all"); + callback(); + }); + + After((scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + After({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + After('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + AfterAll((callback: Callback) => { + console.log("After all"); + callback(); + }); + + AfterAll({ timeout: 1000 }, (callback: Callback) => { + console.log("After all"); + callback(); + }); + + AfterAll('@tag', (callback: Callback) => { + console.log("After all"); + callback(); + }); + + Given(/^a variable set to (\d+)$/, (x: string) => { + console.log("the number is: " + x); + }); + + Given(/^a variable set to (\d+)$/, (x: number) => { + console.log(typeof x); + }); + + Given(/^I am on the Cucumber.js GitHub repository$/, function(callback: Callback) { + this.visit('https://github.com/cucumber/cucumber-js', callback); + }); + + When(/^I go to the README file$/, (title: string, callback: Callback) => { + callback(null, 'pending'); + }); + + Then(/^I should see "(.*)" as the page title$/, {timeout: 60 * 1000}, function(title: string, callback: Callback) { + const pageTitle = this.browser.text('title'); + + if (title === pageTitle) { callback(); + } else { + callback(new Error("Expected to be on page with title " + title)); } }); - return listener; + // Type for data_table.js on + // https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js + + Given(/^a table step with Table raw$/, (table: Table) => { + const expected = [ + ['Cucumber', 'Cucumis sativus'], + ['Burr Gherkin', 'Cucumis anguria'] + ]; + const actual: string[][] = table.raw(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step with Table rows$/, (table: Table) => { + const expected = [ + ['Apricot', '5'], + ['Brocolli', '2'], + ['Cucumber', '10'] + ]; + const actual: string[][] = table.rows(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step with Table rowHash$/, (table: Table) => { + const expected = { + Cucumber: 'Cucumis sativus', + 'Burr Gherkin': 'Cucumis anguria' + }; + const actual: { [firstCol: string]: string } = table.rowsHash(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step$/, (table: Table) => { + const expected = [ + {Vegetable: 'Apricot', Rating: '5'}, + {Vegetable: 'Brocolli', Rating: '2'}, + {Vegetable: 'Cucumber', Rating: '10'} + ]; + const actual: Array<{ [colName: string]: string }> = table.hashes(); + assert.deepEqual(actual, expected); + }); + + defineParameterType({ + regexp: /particular/, + transformer: s => s.toUpperCase(), + typeName: 'param' // deprecated but still supported + }); + + defineParameterType({ + regexp: /particularly/, + transformer: s => s.toUpperCase(), + name: 'param', + preferForRegexpMatch: false, + useForSnippets: false + }); + + Given('a {param} step', param => { + assert.equal(param, 'PARTICULAR'); + }); } + +// syntax defineSupportCode deprecated +function StepSample() { + cucumber.defineSupportCode((l) => { + }); +} + +const fns: cucumber.SupportCodeConsumer[] = cucumber.getSupportCodeFns(); +cucumber.clearSupportCodeFns(); diff --git a/types/cucumber/index.d.ts b/types/cucumber/index.d.ts index 8c2ad7020e..c222ad567a 100644 --- a/types/cucumber/index.d.ts +++ b/types/cucumber/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cucumber-js 3.2 +// Type definitions for cucumber-js 4.0 // Project: https://github.com/cucumber/cucumber-js // Definitions by: Abraão Alves // Jan Molak @@ -49,6 +49,29 @@ export interface StepDefinitions { setDefaultTimeout(time: number): void; } +export function After(code: HookCode): void; +export function After(options: HookOptions | string, code: HookCode): void; +export function AfterAll(code: GlobalHookCode): void; +export function AfterAll(options: HookOptions | string, code: GlobalHookCode): void; +export function Before(code: HookCode): void; +export function Before(options: HookOptions | string, code: HookCode): void; +export function BeforeAll(code: GlobalHookCode): void; +export function BeforeAll(options: HookOptions | string, code: GlobalHookCode): void; + +export function defineParameterType(transform: Transform): void; +export function defineStep(pattern: RegExp | string, code: StepDefinitionCode): void; + +export function Given(pattern: RegExp | string, code: StepDefinitionCode): void; +export function Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; +export function setDefaultTimeout(time: number): void; +export function setDefinitionFunctionWrapper(fn: () => void, options?: {[key: string]: any}): void; +// tslint:disable-next-line ban-types +export function setWorldConstructor(world: ((this: World, init: {attach: Function, parameters: {[key: string]: any}}) => void) | {}): void; +export function Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; +export function Then(pattern: RegExp | string, code: StepDefinitionCode): void; +export function When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; +export function When(pattern: RegExp | string, code: StepDefinitionCode): void; + export interface HookScenarioResult { sourceLocation: SourceLocation; result: ScenarioResult; @@ -98,12 +121,11 @@ export namespace pickle { export type HookCode = (this: World, scenario: HookScenarioResult, callback?: CallbackStepDefinition) => void; export type GlobalHookCode = (callback?: CallbackStepDefinition) => void; -// tslint:disable-next-line ban-types -export type AroundCode = (scenario: HookScenarioResult, runScenario?: (error: string, callback?: Function) => void) => void; - export interface Transform { regexp: RegExp; transformer(arg: string): any; + useForSnippets?: boolean; + preferForRegexpMatch?: boolean; name?: string; typeName?: string; // deprecated } @@ -122,12 +144,9 @@ export interface Hooks { After(options: HookOptions | string, code: HookCode): void; AfterAll(code: GlobalHookCode): void; AfterAll(options: HookOptions | string, code: GlobalHookCode): void; - Around(code: AroundCode): void; setDefaultTimeout(time: number): void; // tslint:disable-next-line ban-types setWorldConstructor(world: ((this: World, init: {attach: Function, parameters: {[key: string]: any}}) => void) | {}): void; - registerHandler(handlerOption: string, code: (event: any, callback: CallbackStepDefinition) => void): void; - registerListener(listener: EventListener): void; defineParameterType(transform: Transform): void; } diff --git a/types/cucumber/tsconfig.json b/types/cucumber/tsconfig.json index e2f9cd081b..53ede2654b 100644 --- a/types/cucumber/tsconfig.json +++ b/types/cucumber/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cucumber/v1/tsconfig.json b/types/cucumber/v1/tsconfig.json index 343c701491..495158d6b0 100644 --- a/types/cucumber/v1/tsconfig.json +++ b/types/cucumber/v1/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cucumber/v3/cucumber-tests.ts b/types/cucumber/v3/cucumber-tests.ts new file mode 100644 index 0000000000..f2aed9aec4 --- /dev/null +++ b/types/cucumber/v3/cucumber-tests.ts @@ -0,0 +1,197 @@ +import * as assert from "power-assert"; +import cucumber = require("cucumber"); + +// You can optionally declare your own world properties +declare module "cucumber" { + interface World { + visit(url: string, callback: CallbackStepDefinition): void; + } +} + +function StepSample() { + type Callback = cucumber.CallbackStepDefinition; + type Table = cucumber.TableDefinition; + type HookScenarioResult = cucumber.HookScenarioResult; + const Status = cucumber.Status; + + cucumber.defineSupportCode(({setWorldConstructor, defineParameterType, After, AfterAll, Around, Before, BeforeAll, registerHandler, Given, When, Then}) => { + setWorldConstructor(function({attach, parameters}) { + this.attach = attach; + this.parameters = parameters; + this.visit = (url: string, callback: Callback) => { + callback(null, 'pending'); + }; + }); + + Before((scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); + + Before({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); + + Before('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log(scenarioResult.result.status === Status.FAILED); + callback(); + }); + + BeforeAll((callback: Callback) => { + console.log("Before all"); + callback(); + }); + + BeforeAll({ timeout: 1000 }, (callback: Callback) => { + console.log("Before all"); + callback(); + }); + + BeforeAll('@tag', (callback: Callback) => { + console.log("Before all"); + callback(); + }); + + Around((scenarioResult: HookScenarioResult, runScenario: (error: string | null, callback?: () => void) => void) => { + if (scenarioResult.result.status === Status.FAILED) { + runScenario(null, () => { + console.log('finish tasks'); + }); + } + }); + + After((scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + After({ timeout: 1000 }, (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + After('@tag', (scenarioResult: HookScenarioResult, callback: Callback) => { + console.log("After"); + callback(); + }); + + AfterAll((callback: Callback) => { + console.log("After all"); + callback(); + }); + + AfterAll({ timeout: 1000 }, (callback: Callback) => { + console.log("After all"); + callback(); + }); + + AfterAll('@tag', (callback: Callback) => { + console.log("After all"); + callback(); + }); + + registerHandler('AfterFeatures', (event: any, callback: () => void) => { + callback(); + }); + + Given(/^a variable set to (\d+)$/, (x: string) => { + console.log("the number is: " + x); + }); + + Given(/^a variable set to (\d+)$/, (x: number) => { + console.log(typeof x); + }); + + Given(/^I am on the Cucumber.js GitHub repository$/, function(callback: Callback) { + this.visit('https://github.com/cucumber/cucumber-js', callback); + }); + + When(/^I go to the README file$/, (title: string, callback: Callback) => { + callback(null, 'pending'); + }); + + Then(/^I should see "(.*)" as the page title$/, {timeout: 60 * 1000}, function(title: string, callback: Callback) { + const pageTitle = this.browser.text('title'); + + if (title === pageTitle) { + callback(); + } else { + callback(new Error("Expected to be on page with title " + title)); + } + }); + + // Type for data_table.js on + // https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js + + Given(/^a table step with Table raw$/, (table: Table) => { + const expected = [ + ['Cucumber', 'Cucumis sativus'], + ['Burr Gherkin', 'Cucumis anguria'] + ]; + const actual: string[][] = table.raw(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step with Table rows$/, (table: Table) => { + const expected = [ + ['Apricot', '5'], + ['Brocolli', '2'], + ['Cucumber', '10'] + ]; + const actual: string[][] = table.rows(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step with Table rowHash$/, (table: Table) => { + const expected = { + Cucumber: 'Cucumis sativus', + 'Burr Gherkin': 'Cucumis anguria' + }; + const actual: { [firstCol: string]: string } = table.rowsHash(); + assert.deepEqual(actual, expected); + }); + + Given(/^a table step$/, (table: Table) => { + const expected = [ + {Vegetable: 'Apricot', Rating: '5'}, + {Vegetable: 'Brocolli', Rating: '2'}, + {Vegetable: 'Cucumber', Rating: '10'} + ]; + const actual: Array<{ [colName: string]: string }> = table.hashes(); + assert.deepEqual(actual, expected); + }); + + defineParameterType({ + regexp: /particular/, + transformer: s => s.toUpperCase(), + typeName: 'param' // deprecated but still supported + }); + + defineParameterType({ + regexp: /particularly/, + transformer: s => s.toUpperCase(), + name: 'param' + }); + + Given('a {param} step', param => { + assert.equal(param, 'PARTICULAR'); + }); + }); + + const fns: cucumber.SupportCodeConsumer[] = cucumber.getSupportCodeFns(); + + cucumber.clearSupportCodeFns(); +} + +function registerListener(): cucumber.EventListener { + const listener = Object.assign(cucumber.Listener(), { + handleBeforeScenarioEvent: (scenario: cucumber.events.ScenarioPayload, callback: () => void) => { + // do some interesting stuff ... + + callback(); + } + }); + + return listener; +} diff --git a/types/cucumber/v3/index.d.ts b/types/cucumber/v3/index.d.ts new file mode 100644 index 0000000000..8c2ad7020e --- /dev/null +++ b/types/cucumber/v3/index.d.ts @@ -0,0 +1,311 @@ +// Type definitions for cucumber-js 3.2 +// Project: https://github.com/cucumber/cucumber-js +// Definitions by: Abraão Alves +// Jan Molak +// Isaiah Soung +// BendingBender +// ErikSchierboom +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export enum Status { + AMBIGUOUS = "ambiguous", + FAILED = "failed", + PASSED = "passed", + PENDING = "pending", + SKIPPED = "skipped", + UNDEFINED = "undefined" +} + +export interface World { + [key: string]: any; +} + +export interface CallbackStepDefinition { + pending(): PromiseLike; + (error?: any, pending?: string): void; +} + +export interface TableDefinition { + raw(): string[][]; + rows(): string[][]; + rowsHash(): { [firstCol: string]: string }; + hashes(): Array<{ [colName: string]: string }>; +} + +export type StepDefinitionCode = (this: World, ...stepArgs: any[]) => any; + +export interface StepDefinitionOptions { + timeout?: number; +} + +export interface StepDefinitions { + Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; + Given(pattern: RegExp | string, code: StepDefinitionCode): void; + When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; + When(pattern: RegExp | string, code: StepDefinitionCode): void; + Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void; + Then(pattern: RegExp | string, code: StepDefinitionCode): void; + setDefaultTimeout(time: number): void; +} + +export interface HookScenarioResult { + sourceLocation: SourceLocation; + result: ScenarioResult; + pickle: pickle.Pickle; +} + +export interface SourceLocation { + line: number; + url: string; +} + +export interface ScenarioResult { + duration: number; + status: Status; +} + +export namespace pickle { + interface Pickle { + language: string; + locations: Location[]; + name: string; + steps: Step[]; + tags: string[]; + } + + interface Location { + column: number; + line: number; + } + + interface Step { + arguments: Argument[]; + locations: Location[]; + text: string; + } + + interface Argument { + rows: Cell[]; + } + + interface Cell { + location: Location; + value: string; + } +} + +export type HookCode = (this: World, scenario: HookScenarioResult, callback?: CallbackStepDefinition) => void; +export type GlobalHookCode = (callback?: CallbackStepDefinition) => void; + +// tslint:disable-next-line ban-types +export type AroundCode = (scenario: HookScenarioResult, runScenario?: (error: string, callback?: Function) => void) => void; + +export interface Transform { + regexp: RegExp; + transformer(arg: string): any; + name?: string; + typeName?: string; // deprecated +} + +export interface HookOptions { + timeout?: number; + tags?: any; +} + +export interface Hooks { + Before(code: HookCode): void; + Before(options: HookOptions | string, code: HookCode): void; + BeforeAll(code: GlobalHookCode): void; + BeforeAll(options: HookOptions | string, code: GlobalHookCode): void; + After(code: HookCode): void; + After(options: HookOptions | string, code: HookCode): void; + AfterAll(code: GlobalHookCode): void; + AfterAll(options: HookOptions | string, code: GlobalHookCode): void; + Around(code: AroundCode): void; + setDefaultTimeout(time: number): void; + // tslint:disable-next-line ban-types + setWorldConstructor(world: ((this: World, init: {attach: Function, parameters: {[key: string]: any}}) => void) | {}): void; + registerHandler(handlerOption: string, code: (event: any, callback: CallbackStepDefinition) => void): void; + registerListener(listener: EventListener): void; + defineParameterType(transform: Transform): void; +} + +export class EventListener { + hear(event: events.Event, callback: () => void): void; + hasHandlerForEvent(event: events.Event): boolean; + buildHandlerNameForEvent(event: events.Event): string; + getHandlerForEvent(event: events.Event): EventHook; + buildHandlerName(shortName: string): string; + setHandlerForEvent(shortName: string, handler: EventListener): void; +} + +export function Listener(): EventListener; + +export namespace events { + interface Event { + name: string; + data: any; + } + + // tslint:disable-next-line no-empty-interface + interface EventPayload { + } + + interface FeaturesPayload extends EventPayload { + getFeatures(): any[]; // https://github.com/cucumber/cucumber-js/blob/dc698bf5bc10d591fa7adeec5fa21b2d90dc9679/lib/cucumber/runtime.js#L34 + } + + interface FeaturesResultPayload extends EventPayload { + duration: number; + scenarioResults: any[]; + success: boolean; + stepsResults: any[]; + strict: boolean; + } + + interface FeaturePayload extends EventPayload { + description: string; + keyword: string; + line: number; + name: string; + tags: Tag[]; + uri: string; + scenarios: Scenario[]; + } + + interface ScenarioPayload extends EventPayload { + feature: Feature; + exception: Error; + keyword: string; + lines: number[]; + name: string; + tags: Tag[]; + uri: string; + line: number; + description: string; + steps: Step[]; + } + + interface ScenarioResultPayload extends EventPayload { + duration: any; + failureException: Error; + scenario: Scenario; + status: Status; + stepResults: any[]; + } + + interface StepPayload extends EventPayload { + arguments: any; + line: number; + name: string; + scenario: Scenario; + uri: string; + isBackground: boolean; + keyword: string; + keywordType: string; + } + + interface StepResultPayload extends EventPayload { + ambiguousStepDefinitions: any; + attachments: any[]; + duration: any; + failureException: Error; + step: Step; + stepDefinition: StepDefinition; + status: Status; + } +} + +export interface StepDefinition { + // tslint:disable-next-line ban-types + code: Function; + line: number; + options: {}; + pattern: any; + uri: string; +} + +export interface Tag { + name: string; + line: number; +} + +export interface Step { + arguments: any; + line: number; + name: string; + scenario: Scenario; + uri: string; + isBackground: boolean; + keyword: string; + keywordType: string; +} + +export interface Scenario { + feature: Feature; + exception: Error; + keyword: string; + lines: number[]; + name: string; + tags: Tag[]; + uri: string; + line: number; + description: string; + steps: Step[]; +} + +export interface Feature { + description: string; + keyword: string; + line: number; + name: string; + tags: Tag[]; + uri: string; + scenarios: Scenario[]; +} + +export type EventHook = (event: events.Event, callback?: () => void) => void; + +export type SupportCodeConsumer = (stepDefinitions: StepDefinitions & Hooks) => void; + +export function defineSupportCode(consumer: SupportCodeConsumer): void; + +export function getSupportCodeFns(): SupportCodeConsumer[]; + +export function clearSupportCodeFns(): void; + +// https://github.com/cucumber/cucumber-js/commit/231183a8a11c985ef7ced1155b7a75f5120a34b6 +export class Formatter { + constructor(options?: any); + + log(data: any): void; +} + +export class SummaryFormatter extends Formatter { + indent(text: string, numberOfSpaces: number): any; +} + +export class PrettyFormatter extends SummaryFormatter { + formatTags(tags: Tag[]): any; + logIndented(text: string, level: number): void; + logStepResult(stepResult: any): void; +} + +export class ProgressFormatter extends SummaryFormatter { +} + +export class RerunFormatter extends Formatter { +} + +export class SnippetsFormatter extends Formatter { +} + +export class UsageFormatter extends Formatter { +} + +export class UsageJsonFormatter extends Formatter { +} + +export class JsonFormatter extends Formatter { +} diff --git a/types/cucumber/v3/tsconfig.json b/types/cucumber/v3/tsconfig.json new file mode 100644 index 0000000000..e10dd587c0 --- /dev/null +++ b/types/cucumber/v3/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "cucumber": [ + "cucumber/v3" + ], + "cucumber/*": [ + "cucumber/v3/*" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "cucumber-tests.ts" + ] +} \ No newline at end of file diff --git a/types/cucumber/v3/tslint.json b/types/cucumber/v3/tslint.json new file mode 100644 index 0000000000..215db37b37 --- /dev/null +++ b/types/cucumber/v3/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "no-any-union": false, + "rules": { + "no-any-union": false, + "no-unnecessary-generics": false + } +} diff --git a/types/cuid/tsconfig.json b/types/cuid/tsconfig.json index 6aebd0a158..26c0b1289e 100644 --- a/types/cuid/tsconfig.json +++ b/types/cuid/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/currency-formatter/tsconfig.json b/types/currency-formatter/tsconfig.json index 47674cfe0d..21957b7d91 100644 --- a/types/currency-formatter/tsconfig.json +++ b/types/currency-formatter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/custom-error-generator/tsconfig.json b/types/custom-error-generator/tsconfig.json index ab16a76d97..99512cdf78 100644 --- a/types/custom-error-generator/tsconfig.json +++ b/types/custom-error-generator/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cwise-compiler/cwise-compiler-tests.ts b/types/cwise-compiler/cwise-compiler-tests.ts index 38e19de886..10d43f1930 100644 --- a/types/cwise-compiler/cwise-compiler-tests.ts +++ b/types/cwise-compiler/cwise-compiler-tests.ts @@ -1,9 +1,7 @@ -/// - -import * as parse from 'cwise-parser'; -import * as ndarray from 'ndarray'; -import * as compile from 'cwise-compiler'; -import * as tape from 'tape'; +import parse = require('cwise-parser'); +import ndarray = require('ndarray'); +import compile = require('cwise-compiler'); +import tape = require('tape'); tape("block tests", (t) => { const ops = require('ndarray-ops'); diff --git a/types/cwise-compiler/tsconfig.json b/types/cwise-compiler/tsconfig.json index 083c5f1666..09b88da3d2 100644 --- a/types/cwise-compiler/tsconfig.json +++ b/types/cwise-compiler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cwise-parser/cwise-parser-tests.ts b/types/cwise-parser/cwise-parser-tests.ts index c50b9be06a..5ee5138a6e 100644 --- a/types/cwise-parser/cwise-parser-tests.ts +++ b/types/cwise-parser/cwise-parser-tests.ts @@ -1,6 +1,5 @@ -import * as parser from "cwise-parser"; -// import parser = require("cwise-parser"); -import * as tape from "tape"; +import parser = require("cwise-parser"); +import tape = require("tape"); tape("basic tests", (t) => { const parsed = parser((a: number, b: number, c: number) => { diff --git a/types/cwise-parser/tsconfig.json b/types/cwise-parser/tsconfig.json index 226bb609fb..b8d5702283 100644 --- a/types/cwise-parser/tsconfig.json +++ b/types/cwise-parser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cwise/cwise-tests.ts b/types/cwise/cwise-tests.ts index b759fb1a0c..3d88ee40fd 100644 --- a/types/cwise/cwise-tests.ts +++ b/types/cwise/cwise-tests.ts @@ -1,6 +1,6 @@ -import * as cwise from 'cwise'; -import * as ndarray from 'ndarray'; -import * as tape from 'tape'; +import cwise = require('cwise'); +import ndarray = require('ndarray'); +import tape = require('tape'); // basic tape("only allow same shape", (t) => { @@ -150,8 +150,7 @@ tape("binary", (t) => { t.end(); }); -// browserify -import * as browserify from "browserify"; +import browserify = require("browserify"); import * as vm from 'vm'; import * as path from 'path'; diff --git a/types/cwise/tsconfig.json b/types/cwise/tsconfig.json index c1ea871113..d545fa98d3 100644 --- a/types/cwise/tsconfig.json +++ b/types/cwise/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cybozulabs-md5/tsconfig.json b/types/cybozulabs-md5/tsconfig.json index a85459ac83..53d546abf1 100644 --- a/types/cybozulabs-md5/tsconfig.json +++ b/types/cybozulabs-md5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/cytoscape/tsconfig.json b/types/cytoscape/tsconfig.json index 348734c733..8796925930 100644 --- a/types/cytoscape/tsconfig.json +++ b/types/cytoscape/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-array/tsconfig.json b/types/d3-array/tsconfig.json index a1dbb238ee..58e25ed31f 100644 --- a/types/d3-array/tsconfig.json +++ b/types/d3-array/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-axis/tsconfig.json b/types/d3-axis/tsconfig.json index 5b54d1f622..6bb2a44fd4 100644 --- a/types/d3-axis/tsconfig.json +++ b/types/d3-axis/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-box/tsconfig.json b/types/d3-box/tsconfig.json index d6411b9a05..d0ea7a30a8 100644 --- a/types/d3-box/tsconfig.json +++ b/types/d3-box/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-brush/tsconfig.json b/types/d3-brush/tsconfig.json index 2aeb012361..52ad4235a8 100644 --- a/types/d3-brush/tsconfig.json +++ b/types/d3-brush/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-chord/tsconfig.json b/types/d3-chord/tsconfig.json index eff4938f78..c5fe3e9133 100644 --- a/types/d3-chord/tsconfig.json +++ b/types/d3-chord/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-collection/tsconfig.json b/types/d3-collection/tsconfig.json index c2ae30cdbd..134b625635 100644 --- a/types/d3-collection/tsconfig.json +++ b/types/d3-collection/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-color/tsconfig.json b/types/d3-color/tsconfig.json index d783922755..a6695317db 100644 --- a/types/d3-color/tsconfig.json +++ b/types/d3-color/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-contour/tsconfig.json b/types/d3-contour/tsconfig.json index 345a064caa..deb7c3dc8f 100644 --- a/types/d3-contour/tsconfig.json +++ b/types/d3-contour/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-dispatch/tsconfig.json b/types/d3-dispatch/tsconfig.json index b270a9c1a0..44d0f4c3e8 100644 --- a/types/d3-dispatch/tsconfig.json +++ b/types/d3-dispatch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-drag/tsconfig.json b/types/d3-drag/tsconfig.json index cb6cab8ba0..f8e6c58777 100644 --- a/types/d3-drag/tsconfig.json +++ b/types/d3-drag/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-dsv/tsconfig.json b/types/d3-dsv/tsconfig.json index 400095c38d..da64649d23 100644 --- a/types/d3-dsv/tsconfig.json +++ b/types/d3-dsv/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "d3-dsv-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/d3-dsv/v0/tsconfig.json b/types/d3-dsv/v0/tsconfig.json index e0ae8b7a42..1a0cae31df 100644 --- a/types/d3-dsv/v0/tsconfig.json +++ b/types/d3-dsv/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-ease/tsconfig.json b/types/d3-ease/tsconfig.json index 6d0831f1a5..ea4d66c4dd 100644 --- a/types/d3-ease/tsconfig.json +++ b/types/d3-ease/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-fetch/d3-fetch-tests.ts b/types/d3-fetch/d3-fetch-tests.ts new file mode 100644 index 0000000000..941955c996 --- /dev/null +++ b/types/d3-fetch/d3-fetch-tests.ts @@ -0,0 +1,51 @@ +import * as d3Fetch from 'd3-fetch'; +import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; + +interface MyType { + foo: string; +} + +const url = 'foo.bar'; + +const init: RequestInit = {}; + +let p1: Promise = d3Fetch.blob(url); +p1 = d3Fetch.blob(url, init); + +let p2: Promise = d3Fetch.buffer(url); +p2 = d3Fetch.buffer(url, init); + +let p3: Promise = d3Fetch.image(url); +const imageProperties = { + width: '300px', + height: '500px' +}; +p3 = d3Fetch.image(url, imageProperties); + +let p4: Promise = d3Fetch.json(url); +p4 = d3Fetch.json(url, init); +let p5: Promise = d3Fetch.json(url); +p5 = d3Fetch.json(url, init); + +let myString: Promise; +myString = d3Fetch.text(url); +myString = d3Fetch.text(url, init); + +const parseRow = (rawRow: DSVRowString, index: number, columns: string[]): (MyType | undefined | null) => { + const myType: MyType | null = rawRow['foo'] ? { foo: rawRow['foo'] + '+ bar' } : null; + return myType; +}; +let promise1: Promise>; +let promise2: Promise>; +promise1 = d3Fetch.csv(url); +promise1 = d3Fetch.csv(url, init); +promise2 = d3Fetch.csv(url, parseRow); +promise2 = d3Fetch.csv(url, init, parseRow); +promise1 = d3Fetch.dsv(';', url); +promise1 = d3Fetch.dsv(';', url, init); +promise2 = d3Fetch.dsv(';', url, parseRow); +promise2 = d3Fetch.dsv(';', url, init, parseRow); +promise1 = d3Fetch.tsv(url); +promise1 = d3Fetch.tsv(url, init); +promise2 = d3Fetch.tsv(url, parseRow); +promise2 = d3Fetch.tsv(url, init, parseRow); diff --git a/types/d3-fetch/index.d.ts b/types/d3-fetch/index.d.ts new file mode 100644 index 0000000000..3eb11ce48a --- /dev/null +++ b/types/d3-fetch/index.d.ts @@ -0,0 +1,236 @@ +// Type definitions for d3-fetch 1.0 +// Project: https://d3js.org/d3-fetch/ +// Definitions by: Hugues Stefanski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Last module patch version validated against: 1.0.1 + +import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; + +/** + * Fetches the binary file at the specified input URL and returns it as a Promise of a Blob. + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function blob(url: string, init?: RequestInit): Promise; + +/** + * Fetches the binary file at the specified input URL and returns it as a Promise of an ArrayBuffer. + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function buffer(url: string, init?: RequestInit): Promise; + +/** + * Fetches the CSV file at the specified input URL and returns + * a promise of an array of objects representing the parsed rows. The values of the properties of the parsed row + * objects are represented as strings. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function csv( + url: string, + init?: RequestInit, +): Promise>; +/** + * Fetches the CSV file at the specified input URL and returns + * a promise of an array of objects representing the parsed rows. + * + * The specified row conversion function is used to map and filter row objects to a more-specific representation; + * see dsv.csvParse for details. + * + * The generic parameter describes the type of the object representation of a parsed row. + * + * @param url A valid URL string. + * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), + * the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.csvParse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ +export function csv( + url: string, + row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null +): Promise>; +/** + * Fetches the CSV file at the specified input URL and returns + * a promise of an array of objects representing the parsed rows. + * + * The init object is passed along to the underlying call to fetch. + * + * The specified row conversion function is used to map and filter row objects to a more-specific representation; + * see dsv.csvParse for details. + * + * The generic parameter describes the type of the object representation of a parsed row. + * + * @param url A valid URL string. + * @param init An request initialization object. + * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), + * the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.csvParse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ +export function csv( + url: string, + init: RequestInit, + row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null +): Promise>; + +/** + * Fetches the DSV file with the specified delimiter character at the specified input URL and returns + * a promise of an array of objects representing the parsed rows. The values of the properties of the parsed row + * objects are represented as strings. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param delimiter The delimiter character used in the DSV file to be fetched. + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function dsv( + delimiter: string, + url: string, + init?: RequestInit, +): Promise>; +/** + * Fetches the DSV file with the specified delimiter character at the specified input URL and returns + * a promise of an array of objects representing the parsed rows. + * + * The specified row conversion function is used to map and filter row objects to a more-specific representation; + * see dsv.parse for details. + * + * The generic parameter describes the type of the object representation of a parsed row. + * + * @param delimiter The delimiter character used in the DSV file to be fetched. + * @param url A valid URL string. + * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), + * the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ +export function dsv( + delimiter: string, + url: string, + row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null +): Promise>; +/** + * Fetches the DSV file with the specified delimiter character at the specified input URL and returns + * a promise of an array of objects representing the parsed rows. + * + * The init object is passed along to the underlying call to fetch. + * + * The specified row conversion function is used to map and filter row objects to a more-specific representation; + * see dsv.parse for details. + * + * The generic parameter describes the type of the object representation of a parsed row. + * + * @param delimiter The delimiter character used in the DSV file to be fetched. + * @param url A valid URL string. + * @param init An request initialization object. + * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), + * the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ +export function dsv( + delimiter: string, + url: string, + init: RequestInit, + row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null +): Promise>; + +/** + * Fetches the image at the specified input URL and returns a promise of an HTML image element. + * + * If init is specified, sets any additional properties on the image before loading. + * + * @param url A valid URL string. + * @param init An optional object of image properties to set. + */ +export function image(url: string, init?: {[key: string]: any}): Promise; + +/** + * Fetches the json file at the specified input URL and returns it as a Promise of a parsed JSON object. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * The generic parameter describes the type of the object parsed from the returned JSON. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function json(url: string, init?: RequestInit): Promise; + +/** + * Fetches the text file at the specified input URL and returns it as a Promise of a string. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function text(url: string, init?: RequestInit): Promise; + +/** + * Fetches the TSV file at the specified input URL and returns + * a promise of an array of objects representing the parsed rows. + * + * If init is specified, it is passed along to the underlying call to fetch. + * + * @param url A valid URL string. + * @param init An optional request initialization object. + */ +export function tsv( + url: string, + init?: RequestInit, +): Promise>; +/** + * Fetches the TSV file at the specified input URL and returns + * a promise of an array of objects representing the parsed rows. The values of the properties of the parsed row + * objects are represented as strings. + * + * The specified row conversion function is used to map and filter row objects to a more-specific representation; + * see dsv.tsvParse for details. + * + * The generic parameter describes the type of the object representation of a parsed row. + * + * @param url A valid URL string. + * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), + * the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.tsvParse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ +export function tsv( + url: string, + row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null +): Promise>; +/** + * Fetches the TSV file at the specified input URL and returns + * a promise of an array of objects representing the parsed rows. + * + * The init object is passed along to the underlying call to fetch. + * + * The specified row conversion function is used to map and filter row objects to a more-specific representation; + * see dsv.tsvParse for details. + * + * The generic parameter describes the type of the object representation of a parsed row. + * + * @param url A valid URL string. + * @param init An request initialization object. + * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), + * the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.tsvParse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ +export function tsv( + url: string, + init: RequestInit, + row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null +): Promise>; diff --git a/types/d3-fetch/tsconfig.json b/types/d3-fetch/tsconfig.json new file mode 100644 index 0000000000..f30552f20d --- /dev/null +++ b/types/d3-fetch/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "d3-fetch-tests.ts" + ] +} \ No newline at end of file diff --git a/types/d3-fetch/tslint.json b/types/d3-fetch/tslint.json new file mode 100644 index 0000000000..54efb0b84e --- /dev/null +++ b/types/d3-fetch/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "unified-signatures": false, + "no-unnecessary-generics": false + } +} diff --git a/types/d3-force/tsconfig.json b/types/d3-force/tsconfig.json index 3d407406eb..cb3b3630c3 100644 --- a/types/d3-force/tsconfig.json +++ b/types/d3-force/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-format/tsconfig.json b/types/d3-format/tsconfig.json index 6017e0916f..cd2ccee91b 100644 --- a/types/d3-format/tsconfig.json +++ b/types/d3-format/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-geo/tsconfig.json b/types/d3-geo/tsconfig.json index f3661c3ad2..ea909a0598 100644 --- a/types/d3-geo/tsconfig.json +++ b/types/d3-geo/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-hexbin/tsconfig.json b/types/d3-hexbin/tsconfig.json index 773221263b..5f58387e06 100644 --- a/types/d3-hexbin/tsconfig.json +++ b/types/d3-hexbin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-hierarchy/tsconfig.json b/types/d3-hierarchy/tsconfig.json index 7fbc1fb5df..88974b9359 100644 --- a/types/d3-hierarchy/tsconfig.json +++ b/types/d3-hierarchy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-hsv/tsconfig.json b/types/d3-hsv/tsconfig.json index c92ce346b2..3249f8d778 100644 --- a/types/d3-hsv/tsconfig.json +++ b/types/d3-hsv/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-interpolate/tsconfig.json b/types/d3-interpolate/tsconfig.json index 14435aff3d..6a3fd2a0b5 100644 --- a/types/d3-interpolate/tsconfig.json +++ b/types/d3-interpolate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-path/tsconfig.json b/types/d3-path/tsconfig.json index 5f3fa1ca3e..6651f7ec3c 100644 --- a/types/d3-path/tsconfig.json +++ b/types/d3-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-polygon/tsconfig.json b/types/d3-polygon/tsconfig.json index 79bd8a43b8..3ac84426f5 100644 --- a/types/d3-polygon/tsconfig.json +++ b/types/d3-polygon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-quadtree/tsconfig.json b/types/d3-quadtree/tsconfig.json index cbbb70a658..3a54e793e7 100644 --- a/types/d3-quadtree/tsconfig.json +++ b/types/d3-quadtree/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-queue/tsconfig.json b/types/d3-queue/tsconfig.json index 72f00c11e5..e48b49503e 100644 --- a/types/d3-queue/tsconfig.json +++ b/types/d3-queue/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-random/tsconfig.json b/types/d3-random/tsconfig.json index a8db248667..f497ce18bf 100644 --- a/types/d3-random/tsconfig.json +++ b/types/d3-random/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-request/tsconfig.json b/types/d3-request/tsconfig.json index a52d00ffaa..741908230f 100644 --- a/types/d3-request/tsconfig.json +++ b/types/d3-request/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-sankey/tsconfig.json b/types/d3-sankey/tsconfig.json index 503145683b..5067a33516 100644 --- a/types/d3-sankey/tsconfig.json +++ b/types/d3-sankey/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-scale-chromatic/tsconfig.json b/types/d3-scale-chromatic/tsconfig.json index 6dda07c981..60c78baedc 100644 --- a/types/d3-scale-chromatic/tsconfig.json +++ b/types/d3-scale-chromatic/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-scale/tsconfig.json b/types/d3-scale/tsconfig.json index 4fb09e2d39..2fe9977909 100644 --- a/types/d3-scale/tsconfig.json +++ b/types/d3-scale/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-selection-multi/tsconfig.json b/types/d3-selection-multi/tsconfig.json index 7344010335..51dfdb320f 100644 --- a/types/d3-selection-multi/tsconfig.json +++ b/types/d3-selection-multi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-selection/d3-selection-tests.ts b/types/d3-selection/d3-selection-tests.ts index 6019084be2..e4f50c89e4 100644 --- a/types/d3-selection/d3-selection-tests.ts +++ b/types/d3-selection/d3-selection-tests.ts @@ -89,10 +89,11 @@ const body5: d3Selection.Selection // d3Selection.select(baseTypeEl.node()!); // fails as baseTypeEl.node() is not of type HTMLBodyElement // test, when it is not certain, whether an element of the type to be selected exists -let maybeSVG1: d3Selection.Selection = d3Selection.select('svg'); +let maybeSVG1: d3Selection.Selection; maybeSVG1 = d3Selection.select('svg'); let maybeSVG2: d3Selection.Selection; +// maybeSVG2 = d3Selection.select(maybeSVG1.node()); // fails with strict function types maybeSVG2 = d3Selection.select(maybeSVG1.node()); // fails, as node type mismatches selection type @@ -144,8 +145,7 @@ const xSVGCircleElementList: NodeListOf = document.querySelect const circleSelection: d3Selection.Selection = d3Selection.selectAll(xSVGCircleElementList); // selectAll(...) accepts HTMLCollection, HTMLCollectionOf<...> argument - -const documentLinks: d3Selection.Selection = d3Selection.selectAll(document.links); +const documentLinks: d3Selection.Selection = d3Selection.selectAll(document.links); // --------------------------------------------------------------------------------------- // Tests of Sub-Selection Functions @@ -166,12 +166,13 @@ let firstG: d3Selection.Selection = svg // firstG = svgEl.select('svg'); // fails, element type of SVGSVGElement provided, but SVGGElement expexted on left-hand side (silly test to begin with) // test, when it is not certain, whether an element of the type to be selected exists -let maybeG: d3Selection.Selection = svgEl.select('g'); +let maybeG: d3Selection.Selection; +// maybeG = svgEl.select('g'); // fails, with strictFunctionTypes maybeG = svgEl.select('g'); // Using select(...) sub-selection with a selector function argument. -function svgGroupSelector(this: SVGSVGElement, d: SVGDatum, i: number, groups: SVGSVGElement[]): SVGGElement { +function svgGroupSelector(this: SVGSVGElement, d: SVGDatum, i: number, groups: SVGSVGElement[] | ArrayLike): SVGGElement { return this.querySelector('g')!; // this-type compatible with group element-type to which the selector function will be appplied } @@ -215,13 +216,14 @@ emptySubSelection = svgEl.selectAll(undefined); // Using selectAll(...) sub-selection with a string argument. -let elementsUnknownData: d3Selection.Selection = svgEl.selectAll('g'); +let elementsUnknownData: d3Selection.Selection = svgEl.selectAll('g'); +// let elementsAndDataUnknown: d3Selection.Selection = svgEl.selectAll('g'); // fails with strictFunctionTypes let gElementsOldData: d3Selection.Selection = svgEl.selectAll('g'); // gElementsOldData = svgEl.selectAll('g'); // fails default type parameters of selectAll for group element type and datum type do not match // Using selectAll(...) sub-selection with a selector function argument. -function svgGroupSelectorAll(this: SVGSVGElement, d: SVGDatum, i: number, groups: SVGSVGElement[]): NodeListOf { +function svgGroupSelectorAll(this: SVGSVGElement, d: SVGDatum, i: number, groups: SVGSVGElement[] | d3Selection.ArrayLike): NodeListOf { return this.querySelectorAll('g'); // this-type compatible with group element-type to which the selector function will be appplied } @@ -774,7 +776,7 @@ nRow = td2.data(); // flattened matrix (Array[16] of number) // Tests of Alternative DOM Manipulation // --------------------------------------------------------------------------------------- -// append(...) and creator(...) ---------------------------------------------------------- +// append(...), creator(...) and create(...) --------------------------------------------- // without append<...> typing returned selection has group element of type BaseType let newDiv: d3Selection.Selection; @@ -805,6 +807,12 @@ newDiv2 = body.append(function(d, i, g) { // return this.ownerDocument.createElement('a'); // fails, HTMLDivElement expected by inference, HTMLAnchorElement returned // }); +// create a detached element + +let detachedDiv: d3Selection.Selection; + +detachedDiv = d3Selection.create('div'); + // insert(...) --------------------------------------------------------------------------- // without insert<...> typing returned selection has group element of type BaseType @@ -847,6 +855,18 @@ newParagraph2 = body.insert(typeValueFunction, 'p.second-paragraph'); newParagraph2 = body.insert(typeValueFunction, beforeValueFunction); newParagraph2 = body.insert(typeValueFunction); +// clone(...) ---------------------------------------------------------------------------- + +let clonedParagraph: d3Selection.Selection; + +// shallow clone +clonedParagraph = newParagraph2.clone(); + +// deep clone + +newParagraph.append('span'); +clonedParagraph = newParagraph2.clone(true); + // sort(...) ----------------------------------------------------------------------------- // NB: Return new selection of same type @@ -925,14 +945,14 @@ circles = circles.call(enforceMinRadius, 40); // check chaining return type by r // on(...) ------------------------------------------------------------------------------- -let listener: undefined | ((this: HTMLBodyElement, datum: BodyDatum, index: number, group: HTMLBodyElement[] | ArrayLike) => void); +let listener: undefined | ((this: HTMLBodyElement, datum: BodyDatum, index: number, group: HTMLBodyElement[] | d3Selection.ArrayLike) => void); body = body.on('click', function(d, i, g) { const that: HTMLBodyElement = this; // const that2: SVGElement = this; // fails, type mismatch const datum: BodyDatum = d; const index: number = i; - const group: HTMLBodyElement[] | ArrayLike = g; + const group: HTMLBodyElement[] | d3Selection.ArrayLike = g; console.log('onclick print body background color: ', this.bgColor); // HTMLBodyElement console.log('onclick print "foo" datum property: ', d.foo); // BodyDatum type }); @@ -988,13 +1008,11 @@ interface SuccessEvent { } const successEvent = { type: 'wonEuro2016', team: 'Island' }; -let customListener: (this: HTMLBodyElement, finalOpponent: string) => string; - -customListener = finalOpponent => { +function customListener(this: HTMLBodyElement | null, finalOpponent: string): string { const e = d3Selection.event; return `${e.team} defeated ${finalOpponent} in the EURO 2016 Cup. Who would have thought!!!`; -}; +} const resultText: string = d3Selection.customEvent(successEvent, customListener, body.node(), 'Wales'); diff --git a/types/d3-selection/index.d.ts b/types/d3-selection/index.d.ts index b5231f37c2..7e23c4aaeb 100644 --- a/types/d3-selection/index.d.ts +++ b/types/d3-selection/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for D3JS d3-selection module 1.2 +// Type definitions for D3JS d3-selection module 1.3 // Project: https://github.com/d3/d3-selection/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.2.0 +// Last module patch version validated against: 1.3.0 // -------------------------------------------------------------------------- // Shared Type Definitions and Interfaces @@ -532,6 +532,15 @@ export interface Selection; + /** * Returns a new selection merging this selection with the specified other selection. * The returned selection has the same number of groups and the same parents as this selection. @@ -1103,6 +1112,15 @@ export function window(DOMNode: Window | Document | Element): Window; // for explicit bound-context dependent use // --------------------------------------------------------------------------- +/** + * Given the specified element name, returns a single-element selection containing + * a detached element of the given name in the current document. + * + * @param name Tag name of the element to be added. See "namespace" for details on supported namespace prefixes, + * such as for SVG elements. + */ +export function create(name: string): Selection; + /** * Given the specified element name, returns a function which creates an element of the given name, * assuming that "this" is the parent element. diff --git a/types/d3-selection/tsconfig.json b/types/d3-selection/tsconfig.json index 9dea0e1226..9ee4a0eef4 100644 --- a/types/d3-selection/tsconfig.json +++ b/types/d3-selection/tsconfig.json @@ -8,17 +8,18 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "d3-selection-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/d3-shape/d3-shape-tests.ts b/types/d3-shape/d3-shape-tests.ts index 687da79188..e668d152f8 100644 --- a/types/d3-shape/d3-shape-tests.ts +++ b/types/d3-shape/d3-shape-tests.ts @@ -17,6 +17,7 @@ import { HierarchyPointLink, HierarchyPointNode } from 'd3-hierarchy'; let context: CanvasRenderingContext2D | null = document.querySelector('canvas')!.getContext('2d'); let num: number; +let padAngleMaybe: number | undefined; let pathStringMaybe: string | null; // ----------------------------------------------------------------------------------- @@ -28,7 +29,7 @@ interface ArcDatum { oRadius: number; sAngle: number; eAngle: number; - pAngle: number; + pAngle?: number; } const arcDefaultDatum: d3Shape.DefaultArcObject = { @@ -39,6 +40,13 @@ const arcDefaultDatum: d3Shape.DefaultArcObject = { padAngle: 0.03 }; +const arcReducedDefaultDatum: d3Shape.DefaultArcObject = { + innerRadius: 40, + outerRadius: 60, + startAngle: 0, + endAngle: Math.PI / 2 +}; + const arcDatum: ArcDatum = { iRadius: 40, oRadius: 60, @@ -48,6 +56,7 @@ const arcDatum: ArcDatum = { }; let accessorArcDatumNumber: (this: any, d: ArcDatum, ...args: any[]) => number; +let accessorArcDatumNumberOrUndefined: (this: any, d: ArcDatum, ...args: any[]) => number | undefined; let accessorArcDatumNumberOrNull: ((this: any, d: ArcDatum, ...args: any[]) => number) | null; // DefaultArcObject interface ======================================================== @@ -64,7 +73,7 @@ num = defaultArcObject.innerRadius; num = defaultArcObject.outerRadius; num = defaultArcObject.startAngle; num = defaultArcObject.endAngle; -num = defaultArcObject.padAngle; +padAngleMaybe = defaultArcObject.padAngle; // arc(...) create Arc generator ===================================================== @@ -134,7 +143,7 @@ canvasArc = canvasArc.padAngle(0); svgArc = svgArc.padAngle(d => { return d.pAngle; // datum type is ArcDatum }); -accessorArcDatumNumber = svgArc.padAngle(); +accessorArcDatumNumberOrUndefined = svgArc.padAngle(); // padRadius(...) ---------------------------------------------------------------------- diff --git a/types/d3-shape/index.d.ts b/types/d3-shape/index.d.ts index 27a92a79fe..5408508683 100644 --- a/types/d3-shape/index.d.ts +++ b/types/d3-shape/index.d.ts @@ -32,9 +32,9 @@ export interface DefaultArcObject { */ endAngle: number; /** - * Pad angle of arcin radians. + * Optional. Pad angle of arcin radians. */ - padAngle: number; + padAngle?: number; } /** @@ -230,7 +230,7 @@ export interface Arc { * Returns the current pad angle accessor, which defaults to a function returning the padAngle property * of the first argument passed into it, or false if no data are passed in or the property is not defined. */ - padAngle(): (this: This, d: Datum, ...args: any[]) => number; + padAngle(): (this: This, d: Datum, ...args: any[]) => number | undefined; /** * Sets the pad angle to the specified number and returns this arc generator. * @@ -248,7 +248,7 @@ export interface Arc { * * @param angle Constant angle in radians. */ - padAngle(angle: number): this; + padAngle(angle: number | undefined): this; /** * Sets the pad angle to the specified function and returns this arc generator. * @@ -267,7 +267,7 @@ export interface Arc { * @param angle An accessor function returning a number in radians to be used as an angle. The accessor function is invoked in the same "this" context as the generator was invoked in and * receives the same arguments that were passed into the arc generator. */ - padAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; + padAngle(angle: (this: This, d: Datum, ...args: any[]) => number | undefined): this; /** * Returns the current pad radius accessor, which defaults to null, indicating that the pad radius should be automatically computed as sqrt(innerRadius * innerRadius + outerRadius * outerRadius). diff --git a/types/d3-shape/tsconfig.json b/types/d3-shape/tsconfig.json index 0436aafd66..95b8e8a112 100644 --- a/types/d3-shape/tsconfig.json +++ b/types/d3-shape/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-time-format/tsconfig.json b/types/d3-time-format/tsconfig.json index 782a3ab291..829d92b69e 100644 --- a/types/d3-time-format/tsconfig.json +++ b/types/d3-time-format/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "d3-time-format-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/d3-time/tsconfig.json b/types/d3-time/tsconfig.json index 963c0df157..aa5250e8df 100644 --- a/types/d3-time/tsconfig.json +++ b/types/d3-time/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-timer/tsconfig.json b/types/d3-timer/tsconfig.json index f3af0c7d8e..6f04f3f1de 100644 --- a/types/d3-timer/tsconfig.json +++ b/types/d3-timer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-tip/tsconfig.json b/types/d3-tip/tsconfig.json index 8bd5f064c9..7a4d78071c 100644 --- a/types/d3-tip/tsconfig.json +++ b/types/d3-tip/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-transition/tsconfig.json b/types/d3-transition/tsconfig.json index f23a386a94..43d4e23565 100644 --- a/types/d3-transition/tsconfig.json +++ b/types/d3-transition/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-voronoi/tsconfig.json b/types/d3-voronoi/tsconfig.json index ada834dec3..88819747f1 100644 --- a/types/d3-voronoi/tsconfig.json +++ b/types/d3-voronoi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3-zoom/tsconfig.json b/types/d3-zoom/tsconfig.json index ed184bf861..460c577983 100644 --- a/types/d3-zoom/tsconfig.json +++ b/types/d3-zoom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3.cloud.layout/tsconfig.json b/types/d3.cloud.layout/tsconfig.json index ffb26214cc..5dc4a6e41b 100644 --- a/types/d3.cloud.layout/tsconfig.json +++ b/types/d3.cloud.layout/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3.slider/tsconfig.json b/types/d3.slider/tsconfig.json index a2a0a2c0c7..487fbb4be2 100644 --- a/types/d3.slider/tsconfig.json +++ b/types/d3.slider/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3/tsconfig.json b/types/d3/tsconfig.json index 8ec0a8e64e..adea130e6c 100644 --- a/types/d3/tsconfig.json +++ b/types/d3/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3/v3/tsconfig.json b/types/d3/v3/tsconfig.json index dd4cea8078..4912912a48 100644 --- a/types/d3/v3/tsconfig.json +++ b/types/d3/v3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3kit/tsconfig.json b/types/d3kit/tsconfig.json index 40e266f6f9..3288c90ae9 100644 --- a/types/d3kit/tsconfig.json +++ b/types/d3kit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3kit/v1/tsconfig.json b/types/d3kit/v1/tsconfig.json index f2112d2661..0856962263 100644 --- a/types/d3kit/v1/tsconfig.json +++ b/types/d3kit/v1/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/d3pie/tsconfig.json b/types/d3pie/tsconfig.json index c654f02557..ee657eb9ed 100644 --- a/types/d3pie/tsconfig.json +++ b/types/d3pie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dagre-d3/tsconfig.json b/types/dagre-d3/tsconfig.json index 584a8cc848..c67751ed03 100644 --- a/types/dagre-d3/tsconfig.json +++ b/types/dagre-d3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dagre-layout/tsconfig.json b/types/dagre-layout/tsconfig.json index 12bfb07f57..b1b3ec1692 100644 --- a/types/dagre-layout/tsconfig.json +++ b/types/dagre-layout/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dagre/tsconfig.json b/types/dagre/tsconfig.json index b5802bd42e..07d7208f87 100644 --- a/types/dagre/tsconfig.json +++ b/types/dagre/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dargs/tsconfig.json b/types/dargs/tsconfig.json index 88aef9d923..eb152319a9 100644 --- a/types/dargs/tsconfig.json +++ b/types/dargs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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..4ca9ab12f2 --- /dev/null +++ b/types/dashify/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": 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" +} diff --git a/types/dat-gui/tsconfig.json b/types/dat-gui/tsconfig.json index 4961272694..b8138868cc 100644 --- a/types/dat-gui/tsconfig.json +++ b/types/dat-gui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/data-driven/tsconfig.json b/types/data-driven/tsconfig.json index 7e3cb6a15c..4423546191 100644 --- a/types/data-driven/tsconfig.json +++ b/types/data-driven/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datadog-metrics/tsconfig.json b/types/datadog-metrics/tsconfig.json index ca3613429a..3cb76e9dfd 100644 --- a/types/datadog-metrics/tsconfig.json +++ b/types/datadog-metrics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datatables.net-buttons/tsconfig.json b/types/datatables.net-buttons/tsconfig.json index 3e8d4ce82c..47ef321009 100644 --- a/types/datatables.net-buttons/tsconfig.json +++ b/types/datatables.net-buttons/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datatables.net-fixedheader/tsconfig.json b/types/datatables.net-fixedheader/tsconfig.json index 5c747aa854..e42c69588e 100644 --- a/types/datatables.net-fixedheader/tsconfig.json +++ b/types/datatables.net-fixedheader/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datatables.net-rowgroup/datatables.net-rowgroup-tests.ts b/types/datatables.net-rowgroup/datatables.net-rowgroup-tests.ts new file mode 100644 index 0000000000..d0149faba2 --- /dev/null +++ b/types/datatables.net-rowgroup/datatables.net-rowgroup-tests.ts @@ -0,0 +1,40 @@ +let config_1: DataTables.Settings = { + // RowGroup extension options + rowGroup: { + className: 'className', + enable: true, + dataSrc: 'data', + endClassName: 'endClassName', + endRender: (rows, group) => { + return `${ group } (${ rows.count() } rows)`; + }, + startRender: (rows, group) => { + return `${ group } (${ rows.count() } rows)`; + } + } +}; + +let dt: DataTables.Api = $("selector").DataTable({ + rowGroup: true +}); + +// Statics +let fixed_1 = new $.fn.dataTable.RowGroup(dt, { + enable: true, +}); + +let fixed_2 = new $.fn.dataTable.RowGroup(dt, true); + +let version = $.fn.dataTable.RowGroup.version; + +$.fn.dataTable.RowGroup.defaults.className = 'row-group-class'; + +// API +dt.rowGroup().dataSrc(); +dt.rowGroup().disable(); +dt.rowGroup().enable(true); + +// Chaining +dt.rowGroup().dataSrc(12) + .rowGroup().disable() + .rowGroup().enable(); diff --git a/types/datatables.net-rowgroup/index.d.ts b/types/datatables.net-rowgroup/index.d.ts new file mode 100644 index 0000000000..e2697c7fac --- /dev/null +++ b/types/datatables.net-rowgroup/index.d.ts @@ -0,0 +1,88 @@ +// Type definitions for datatables.net-rowgroup 1.0 +// Project: https://datatables.net/extensions/rowgroup/ +// Definitions by: Matthieu Tabuteau +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +/// + +declare namespace DataTables { + interface Settings { + /** + * RowGroup extension options + */ + rowGroup?: boolean | RowGroupSettings; + } + + interface StaticFunctions { + RowGroup: RowGroupStaticFunctions; + } + + interface RowGroupStaticFunctions { + new (dt: Api, settings: boolean | RowGroupSettings): undefined; + version: string; + defaults: RowGroupSettings; + } + + interface Api { + rowGroup(): RowGroupApi; + } + + interface RowGroupApi { + /** + * Get the data source for the row grouping + */ + dataSrc(): number|string; + + /** + * Set the data source for the row grouping + */ + dataSrc(prop: number|string): Api; + + /** + * Disable RowGroup's interaction with the table + */ + disable(): Api; + + /** + * Enable or disable RowGroup's interaction with the table + */ + enable(enable?: boolean): Api; + } + + /** + * RowGroup extension options + */ + interface RowGroupSettings { + /** + * Set the class name to be used for the grouping rows + */ + className?: string; + + /** + * Set the data point to use as the grouping data source + */ + dataSrc?: number|string; + + /** + * Provides the ability to disable row grouping at initialisation + */ + enable?: boolean; + + /** + * Set the class name to be used for the grouping end rows + */ + endClassName?: string; + + /** + * Provide a function that can be used to control the data shown in the end grouping row + */ + endRender?: (rows: Api, group: string) => string|HTMLElement|JQuery; + + /** + * Provide a function that can be used to control the data shown in the start grouping row + */ + startRender?: (rows: Api, group: string) => string|HTMLElement|JQuery; + } +} diff --git a/types/datatables.net-rowgroup/tsconfig.json b/types/datatables.net-rowgroup/tsconfig.json new file mode 100644 index 0000000000..66d4610072 --- /dev/null +++ b/types/datatables.net-rowgroup/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "datatables.net-rowgroup-tests.ts" + ] +} \ No newline at end of file diff --git a/types/datatables.net-rowgroup/tslint.json b/types/datatables.net-rowgroup/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net-rowgroup/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/datatables.net-rowreorder/tsconfig.json b/types/datatables.net-rowreorder/tsconfig.json index c16752cd22..3f2a9668a1 100644 --- a/types/datatables.net-rowreorder/tsconfig.json +++ b/types/datatables.net-rowreorder/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datatables.net-select/tsconfig.json b/types/datatables.net-select/tsconfig.json index 50398d173e..63aaf5e9df 100644 --- a/types/datatables.net-select/tsconfig.json +++ b/types/datatables.net-select/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datatables.net/tsconfig.json b/types/datatables.net/tsconfig.json index 04972add17..8aafdcfc1c 100644 --- a/types/datatables.net/tsconfig.json +++ b/types/datatables.net/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/date-arithmetic/tsconfig.json b/types/date-arithmetic/tsconfig.json index d8942e343c..2e9dea5326 100644 --- a/types/date-arithmetic/tsconfig.json +++ b/types/date-arithmetic/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/date.format.js/tsconfig.json b/types/date.format.js/tsconfig.json index a7a5e7f404..a835b70fa3 100644 --- a/types/date.format.js/tsconfig.json +++ b/types/date.format.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dateformat/tsconfig.json b/types/dateformat/tsconfig.json index 1c5fc06611..0511224dad 100644 --- a/types/dateformat/tsconfig.json +++ b/types/dateformat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/datejs/tsconfig.json b/types/datejs/tsconfig.json index 5d17ca2da9..eb53ed05f1 100644 --- a/types/datejs/tsconfig.json +++ b/types/datejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/daterangepicker/tsconfig.json b/types/daterangepicker/tsconfig.json index 1ed4157bc7..621dd6dada 100644 --- a/types/daterangepicker/tsconfig.json +++ b/types/daterangepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/db-migrate-base/tsconfig.json b/types/db-migrate-base/tsconfig.json index f4c835bb88..0d756c7d5c 100644 --- a/types/db-migrate-base/tsconfig.json +++ b/types/db-migrate-base/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/db-migrate-pg/tsconfig.json b/types/db-migrate-pg/tsconfig.json index c63efcd105..3243faf3dd 100644 --- a/types/db-migrate-pg/tsconfig.json +++ b/types/db-migrate-pg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/db.js/tsconfig.json b/types/db.js/tsconfig.json index 75989af0b3..10ea07f745 100644 --- a/types/db.js/tsconfig.json +++ b/types/db.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dc/tsconfig.json b/types/dc/tsconfig.json index 863d600736..290a1e994d 100644 --- a/types/dc/tsconfig.json +++ b/types/dc/tsconfig.json @@ -24,6 +24,7 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/deasync/tsconfig.json b/types/deasync/tsconfig.json index d61004bac3..d62c8d7f8e 100644 --- a/types/deasync/tsconfig.json +++ b/types/deasync/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/debessmann/tsconfig.json b/types/debessmann/tsconfig.json index b8b4c01d06..1dc931d093 100644 --- a/types/debessmann/tsconfig.json +++ b/types/debessmann/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/debounce/tsconfig.json b/types/debounce/tsconfig.json index bf08d46e44..4dd1415a27 100644 --- a/types/debounce/tsconfig.json +++ b/types/debounce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/debug/tsconfig.json b/types/debug/tsconfig.json index 7caca45f35..33cacd7464 100644 --- a/types/debug/tsconfig.json +++ b/types/debug/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/decamelize/tsconfig.json b/types/decamelize/tsconfig.json index 54bea1b020..9c034b4839 100644 --- a/types/decamelize/tsconfig.json +++ b/types/decamelize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/decay/tsconfig.json b/types/decay/tsconfig.json index d35511f505..1300da9349 100644 --- a/types/decay/tsconfig.json +++ b/types/decay/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/decompress/tsconfig.json b/types/decompress/tsconfig.json index 33c7a8c5e8..a76b0817fd 100644 --- a/types/decompress/tsconfig.json +++ b/types/decompress/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "decompress-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/decorum/tsconfig.json b/types/decorum/tsconfig.json index 82792e10c5..40ba95f9ea 100644 --- a/types/decorum/tsconfig.json +++ b/types/decorum/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dedent/tsconfig.json b/types/dedent/tsconfig.json index 30c39b0a23..61234daf73 100644 --- a/types/dedent/tsconfig.json +++ b/types/dedent/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-assign/tsconfig.json b/types/deep-assign/tsconfig.json index 76d4b1b23e..f8a0647dca 100644 --- a/types/deep-assign/tsconfig.json +++ b/types/deep-assign/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-diff/tsconfig.json b/types/deep-diff/tsconfig.json index 95cd2d22ac..76c498035e 100644 --- a/types/deep-diff/tsconfig.json +++ b/types/deep-diff/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-equal/tsconfig.json b/types/deep-equal/tsconfig.json index e5c20aa772..9c016f9281 100644 --- a/types/deep-equal/tsconfig.json +++ b/types/deep-equal/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-extend/tsconfig.json b/types/deep-extend/tsconfig.json index 768b1ac92d..ff77090b23 100644 --- a/types/deep-extend/tsconfig.json +++ b/types/deep-extend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-freeze-es6/tsconfig.json b/types/deep-freeze-es6/tsconfig.json index cf9a3b32f5..f47120248f 100644 --- a/types/deep-freeze-es6/tsconfig.json +++ b/types/deep-freeze-es6/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deep-freeze-strict/tsconfig.json b/types/deep-freeze-strict/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/deep-freeze-strict/tsconfig.json +++ b/types/deep-freeze-strict/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/deep-freeze/tsconfig.json b/types/deep-freeze/tsconfig.json index 3fe6438f96..bd681a7f3b 100644 --- a/types/deep-freeze/tsconfig.json +++ b/types/deep-freeze/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deepmerge/tsconfig.json b/types/deepmerge/tsconfig.json index b863d1bcb9..fd45a1df17 100644 --- a/types/deepmerge/tsconfig.json +++ b/types/deepmerge/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/defaults/tsconfig.json b/types/defaults/tsconfig.json index 4a66176c28..90757c2104 100644 --- a/types/defaults/tsconfig.json +++ b/types/defaults/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/defer-promise/tsconfig.json b/types/defer-promise/tsconfig.json index 1aaa667626..ef7ffa0690 100644 --- a/types/defer-promise/tsconfig.json +++ b/types/defer-promise/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "defer-promise-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/define-lazy-prop/tsconfig.json b/types/define-lazy-prop/tsconfig.json index e72c943c52..8b8f252553 100644 --- a/types/define-lazy-prop/tsconfig.json +++ b/types/define-lazy-prop/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/defined/tsconfig.json b/types/defined/tsconfig.json index 35b5bb7c83..3f8607f716 100644 --- a/types/defined/tsconfig.json +++ b/types/defined/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deku/tsconfig.json b/types/deku/tsconfig.json index ad8473665d..67cbce0a6a 100644 --- a/types/deku/tsconfig.json +++ b/types/deku/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/del/tsconfig.json b/types/del/tsconfig.json index 6143d08346..8d4988bb00 100644 --- a/types/del/tsconfig.json +++ b/types/del/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/del/v2/tsconfig.json b/types/del/v2/tsconfig.json index 568d1a8a21..00f2f32920 100644 --- a/types/del/v2/tsconfig.json +++ b/types/del/v2/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/delaunator/tsconfig.json b/types/delaunator/tsconfig.json index a9c94600d8..97bca0c508 100644 --- a/types/delaunator/tsconfig.json +++ b/types/delaunator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/delay/tsconfig.json b/types/delay/tsconfig.json index cb0da53652..039ccc4860 100644 --- a/types/delay/tsconfig.json +++ b/types/delay/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/denodeify/tsconfig.json b/types/denodeify/tsconfig.json index 04d0008cd5..309f54e7c1 100644 --- a/types/denodeify/tsconfig.json +++ b/types/denodeify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deoxxa-content-type/tsconfig.json b/types/deoxxa-content-type/tsconfig.json index 5f50fa4676..10d2335f0f 100644 --- a/types/deoxxa-content-type/tsconfig.json +++ b/types/deoxxa-content-type/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/depcheck/tsconfig.json b/types/depcheck/tsconfig.json index f3a0a7df65..14f56cc2b5 100644 --- a/types/depcheck/tsconfig.json +++ b/types/depcheck/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "depcheck-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/depd/tsconfig.json b/types/depd/tsconfig.json index cea39d4996..3164f96fa6 100644 --- a/types/depd/tsconfig.json +++ b/types/depd/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/deployjava/tsconfig.json b/types/deployjava/tsconfig.json index 934531a4ee..7241ae5513 100644 --- a/types/deployjava/tsconfig.json +++ b/types/deployjava/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/destroy-on-hwm/tsconfig.json b/types/destroy-on-hwm/tsconfig.json index 8f77b1b9a4..54b7ae1b87 100644 --- a/types/destroy-on-hwm/tsconfig.json +++ b/types/destroy-on-hwm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/destroy/tsconfig.json b/types/destroy/tsconfig.json index d3c5ca771d..4d57e05510 100644 --- a/types/destroy/tsconfig.json +++ b/types/destroy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-browser/tsconfig.json b/types/detect-browser/tsconfig.json index b1319407fc..745bcc8128 100644 --- a/types/detect-browser/tsconfig.json +++ b/types/detect-browser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-hover/tsconfig.json b/types/detect-hover/tsconfig.json index 69abd062cd..b2f4b457c6 100644 --- a/types/detect-hover/tsconfig.json +++ b/types/detect-hover/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-indent/tsconfig.json b/types/detect-indent/tsconfig.json index 3119632150..e75f82a918 100644 --- a/types/detect-indent/tsconfig.json +++ b/types/detect-indent/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-indent/v0/tsconfig.json b/types/detect-indent/v0/tsconfig.json index 6fb921c298..a646b4f457 100644 --- a/types/detect-indent/v0/tsconfig.json +++ b/types/detect-indent/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-it/tsconfig.json b/types/detect-it/tsconfig.json index 28787b09b8..c74d5b9c65 100644 --- a/types/detect-it/tsconfig.json +++ b/types/detect-it/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-newline/tsconfig.json b/types/detect-newline/tsconfig.json index a94c517f93..1ee86197af 100644 --- a/types/detect-newline/tsconfig.json +++ b/types/detect-newline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-passive-events/tsconfig.json b/types/detect-passive-events/tsconfig.json index 83ddf05856..6e57a4488c 100644 --- a/types/detect-passive-events/tsconfig.json +++ b/types/detect-passive-events/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-pointer/tsconfig.json b/types/detect-pointer/tsconfig.json index 50b7d6cb7d..de5138f95a 100644 --- a/types/detect-pointer/tsconfig.json +++ b/types/detect-pointer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-port/tsconfig.json b/types/detect-port/tsconfig.json index 9d400580a4..353d626311 100644 --- a/types/detect-port/tsconfig.json +++ b/types/detect-port/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/detect-touch-events/tsconfig.json b/types/detect-touch-events/tsconfig.json index 03b3cc49cb..cfd46b1f2b 100644 --- a/types/detect-touch-events/tsconfig.json +++ b/types/detect-touch-events/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/devexpress-web/tsconfig.json b/types/devexpress-web/tsconfig.json index 3510853ddd..22b3c9ce8c 100644 --- a/types/devexpress-web/tsconfig.json +++ b/types/devexpress-web/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/devexpress-web/v161/tsconfig.json b/types/devexpress-web/v161/tsconfig.json index 0c6ad80e42..1875485bf1 100644 --- a/types/devexpress-web/v161/tsconfig.json +++ b/types/devexpress-web/v161/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/devexpress-web/v162/tsconfig.json b/types/devexpress-web/v162/tsconfig.json index 0878906afb..b0e0cd1a6f 100644 --- a/types/devexpress-web/v162/tsconfig.json +++ b/types/devexpress-web/v162/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/devtools-detect/tsconfig.json b/types/devtools-detect/tsconfig.json index 8ab64cb68c..cbf7e862ac 100644 --- a/types/devtools-detect/tsconfig.json +++ b/types/devtools-detect/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/df-visible/tsconfig.json b/types/df-visible/tsconfig.json index ca15676b02..3ada905eca 100644 --- a/types/df-visible/tsconfig.json +++ b/types/df-visible/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dhtmlxgantt/tsconfig.json b/types/dhtmlxgantt/tsconfig.json index f897e58d02..280ae19957 100644 --- a/types/dhtmlxgantt/tsconfig.json +++ b/types/dhtmlxgantt/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dhtmlxscheduler/tsconfig.json b/types/dhtmlxscheduler/tsconfig.json index 8d145fb613..71b2f56ab6 100644 --- a/types/dhtmlxscheduler/tsconfig.json +++ b/types/dhtmlxscheduler/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/di-lite/tsconfig.json b/types/di-lite/tsconfig.json index 7f10ef8967..e76b11c158 100644 --- a/types/di-lite/tsconfig.json +++ b/types/di-lite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/diacritics/tsconfig.json b/types/diacritics/tsconfig.json index 03b49dbe95..f0b9510d2e 100644 --- a/types/diacritics/tsconfig.json +++ b/types/diacritics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/diff-match-patch/tsconfig.json b/types/diff-match-patch/tsconfig.json index 11f60e2489..a28e29633b 100644 --- a/types/diff-match-patch/tsconfig.json +++ b/types/diff-match-patch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/diff/tsconfig.json b/types/diff/tsconfig.json index 9a1fdba840..bf2e3af341 100644 --- a/types/diff/tsconfig.json +++ b/types/diff/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/diff2html/index.d.ts b/types/diff2html/index.d.ts index ce2522d444..1b75f1e3df 100644 --- a/types/diff2html/index.d.ts +++ b/types/diff2html/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Diff2Html { - + export interface Options { inputFormat?: string; outputFormat?: string; @@ -53,10 +53,11 @@ declare namespace Diff2Html { checksumAfter?: string; mode?: string; } - + export interface Diff2Html { - getJsonFromDiff(input: string, configuration?: Options): Result; + getJsonFromDiff(input: string, configuration?: Options): Result[]; getPrettyHtml(input: any, configuration?: Options): string; + getPrettyHtmlFromJson(input: Result[], configuration?: Options): string; } } diff --git a/types/diff2html/tsconfig.json b/types/diff2html/tsconfig.json index bb9662b5b6..7eb376bb33 100644 --- a/types/diff2html/tsconfig.json +++ b/types/diff2html/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dir-resolve/tsconfig.json b/types/dir-resolve/tsconfig.json index 129d8a0aa9..1a2677f4da 100644 --- a/types/dir-resolve/tsconfig.json +++ b/types/dir-resolve/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/discontinuous-range/tsconfig.json b/types/discontinuous-range/tsconfig.json index 26c43bf7f0..64edbc248e 100644 --- a/types/discontinuous-range/tsconfig.json +++ b/types/discontinuous-range/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/disposable-email-domains/tsconfig.json b/types/disposable-email-domains/tsconfig.json index 70b9e249d1..3fd51dba9b 100644 --- a/types/disposable-email-domains/tsconfig.json +++ b/types/disposable-email-domains/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/doccookies/tsconfig.json b/types/doccookies/tsconfig.json index e4de927a2f..9df6ed48d5 100644 --- a/types/doccookies/tsconfig.json +++ b/types/doccookies/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dock-spawn/tsconfig.json b/types/dock-spawn/tsconfig.json index a5c6c7b144..c79bde1059 100644 --- a/types/dock-spawn/tsconfig.json +++ b/types/dock-spawn/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dockerode/dockerode-tests.ts b/types/dockerode/dockerode-tests.ts index 458134917b..f53f0d2ad4 100644 --- a/types/dockerode/dockerode-tests.ts +++ b/types/dockerode/dockerode-tests.ts @@ -1,4 +1,4 @@ -import * as Docker from 'dockerode'; +import Docker = require('dockerode'); import * as fs from 'fs'; // Code samples from Dockerode 'Getting started' diff --git a/types/dockerode/tsconfig.json b/types/dockerode/tsconfig.json index 3334b9b296..85e6705d47 100644 --- a/types/dockerode/tsconfig.json +++ b/types/dockerode/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/docopt/tsconfig.json b/types/docopt/tsconfig.json index bc71021fcd..ac4ca64e76 100644 --- a/types/docopt/tsconfig.json +++ b/types/docopt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/doctrine/tsconfig.json b/types/doctrine/tsconfig.json index 1b9e7702c2..cf7070091c 100644 --- a/types/doctrine/tsconfig.json +++ b/types/doctrine/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/documentdb-server/tsconfig.json b/types/documentdb-server/tsconfig.json index 98dcf6bf5c..9320c53f1b 100644 --- a/types/documentdb-server/tsconfig.json +++ b/types/documentdb-server/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/documentdb-session/tsconfig.json b/types/documentdb-session/tsconfig.json index 40ab7520b7..45398d91dd 100644 --- a/types/documentdb-session/tsconfig.json +++ b/types/documentdb-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/documentdb/tsconfig.json b/types/documentdb/tsconfig.json index 48c13eac51..f602f0c74d 100644 --- a/types/documentdb/tsconfig.json +++ b/types/documentdb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dojo/tsconfig.json b/types/dojo/tsconfig.json index 140f764554..d7f9e50b42 100644 --- a/types/dojo/tsconfig.json +++ b/types/dojo/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -83,5 +84,4 @@ "dojox.widget.d.ts", "dojox.xml.d.ts" ] -} - +} \ No newline at end of file diff --git a/types/dom-inputevent/tsconfig.json b/types/dom-inputevent/tsconfig.json index a309b9ec2e..cd56b783f6 100644 --- a/types/dom-inputevent/tsconfig.json +++ b/types/dom-inputevent/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dom4/dom4-tests.ts b/types/dom4/dom4-tests.ts index 35867f2e43..7dbf8e12f0 100644 --- a/types/dom4/dom4-tests.ts +++ b/types/dom4/dom4-tests.ts @@ -1,7 +1,7 @@ function testDocument() { - document.query(".container-a").classList; - document.queryAll(".container-b")[0].className; - document.queryAll(".container-c").childElementCount; + document.querySelector(".container-a").classList; + document.querySelectorAll(".container-b")[0].className; + document.querySelector(".container-c").append("foo", document.createElement("button")); } function testElement(el: Element) { diff --git a/types/dom4/index.d.ts b/types/dom4/index.d.ts index 95cabbd4d3..90c9c29966 100644 --- a/types/dom4/index.d.ts +++ b/types/dom4/index.d.ts @@ -1,8 +1,11 @@ -// Type definitions for dom4 v1.5 +// Type definitions for dom4 v2.0 // Project: https://github.com/WebReflection/dom4 // Definitions by: Adi Dahiya , Gilad Gray // Definitions: https://github.com/borisyankov/DefinitelyTyped +/** + * https://dom.spec.whatwg.org/#parentnode + */ interface ParentNode { /** * Returns the child elements. @@ -10,21 +13,46 @@ interface ParentNode { readonly children: HTMLCollection; /** - * Returns the first element that is a descendant of node that matches relativeSelectors. + * Inserts `nodes` after the last child of this node, while replacing strings with equivalent `Text` nodes. */ - query(relativeSelectors: string): Element; + append(...nodes: Array): void; /** - * Returns all element descendants of node that match relativeSelectors. + * Inserts `nodes` before the first child of this node, while replacing strings with equivalent `Text` nodes. */ - queryAll(relativeSelectors: string): Elements; + prepend(...nodes: Array): void; +} + +/** + * https://dom.spec.whatwg.org/#childnode + */ +interface ChildNode { + /** + * Inserts `nodes` just after this node, while replacing strings with equivalent `Text` nodes. + */ + after(...nodes: Array): void; + + /** + * Inserts `nodes` just before this node, while replacing strings with equivalent `Text` nodes. + */ + before(...nodes: Array): void; + + /** + * Replaces this node with `nodes`, while replacing strings in nodes with equivalent Text nodes. + */ + replaceWith(...nodes: Array): void; + + /** + * Removes this node. + */ + remove(): void; } interface Element extends ParentNode { /** * Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. */ - closest(selectors: string): Element; + closest(selectors: string): Element | null; /** * Returns true if matching selectors against element’s root yields element, and false otherwise. diff --git a/types/dom4/tsconfig.json b/types/dom4/tsconfig.json index 3db581ed36..579670df92 100644 --- a/types/dom4/tsconfig.json +++ b/types/dom4/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/domo/tsconfig.json b/types/domo/tsconfig.json index 1700042ecc..d98ca4d683 100644 --- a/types/domo/tsconfig.json +++ b/types/domo/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dompurify/tsconfig.json b/types/dompurify/tsconfig.json index f10fdda910..e43c9febde 100644 --- a/types/dompurify/tsconfig.json +++ b/types/dompurify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/domready/tsconfig.json b/types/domready/tsconfig.json index 1495d185a6..08391e9dd2 100644 --- a/types/domready/tsconfig.json +++ b/types/domready/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/domurl/tsconfig.json b/types/domurl/tsconfig.json index c678dbc069..450c43b839 100644 --- a/types/domurl/tsconfig.json +++ b/types/domurl/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/donna/tsconfig.json b/types/donna/tsconfig.json index 6e06e71c36..c683e15ca5 100644 --- a/types/donna/tsconfig.json +++ b/types/donna/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dookie/tsconfig.json b/types/dookie/tsconfig.json index a788cba5bc..e4f71c26fa 100644 --- a/types/dookie/tsconfig.json +++ b/types/dookie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dot-object/tsconfig.json b/types/dot-object/tsconfig.json index f58205cdaf..941ba764dc 100644 --- a/types/dot-object/tsconfig.json +++ b/types/dot-object/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dot-prop/tsconfig.json b/types/dot-prop/tsconfig.json index cbacf32b41..73180091a1 100644 --- a/types/dot-prop/tsconfig.json +++ b/types/dot-prop/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dot-prop/v2/tsconfig.json b/types/dot-prop/v2/tsconfig.json index f5770f3083..66701208fc 100644 --- a/types/dot-prop/v2/tsconfig.json +++ b/types/dot-prop/v2/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dot/tsconfig.json b/types/dot/tsconfig.json index 2c1a595ac6..dc732938b9 100644 --- a/types/dot/tsconfig.json +++ b/types/dot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dotdir-regex/tsconfig.json b/types/dotdir-regex/tsconfig.json index 48f516abd8..05a1fa51fc 100644 --- a/types/dotdir-regex/tsconfig.json +++ b/types/dotdir-regex/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "dotdir-regex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dotdotdot/tsconfig.json b/types/dotdotdot/tsconfig.json index 8be8dc5245..646dc386bb 100644 --- a/types/dotdotdot/tsconfig.json +++ b/types/dotdotdot/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dotenv-safe/tsconfig.json b/types/dotenv-safe/tsconfig.json index 46b51afc29..3deacfa95d 100644 --- a/types/dotenv-safe/tsconfig.json +++ b/types/dotenv-safe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dotenv/tsconfig.json b/types/dotenv/tsconfig.json index 5c51b4d698..f5e49e1b84 100644 --- a/types/dotenv/tsconfig.json +++ b/types/dotenv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dotenv/v2/tsconfig.json b/types/dotenv/v2/tsconfig.json index facb307571..c7b540d409 100644 --- a/types/dotenv/v2/tsconfig.json +++ b/types/dotenv/v2/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dotfile-regex/tsconfig.json b/types/dotfile-regex/tsconfig.json index 899be54b3b..74e46144e6 100644 --- a/types/dotfile-regex/tsconfig.json +++ b/types/dotfile-regex/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "dotfile-regex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dottie/tsconfig.json b/types/dottie/tsconfig.json index f770bbf57d..34b719f7be 100644 --- a/types/dottie/tsconfig.json +++ b/types/dottie/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/double-ended-queue/tsconfig.json b/types/double-ended-queue/tsconfig.json index 5477379341..5289474c22 100644 --- a/types/double-ended-queue/tsconfig.json +++ b/types/double-ended-queue/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "double-ended-queue-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/doublearray/tsconfig.json b/types/doublearray/tsconfig.json index fbc5ab9e55..60fcedffa5 100644 --- a/types/doublearray/tsconfig.json +++ b/types/doublearray/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/doubleclick-gpt/tsconfig.json b/types/doubleclick-gpt/tsconfig.json index d240d560ce..0cadcea552 100644 --- a/types/doubleclick-gpt/tsconfig.json +++ b/types/doubleclick-gpt/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/download/download-tests.ts b/types/download/download-tests.ts index 34d56d763b..7a498ef0dd 100644 --- a/types/download/download-tests.ts +++ b/types/download/download-tests.ts @@ -28,8 +28,3 @@ download('unicorn.com/foo.jpg', 'dest', { }, useElectronNet: true }); - -import * as download2 from 'download'; - -let downloadFunction = download; -downloadFunction = download2; diff --git a/types/download/tsconfig.json b/types/download/tsconfig.json index 634ae5ab32..4c2a798181 100644 --- a/types/download/tsconfig.json +++ b/types/download/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "download-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/downloadjs/tsconfig.json b/types/downloadjs/tsconfig.json index 15703cf41a..ef9a4f48df 100644 --- a/types/downloadjs/tsconfig.json +++ b/types/downloadjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/draft-js/tsconfig.json b/types/draft-js/tsconfig.json index 58fc6cd302..6b00c0304b 100644 --- a/types/draft-js/tsconfig.json +++ b/types/draft-js/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/drag-timetable/tsconfig.json b/types/drag-timetable/tsconfig.json index 875c35f69a..bb865cb850 100644 --- a/types/drag-timetable/tsconfig.json +++ b/types/drag-timetable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/draggabilly/tsconfig.json b/types/draggabilly/tsconfig.json index d34c51c338..ce7ce9796a 100644 --- a/types/draggabilly/tsconfig.json +++ b/types/draggabilly/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dragster/tsconfig.json b/types/dragster/tsconfig.json index c415da2b1a..a01e46114a 100644 --- a/types/dragster/tsconfig.json +++ b/types/dragster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dragula/tsconfig.json b/types/dragula/tsconfig.json index 8179057247..2a559a985a 100644 --- a/types/dragula/tsconfig.json +++ b/types/dragula/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dropboxjs/tsconfig.json b/types/dropboxjs/tsconfig.json index c1c700cf02..eacfcbef6a 100644 --- a/types/dropboxjs/tsconfig.json +++ b/types/dropboxjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dropkickjs/tsconfig.json b/types/dropkickjs/tsconfig.json index 31076fcede..236482a1b4 100644 --- a/types/dropkickjs/tsconfig.json +++ b/types/dropkickjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dropzone/tsconfig.json b/types/dropzone/tsconfig.json index 552b864cb7..122461bf99 100644 --- a/types/dropzone/tsconfig.json +++ b/types/dropzone/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dropzone/v4/tsconfig.json b/types/dropzone/v4/tsconfig.json index d88ab721fd..aae03fcbc2 100644 --- a/types/dropzone/v4/tsconfig.json +++ b/types/dropzone/v4/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { "dropzone": [ "dropzone/v4" diff --git a/types/dsv/tsconfig.json b/types/dsv/tsconfig.json index ba47a0e093..caec8c18be 100644 --- a/types/dsv/tsconfig.json +++ b/types/dsv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dts-bundle/tsconfig.json b/types/dts-bundle/tsconfig.json index a380447ece..e0f3943154 100644 --- a/types/dts-bundle/tsconfig.json +++ b/types/dts-bundle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dts-generator/tsconfig.json b/types/dts-generator/tsconfig.json index 97bc3726f6..2095dbfe71 100644 --- a/types/dts-generator/tsconfig.json +++ b/types/dts-generator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/duplexer2/tsconfig.json b/types/duplexer2/tsconfig.json index 90332a13a9..f6c3a3bd6f 100644 --- a/types/duplexer2/tsconfig.json +++ b/types/duplexer2/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/duplexer3/tsconfig.json b/types/duplexer3/tsconfig.json index 1b3e73cc33..bffe49054d 100644 --- a/types/duplexer3/tsconfig.json +++ b/types/duplexer3/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/duplexify/tsconfig.json b/types/duplexify/tsconfig.json index 72c801f5ab..77cccda4d5 100644 --- a/types/duplexify/tsconfig.json +++ b/types/duplexify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/duplicate-package-checker-webpack-plugin/tsconfig.json b/types/duplicate-package-checker-webpack-plugin/tsconfig.json index 7174bf68ea..835669e473 100644 --- a/types/duplicate-package-checker-webpack-plugin/tsconfig.json +++ b/types/duplicate-package-checker-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/durandal/tsconfig.json b/types/durandal/tsconfig.json index d34d6a1d77..19a01dfff9 100644 --- a/types/durandal/tsconfig.json +++ b/types/durandal/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/durandal/v1/tsconfig.json b/types/durandal/v1/tsconfig.json index d39bcbc18d..f0245c65e7 100644 --- a/types/durandal/v1/tsconfig.json +++ b/types/durandal/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/dustjs-linkedin/tsconfig.json b/types/dustjs-linkedin/tsconfig.json index 36a7497468..a0f0dca49a 100644 --- a/types/dustjs-linkedin/tsconfig.json +++ b/types/dustjs-linkedin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dvtng-jss/tsconfig.json b/types/dvtng-jss/tsconfig.json index 3d47f98d9f..c7b51d7005 100644 --- a/types/dvtng-jss/tsconfig.json +++ b/types/dvtng-jss/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "dvtng-jss-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/dw-bxslider-4/tsconfig.json b/types/dw-bxslider-4/tsconfig.json index 64526359b3..e5465c64d5 100644 --- a/types/dw-bxslider-4/tsconfig.json +++ b/types/dw-bxslider-4/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dwt/tsconfig.json b/types/dwt/tsconfig.json index db2ac6bbf4..bc93f94dcd 100644 --- a/types/dwt/tsconfig.json +++ b/types/dwt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dwt/v12/tsconfig.json b/types/dwt/v12/tsconfig.json index f856dd2657..7ef5ca74c2 100644 --- a/types/dwt/v12/tsconfig.json +++ b/types/dwt/v12/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dygraphs/tsconfig.json b/types/dygraphs/tsconfig.json index c3ff239b4b..d6df213d34 100644 --- a/types/dygraphs/tsconfig.json +++ b/types/dygraphs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dymo-label-framework/tsconfig.json b/types/dymo-label-framework/tsconfig.json index 23ac4038d1..54a508bf9f 100644 --- a/types/dymo-label-framework/tsconfig.json +++ b/types/dymo-label-framework/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dynatable/tsconfig.json b/types/dynatable/tsconfig.json index 04ffb1120a..ca539d36d9 100644 --- a/types/dynatable/tsconfig.json +++ b/types/dynatable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/dynogels/tsconfig.json b/types/dynogels/tsconfig.json index 40297f0a43..07145428de 100644 --- a/types/dynogels/tsconfig.json +++ b/types/dynogels/tsconfig.json @@ -14,7 +14,8 @@ "types": [], "noEmit": true, "strictFunctionTypes": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/each/tsconfig.json b/types/each/tsconfig.json index 4b80cb809d..0148832306 100644 --- a/types/each/tsconfig.json +++ b/types/each/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/earcut/tsconfig.json b/types/earcut/tsconfig.json index 5dca6eec84..24dddd5a2b 100644 --- a/types/earcut/tsconfig.json +++ b/types/earcut/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "earcut-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/easeljs/tsconfig.json b/types/easeljs/tsconfig.json index 1925fa9a78..7b9d6a37f8 100644 --- a/types/easeljs/tsconfig.json +++ b/types/easeljs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-api-request/tsconfig.json b/types/easy-api-request/tsconfig.json index 8cc26d7811..682a4930a0 100644 --- a/types/easy-api-request/tsconfig.json +++ b/types/easy-api-request/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-jsend/tsconfig.json b/types/easy-jsend/tsconfig.json index 3efc497aaf..4a69b01d6e 100644 --- a/types/easy-jsend/tsconfig.json +++ b/types/easy-jsend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-session/tsconfig.json b/types/easy-session/tsconfig.json index 99d70bf37b..1e2dce35c0 100644 --- a/types/easy-session/tsconfig.json +++ b/types/easy-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-table/tsconfig.json b/types/easy-table/tsconfig.json index 4013bbca85..1c1ae66ab8 100644 --- a/types/easy-table/tsconfig.json +++ b/types/easy-table/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-xapi-utils/tsconfig.json b/types/easy-xapi-utils/tsconfig.json index 6cd04a79b9..2d2ccd5660 100644 --- a/types/easy-xapi-utils/tsconfig.json +++ b/types/easy-xapi-utils/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/easy-xapi/tsconfig.json b/types/easy-xapi/tsconfig.json index fa0e8da402..d77f1bf681 100644 --- a/types/easy-xapi/tsconfig.json +++ b/types/easy-xapi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ebongarde-root/tsconfig.json b/types/ebongarde-root/tsconfig.json index 4765268055..e18dcd54f4 100644 --- a/types/ebongarde-root/tsconfig.json +++ b/types/ebongarde-root/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/echarts/index.d.ts b/types/echarts/index.d.ts index 0ea8aa0c6a..1f42f8030c 100644 --- a/types/echarts/index.d.ts +++ b/types/echarts/index.d.ts @@ -2,6 +2,7 @@ // Project: http://echarts.baidu.com/ // Definitions by: Xie Jingyang , AntiMoron // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 declare namespace echarts { function init(dom: HTMLDivElement | HTMLCanvasElement, theme?: Object | string, opts?: { @@ -9,13 +10,13 @@ declare namespace echarts { renderer?: string }): ECharts; - const graphic: { + const graphic: Graphic; + + interface Graphic { clipPointsByRect(points: number[][], rect: ERectangle): number[][]; clipRectByRect(targetRect: ERectangle, rect: ERectangle): ERectangle; - LinearGradient: { new (x: number, y: number, x2: number, y2: number, colorStops: Array, globalCoord?: boolean): LinearGradient } - - }; - + LinearGradient: { new(x: number, y: number, x2: number, y2: number, colorStops: Array, globalCoord?: boolean): LinearGradient } + } function connect(group: string | Array): void; @@ -29,6 +30,15 @@ declare namespace echarts { function registerTheme(themeName: string, theme: Object): void; + interface MapObj { + /** geoJson data for map */ + geoJson: object, + /** special areas fro map */ + specialAreas: object + } + + function getMap(mapName: string): MapObj; + interface LinearGradient { colorStops: Array; global: boolean; @@ -39,9 +49,8 @@ declare namespace echarts { y2: number } - interface ECharts { - group: string; + group: string setOption(option: EChartOption, notMerge?: boolean, notRefreshImmediately?: boolean): void @@ -66,20 +75,20 @@ declare namespace echarts { hideLoading(): void getDataURL(opts: { - // 导出的格式,可选 png, jpeg + /** 导出的格式,可选 png, jpeg */ type?: string, - // 导出的图片分辨率比例,默认为 1。 + /** 导出的图片分辨率比例,默认为 1。*/ pixelRatio?: number, - // 导出的图片背景色,默认使用 option 里的 backgroundColor + /** 导出的图片背景色,默认使用 option 里的 backgroundColor */ backgroundColor?: string }): string getConnectedDataURL(opts: { - // 导出的格式,可选 png, jpeg + /** 导出的格式,可选 png, jpeg */ type: string, - // 导出的图片分辨率比例,默认为 1。 + /** 导出的图片分辨率比例,默认为 1。 */ pixelRatio: number, - // 导出的图片背景色,默认使用 option 里的 backgroundColor + /** 导出的图片背景色,默认使用 option 里的 backgroundColor */ backgroundColor: string }): string @@ -89,42 +98,32 @@ declare namespace echarts { dispose(): void - // 转换逻辑点到像素 - convertToPixel(finder: { - seriesIndex?: number, - seriesId?: string, - seriesName?: string, - geoIndex?: number, - geoId?: string, - geoName?: string, - xAxisIndex?: number, - xAxisId?: string, - xAxisName?: string, - yAxisIndex?: number, - yAxisId?: string, - yAxisName?: string, - gridIndex?: number, - gridId?: string - gridName?: string - } | string, value: string | Array): string | Array + /** 转换逻辑点到像素 */ + convertToPixel(finder: ConvertFinder | string, value: string | Array): string | Array - convertFromPixel(finder: { - seriesIndex?: number, - seriesId?: string, - seriesName?: string, - geoIndex?: number, - geoId?: string, - geoName?: string, - xAxisIndex?: number, - xAxisId?: string, - xAxisName?: string, - yAxisIndex?: number, - yAxisId?: string, - yAxisName?: string, - gridIndex?: number, - gridId?: string - gridName?: string - } | string, value: Array | string): Array | string + convertFromPixel(finder: ConvertFinder | string, value: Array | string): Array | string + + containPixel(finder: ConvertFinder | string, + /** 要被判断的点,为像素坐标值,以 echarts 实例的 dom 节点的左上角为坐标 [0, 0] 点。*/ + value: any[]): boolean + } + + interface ConvertFinder { + seriesIndex?: number, + seriesId?: string, + seriesName?: string, + geoIndex?: number, + geoId?: string, + geoName?: string, + xAxisIndex?: number, + xAxisId?: string, + xAxisName?: string, + yAxisIndex?: number, + yAxisId?: string, + yAxisName?: string, + gridIndex?: number, + gridId?: string + gridName?: string } interface ERectangle { @@ -194,3 +193,7 @@ declare namespace echarts { declare module 'echarts' { export = echarts; } + +declare module 'echarts/lib/echarts' { + export = echarts; +} diff --git a/types/echarts/tsconfig.json b/types/echarts/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/echarts/tsconfig.json +++ b/types/echarts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/ecurve/tsconfig.json b/types/ecurve/tsconfig.json index b3d1d586fe..a63c9a4fb5 100644 --- a/types/ecurve/tsconfig.json +++ b/types/ecurve/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ed25519/tsconfig.json b/types/ed25519/tsconfig.json index 98fa33a4b1..31cc84042c 100644 --- a/types/ed25519/tsconfig.json +++ b/types/ed25519/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ed25519-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ed2curve/ed2curve-tests.ts b/types/ed2curve/ed2curve-tests.ts new file mode 100644 index 0000000000..bb26cf5b49 --- /dev/null +++ b/types/ed2curve/ed2curve-tests.ts @@ -0,0 +1,9 @@ +import * as ed2curve from 'ed2curve'; +import * as nacl from 'tweetnacl'; + +const myKeyPair = nacl.sign.keyPair(); + +const newPublicKey = ed2curve.convertPublicKey(myKeyPair.publicKey); +const newSecretKey = ed2curve.convertSecretKey(myKeyPair.secretKey); + +const newKeyPair = ed2curve.convertKeyPair(myKeyPair); diff --git a/types/ed2curve/index.d.ts b/types/ed2curve/index.d.ts new file mode 100644 index 0000000000..6b27ee56e4 --- /dev/null +++ b/types/ed2curve/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for ed2curve 0.2 +// Project: https://github.com/dchest/ed2curve-js +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { BoxKeyPair, SignKeyPair } from "tweetnacl"; + +export as namespace ed2curve; + +/** + * Converts Ed25519 public key to Curve25519 public key. + * montgomeryX = (edwardsY + 1)*inverse(1 - edwardsY) mod p + */ +export function convertPublicKey(publicKey: SignKeyPair["publicKey"]): BoxKeyPair["publicKey"] | null; + +/** Converts Ed25519 secret key to Curve25519 secret key. */ +export function convertSecretKey(secretKey: SignKeyPair["secretKey"]): BoxKeyPair["secretKey"] | null; + +/** Converts Ed25519 key pair to Curve25519 key pair. */ +export function convertKeyPair(keyPair: SignKeyPair): BoxKeyPair; diff --git a/types/ed2curve/package.json b/types/ed2curve/package.json new file mode 100644 index 0000000000..95cfca5ea9 --- /dev/null +++ b/types/ed2curve/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "tweetnacl": "^1.0.0" + } +} diff --git a/types/ed2curve/tsconfig.json b/types/ed2curve/tsconfig.json new file mode 100644 index 0000000000..41c38b86dc --- /dev/null +++ b/types/ed2curve/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "ed2curve-tests.ts" + ] +} \ No newline at end of file diff --git a/types/ed2curve/tslint.json b/types/ed2curve/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ed2curve/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/egg-mock/tsconfig.json b/types/egg-mock/tsconfig.json index 86b33fc149..b1c6e12ced 100644 --- a/types/egg-mock/tsconfig.json +++ b/types/egg-mock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/egg.js/tsconfig.json b/types/egg.js/tsconfig.json index c7364d3f99..45a13df64d 100644 --- a/types/egg.js/tsconfig.json +++ b/types/egg.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/egjs__axes/Axes.d.ts b/types/egjs__axes/Axes.d.ts index 83bd1f24af..2b00624ee2 100644 --- a/types/egjs__axes/Axes.d.ts +++ b/types/egjs__axes/Axes.d.ts @@ -1,4 +1,4 @@ -import * as Component from "@egjs/component"; +import Component = require("@egjs/component"); import { AnimationManager } from "./AnimationManager"; import { EventManager } from "./EventManager"; import { InterruptManager } from "./InterruptManager"; diff --git a/types/egjs__axes/tsconfig.json b/types/egjs__axes/tsconfig.json index 3086687bc3..6abab016ee 100644 --- a/types/egjs__axes/tsconfig.json +++ b/types/egjs__axes/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { "@egjs/component": [ "egjs__component" diff --git a/types/egjs__component/tsconfig.json b/types/egjs__component/tsconfig.json index 778e5a9f16..cc2373f384 100644 --- a/types/egjs__component/tsconfig.json +++ b/types/egjs__component/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { "@egjs/component": [ "egjs__component" diff --git a/types/ej.web.all/tsconfig.json b/types/ej.web.all/tsconfig.json index 0a0a2b79e4..fd4e862f17 100644 --- a/types/ej.web.all/tsconfig.json +++ b/types/ej.web.all/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ejs-locals/tsconfig.json b/types/ejs-locals/tsconfig.json index 7f549cd0a6..f52e703a13 100644 --- a/types/ejs-locals/tsconfig.json +++ b/types/ejs-locals/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ejs/tsconfig.json b/types/ejs/tsconfig.json index ea91455364..07c96c4dc5 100644 --- a/types/ejs/tsconfig.json +++ b/types/ejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ejson/tsconfig.json b/types/ejson/tsconfig.json index 3769f3db66..37caf6d903 100644 --- a/types/ejson/tsconfig.json +++ b/types/ejson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/elastic.js/tsconfig.json b/types/elastic.js/tsconfig.json index 6a705c4c27..498af2bd5c 100644 --- a/types/elastic.js/tsconfig.json +++ b/types/elastic.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/elasticsearch/tsconfig.json b/types/elasticsearch/tsconfig.json index 21ac20d7e9..53c7b4e86d 100644 --- a/types/elasticsearch/tsconfig.json +++ b/types/elasticsearch/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "elasticsearch-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-config/tsconfig.json b/types/electron-config/tsconfig.json index 8462205033..928f18f011 100644 --- a/types/electron-config/tsconfig.json +++ b/types/electron-config/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-debug/tsconfig.json b/types/electron-debug/tsconfig.json index 65a83c7c64..8422bbf834 100644 --- a/types/electron-debug/tsconfig.json +++ b/types/electron-debug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-devtools-installer/tsconfig.json b/types/electron-devtools-installer/tsconfig.json index 77fbb1d7c5..1a943c0c96 100644 --- a/types/electron-devtools-installer/tsconfig.json +++ b/types/electron-devtools-installer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-is-dev/tsconfig.json b/types/electron-is-dev/tsconfig.json index 1260f76477..1201808cbe 100644 --- a/types/electron-is-dev/tsconfig.json +++ b/types/electron-is-dev/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-json-storage/tsconfig.json b/types/electron-json-storage/tsconfig.json index d5bbe0168b..a66e96746a 100644 --- a/types/electron-json-storage/tsconfig.json +++ b/types/electron-json-storage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-notifications/tsconfig.json b/types/electron-notifications/tsconfig.json index b5d1926fe9..486d6311e7 100644 --- a/types/electron-notifications/tsconfig.json +++ b/types/electron-notifications/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-notify/tsconfig.json b/types/electron-notify/tsconfig.json index 49580cd305..d265180995 100644 --- a/types/electron-notify/tsconfig.json +++ b/types/electron-notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-packager/electron-packager-tests.ts b/types/electron-packager/electron-packager-tests.ts index 482c49bbff..f956910b78 100644 --- a/types/electron-packager/electron-packager-tests.ts +++ b/types/electron-packager/electron-packager-tests.ts @@ -1,8 +1,16 @@ -import * as packager from "electron-packager"; +import packager = require("electron-packager"); -function callback(err: Error, appPath: string) { +function callback(err: Error, appPaths: string[]) { const msg = err.message; - const index = appPath.indexOf("test"); + const index = appPaths.indexOf("test"); +} + +function completeFunction(buildPath: string, electronVersion: string, platform: string, arch: string, callbackFn: () => void) { + callbackFn(); +} + +function ignoreFunction(path: string) { + return true; } packager({ @@ -10,20 +18,38 @@ packager({ name: "myapplication", platform: "win32", arch: "all", - electronVersion: "0.34.0" + electronVersion: "0.34.0", + win32metadata: { + CompanyName: "Acme CO", + FileDescription: "My application", + OriginalFilename: "myapp.exe", + ProductName: "Application", + InternalName: "roadrunner", + "requested-execution-level": "highestAvailable", + "application-manifest": "manifest.xml" + } }, callback); packager({ dir: ".", name: "myapplication", electronVersion: "0.34.0", - all: true + all: true, + win32metadata: { + CompanyName: "Acme CO", + FileDescription: "My application", + OriginalFilename: "myapp.exe", + ProductName: "Application", + InternalName: "roadrunner", + "requested-execution-level": "requireAdministrator", + "application-manifest": "manifest.xml" + } }, callback); packager({ dir: ".", name: "myapplication", - platform: "win32", + platform: "all", arch: "all", electronVersion: "0.34.0" }, callback); @@ -34,3 +60,136 @@ packager({ electronVersion: "0.34.0", all: true }, callback); + +packager({ + dir: ".", + name: "myapplication", + electronVersion: "0.34.0", + arch: "arm64", + executableName: "myapp" +}, callback); + +packager({ + dir: ".", + afterCopy: [ + completeFunction + ], + afterExtract: [ + completeFunction + ], + afterPrune: [ + completeFunction + ], + appCopyright: "Copyright", + appVersion: "1.0", + arch: "ia32", + asar: false, + buildVersion: "1.2.3", + derefSymlinks: true, + download: { + cache: "./zips", + mirror: "https://10.1.2.105/", + quiet: true, + strictSSL: true + }, + extraResource: "foo.js", + icon: "foo.ico", + ignore: /ab+c/, + out: "out", + overwrite: true, + packageManager: false, + prune: true, + quiet: true, + tmpdir: "/tmp", + win32metadata: { + CompanyName: "Acme CO", + FileDescription: "My application", + OriginalFilename: "myapp.exe", + ProductName: "Application", + InternalName: "roadrunner", + "requested-execution-level": "asInvoker", + "application-manifest": "manifest.xml" + } +}, callback); + +packager({ + dir: ".", + arch: "x64", + asar: true, + derefSymlinks: false, + download: { + cache: "./zips", + mirror: "https://10.1.2.105/", + quiet: false, + strictSSL: true + }, + extraResource: [ + "foo.js", + "bar.js" + ], + ignore: [ + /ab+c/, + new RegExp('abc') + ], + overwrite: false, + packageManager: "npm", + platform: "darwin", + prune: false, + quiet: false, + tmpdir: "false", + appBundleId: "123456", + appCategoryType: "public.app-category.developer-tools", + extendInfo: "plist.txt", + helperBundleId: "23223f", + osxSign: true +}, callback); + +packager({ + dir: ".", + arch: "armv7l", + asar: { + ordering: "order.txt", + unpack: "*.js", + unpackDir: "sub_dir" + }, + download: { + cache: "./zips", + mirror: "https://10.1.2.105/", + quiet: false, + strictSSL: false + }, + ignore: ignoreFunction, + packageManager: "cnpm", + platform: "linux" +}, callback); + +packager({ + dir: ".", + arch: [ + "ia32", + "x64" + ], + download: { + cache: "./zips", + mirror: "https://10.1.2.105/", + quiet: true, + strictSSL: false + }, + packageManager: "yarn", + platform: "mas", + extendInfo: { + foo: "bar" + }, + osxSign: { + identity: "myidentity", + entitlements: "path/to/my.entitlements", + "entitlements-inherit": "path/to/inherit.entitlements" + }, + protocols: [{ + name: "myappproto", + schemes: [ + "myapp", + "myapp2" + ] + }] +}, callback); diff --git a/types/electron-packager/index.d.ts b/types/electron-packager/index.d.ts index de33fa3499..6e430ecdb2 100644 --- a/types/electron-packager/index.d.ts +++ b/types/electron-packager/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for electron-packager 8.7 +// Type definitions for electron-packager 10.1 // Project: https://github.com/electron-userland/electron-packager // Definitions by: Maxime LUCE // Juan Jimenez-Anca +// John Kleinschmidt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -31,8 +32,8 @@ declare namespace electronPackager { type ignoreFunction = (path: string) => boolean; type onCompleteFn = (buildPath: string, electronVersion: string, platform: string, arch: string, callbackFn: () => void) => void; - type arch = "ia32" | "x64" | "armv7l" | "all"; - type packageManager = "npm" | "cnpm" | "yarn"; + type arch = "ia32" | "x64" | "armv7l" | "arm64" |"all"; + type packageManager = "npm" | "cnpm" | "yarn" | false; type platform = "linux" | "win32" | "darwin" | "mas" | "all"; interface AsarOptions { @@ -94,7 +95,7 @@ declare namespace electronPackager { * Arbitrary combinations of individual architectures are also supported via a comma-delimited string or array of strings. * The non-all values correspond to the architecture names used by Electron releases. This value is not restricted to the official set if download.mirror is set. */ - arch?: arch; + arch?: arch | arch[]; /** * Whether to package the application's source code into an archive, using Electron's archive format */ @@ -120,6 +121,10 @@ declare namespace electronPackager { * One or more files to be copied directly into the app's Contents/Resources directory for OS X target platforms, and the resources directory for other target platforms. */ extraResource?: string | string[]; + /** + * The name of the executable file, sans file extension. Defaults to the value for the name parameter + */ + executableName?: string; /** * The local path to the icon file, if the target platform supports setting embedding an icon. */ diff --git a/types/electron-packager/tsconfig.json b/types/electron-packager/tsconfig.json index 76f19f8f73..a279fa7571 100644 --- a/types/electron-packager/tsconfig.json +++ b/types/electron-packager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-settings/tsconfig.json b/types/electron-settings/tsconfig.json index badf76a8d0..655cfc5dc8 100644 --- a/types/electron-settings/tsconfig.json +++ b/types/electron-settings/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-settings/v2/tsconfig.json b/types/electron-settings/v2/tsconfig.json index 810fdbd504..8e5453808e 100644 --- a/types/electron-settings/v2/tsconfig.json +++ b/types/electron-settings/v2/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-spellchecker/tsconfig.json b/types/electron-spellchecker/tsconfig.json index 539cc30156..6494f31e81 100644 --- a/types/electron-spellchecker/tsconfig.json +++ b/types/electron-spellchecker/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "electron-spellchecker-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-store/tsconfig.json b/types/electron-store/tsconfig.json index 6f21caec55..f5eb483b5e 100644 --- a/types/electron-store/tsconfig.json +++ b/types/electron-store/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-util/tsconfig.json b/types/electron-util/tsconfig.json index c65e02a5c7..49206d08cd 100644 --- a/types/electron-util/tsconfig.json +++ b/types/electron-util/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "electron-util-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/electron-window-state/tsconfig.json b/types/electron-window-state/tsconfig.json index 3843443cda..3099f275a8 100644 --- a/types/electron-window-state/tsconfig.json +++ b/types/electron-window-state/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/electron-winstaller/tsconfig.json b/types/electron-winstaller/tsconfig.json index af16777473..41b83013bf 100644 --- a/types/electron-winstaller/tsconfig.json +++ b/types/electron-winstaller/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/element-ready/tsconfig.json b/types/element-ready/tsconfig.json index e5067c7ccf..fcd6b1d926 100644 --- a/types/element-ready/tsconfig.json +++ b/types/element-ready/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/element-resize-detector/tsconfig.json b/types/element-resize-detector/tsconfig.json index 9400053488..919187d401 100644 --- a/types/element-resize-detector/tsconfig.json +++ b/types/element-resize-detector/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "element-resize-detector-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/element-resize-event/tsconfig.json b/types/element-resize-event/tsconfig.json index 9d86e4632f..f0d3918e5a 100644 --- a/types/element-resize-event/tsconfig.json +++ b/types/element-resize-event/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/elm/tsconfig.json b/types/elm/tsconfig.json index bca395d3c2..c82a960fb7 100644 --- a/types/elm/tsconfig.json +++ b/types/elm/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/email-templates/tsconfig.json b/types/email-templates/tsconfig.json index 5a2994bb04..cb8601eaae 100644 --- a/types/email-templates/tsconfig.json +++ b/types/email-templates/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ember-data/tsconfig.json b/types/ember-data/tsconfig.json index 15f77391aa..0845f9e795 100644 --- a/types/ember-data/tsconfig.json +++ b/types/ember-data/tsconfig.json @@ -10,10 +10,13 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -31,4 +34,4 @@ "test/injections.ts", "test/error.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-feature-flags/tsconfig.json b/types/ember-feature-flags/tsconfig.json index 9481eddeb5..d71fce7001 100644 --- a/types/ember-feature-flags/tsconfig.json +++ b/types/ember-feature-flags/tsconfig.json @@ -15,11 +15,12 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "tests/helpers/with-feature.d.ts", "ember-feature-flags-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-mocha/tsconfig.json b/types/ember-mocha/tsconfig.json index e9fdedfe7f..7c2a404282 100644 --- a/types/ember-mocha/tsconfig.json +++ b/types/ember-mocha/tsconfig.json @@ -9,13 +9,16 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ember-mocha-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-modal-dialog/tsconfig.json b/types/ember-modal-dialog/tsconfig.json index 8834a9ae3d..1826d665c7 100644 --- a/types/ember-modal-dialog/tsconfig.json +++ b/types/ember-modal-dialog/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ember-modal-dialog-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-qunit/tsconfig.json b/types/ember-qunit/tsconfig.json index 1f9e626103..c09b50cd66 100644 --- a/types/ember-qunit/tsconfig.json +++ b/types/ember-qunit/tsconfig.json @@ -10,13 +10,16 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ember-qunit-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-qunit/v2/tsconfig.json b/types/ember-qunit/v2/tsconfig.json index e173bc0d73..2d4c3deabd 100644 --- a/types/ember-qunit/v2/tsconfig.json +++ b/types/ember-qunit/v2/tsconfig.json @@ -10,16 +10,21 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../../", - "typeRoots": ["../../"], + "typeRoots": [ + "../../" + ], "paths": { - "ember-qunit": ["ember-qunit/v2"] + "ember-qunit": [ + "ember-qunit/v2" + ] }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ember-qunit-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-test-helpers/tsconfig.json b/types/ember-test-helpers/tsconfig.json index dc9c583d1c..9bd7a250d9 100644 --- a/types/ember-test-helpers/tsconfig.json +++ b/types/ember-test-helpers/tsconfig.json @@ -10,13 +10,16 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ember-test-helpers-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ember-testing-helpers/tsconfig.json b/types/ember-testing-helpers/tsconfig.json index 622d4d1584..8cb8c83838 100644 --- a/types/ember-testing-helpers/tsconfig.json +++ b/types/ember-testing-helpers/tsconfig.json @@ -10,10 +10,13 @@ "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 61bdcb9828..22ff839774 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -1111,7 +1111,7 @@ declare module 'ember' { * item. This method corresponds to the `forEach()` method defined in * JavaScript 1.6. */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + forEach: GlobalArray['forEach']; /** * Alias for `mapBy` */ @@ -1127,7 +1127,7 @@ declare module 'ember' { * Maps all of the items in the enumeration to another value, returning * a new array. This method corresponds to `map()` defined in JavaScript 1.6. */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + map: GlobalArray['map']; /** * Similar to map, this specialized function returns the value of the named * property on all items in the enumeration. @@ -1138,11 +1138,7 @@ declare module 'ember' { * function returns true for. This method corresponds to `filter()` defined in * JavaScript 1.6. */ - filter( - callbackfn: (value: T, index: number, array: T[]) => value is S, - thisArg?: any - ): S[]; - filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): NativeArray; + filter: GlobalArray['filter']; /** * Returns an array with all of the items in the enumeration where the passed * function returns false. This method is the inverse of filter(). @@ -1165,10 +1161,7 @@ declare module 'ember' { * This method works similar to the `filter()` method defined in JavaScript 1.6 * except that it will stop working on the array once a match is found. */ - find( - predicate: (value: T, index: number, obj: T[]) => boolean, - thisArg?: any - ): T | undefined; + find: GlobalArray['find']; /** * Returns the first item with a property matching the passed value. You * can pass an optional second argument with the target value. Otherwise @@ -1179,10 +1172,7 @@ declare module 'ember' { * Returns `true` if the passed function returns true for every item in the * enumeration. This corresponds with the `every()` method in JavaScript 1.6. */ - every( - callbackfn: (value: T, index: number, array: T[]) => boolean, - thisArg?: any - ): boolean; + every: GlobalArray['every']; /** * Returns `true` if the passed property resolves to the value of the second * argument for all items in the enumerable. This method is often simpler/faster @@ -1205,8 +1195,7 @@ declare module 'ember' { * is a useful way to collect a summary value from an enumeration. This * corresponds to the `reduce()` method defined in JavaScript 1.8. */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + reduce: GlobalArray['reduce']; /** * Invokes the named method on every object in the receiver that * implements it. This method corresponds to the implementation in @@ -1616,32 +1605,6 @@ declare module 'ember' { * __Required.__ You must implement this method to apply this mixin. */ length: number; - - // NOTE: some array polyfill methods are re-declared here because their signatures - // differ between typescript versions 2.4 and 2.6. Since we need to compile against - // both, pick the more recent signature and re-declare it here as a tie-breaker. - - /** - * Returns the first item in the array for which the callback returns true. - * This method works similar to the `filter()` method defined in JavaScript 1.6 - * except that it will stop working on the array once a match is found. - */ - find( - predicate: (value: T, index: number, obj: T[]) => boolean, - thisArg?: any - ): T | undefined; - /** - * This will combine the values of the enumerator into a single value. It - * is a useful way to collect a summary value from an enumeration. This - * corresponds to the `reduce()` method defined in JavaScript 1.8. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - filter( - callbackfn: (value: T, index: number, array: T[]) => value is S, - thisArg?: any - ): S[]; - filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): Enumerable; } const NativeArray: Mixin>; /** @@ -3321,7 +3284,7 @@ declare module 'ember' { declare module '@ember/application' { import Ember from 'ember'; - export default Ember.Application; + export default class Application extends Ember.Application { } export const getOwner: typeof Ember.getOwner; export const onLoad: typeof Ember.onLoad; export const runLoadHooks: typeof Ember.runLoadHooks; @@ -3336,22 +3299,23 @@ declare module '@ember/application/deprecations' { declare module '@ember/application/globals-resolver' { import Ember from 'ember'; - export default Ember.DefaultResolver; + export default class GlobalsResolver extends Ember.DefaultResolver { } } declare module '@ember/application/instance' { import Ember from 'ember'; - export default Ember.ApplicationInstance; + export default class ApplicationInstance extends Ember.ApplicationInstance { } } declare module '@ember/application/resolver' { import Ember from 'ember'; - export default Ember.Resolver; + export default class Resolver extends Ember.Resolver { } } declare module '@ember/array' { import Ember from 'ember'; - export default Ember.Array; + const EmberArray: typeof Ember.Array; + export default EmberArray; export const A: typeof Ember.A; export const isArray: typeof Ember.isArray; export const makeArray: typeof Ember.makeArray; @@ -3359,43 +3323,44 @@ declare module '@ember/array' { declare module '@ember/array/mutable' { import Ember from 'ember'; - export default Ember.MutableArray; + const MutableArray: typeof Ember.MutableArray; + export default MutableArray; } declare module '@ember/array/proxy' { import Ember from 'ember'; - export default Ember.ArrayProxy; + export default class ArrayProxy extends Ember.ArrayProxy { } } declare module '@ember/component' { import Ember from 'ember'; - export default Ember.Component; + export default class Component extends Ember.Component { } } declare module '@ember/component/checkbox' { import Ember from 'ember'; - export default Ember.Checkbox; + export default class Checkbox extends Ember.Checkbox { } } declare module '@ember/component/helper' { import Ember from 'ember'; - export default Ember.Helper; + export default class Helper extends Ember.Helper { } export const helper: typeof Ember.Helper.helper; } declare module '@ember/component/text-area' { import Ember from 'ember'; - export default Ember.TextArea; + export default class TextArea extends Ember.TextArea { } } declare module '@ember/component/text-field' { import Ember from 'ember'; - export default Ember.TextField; + export default class TextField extends Ember.TextField { } } declare module '@ember/controller' { import Ember from 'ember'; - export default Ember.Controller; + export default class Controller extends Ember.Controller { } export const inject: typeof Ember.inject.controller; } @@ -3412,28 +3377,29 @@ declare module '@ember/debug' { declare module '@ember/debug/container-debug-adapter' { import Ember from 'ember'; - export default Ember.ContainerDebugAdapter; + export default class ContainerDebugAdapter extends Ember.ContainerDebugAdapter { } } declare module '@ember/debug/data-adapter' { import Ember from 'ember'; - export default Ember.DataAdapter; + export default class DataAdapter extends Ember.DataAdapter { } } declare module '@ember/engine' { import Ember from 'ember'; - export default Ember.Engine; + export default class Engine extends Ember.Engine { } export const getEngineParent: typeof Ember.getEngineParent; } declare module '@ember/engine/instance' { import Ember from 'ember'; - export default Ember.EngineInstance; + export default class EngineInstance extends Ember.EngineInstance { } } declare module '@ember/enumerable' { import Ember from 'ember'; - export default Ember.Enumerable; + const Enumerable: typeof Ember.Enumerable; + export default Enumerable; } declare module '@ember/instrumentation' { @@ -3446,17 +3412,17 @@ declare module '@ember/instrumentation' { declare module '@ember/map' { import Ember from 'ember'; - export default Ember.Map; + export default class EmberMap extends Ember.Map { } } declare module '@ember/map/with-default' { import Ember from 'ember'; - export default Ember.MapWithDefault; + export default class MapWithDefault extends Ember.MapWithDefault { } } declare module '@ember/object' { import Ember from 'ember'; - export default Ember.Object; + export default class EmberObject extends Ember.Object { } export const aliasMethod: typeof Ember.aliasMethod; export const computed: typeof Ember.computed; export const defineProperty: typeof Ember.defineProperty; @@ -3471,7 +3437,7 @@ declare module '@ember/object' { declare module '@ember/object/computed' { import Ember from 'ember'; - export default Ember.ComputedProperty; + export default class ComputedProperty extends Ember.ComputedProperty { } export const alias: typeof Ember.computed.alias; export const and: typeof Ember.computed.and; export const bool: typeof Ember.computed.bool; @@ -3509,12 +3475,13 @@ declare module '@ember/object/computed' { declare module '@ember/object/core' { import Ember from 'ember'; - export default Ember.CoreObject; + export default class CoreObject extends Ember.CoreObject { } } declare module '@ember/object/evented' { import Ember from 'ember'; - export default Ember.Evented; + const Evented: typeof Ember.Evented; + export default Evented; export const on: typeof Ember.on; } @@ -3534,12 +3501,14 @@ declare module '@ember/object/internals' { declare module '@ember/object/mixin' { import Ember from 'ember'; - export default Ember.Mixin; + const Mixin: typeof Ember.Mixin; + export default Mixin; } declare module '@ember/object/observable' { import Ember from 'ember'; - export default Ember.Observable; + const Observable: typeof Ember.Observable; + export default Observable; } declare module '@ember/object/observers' { @@ -3550,12 +3519,13 @@ declare module '@ember/object/observers' { declare module '@ember/object/promise-proxy-mixin' { import Ember from 'ember'; - export default Ember.PromiseProxyMixin; + const PromiseProxyMixin: typeof Ember.PromiseProxyMixin; + export default PromiseProxyMixin; } declare module '@ember/object/proxy' { import Ember from 'ember'; - export default Ember.ObjectProxy; + export default class ObjectProxy extends Ember.ObjectProxy { } } declare module '@ember/polyfills' { @@ -3569,42 +3539,43 @@ declare module '@ember/polyfills' { declare module '@ember/routing/auto-location' { import Ember from 'ember'; - export default Ember.AutoLocation; + export default class AutoLocation extends Ember.AutoLocation { } } declare module '@ember/routing/hash-location' { import Ember from 'ember'; - export default Ember.HashLocation; + export default class HashLocation extends Ember.HashLocation { } } declare module '@ember/routing/history-location' { import Ember from 'ember'; - export default Ember.HistoryLocation; + export default class HistoryLocation extends Ember.HistoryLocation { } } declare module '@ember/routing/link-component' { import Ember from 'ember'; - export default Ember.LinkComponent; + export default class LinkComponent extends Ember.LinkComponent { } } declare module '@ember/routing/location' { import Ember from 'ember'; - export default Ember.Location; + const Location: typeof Ember.Location; + export default Location; } declare module '@ember/routing/none-location' { import Ember from 'ember'; - export default Ember.NoneLocation; + export default class NoneLocation extends Ember.NoneLocation { } } declare module '@ember/routing/route' { import Ember from 'ember'; - export default Ember.Route; + export default class Route extends Ember.Route { } } declare module '@ember/routing/router' { import Ember from 'ember'; - export default Ember.Router; + export default class EmberRouter extends Ember.Router { } } declare module '@ember/runloop' { @@ -3626,7 +3597,7 @@ declare module '@ember/runloop' { declare module '@ember/service' { import Ember from 'ember'; - export default Ember.Service; + export default class Service extends Ember.Service { } export const inject: typeof Ember.inject.service; } @@ -3656,7 +3627,7 @@ declare module '@ember/test' { declare module '@ember/test/adapter' { import Ember from 'ember'; - export default Ember.Test.Adapter; + export default class TestAdapter extends Ember.Test.Adapter { } } declare module '@ember/utils' { diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index 98d2623024..d8580b0760 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -11,10 +11,13 @@ "strictNullChecks": true, "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -47,4 +50,4 @@ "test/route.ts", "test/view-utils.ts" ] -} +} \ No newline at end of file diff --git a/types/ember/v1/tsconfig.json b/types/ember/v1/tsconfig.json index 7be1f0660b..c817172bbf 100644 --- a/types/ember/v1/tsconfig.json +++ b/types/ember/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/emissary/tsconfig.json b/types/emissary/tsconfig.json index b6d04f07a7..b8d3d5241a 100644 --- a/types/emissary/tsconfig.json +++ b/types/emissary/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/emoji-mart/tsconfig.json b/types/emoji-mart/tsconfig.json index fb776e9a21..b0e8df2d67 100644 --- a/types/emoji-mart/tsconfig.json +++ b/types/emoji-mart/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ @@ -29,4 +30,4 @@ "dist-es/index.d.ts", "emoji-mart-tests.tsx" ] -} +} \ No newline at end of file diff --git a/types/emojione/tsconfig.json b/types/emojione/tsconfig.json index f74fb50d6f..3dc6a32fc9 100644 --- a/types/emojione/tsconfig.json +++ b/types/emojione/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/empower/tsconfig.json b/types/empower/tsconfig.json index 9d9d553fc0..ac5a3bd4d8 100644 --- a/types/empower/tsconfig.json +++ b/types/empower/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/emscripten/tsconfig.json b/types/emscripten/tsconfig.json index d17ea9a00a..55db0defd3 100644 --- a/types/emscripten/tsconfig.json +++ b/types/emscripten/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/encoding-japanese/tsconfig.json b/types/encoding-japanese/tsconfig.json index b3b7a2861f..90acb7e3aa 100644 --- a/types/encoding-japanese/tsconfig.json +++ b/types/encoding-japanese/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/end-of-stream/end-of-stream-tests.ts b/types/end-of-stream/end-of-stream-tests.ts index 211c6f5196..829a177d5c 100644 --- a/types/end-of-stream/end-of-stream-tests.ts +++ b/types/end-of-stream/end-of-stream-tests.ts @@ -1,4 +1,4 @@ -import * as eos from "end-of-stream"; +import eos = require("end-of-stream"); declare const readableStream: NodeJS.ReadableStream; declare const writableStream: NodeJS.WritableStream; diff --git a/types/end-of-stream/tsconfig.json b/types/end-of-stream/tsconfig.json index b46ee0c768..10cf712c76 100644 --- a/types/end-of-stream/tsconfig.json +++ b/types/end-of-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/engine.io-client/tsconfig.json b/types/engine.io-client/tsconfig.json index cb3a024a3e..e473bfebe5 100644 --- a/types/engine.io-client/tsconfig.json +++ b/types/engine.io-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/engine.io/tsconfig.json b/types/engine.io/tsconfig.json index b31b3394b0..5e35fcea3a 100644 --- a/types/engine.io/tsconfig.json +++ b/types/engine.io/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/enhanced-resolve/tsconfig.json b/types/enhanced-resolve/tsconfig.json index 9c87f7e7a1..784aadf889 100644 --- a/types/enhanced-resolve/tsconfig.json +++ b/types/enhanced-resolve/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/enigma.js/tsconfig.json b/types/enigma.js/tsconfig.json index b3b93456f0..10d59e2fab 100644 --- a/types/enigma.js/tsconfig.json +++ b/types/enigma.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ent/tsconfig.json b/types/ent/tsconfig.json index 53249c7605..ff83547680 100644 --- a/types/ent/tsconfig.json +++ b/types/ent/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/entities/tsconfig.json b/types/entities/tsconfig.json index 1a88ad9778..90c9f78f64 100644 --- a/types/entities/tsconfig.json +++ b/types/entities/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/env-to-object/tsconfig.json b/types/env-to-object/tsconfig.json index 2e59eff3e4..9154d82826 100644 --- a/types/env-to-object/tsconfig.json +++ b/types/env-to-object/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/envify/tsconfig.json b/types/envify/tsconfig.json index 381ca464c9..bfa88f845a 100644 --- a/types/envify/tsconfig.json +++ b/types/envify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/enzyme-adapter-react-15.4/enzyme-adapter-react-15.4-tests.ts b/types/enzyme-adapter-react-15.4/enzyme-adapter-react-15.4-tests.ts index 603c7634b3..af26532174 100644 --- a/types/enzyme-adapter-react-15.4/enzyme-adapter-react-15.4-tests.ts +++ b/types/enzyme-adapter-react-15.4/enzyme-adapter-react-15.4-tests.ts @@ -1,4 +1,4 @@ import { configure } from 'enzyme'; -import * as Adapter from 'enzyme-adapter-react-15.4'; +import Adapter = require('enzyme-adapter-react-15.4'); configure({ adapter: new Adapter() }); diff --git a/types/enzyme-adapter-react-15.4/tsconfig.json b/types/enzyme-adapter-react-15.4/tsconfig.json index 804fe8ee07..51543ab615 100644 --- a/types/enzyme-adapter-react-15.4/tsconfig.json +++ b/types/enzyme-adapter-react-15.4/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "enzyme-adapter-react-15.4-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts b/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts index 9be474c2d8..fa3c9a357a 100644 --- a/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts +++ b/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts @@ -1,4 +1,4 @@ import { configure } from 'enzyme'; -import * as Adapter from 'enzyme-adapter-react-15'; +import Adapter = require('enzyme-adapter-react-15'); configure({ adapter: new Adapter() }); diff --git a/types/enzyme-adapter-react-15/tsconfig.json b/types/enzyme-adapter-react-15/tsconfig.json index 23f0d0d292..fbd8458aac 100644 --- a/types/enzyme-adapter-react-15/tsconfig.json +++ b/types/enzyme-adapter-react-15/tsconfig.json @@ -1,21 +1,27 @@ { - "compilerOptions": { - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "module": "commonjs", - "lib": ["es6", "dom"], - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true - }, - "files": [ - "index.d.ts", - "enzyme-adapter-react-15-tests.ts" - ] -} + "compilerOptions": { + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "enzyme-adapter-react-15-tests.ts" + ] +} \ No newline at end of file diff --git a/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts b/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts index b8acf7f719..8b53ed9dc7 100644 --- a/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts +++ b/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts @@ -1,4 +1,4 @@ import { configure } from 'enzyme'; -import * as Adapter from 'enzyme-adapter-react-16'; +import Adapter = require('enzyme-adapter-react-16'); configure({ adapter: new Adapter() }); diff --git a/types/enzyme-adapter-react-16/tsconfig.json b/types/enzyme-adapter-react-16/tsconfig.json index 1c1c8e15f9..2f1b7b089c 100644 --- a/types/enzyme-adapter-react-16/tsconfig.json +++ b/types/enzyme-adapter-react-16/tsconfig.json @@ -1,21 +1,27 @@ { - "compilerOptions": { - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "module": "commonjs", - "lib": ["es6", "dom"], - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true - }, - "files": [ - "index.d.ts", - "enzyme-adapter-react-16-tests.ts" - ] -} + "compilerOptions": { + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "enzyme-adapter-react-16-tests.ts" + ] +} \ No newline at end of file diff --git a/types/enzyme-to-json/tsconfig.json b/types/enzyme-to-json/tsconfig.json index 948a88349a..be2b7c3113 100644 --- a/types/enzyme-to-json/tsconfig.json +++ b/types/enzyme-to-json/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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 diff --git a/types/enzyme/tsconfig.json b/types/enzyme/tsconfig.json index 096b64a111..f8618a73da 100644 --- a/types/enzyme/tsconfig.json +++ b/types/enzyme/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eonasdan-bootstrap-datetimepicker/tsconfig.json b/types/eonasdan-bootstrap-datetimepicker/tsconfig.json index d2f659f25f..ae702872b6 100644 --- a/types/eonasdan-bootstrap-datetimepicker/tsconfig.json +++ b/types/eonasdan-bootstrap-datetimepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/epiceditor/tsconfig.json b/types/epiceditor/tsconfig.json index ccd9f7cce0..2d3338100c 100644 --- a/types/epiceditor/tsconfig.json +++ b/types/epiceditor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/epilogue/epilogue-tests.ts b/types/epilogue/epilogue-tests.ts index 0cf40fd1e9..cff716f780 100644 --- a/types/epilogue/epilogue-tests.ts +++ b/types/epilogue/epilogue-tests.ts @@ -1,6 +1,6 @@ import * as epilogue from 'epilogue'; -import * as express from 'express'; -import * as Sequelize from 'sequelize'; +import express = require('express'); +import Sequelize = require('sequelize'); const database = new Sequelize({ }); diff --git a/types/epilogue/tsconfig.json b/types/epilogue/tsconfig.json index 593077c6bc..ab9ee2a292 100644 --- a/types/epilogue/tsconfig.json +++ b/types/epilogue/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "epilogue-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/epub/tsconfig.json b/types/epub/tsconfig.json index 90ba263b21..35b9ccc362 100644 --- a/types/epub/tsconfig.json +++ b/types/epub/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eq.js/tsconfig.json b/types/eq.js/tsconfig.json index 3d35e3fefa..1fa222c5f8 100644 --- a/types/eq.js/tsconfig.json +++ b/types/eq.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/errorhandler/errorhandler-tests.ts b/types/errorhandler/errorhandler-tests.ts index f6a35dd19d..3f8ada3372 100644 --- a/types/errorhandler/errorhandler-tests.ts +++ b/types/errorhandler/errorhandler-tests.ts @@ -1,6 +1,5 @@ - -import * as express from 'express'; -import * as errorhandler from 'errorhandler'; +import express = require('express'); +import errorhandler = require('errorhandler'); var app = express(); diff --git a/types/errorhandler/tsconfig.json b/types/errorhandler/tsconfig.json index dc08f31d21..d827ee2b51 100644 --- a/types/errorhandler/tsconfig.json +++ b/types/errorhandler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/es6-collections/tsconfig.json b/types/es6-collections/tsconfig.json index c2b2ba64d7..4297f94f93 100644 --- a/types/es6-collections/tsconfig.json +++ b/types/es6-collections/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/es6-promisify/tsconfig.json b/types/es6-promisify/tsconfig.json index 707e6094d3..ad7eafa8c2 100644 --- a/types/es6-promisify/tsconfig.json +++ b/types/es6-promisify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/es6-shim/tsconfig.json b/types/es6-shim/tsconfig.json index f11dcede04..54aeed6ac4 100644 --- a/types/es6-shim/tsconfig.json +++ b/types/es6-shim/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/es6-weak-map/tsconfig.json b/types/es6-weak-map/tsconfig.json index 2652a8f513..4c0232519a 100644 --- a/types/es6-weak-map/tsconfig.json +++ b/types/es6-weak-map/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/escape-html/tsconfig.json b/types/escape-html/tsconfig.json index 336fcb1583..34e696e44e 100644 --- a/types/escape-html/tsconfig.json +++ b/types/escape-html/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/escape-latex/tsconfig.json b/types/escape-latex/tsconfig.json index 2c782b99a5..1484ee5040 100644 --- a/types/escape-latex/tsconfig.json +++ b/types/escape-latex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/escape-string-regexp/tsconfig.json b/types/escape-string-regexp/tsconfig.json index 46d2b8fec7..30e6ca0344 100644 --- a/types/escape-string-regexp/tsconfig.json +++ b/types/escape-string-regexp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/escodegen/tsconfig.json b/types/escodegen/tsconfig.json index 4755f2604a..9256804b2a 100644 --- a/types/escodegen/tsconfig.json +++ b/types/escodegen/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eslint-plugin-prettier/tsconfig.json b/types/eslint-plugin-prettier/tsconfig.json index 67ba3c86f6..a04dd71953 100644 --- a/types/eslint-plugin-prettier/tsconfig.json +++ b/types/eslint-plugin-prettier/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/esprima-walk/tsconfig.json b/types/esprima-walk/tsconfig.json index 7314e2d509..db6207d8ff 100644 --- a/types/esprima-walk/tsconfig.json +++ b/types/esprima-walk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/esprima/tsconfig.json b/types/esprima/tsconfig.json index 2ac3b4bb46..16cac910ee 100644 --- a/types/esprima/tsconfig.json +++ b/types/esprima/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/esprima/v2/tsconfig.json b/types/esprima/v2/tsconfig.json index a3c195ca3c..ff4deff6d5 100644 --- a/types/esprima/v2/tsconfig.json +++ b/types/esprima/v2/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/espruino/tsconfig.json b/types/espruino/tsconfig.json index 38bb3dfd03..9766072d18 100644 --- a/types/espruino/tsconfig.json +++ b/types/espruino/tsconfig.json @@ -2,8 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es2015", - "dom" + "es2015", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "espruino-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/esri-leaflet-geocoder/tsconfig.json b/types/esri-leaflet-geocoder/tsconfig.json index 6bdfac4c4d..ef48041716 100644 --- a/types/esri-leaflet-geocoder/tsconfig.json +++ b/types/esri-leaflet-geocoder/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/esri-leaflet/tsconfig.json b/types/esri-leaflet/tsconfig.json index 596c74f0a2..adfbf16e8b 100644 --- a/types/esri-leaflet/tsconfig.json +++ b/types/esri-leaflet/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/estraverse/tsconfig.json b/types/estraverse/tsconfig.json index 0a199a8857..d69033219b 100644 --- a/types/estraverse/tsconfig.json +++ b/types/estraverse/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/estree/tsconfig.json b/types/estree/tsconfig.json index 9e10c93348..d840cbe748 100644 --- a/types/estree/tsconfig.json +++ b/types/estree/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/etag/tsconfig.json b/types/etag/tsconfig.json index 5df46bdfe9..692a356590 100644 --- a/types/etag/tsconfig.json +++ b/types/etag/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ethjs-signer/tsconfig.json b/types/ethjs-signer/tsconfig.json index b9548b9847..c68bd2742f 100644 --- a/types/ethjs-signer/tsconfig.json +++ b/types/ethjs-signer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eureka-js-client/tsconfig.json b/types/eureka-js-client/tsconfig.json index 8a981b029d..0863854329 100644 --- a/types/eureka-js-client/tsconfig.json +++ b/types/eureka-js-client/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/evaporate/tsconfig.json b/types/evaporate/tsconfig.json index 9164730455..5fb5abffa1 100644 --- a/types/evaporate/tsconfig.json +++ b/types/evaporate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/event-emitter/tsconfig.json b/types/event-emitter/tsconfig.json index ef667ae292..8e8bbb8316 100644 --- a/types/event-emitter/tsconfig.json +++ b/types/event-emitter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "all-off.d.ts", diff --git a/types/event-kit/tsconfig.json b/types/event-kit/tsconfig.json index 0b6a81c5f8..b83f78d573 100644 --- a/types/event-kit/tsconfig.json +++ b/types/event-kit/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "event-kit-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/event-loop-lag/tsconfig.json b/types/event-loop-lag/tsconfig.json index 39962c46ae..0a80b389ad 100644 --- a/types/event-loop-lag/tsconfig.json +++ b/types/event-loop-lag/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/event-stream/tsconfig.json b/types/event-stream/tsconfig.json index 6f3624e82f..5612b82ced 100644 --- a/types/event-stream/tsconfig.json +++ b/types/event-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/event-to-promise/event-to-promise-tests.ts b/types/event-to-promise/event-to-promise-tests.ts index 2b99ddc62f..d8ca31f496 100644 --- a/types/event-to-promise/event-to-promise-tests.ts +++ b/types/event-to-promise/event-to-promise-tests.ts @@ -1,21 +1,19 @@ import { EventEmitter } from 'events' -import * as eventToPromise from 'event-to-promise' - +import eventToPromise = require('event-to-promise'); { const ee = new EventEmitter() const ep = eventToPromise(ee, 'custom') - + ep.then(console.log) ee.emit('custom') } - { const et = new EventTarget() const tp = eventToPromise.multi(et, ['custom']) - + tp.then(console.log) et.dispatchEvent(new Event('custom')) } diff --git a/types/event-to-promise/tsconfig.json b/types/event-to-promise/tsconfig.json index d47bd1672d..e3bd1d3c46 100644 --- a/types/event-to-promise/tsconfig.json +++ b/types/event-to-promise/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/events/tsconfig.json b/types/events/tsconfig.json index f43a926ad8..35b4a183b7 100644 --- a/types/events/tsconfig.json +++ b/types/events/tsconfig.json @@ -1,25 +1,26 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true + "module": "commonjs", + "target": "es6", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ - "index.d.ts", - "events-tests.ts" + "index.d.ts", + "events-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/evernote/tsconfig.json b/types/evernote/tsconfig.json index 2c89a52715..3815e7d498 100644 --- a/types/evernote/tsconfig.json +++ b/types/evernote/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/exceljs/tsconfig.json b/types/exceljs/tsconfig.json index a477befe57..c8cdf0d345 100644 --- a/types/exceljs/tsconfig.json +++ b/types/exceljs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/execa/execa-tests.ts b/types/execa/execa-tests.ts index abdbfd6dad..2525091f2a 100644 --- a/types/execa/execa-tests.ts +++ b/types/execa/execa-tests.ts @@ -1,5 +1,5 @@ -import * as assert from 'assert'; -import * as execa from 'execa'; +import assert = require('assert'); +import execa = require('execa'); import { PassThrough } from "stream"; execa('unicorns') diff --git a/types/execa/tsconfig.json b/types/execa/tsconfig.json index 2d20077a4f..61568807ee 100644 --- a/types/execa/tsconfig.json +++ b/types/execa/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/exit-hook/tsconfig.json b/types/exit-hook/tsconfig.json index 34396672b0..637da53ef1 100644 --- a/types/exit-hook/tsconfig.json +++ b/types/exit-hook/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/exit/tsconfig.json b/types/exit/tsconfig.json index 4343e78761..942627fd28 100644 --- a/types/exit/tsconfig.json +++ b/types/exit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/exorcist/tsconfig.json b/types/exorcist/tsconfig.json index c32fd613f3..b6c15addd0 100644 --- a/types/exorcist/tsconfig.json +++ b/types/exorcist/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/expect.js/tsconfig.json b/types/expect.js/tsconfig.json index c8f60ed6e5..d9f4950675 100644 --- a/types/expect.js/tsconfig.json +++ b/types/expect.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/expect/tsconfig.json b/types/expect/tsconfig.json index 33e71dad4c..225b2ac217 100644 --- a/types/expect/tsconfig.json +++ b/types/expect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/expectations/tsconfig.json b/types/expectations/tsconfig.json index 857a8a1eef..e22736f12d 100644 --- a/types/expectations/tsconfig.json +++ b/types/expectations/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 9c9cfc979e..79c80aa29d 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -166,12 +166,7 @@ async () => { }; async () => { - const result = await Facebook.logInWithReadPermissionsAsync('appId'); - - if (result.type === 'success') { - result.expires; - result.token; - } + const { type, expires, token } = await Facebook.logInWithReadPermissionsAsync("appId"); }; () => ( diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index c9c0ca88f3..c3977918ad 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/expo/expo-sdk // Definitions by: Konstantin Kai // Martynas Kadiša +// Sergio Sánchez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -728,13 +729,11 @@ export namespace Facebook { permissions?: string[]; behavior?: 'web' | 'native' | 'browser' | 'system'; } - type Response = { - type: 'success'; - token: string; - expires: number; - } | { - type: 'cancel'; - }; + interface Response { + type: 'cancel' | 'success'; + token?: string; + expires?: number; + } function logInWithReadPermissionsAsync(appId: string, options?: Options): Promise; } @@ -1213,7 +1212,7 @@ export namespace Notifications { type LocalNotificationId = string | number; function addListener(listener: (notification: Notification) => any): EventSubscription; - function getExponentPushTokenAsync(): Promise; + function getExpoPushTokenAsync(): Promise; function presentLocalNotificationAsync(localNotification: LocalNotification): Promise; function scheduleLocalNotificationAsync( localNotification: LocalNotification, diff --git a/types/expo/tsconfig.json b/types/expo/tsconfig.json index 5d0f560837..8590ce01f7 100644 --- a/types/expo/tsconfig.json +++ b/types/expo/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "expo-tests.tsx" ] -} +} \ No newline at end of file diff --git a/types/expo/v23/expo-tests.tsx b/types/expo/v23/expo-tests.tsx index dd8696d5ba..0764a4d53e 100644 --- a/types/expo/v23/expo-tests.tsx +++ b/types/expo/v23/expo-tests.tsx @@ -159,12 +159,7 @@ async () => { }; async () => { - const result = await Facebook.logInWithReadPermissionsAsync('appId'); - - if (result.type === 'success') { - result.expires; - result.token; - } + const { type, expires, token } = await Facebook.logInWithReadPermissionsAsync("appId"); }; () => ( diff --git a/types/expo/v23/index.d.ts b/types/expo/v23/index.d.ts index 076cd43f8c..8aaa28bace 100644 --- a/types/expo/v23/index.d.ts +++ b/types/expo/v23/index.d.ts @@ -726,13 +726,11 @@ export namespace Facebook { permissions?: string[]; behavior?: 'web' | 'native' | 'browser' | 'system'; } - type Response = { - type: 'success'; - token: string; - expires: number; - } | { - type: 'cancel'; - }; + interface Response { + type: 'cancel' | 'success'; + token?: string; + expires?: number; + } function logInWithReadPermissionsAsync(appId: string, options?: Options): Promise; } diff --git a/types/expo/v23/tsconfig.json b/types/expo/v23/tsconfig.json index 4dbf5afca3..a2291cf3e2 100644 --- a/types/expo/v23/tsconfig.json +++ b/types/expo/v23/tsconfig.json @@ -23,10 +23,11 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "expo-tests.tsx" ] -} +} \ No newline at end of file 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..a0aaaf4767 --- /dev/null +++ b/types/expo__vector-icons/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "expo__vector-icons-tests.tsx" + ] +} \ No newline at end of file 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" } diff --git a/types/express-brute-memcached/express-brute-memcached-tests.ts b/types/express-brute-memcached/express-brute-memcached-tests.ts index 37dadf6189..4a74da4d87 100644 --- a/types/express-brute-memcached/express-brute-memcached-tests.ts +++ b/types/express-brute-memcached/express-brute-memcached-tests.ts @@ -1,5 +1,5 @@ -import * as express from "express"; -import * as ExpressBrute from "express-brute"; +import express = require("express"); +import ExpressBrute = require("express-brute"); import MemcachedStore from "express-brute-memcached"; var app = express(); diff --git a/types/express-brute-memcached/tsconfig.json b/types/express-brute-memcached/tsconfig.json index c49c399e0d..031f4178f1 100644 --- a/types/express-brute-memcached/tsconfig.json +++ b/types/express-brute-memcached/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-brute-mongo/tsconfig.json b/types/express-brute-mongo/tsconfig.json index d57cb21dd2..37f2386a8a 100644 --- a/types/express-brute-mongo/tsconfig.json +++ b/types/express-brute-mongo/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-brute-redis/tsconfig.json b/types/express-brute-redis/tsconfig.json index a033b8f228..3fdde618ad 100644 --- a/types/express-brute-redis/tsconfig.json +++ b/types/express-brute-redis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-brute/tsconfig.json b/types/express-brute/tsconfig.json index 30bf0ccf14..42a510b1ed 100644 --- a/types/express-brute/tsconfig.json +++ b/types/express-brute/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-busboy/express-busboy-tests.ts b/types/express-busboy/express-busboy-tests.ts index 512fd7f245..801ad24481 100644 --- a/types/express-busboy/express-busboy-tests.ts +++ b/types/express-busboy/express-busboy-tests.ts @@ -1,6 +1,5 @@ import * as expressBusboy from 'express-busboy'; - -import * as express from 'express'; +import express = require('express'); const app: express.Application = express(); const options: expressBusboy.ExpressBusboyOptions = {}; diff --git a/types/express-busboy/tsconfig.json b/types/express-busboy/tsconfig.json index 1920bb9991..3bd9a10474 100644 --- a/types/express-busboy/tsconfig.json +++ b/types/express-busboy/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-busboy-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-cluster/tsconfig.json b/types/express-cluster/tsconfig.json index 5d27d3ec2e..85722d9956 100644 --- a/types/express-cluster/tsconfig.json +++ b/types/express-cluster/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-debug/tsconfig.json b/types/express-debug/tsconfig.json index 9763943be8..65dccfc944 100644 --- a/types/express-debug/tsconfig.json +++ b/types/express-debug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-domain-middleware/tsconfig.json b/types/express-domain-middleware/tsconfig.json index 454fedea14..e18ec4e697 100644 --- a/types/express-domain-middleware/tsconfig.json +++ b/types/express-domain-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-ejs-layouts/express-ejs-layouts-tests.ts b/types/express-ejs-layouts/express-ejs-layouts-tests.ts index 9d77105a9d..f6820c57cf 100644 --- a/types/express-ejs-layouts/express-ejs-layouts-tests.ts +++ b/types/express-ejs-layouts/express-ejs-layouts-tests.ts @@ -1,5 +1,5 @@ -import * as express from 'express'; -import * as expressEjsLayouts from 'express-ejs-layouts'; +import express = require('express'); +import expressEjsLayouts = require('express-ejs-layouts'); function expressRequestHandlerTest() { const app = express() diff --git a/types/express-ejs-layouts/tsconfig.json b/types/express-ejs-layouts/tsconfig.json index 7ade9f8819..83f8ab2270 100644 --- a/types/express-ejs-layouts/tsconfig.json +++ b/types/express-ejs-layouts/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-ejs-layouts-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-enforces-ssl/tsconfig.json b/types/express-enforces-ssl/tsconfig.json index 9e071e54fb..744f4f7b82 100644 --- a/types/express-enforces-ssl/tsconfig.json +++ b/types/express-enforces-ssl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-fileupload/express-fileupload-tests.ts b/types/express-fileupload/express-fileupload-tests.ts index 21115937d1..2a268fb64e 100644 --- a/types/express-fileupload/express-fileupload-tests.ts +++ b/types/express-fileupload/express-fileupload-tests.ts @@ -1,4 +1,4 @@ -import * as express from 'express'; +import express = require('express'); import { RequestHandler, Request, Response, NextFunction } from 'express-serve-static-core'; import fileUpload = require('express-fileupload'); diff --git a/types/express-fileupload/tsconfig.json b/types/express-fileupload/tsconfig.json index ecbd735cea..34badd8266 100644 --- a/types/express-fileupload/tsconfig.json +++ b/types/express-fileupload/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-flash-2/tsconfig.json b/types/express-flash-2/tsconfig.json index 6a0ef5a28b..fcfa6b81db 100644 --- a/types/express-flash-2/tsconfig.json +++ b/types/express-flash-2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-flash-notification/tsconfig.json b/types/express-flash-notification/tsconfig.json index 842aacf264..4341feca18 100644 --- a/types/express-flash-notification/tsconfig.json +++ b/types/express-flash-notification/tsconfig.json @@ -5,19 +5,20 @@ "es6" ], "noImplicitAny": true, - "noImplicitThis": true, + "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-flash-notification-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-formidable/tsconfig.json b/types/express-formidable/tsconfig.json index 45a7b6c12b..66ac147736 100644 --- a/types/express-formidable/tsconfig.json +++ b/types/express-formidable/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-formidable-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts index d476682104..0479716860 100644 --- a/types/express-graphql/express-graphql-tests.ts +++ b/types/express-graphql/express-graphql-tests.ts @@ -1,6 +1,6 @@ -import * as express from 'express'; +import express = require('express'); import 'express-session'; -import * as graphqlHTTP from 'express-graphql'; +import graphqlHTTP = require('express-graphql'); const app = express(); const schema = {}; diff --git a/types/express-graphql/tsconfig.json b/types/express-graphql/tsconfig.json index 7924c82706..c46f5fc04a 100644 --- a/types/express-graphql/tsconfig.json +++ b/types/express-graphql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-handlebars/tsconfig.json b/types/express-handlebars/tsconfig.json index 9c6da1ba25..4233c4b5f8 100644 --- a/types/express-handlebars/tsconfig.json +++ b/types/express-handlebars/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-jwt/tsconfig.json b/types/express-jwt/tsconfig.json index f91064aba5..dff320327c 100644 --- a/types/express-jwt/tsconfig.json +++ b/types/express-jwt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-less/tsconfig.json b/types/express-less/tsconfig.json index c8e44f8204..8d9e70440e 100644 --- a/types/express-less/tsconfig.json +++ b/types/express-less/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-minify/tsconfig.json b/types/express-minify/tsconfig.json index 65c999883e..48a257d074 100644 --- a/types/express-minify/tsconfig.json +++ b/types/express-minify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts b/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts index 21a5028b27..03074593ca 100644 --- a/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts +++ b/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts @@ -1,5 +1,5 @@ -import * as express from 'express'; -import * as mongoSanitize from 'express-mongo-sanitize'; +import express = require('express'); +import mongoSanitize = require('express-mongo-sanitize'); const app: express.Express = express(); diff --git a/types/express-mongo-sanitize/tsconfig.json b/types/express-mongo-sanitize/tsconfig.json index 0834820a85..52dd3131cd 100644 --- a/types/express-mongo-sanitize/tsconfig.json +++ b/types/express-mongo-sanitize/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "express-mongo-sanitize-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-mung/tsconfig.json b/types/express-mung/tsconfig.json index 9dd04b84e6..2a2d18d7be 100644 --- a/types/express-mung/tsconfig.json +++ b/types/express-mung/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-myconnection/tsconfig.json b/types/express-myconnection/tsconfig.json index b68ca7cb51..a4a0b3ee3c 100644 --- a/types/express-myconnection/tsconfig.json +++ b/types/express-myconnection/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-mysql-session/tsconfig.json b/types/express-mysql-session/tsconfig.json index f6d45a934d..ea0fe2693f 100644 --- a/types/express-mysql-session/tsconfig.json +++ b/types/express-mysql-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-oauth-server/express-oauth-server-tests.ts b/types/express-oauth-server/express-oauth-server-tests.ts index 436763b9b8..1aea48c256 100644 --- a/types/express-oauth-server/express-oauth-server-tests.ts +++ b/types/express-oauth-server/express-oauth-server-tests.ts @@ -1,6 +1,6 @@ import ExpressOAuthServer = require("express-oauth-server"); import * as OAuth2Server from "oauth2-server"; -import * as express from "express"; +import express = require("express"); const oauth2Model: OAuth2Server.AuthorizationCodeModel = { getClient: async (clientId: string, clientSecret: string): Promise => { diff --git a/types/express-oauth-server/tsconfig.json b/types/express-oauth-server/tsconfig.json index 197ec65f00..b694bb7d6d 100644 --- a/types/express-oauth-server/tsconfig.json +++ b/types/express-oauth-server/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-oauth-server-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-openapi/tsconfig.json b/types/express-openapi/tsconfig.json index a6cf4f3530..f4a2f9f9f5 100644 --- a/types/express-openapi/tsconfig.json +++ b/types/express-openapi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-partials/tsconfig.json b/types/express-partials/tsconfig.json index 72e02dcdee..191459d746 100644 --- a/types/express-partials/tsconfig.json +++ b/types/express-partials/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-promise-router/tsconfig.json b/types/express-promise-router/tsconfig.json index 1f33dd7104..8e2b57d951 100644 --- a/types/express-promise-router/tsconfig.json +++ b/types/express-promise-router/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-promise-router-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express-rate-limit/tsconfig.json b/types/express-rate-limit/tsconfig.json index 7dfb99a1d4..f3029afb95 100644 --- a/types/express-rate-limit/tsconfig.json +++ b/types/express-rate-limit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-route-fs/tsconfig.json b/types/express-route-fs/tsconfig.json index 550f0d3b31..5b4456a483 100644 --- a/types/express-route-fs/tsconfig.json +++ b/types/express-route-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-sanitized/express-sanitized-tests.ts b/types/express-sanitized/express-sanitized-tests.ts index 1610ef6c91..4ff8cce13b 100644 --- a/types/express-sanitized/express-sanitized-tests.ts +++ b/types/express-sanitized/express-sanitized-tests.ts @@ -1,5 +1,5 @@ -import * as express from "express"; -import * as expressSanitized from "express-sanitized"; +import express = require("express"); +import expressSanitized = require("express-sanitized"); const RoutingServer: express.Express = express(); diff --git a/types/express-sanitized/tsconfig.json b/types/express-sanitized/tsconfig.json index 9924f49f46..0c6bcf3836 100644 --- a/types/express-sanitized/tsconfig.json +++ b/types/express-sanitized/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-serve-static-core/tsconfig.json b/types/express-serve-static-core/tsconfig.json index 73c2b38c7d..40b2ef2060 100644 --- a/types/express-serve-static-core/tsconfig.json +++ b/types/express-serve-static-core/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-session/express-session-tests.ts b/types/express-session/express-session-tests.ts index fdb77caedb..6a619f162c 100644 --- a/types/express-session/express-session-tests.ts +++ b/types/express-session/express-session-tests.ts @@ -37,3 +37,34 @@ app.use((req, res, next) => { res.end('welcome to the session demo. refresh!'); } }); + +// Custom Session Store + +class MyStore extends session.Store { + private sessions: { [sid: string]: string }; + + constructor() { + super(); + this.sessions = {}; + } + + get = (sid: string, callback: (err: any, session: Express.SessionData) => void): void => { + callback(null, JSON.parse(this.sessions[sid])); + } + + set = (sid: string, session: Express.Session, callback: (err: any) => void): void => { + this.sessions[sid] = JSON.stringify(session); + callback(null); + } + + destroy = (sid: string, callback: (err: any) => void): void => { + this.sessions[sid] = undefined; + this.sessions = JSON.parse(JSON.stringify(this.sessions)); + callback(null); + } +} + +app.use(session({ + secret: 'keyboard cat', + store: new MyStore() +})); diff --git a/types/express-session/index.d.ts b/types/express-session/index.d.ts index 13ce6ab8b2..6b59efc925 100644 --- a/types/express-session/index.d.ts +++ b/types/express-session/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for express-session 1.15 // Project: https://www.npmjs.org/package/express-session -// Definitions by: Hiroki Horiuchi , Jacob Bogers +// Definitions by: Hiroki Horiuchi , Jacob Bogers , Naoto Yokoyama // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -64,7 +64,7 @@ declare namespace session { } interface BaseMemoryStore { - get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData) => void) => void; set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; destroy: (sid: string, callback: (err: any) => void) => void; length?: (callback: (err: any, length: number) => void) => void; @@ -78,7 +78,7 @@ declare namespace session { load: (sid: string, fn: (err: any, session: Express.Session) => any) => void; createSession: (req: express.Request, sess: Express.SessionData) => void; - get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData) => void) => void; set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; destroy: (sid: string, callback: (err: any) => void) => void; all: (callback: (err: any, obj: { [sid: string]: Express.SessionData; }) => void) => void; @@ -87,7 +87,7 @@ declare namespace session { } class MemoryStore implements BaseMemoryStore { - get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData) => void) => void; set: (sid: string, session: Express.Session, callback: (err: any) => void) => void; destroy: (sid: string, callback: (err: any) => void) => void; all: (callback: (err: any, obj: { [sid: string]: Express.Session; }) => void) => void; diff --git a/types/express-session/tsconfig.json b/types/express-session/tsconfig.json index 14c2e75bd5..190564ac5e 100644 --- a/types/express-session/tsconfig.json +++ b/types/express-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-to-koa/express-to-koa-tests.ts b/types/express-to-koa/express-to-koa-tests.ts new file mode 100644 index 0000000000..1329a15851 --- /dev/null +++ b/types/express-to-koa/express-to-koa-tests.ts @@ -0,0 +1,12 @@ +import Koa = require('koa'); +import * as connect from 'connect'; +import expressToKoa = require('express-to-koa'); + +const app = new Koa(); +const middleware: connect.NextHandleFunction = (req, res, next) => { + // 'express middleware' + next(); +}; + +app.use(expressToKoa(middleware)); +app.listen(3000); diff --git a/types/express-to-koa/index.d.ts b/types/express-to-koa/index.d.ts new file mode 100644 index 0000000000..9a23108943 --- /dev/null +++ b/types/express-to-koa/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for express-to-koa 1.0 +// Project: https://github.com/kaelzhang/express-to-koa +// Definitions by: Xiaohan Zhang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as Koa from "koa"; +import { IncomingMessage, ServerResponse } from "http"; + +export = expressToKoa; + +declare function expressToKoa( + middleware: ( + req: IncomingMessage, + res: ServerResponse, + next: (err?: any) => void, + ) => void +): Koa.Middleware; diff --git a/types/express-to-koa/tsconfig.json b/types/express-to-koa/tsconfig.json new file mode 100644 index 0000000000..5b33c7ac55 --- /dev/null +++ b/types/express-to-koa/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "express-to-koa-tests.ts" + ] +} \ No newline at end of file diff --git a/types/express-to-koa/tslint.json b/types/express-to-koa/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-to-koa/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-unless/tsconfig.json b/types/express-unless/tsconfig.json index 44038c38d3..5cb90389b5 100644 --- a/types/express-unless/tsconfig.json +++ b/types/express-unless/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-useragent/tsconfig.json b/types/express-useragent/tsconfig.json index 3bbc5c5520..0cf85a5a95 100644 --- a/types/express-useragent/tsconfig.json +++ b/types/express-useragent/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/express-winston/express-winston-tests.ts b/types/express-winston/express-winston-tests.ts index 7ce00c479e..297b7afc49 100644 --- a/types/express-winston/express-winston-tests.ts +++ b/types/express-winston/express-winston-tests.ts @@ -1,6 +1,6 @@ import expressWinston = require('express-winston'); import * as winston from 'winston'; -import * as express from 'express'; +import express = require('express'); const app = express(); diff --git a/types/express-winston/tsconfig.json b/types/express-winston/tsconfig.json index dcebd7fafb..7ec0a4eff8 100644 --- a/types/express-winston/tsconfig.json +++ b/types/express-winston/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "express-winston-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/express/express-tests.ts b/types/express/express-tests.ts index 1c9220a8b5..137c70c8e8 100644 --- a/types/express/express-tests.ts +++ b/types/express/express-tests.ts @@ -1,4 +1,4 @@ -import * as express from 'express'; +import express = require('express'); namespace express_tests { const app = express(); diff --git a/types/express/index.d.ts b/types/express/index.d.ts index 18231dcfbc..4e6ed8fcc1 100644 --- a/types/express/index.d.ts +++ b/types/express/index.d.ts @@ -15,7 +15,7 @@ /// import * as bodyParser from "body-parser"; -import * as serveStatic from "serve-static"; +import serveStatic = require("serve-static"); import * as core from "express-serve-static-core"; /** diff --git a/types/express/tsconfig.json b/types/express/tsconfig.json index b38c24658e..999dd53a3e 100644 --- a/types/express/tsconfig.json +++ b/types/express/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/extend/extend-tests.ts b/types/extend/extend-tests.ts index 0bf977e6e8..5ff62322b1 100644 --- a/types/extend/extend-tests.ts +++ b/types/extend/extend-tests.ts @@ -1,6 +1,4 @@ -/// -import * as assert from 'assert'; -import * as extend from 'extend'; +import extend = require('extend'); const objectBase = { test: 'base' @@ -25,19 +23,19 @@ const objectThree = { type ExtendedType = typeof objectBase & typeof objectOne; const extended: ExtendedType = extend(objectBase, objectOne); -assert(extended.test === 'one'); -assert(extended.iamone); +extended.test === 'one'; +extended.iamone; type MoreExtendedType = typeof objectBase & typeof objectOne & typeof objectTwo; const moreExtended: MoreExtendedType = extend(objectBase, objectOne, objectTwo); -assert(moreExtended.test === 2); -assert(moreExtended.iamone); -assert(moreExtended.iamtwo); +moreExtended.test === 2; +moreExtended.iamone; +moreExtended.iamtwo; type DeepExtendedType = typeof objectBase & typeof objectOne & typeof objectTwo & typeof objectThree; const deepExtended = extend(true, objectBase, objectOne, objectTwo, objectThree); -assert(deepExtended.iamone); -assert(deepExtended.iamtwo); -assert(deepExtended.iamthree); -assert(deepExtended.depth.innerType === 'deep'); +deepExtended.iamone; +deepExtended.iamtwo; +deepExtended.iamthree; +deepExtended.depth.innerType === 'deep'; diff --git a/types/extend/tsconfig.json b/types/extend/tsconfig.json index dce058009d..19ed5928ee 100644 --- a/types/extend/tsconfig.json +++ b/types/extend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/extjs/tsconfig.json b/types/extjs/tsconfig.json index 16cf9bcee6..20138aaa88 100644 --- a/types/extjs/tsconfig.json +++ b/types/extjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/extract-stack/tsconfig.json b/types/extract-stack/tsconfig.json index 26f0c50479..2779df149a 100644 --- a/types/extract-stack/tsconfig.json +++ b/types/extract-stack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/extract-text-webpack-plugin/tsconfig.json b/types/extract-text-webpack-plugin/tsconfig.json index dc6516b37e..9a503d773a 100644 --- a/types/extract-text-webpack-plugin/tsconfig.json +++ b/types/extract-text-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/extract-zip/tsconfig.json b/types/extract-zip/tsconfig.json index 821ad3b5b3..db692aa262 100644 --- a/types/extract-zip/tsconfig.json +++ b/types/extract-zip/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/eyes/tsconfig.json b/types/eyes/tsconfig.json index e0effcdb85..cca90d6857 100644 --- a/types/eyes/tsconfig.json +++ b/types/eyes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/f1/tsconfig.json b/types/f1/tsconfig.json index e54cd01b58..45e94b199c 100644 --- a/types/f1/tsconfig.json +++ b/types/f1/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fabric/fabric-tests.ts b/types/fabric/fabric-tests.ts index 2f7d1a7d37..0f51499c0b 100644 --- a/types/fabric/fabric-tests.ts +++ b/types/fabric/fabric-tests.ts @@ -331,10 +331,10 @@ function sample6() { canvas.centerObject(obj); canvas.add(obj); - canvas.add(obj.clone(() => { }).set({ left: 100, top: 100, angle: -15 })); - canvas.add(obj.clone(() => { }).set({ left: 480, top: 100, angle: 15 })); - canvas.add(obj.clone(() => { }).set({ left: 100, top: 400, angle: -15 })); - canvas.add(obj.clone(() => { }).set({ left: 480, top: 400, angle: 15 })); + obj.clone(clone => canvas.add(clone.set({ left: 100, top: 100, angle: -15 }))); + obj.clone(clone => canvas.add(clone.set({ left: 480, top: 100, angle: 15 }))); + obj.clone(clone => canvas.add(clone.set({ left: 100, top: 400, angle: -15 }))); + obj.clone(clone => canvas.add(clone.set({ left: 480, top: 400, angle: 15 }))); canvas.on('mouse:move', options => { const p = canvas.getPointer(options.e); @@ -481,7 +481,7 @@ function sample8() { top, angle, padding: 10, - cornersize: 10 + cornerSize: 10 }); image.scale(getRandomNum(0.1, 0.25)).setCoords(); canvas.add(image); @@ -495,7 +495,7 @@ function sample8() { top, angle, padding: 10, - cornersize: 10 + cornerSize: 10 }); image.scale(getRandomNum(0.1, 1)).setCoords(); canvas.add(image); @@ -515,7 +515,7 @@ function sample8() { top, angle, padding: 10, - cornersize: 10 + cornerSize: 10 }); loadedObject/*.scaleToWidth(300)*/.setCoords(); diff --git a/types/fabric/index.d.ts b/types/fabric/index.d.ts index ac6104d419..2163faecef 100644 --- a/types/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -1,7 +1,11 @@ // Type definitions for FabricJS 1.5 // Project: http://fabricjs.com/ -// Definitions by: Oliver Klemencic , Joseph Livecchi , Michael Randolph +// Definitions by: Oliver Klemencic +// Joseph Livecchi +// Michael Randolph +// Tiger Oakes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 export as namespace fabric; @@ -61,7 +65,7 @@ export function parseStyleAttribute(element: SVGElement): any; * @param [options] Options object * @param [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ -export function parseElements(elements: any[], callback: Function, options?: any, reviver?: Function): void; +export function parseElements(elements: SVGElement[], callback: Function, options?: any, reviver?: Function): void; /** * Returns an object of attributes' name/value, given element and an array of attribute names; * Parses parent "g" nodes recursively upwards. @@ -232,7 +236,7 @@ interface ICollection { * @param context Context (aka thisObject) * @return thisArg */ - forEachObject(callback: (element: Object, index: number, array: Object[]) => any, context?: any): T; + forEachObject(callback: (element: Object, index: number, array: Object[]) => void, context?: any): T; /** * Returns an array of children objects of this instance @@ -279,13 +283,13 @@ interface IObservable { * @param eventName Event name (eg. 'after:render') * @param handler Function that receives a notification when an event of the specified type occurs */ - on(eventName: string, handler: (e: IEvent) => any): T; + on(eventName: string, handler: (e: IEvent) => void): T; /** * Observes specified event * @param eventName Object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) */ - on(eventName: {[key: string]: Function}): T; + on(events: {[eventName: string]: (e: IEvent) => void}): T; /** * Fires event with an optional options object * @param eventName Event name to fire @@ -298,7 +302,7 @@ interface IObservable { * @param eventName Event name (eg. 'after:render') or object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) * @param handler Function to be deleted from EventListeners */ - off(eventName?: string|any, handler?: (e: IEvent) => any): T; + off(eventName?: string|any, handler?: (e: IEvent) => void): T; } interface Callbacks { @@ -799,14 +803,14 @@ interface IShadowOptions { */ offsetY: number; } -export interface IShadow extends IShadowOptions {} -export class IShadow { +export interface Shadow extends IShadowOptions {} +export class Shadow { constructor(options?: IShadowOptions); - initialize(options?: IShadowOptions|string): IShadow; + initialize(options?: IShadowOptions|string): Shadow; /** * Returns object representation of a shadow */ - toObject(): Object; + toObject(): any; /** * Returns a string representation of an instance, CSS3 text-shadow declaration */ @@ -953,7 +957,7 @@ export class StaticCanvas { * @param callback Callback to invoke when image is loaded and set as background * @param [options] Optional options to set for the {@link fabric.Image|background image}. */ - setBackgroundImage(image: Image|string, callback: Function, options?: IObjectOptions): StaticCanvas; + setBackgroundImage(image: Image|string, callback?: Function, options?: IObjectOptions): StaticCanvas; /** * Sets {@link fabric.StaticCanvas#overlayColor|background color} for this canvas @@ -1112,19 +1116,19 @@ export class StaticCanvas { * Returs dataless JSON representation of canvas * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toDatalessJSON(propertiesToInclude?: any[]): string; + toDatalessJSON(propertiesToInclude?: string[]): string; /** * Returns object representation of canvas * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns dataless object representation of canvas * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toDatalessObject(propertiesToInclude?: any[]): any; + toDatalessObject(propertiesToInclude?: string[]): any; /** * When true, getSvgTransform() will apply the StaticCanvas.viewportTransform to the SVG transformation. When true, @@ -1198,7 +1202,7 @@ export class StaticCanvas { * @param methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" * @return `true` if method is supported (or at least exists), null` if canvas element or context can not be initialized */ - supports(methodName: string): boolean; + supports(methodName: "getImageData" | "toDataURL" | "toDataURLWithQuality" | "setLineDash"): boolean; /** * Populates canvas with data from the specified JSON. @@ -1215,7 +1219,7 @@ export class StaticCanvas { * @param [callback] Receives cloned instance as a first argument * @param [properties] Array of properties to include in the cloned canvas and children */ - clone(callback: (canvas: StaticCanvas) => any, properties?: any[]): void; + clone(callback: (canvas: StaticCanvas) => void, properties?: any[]): void; /** * Clones canvas instance without cloning existing data. @@ -1223,7 +1227,7 @@ export class StaticCanvas { * but leaves data empty (so that you can populate it with your own) * @param [callback] Receives cloned instance as a first argument */ - cloneWithoutData(callback: (canvas: StaticCanvas) => any): void; + cloneWithoutData(callback: (canvas: StaticCanvas) => void): void; /** * Callback; invoked right before object is about to be scaled/rotated @@ -1251,12 +1255,12 @@ export class StaticCanvas { * (either those of HTMLCanvasElement itself, or rendering context) * @param methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" */ - static supports(methodName: string): boolean; + static supports(methodName: "getImageData" | "toDataURL" | "toDataURLWithQuality" | "setLineDash"): boolean; /** * Returns JSON representation of canvas * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - static toJSON(propertiesToInclude?: any[]): string; + static toJSON(propertiesToInclude?: string[]): string; } interface ICanvasOptions extends IStaticCanvasOptions { @@ -1473,12 +1477,12 @@ export class Canvas { * (either those of HTMLCanvasElement itself, or rendering context) * @param methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" */ - static supports(methodName: string): boolean; + static supports(methodName: "getImageData" | "toDataURL" | "toDataURLWithQuality" | "setLineDash"): boolean; /** * Returns JSON representation of canvas * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - static toJSON(propertiesToInclude?: any[]): string; + static toJSON(propertiesToInclude?: string[]): string; } /////////////////////////////////////////////////////////////////////////////// @@ -1527,7 +1531,7 @@ export class Circle { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns svg representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -1580,7 +1584,7 @@ export class Ellipse { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns svg representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -1681,7 +1685,7 @@ export class Group { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns string represenation of a group */ @@ -1751,7 +1755,7 @@ export class Image { * @param callback Callback is invoked with a clone as a first argument * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - clone(callback?: Function, propertiesToInclude?: any[]): Object; + clone(callback?: Function, propertiesToInclude?: string[]): void; /** * Returns complexity of an instance * @return complexity of this instance @@ -1791,7 +1795,7 @@ export class Image { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return Object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns string representation of an instance * @return String representation of an instance @@ -1817,20 +1821,20 @@ export class Image { * @param [callback] Callback to invoke when image is created (newly created image is passed as a first argument) * @param [imgOptions] Options object */ - static fromURL(url: string, callback?: (image: Image) => any, objObjects?: IObjectOptions): Image; + static fromURL(url: string, callback?: (image: Image) => void, objObjects?: IObjectOptions): Image; /** * Creates an instance of fabric.Image from its object representation * @param object Object to create an instance from * @param [callback] Callback to invoke when an image instance is created */ - static fromObject(object: any, callback: (image: Image) => {}): void; + static fromObject(object: any, callback: (image: Image) => void): void; /** * Returns Image instance from an SVG element * @param element Element to parse * @param callback Callback to execute when fabric.Image object is created * @param [options] Options object */ - static fromElement(element: SVGElement, callback: Function, options?: IImageOptions): void; + static fromElement(element: SVGElement, callback: (image: Image) => void, options?: IImageOptions): void; /** * Default CSS class name for canvas */ @@ -1877,7 +1881,7 @@ export class Line { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude: any[]): any; + toObject(propertiesToInclude: string[]): any; /** * Returns SVG representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -1997,6 +2001,11 @@ interface IObjectOptions { */ cornerColor?: string; + /** + * Specify style of control, 'rect' or 'circle' + */ + cornerStrokeColor?: "rect" | "circle"; + /** * When true, this object will use center point as the origin of transformation * when being scaled via the controls. @@ -2066,7 +2075,7 @@ interface IObjectOptions { /** * Shadow object representing shadow of this shape */ - shadow?: IShadow|string; + shadow?: Shadow|string; /** * Opacity of object's controlling borders when object is active and moving @@ -2245,7 +2254,7 @@ export class Object { /* * Sets object's properties from options * @param {Object} [options] Options object */ - setOptions(options: any): void; + setOptions(options: IObjectOptions): void; /** * Transforms context when rendering an object @@ -2258,13 +2267,13 @@ export class Object { * Returns an object representation of an instance * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns (dataless) object representation of an instance * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toDatalessObject(propertiesToInclude?: any[]): any; + toDatalessObject(propertiesToInclude?: string[]): any; /** * Returns a string representation of an instance @@ -2275,7 +2284,7 @@ export class Object { * Basic getter * @param property Property name */ - get(property: string): any; + get(property: K): this[K]; /** * Sets property to a given value. @@ -2284,26 +2293,26 @@ export class Object { * @param key Property name * @param value Property value (if function, the value is passed into it and its return value is used as a new one) */ - set(key: string, value: any|Function): Object; + set(key: K, value: this[K] | ((value: this[K]) => this[K])): this; /** * Sets property to a given value. * When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. * If you need to update those, call `setCoords()`. - * @param Object key Property object, iterate over the object properties + * @param options Property object, iterate over the object properties */ - set(key: any): Object; + set(options: Partial): this; /** * Toggles specified property from `true` to `false` or from `false` to `true` * @param property Property to toggle */ - toggle(property: string): Object; + toggle(property: keyof this): this; /** * Sets sourcePath of an object * @param value Value to set sourcePath to */ - setSourcePath(value: string): Object; + setSourcePath(value: string): this; /** * Retrieves viewportTransform from Object's canvas if possible @@ -2318,17 +2327,17 @@ export class Object { render(ctx: CanvasRenderingContext2D, noTransform?: boolean): void; /** - * Clones an instance + * Clones an instance, using a callback method will work for every object. * @param callback Callback is invoked with a clone as a first argument * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - clone(callback: Function, propertiesToInclude?: any[]): Object; + clone(callback: (clone: Object) => void, propertiesToInclude?: string[]): void; /** * Creates an instance of fabric.Image out of an object * @param callback callback, invoked with an instance as a first argument */ - cloneAsImage(callback: (image: Image) => any): Object; + cloneAsImage(callback: (image: Image) => void): this; /** * Converts an object into a data-url-like string @@ -2351,67 +2360,62 @@ export class Object { * Returns a JSON representation of an instance * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toJSON(propertiesToInclude?: any[]): any; + toJSON(propertiesToInclude?: string[]): any; /** * Sets gradient (fill or stroke) of an object - * Backwards incompatibility note: This method was named "setGradientFill" until v1.1.0 + * **Backwards incompatibility note:** This method was named "setGradientFill" until v1.1.0 * @param property Property name 'stroke' or 'fill' * @param [options] Options object */ - setGradient(property: string, options: IGradientOptions): Object; + setGradient(property: "stroke" | "fill", options: IGradientOptions): this; /** * Sets pattern fill of an object * @param options Options object */ - setPatternFill(options: IFillOptions): Object; + setPatternFill(options: IFillOptions): this; /** * Sets shadow of an object * @param [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") */ - setShadow(options?: string): Object; - /** - * Sets shadow of an object - * @param [options] Options object - */ - setShadow(options: IShadow): Object; + setShadow(options?: string | Shadow): this; /** * Sets "color" of an instance (alias of `set('fill', …)`) * @param color Color value */ - setColor(color: string): Object; + setColor(color: string): this; /** * Sets "angle" of an instance * @param angle Angle value */ - setAngle(angle: number): Object; + setAngle(angle: number): this; /** * Sets "angle" of an instance * @param angle Angle value */ - rotate(angle: number): Object; + rotate(angle: number): this; /** * Centers object horizontally on canvas to which it was added last. * You might need to call `setCoords` on an object after centering, to update controls area. */ - centerH(): void; + centerH(): this; /** * Centers object vertically on canvas to which it was added last. * You might need to call `setCoords` on an object after centering, to update controls area. */ - centerV(): void; + centerV(): this; /** * Centers object vertically and horizontally on canvas to which is was added last * You might need to call `setCoords` on an object after centering, to update controls area. */ - center(): void; + center(): this; /** * Removes object from canvas to which it was added last @@ -2423,7 +2427,7 @@ export class Object { * @param e Event to operate upon * @param [pointer] Pointer to operate upon (instead of event) */ - getLocalPointer(e: Event, pointer: any): any; + getLocalPointer(e: Event, pointer?: { x: number, y: number }): { x: number, y: number }; /** * Sets object's properties from options @@ -2461,21 +2465,21 @@ export class Object { * @param [options] Object with additional `stateProperties` array to include when saving state * @return thisArg */ - saveState(options?: { stateProperties: any[] }): Object; + saveState(options?: { stateProperties: any[] }): this; /** * Setups state of an object */ - setupState(): Object; + setupState(): this; // functions from object straightening mixin // ----------------------------------------------------------------------------------------------------------------------------------- /** * Straightens an object (rotating it from current angle to one of 0, 90, 180, 270, etc. depending on which is closer) */ - straighten(): Object; + straighten(): this; /** * Same as straighten but with animation */ - fxStraighten(callbacks: Callbacks): Object; + fxStraighten(callbacks: Callbacks): this; // functions from object stacking mixin // ----------------------------------------------------------------------------------------------------------------------------------- @@ -2483,25 +2487,25 @@ export class Object { * Moves an object up in stack of drawn objects * @param [intersecting] If `true`, send object in front of next upper intersecting object */ - bringForward(intersecting?: boolean): Object; + bringForward(intersecting?: boolean): this; /** * Moves an object to the top of the stack of drawn objects */ - bringToFront(): Object; + bringToFront(): this; /** * Moves an object down in stack of drawn objects * @param [intersecting] If `true`, send object behind next lower intersecting object */ - sendBackwards(intersecting?: boolean): Object; + sendBackwards(intersecting?: boolean): this; /** * Moves an object to the bottom of the stack of drawn objects */ - sendToBack(): Object; + sendToBack(): this; /** * Moves an object to specified level in stack of drawn objects * @param index New position of object */ - moveTo(index: number): Object; + moveTo(index: number): this; // functions from object origin mixin // ----------------------------------------------------------------------------------------------------------------------------------- @@ -2561,7 +2565,7 @@ export class Object { * Requires public options: padding, borderColor * @param ctx Context to draw on */ - drawBorders(context: CanvasRenderingContext2D): Object; + drawBorders(context: CanvasRenderingContext2D): this; /** * Draws corners of an object's bounding box. @@ -2581,7 +2585,7 @@ export class Object { * @param controlName The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. * @param visible true to set the specified control visible, false otherwise */ - setControlVisible(controlName: string, visible: boolean): Object; + setControlVisible(controlName: string, visible: boolean): this; /** * Sets the visibility state of object controls. @@ -2596,7 +2600,7 @@ export class Object { mt?: boolean; tl?: boolean; tr?: boolean; - mtr?: boolean; }): Object; + mtr?: boolean; }): this; // functions from geometry mixin // ------------------------------------------------------------------------------------------------------------------------------- @@ -2604,7 +2608,7 @@ export class Object { * Sets corner position coordinates based on current angle, width and height * See https://github.com/kangax/fabric.js/wiki/When-to-call-setCoords */ - setCoords(): Object; + setCoords(): this; /** * Returns coordinates of object's bounding rectangle (left, top, width, height) * @return Object with left, top, width, height properties @@ -2631,17 +2635,17 @@ export class Object { * @param value Scale factor * @return thisArg */ - scale(value: number): Object; + scale(value: number): this; /** * Scales an object to a given height, with respect to bounding box (scaling by x/y equally) * @param value New height value */ - scaleToHeight(value: number): Object; + scaleToHeight(value: number): this; /** * Scales an object to a given width, with respect to bounding box (scaling by x/y equally) * @param value New width value */ - scaleToWidth(value: number): Object; + scaleToWidth(value: number): this; /** * Checks if object intersects with another object * @param other Object to test @@ -2671,8 +2675,8 @@ interface IPathOptions extends IObjectOptions { */ minY?: number; } -export interface IPath extends Object, IPathOptions {} -export class IPath { +export interface Path extends Object, IPathOptions {} +export class Path { /** * Constructor * @param path Path data (sequence of coordinates and corresponding "command" tokens) @@ -2680,7 +2684,7 @@ export class IPath { */ constructor(path?: string|any[], options?: IPathOptions); - initialize(path?: any[], options?: IPathOptions): IPath; + initialize(path?: any[], options?: IPathOptions): Path; /** * Returns number representation of an instance complexity @@ -2699,13 +2703,13 @@ export class IPath { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toDatalessObject(propertiesToInclude?: any[]): any; + toDatalessObject(propertiesToInclude?: string[]): any; /** * Returns object representation of an instance * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns string representation of an instance * @return string representation of an instance @@ -2724,12 +2728,12 @@ export class IPath { * @param callback Callback to invoke when an fabric.Path instance is created * @param [options] Options object */ - static fromElement(element: SVGElement, callback: (path: IPath) => any, options?: IPathOptions): void; + static fromElement(element: SVGElement, callback: (path: Path) => any, options?: IPathOptions): void; /** * Creates an instance of fabric.Path from an object * @param callback Callback to invoke when an fabric.Path instance is created */ - static fromObject(object: any, callback: (path: IPath) => any): void; + static fromObject(object: any, callback: (path: Path) => any): void; } export class PathGroup extends Object { @@ -2737,9 +2741,9 @@ export class PathGroup extends Object { * Constructor * @param [options] Options object */ - constructor(paths: IPath[], options?: IObjectOptions); + constructor(paths: Path[], options?: IObjectOptions); - initialize(paths: IPath[], options?: IObjectOptions): void; + initialize(paths: Path[], options?: IObjectOptions): void; /** * Returns number representation of object's complexity * @return complexity @@ -2760,13 +2764,13 @@ export class PathGroup extends Object { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return dataless object representation of an instance */ - toDatalessObject(propertiesToInclude?: any[]): any; + toDatalessObject(propertiesToInclude?: string[]): any; /** * Returns object representation of this path group * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns a string representation of this path group * @return string representation of an object @@ -2782,7 +2786,7 @@ export class PathGroup extends Object { * Returns all paths in this path group * @return array of path objects included in this path group */ - getObjects(): IPath[]; + getObjects(): Path[]; static fromObject(object: any): PathGroup; /** @@ -2829,7 +2833,7 @@ export class Polygon extends Object { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns svg representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -2891,7 +2895,7 @@ export class Polyline extends Object { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return Object representation of an instance */ - toObject(propertiesToInclude?: any[]): any; + toObject(propertiesToInclude?: string[]): any; /** * Returns SVG representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -3012,7 +3016,7 @@ interface ITextOptions extends IObjectOptions { * Shadow object representing shadow of this shape. * Backwards incompatibility note?: This property was named "textShadow" (String) until v1.2.11 */ - shadow?: IShadow|string; + shadow?: Shadow|string; /** * Background color of text lines */ @@ -3047,7 +3051,7 @@ export class Text extends Object { * Returns object representation of an instance * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ - toObject(propertiesToInclude?: any[]): Object; + toObject(propertiesToInclude?: string[]): any; /** * Returns SVG representation of an instance * @param [reviver] Method for further parsing of svg representation. @@ -3237,7 +3241,7 @@ export class IText extends Object { * @param [propertiesToInclude] Any properties that you might want to additionally include in the output * @return object representation of an instance */ - toObject(propertiesToInclude?: any[]): Object; + toObject(propertiesToInclude?: string[]): any; setText(value: string): Text; /** @@ -3843,7 +3847,7 @@ export class BaseBrush { * Backwards incompatibility note: This property replaces "shadowColor" (String), "shadowOffsetX" (Number), * "shadowOffsetY" (Number) and "shadowBlur" (Number) since v1.2.12 */ - shadow: IShadow|string; + shadow: Shadow|string; /** * Line endings style of a brush (one of "butt", "round", "square") */ @@ -3924,7 +3928,7 @@ export class PatternBrush extends PencilBrush { /** * Creates path */ - createPath(pathData: string): IPath; + createPath(pathData: string): Path; } export class PencilBrush extends BaseBrush { /** @@ -3937,7 +3941,7 @@ export class PencilBrush extends BaseBrush { * Creates fabric.Path object to add on canvas * @param pathData Path data */ - createPath(pathData: string): IPath; + createPath(pathData: string): Path; } /////////////////////////////////////////////////////////////////////////////// @@ -4258,6 +4262,13 @@ interface IUtilMisc { */ rotatePoint(point: Point, origin: Point, radians: number): Point; + /** + * Rotates `vector` with `radians` + * @param vector The vector to rotate (x and y) + * @param radians The radians of the angle for the rotation + */ + rotateVector(vector: { x: number, y: number }, radians: number): { x: number, y: number }; + /** * Apply transform t to point p * @param p The point to transform @@ -4378,7 +4389,13 @@ interface IUtilMisc { * @param a First transformMatrix * @param b Second transformMatrix */ - multiplyTransformMatrices(a: any[], b: any[]): any[]; + multiplyTransformMatrices(a: number[], b: number[]): number[]; + + /** + * Decomposes standard 2x2 matrix into transform componentes + * @param a transformMatrix + */ + qrDecompose(a: number[]): { angle: number, scaleX: number, scaleY: number, skewX: number, skewY: number, translateX: number, translateY: number }; /** * Returns string representation of function body diff --git a/types/fabric/tsconfig.json b/types/fabric/tsconfig.json index fc7ce8ddc9..93924ce83d 100644 --- a/types/fabric/tsconfig.json +++ b/types/fabric/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/facebook-js-sdk/tsconfig.json b/types/facebook-js-sdk/tsconfig.json index 2ac8efade5..ed029f3557 100644 --- a/types/facebook-js-sdk/tsconfig.json +++ b/types/facebook-js-sdk/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/facebook-pixel/tsconfig.json b/types/facebook-pixel/tsconfig.json index c4cc9bd7fa..487b76e1e4 100644 --- a/types/facebook-pixel/tsconfig.json +++ b/types/facebook-pixel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/faker/tsconfig.json b/types/faker/tsconfig.json index 33d32cb266..cbf9fdad1c 100644 --- a/types/faker/tsconfig.json +++ b/types/faker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/faker/v3/tsconfig.json b/types/faker/v3/tsconfig.json index 5cfa258457..53f848d0dc 100644 --- a/types/faker/v3/tsconfig.json +++ b/types/faker/v3/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/falcor-express/tsconfig.json b/types/falcor-express/tsconfig.json index 0f4a36624a..1ba6e4c5c7 100644 --- a/types/falcor-express/tsconfig.json +++ b/types/falcor-express/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/falcor-http-datasource/tsconfig.json b/types/falcor-http-datasource/tsconfig.json index 114a1e5046..948a3c2ffa 100644 --- a/types/falcor-http-datasource/tsconfig.json +++ b/types/falcor-http-datasource/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/falcor-json-graph/tsconfig.json b/types/falcor-json-graph/tsconfig.json index 2753b64668..7ae61b9563 100644 --- a/types/falcor-json-graph/tsconfig.json +++ b/types/falcor-json-graph/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/falcor-router/tsconfig.json b/types/falcor-router/tsconfig.json index 4f37ee59be..4ca1b54a8b 100644 --- a/types/falcor-router/tsconfig.json +++ b/types/falcor-router/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/falcor/tsconfig.json b/types/falcor/tsconfig.json index 94084a9884..3444c09530 100644 --- a/types/falcor/tsconfig.json +++ b/types/falcor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/famous/tsconfig.json b/types/famous/tsconfig.json index e2760ecc02..37897f899c 100644 --- a/types/famous/tsconfig.json +++ b/types/famous/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fancy-log/tsconfig.json b/types/fancy-log/tsconfig.json index 0ef3d95d9e..ec3b2f25de 100644 --- a/types/fancy-log/tsconfig.json +++ b/types/fancy-log/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fancy-log-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fancybox/tsconfig.json b/types/fancybox/tsconfig.json index e8011cdd21..87689cdc4f 100644 --- a/types/fancybox/tsconfig.json +++ b/types/fancybox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/farbtastic/tsconfig.json b/types/farbtastic/tsconfig.json index 91f8048ddb..8b812fadc8 100644 --- a/types/farbtastic/tsconfig.json +++ b/types/farbtastic/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fast-diff/tsconfig.json b/types/fast-diff/tsconfig.json index 0c6f0c4ae2..6be0492a01 100644 --- a/types/fast-diff/tsconfig.json +++ b/types/fast-diff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fast-levenshtein/tsconfig.json b/types/fast-levenshtein/tsconfig.json index 1cb0e8b022..6f108c6f06 100644 --- a/types/fast-levenshtein/tsconfig.json +++ b/types/fast-levenshtein/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/fast-list/tsconfig.json b/types/fast-list/tsconfig.json index ce90acb3cd..94d28d10ba 100644 --- a/types/fast-list/tsconfig.json +++ b/types/fast-list/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fast-stats/tsconfig.json b/types/fast-stats/tsconfig.json index c845c63f47..9439a56f37 100644 --- a/types/fast-stats/tsconfig.json +++ b/types/fast-stats/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fastclick/tsconfig.json b/types/fastclick/tsconfig.json index 494a7b78d7..31d363d25c 100644 --- a/types/fastclick/tsconfig.json +++ b/types/fastclick/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/favico.js/tsconfig.json b/types/favico.js/tsconfig.json index 15047d8dbf..185be44519 100644 --- a/types/favico.js/tsconfig.json +++ b/types/favico.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fb/tsconfig.json b/types/fb/tsconfig.json index 9e8582a781..e38dd69198 100644 --- a/types/fb/tsconfig.json +++ b/types/fb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fbemitter/tsconfig.json b/types/fbemitter/tsconfig.json index 8032d97e7f..9ebe492c70 100644 --- a/types/fbemitter/tsconfig.json +++ b/types/fbemitter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/featherlight/tsconfig.json b/types/featherlight/tsconfig.json index 32c72beb9f..aa6c592a74 100644 --- a/types/featherlight/tsconfig.json +++ b/types/featherlight/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/feathersjs__authentication-client/feathersjs__authentication-client-tests.ts b/types/feathersjs__authentication-client/feathersjs__authentication-client-tests.ts index 3d4eb36362..2a4ea96f91 100644 --- a/types/feathersjs__authentication-client/feathersjs__authentication-client-tests.ts +++ b/types/feathersjs__authentication-client/feathersjs__authentication-client-tests.ts @@ -1,4 +1,11 @@ +import feathers from '@feathersjs/feathers'; import feathersAuthClient from '@feathersjs/authentication-client'; -// we can't really do much, because the augmentation of @feathersjs/feathers breaks importing it here. -const configureFn = feathersAuthClient({}); +const app = feathers(); +app.configure(feathersAuthClient()); +app.authenticate({strategy : 'abcdef'}).then(() => {}); +app.logout().then(() => {}); + +// check if the non-augmented @feathersjs/feathers typings still work +app.on('asd', () => {}); +app.service('asd').get(0).then(() => {}); diff --git a/types/feathersjs__authentication-client/feathersjs__feathers.d.ts b/types/feathersjs__authentication-client/feathersjs__feathers.d.ts deleted file mode 100644 index 9c0fa2e05e..0000000000 --- a/types/feathersjs__authentication-client/feathersjs__feathers.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -declare module '@feathersjs/feathers' { - import { - FeathersAuthCredentials, - Passport - } from '@feathersjs/authentication-client'; - - interface Application { - authenticate(options?: FeathersAuthCredentials): Promise; - - logout(): Promise; - - passport: Passport; - } -} diff --git a/types/feathersjs__authentication-client/index.d.ts b/types/feathersjs__authentication-client/index.d.ts index a29039aab9..16f4f4a415 100644 --- a/types/feathersjs__authentication-client/index.d.ts +++ b/types/feathersjs__authentication-client/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: Abraao Alves , Jan Lohage // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript -import './feathersjs__feathers'; - export default function feathersAuthClient(config?: FeathersAuthClientConfig): () => void; export interface FeathersAuthClientConfig { @@ -62,3 +60,13 @@ export interface Passport { getStorage(storage: any): any; } + +declare module '@feathersjs/feathers' { + interface Application { + authenticate(options?: FeathersAuthCredentials): Promise; + + logout(): Promise; + + passport: Passport; + } +} diff --git a/types/feathersjs__authentication-client/tsconfig.json b/types/feathersjs__authentication-client/tsconfig.json index 62adef4864..77f8c05aef 100644 --- a/types/feathersjs__authentication-client/tsconfig.json +++ b/types/feathersjs__authentication-client/tsconfig.json @@ -16,12 +16,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/authentication-client": ["feathersjs__authentication-client"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/authentication-client": [ + "feathersjs__authentication-client" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__authentication-client-tests.ts" + "index.d.ts", + "feathersjs__authentication-client-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__authentication-jwt/tsconfig.json b/types/feathersjs__authentication-jwt/tsconfig.json index 9845c047e6..6d4d54675f 100644 --- a/types/feathersjs__authentication-jwt/tsconfig.json +++ b/types/feathersjs__authentication-jwt/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/authentication-jwt": ["feathersjs__authentication-jwt"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/authentication-jwt": [ + "feathersjs__authentication-jwt" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__authentication-jwt-tests.ts" + "index.d.ts", + "feathersjs__authentication-jwt-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__authentication-local/tsconfig.json b/types/feathersjs__authentication-local/tsconfig.json index 1972b0a171..b68a9d954c 100644 --- a/types/feathersjs__authentication-local/tsconfig.json +++ b/types/feathersjs__authentication-local/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/authentication-local": ["feathersjs__authentication-local"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/authentication-local": [ + "feathersjs__authentication-local" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__authentication-local-tests.ts" + "index.d.ts", + "feathersjs__authentication-local-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__authentication-oauth1/tsconfig.json b/types/feathersjs__authentication-oauth1/tsconfig.json index 0a57818109..1e7967d274 100644 --- a/types/feathersjs__authentication-oauth1/tsconfig.json +++ b/types/feathersjs__authentication-oauth1/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/authentication-oauth1": ["feathersjs__authentication-oauth1"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/authentication-oauth1": [ + "feathersjs__authentication-oauth1" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__authentication-oauth1-tests.ts" + "index.d.ts", + "feathersjs__authentication-oauth1-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__authentication-oauth2/tsconfig.json b/types/feathersjs__authentication-oauth2/tsconfig.json index 6c347cef78..6fdc874a04 100644 --- a/types/feathersjs__authentication-oauth2/tsconfig.json +++ b/types/feathersjs__authentication-oauth2/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/authentication-oauth2": ["feathersjs__authentication-oauth2"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/authentication-oauth2": [ + "feathersjs__authentication-oauth2" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__authentication-oauth2-tests.ts" + "index.d.ts", + "feathersjs__authentication-oauth2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__authentication/tsconfig.json b/types/feathersjs__authentication/tsconfig.json index 8cb6f348ed..6a7bb9fd07 100644 --- a/types/feathersjs__authentication/tsconfig.json +++ b/types/feathersjs__authentication/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/authentication": ["feathersjs__authentication"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/authentication": [ + "feathersjs__authentication" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__authentication-tests.ts" + "index.d.ts", + "feathersjs__authentication-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__configuration/tsconfig.json b/types/feathersjs__configuration/tsconfig.json index 4ff80d4bea..9d6cd3ea8f 100644 --- a/types/feathersjs__configuration/tsconfig.json +++ b/types/feathersjs__configuration/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/configuration": ["feathersjs__configuration"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/configuration": [ + "feathersjs__configuration" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__configuration-tests.ts" + "index.d.ts", + "feathersjs__configuration-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__errors/tsconfig.json b/types/feathersjs__errors/tsconfig.json index f07ee484aa..112341f970 100644 --- a/types/feathersjs__errors/tsconfig.json +++ b/types/feathersjs__errors/tsconfig.json @@ -15,13 +15,23 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/errors": ["feathersjs__errors"], - "@feathersjs/errors/handler": ["feathersjs__errors/handler"], - "@feathersjs/errors/not-found": ["feathersjs__errors/not-found"] + "@feathersjs/errors": [ + "feathersjs__errors" + ], + "@feathersjs/errors/handler": [ + "feathersjs__errors/handler" + ], + "@feathersjs/errors/not-found": [ + "feathersjs__errors/not-found" + ] } }, "files": [ - "index.d.ts", "feathersjs__errors-tests.ts", "handler.d.ts", "not-found.d.ts" + "index.d.ts", + "feathersjs__errors-tests.ts", + "handler.d.ts", + "not-found.d.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__express/feathersjs__express-tests.ts b/types/feathersjs__express/feathersjs__express-tests.ts index d7f981eaa0..687191d0c6 100644 --- a/types/feathersjs__express/feathersjs__express-tests.ts +++ b/types/feathersjs__express/feathersjs__express-tests.ts @@ -1,5 +1,8 @@ import feathers, { Application } from '@feathersjs/feathers'; -import feathersExpress from '@feathersjs/express'; -import { Application as ExpressApplication } from 'express'; +import feathersExpress, { original, rest, notFound, errorHandler } from '@feathersjs/express'; -const app: ExpressApplication & Application<{}> = feathersExpress(feathers()); +const app = feathersExpress(feathers()); + +app.configure(rest()); +app.use(notFound()); +app.use(errorHandler()); diff --git a/types/feathersjs__express/index.d.ts b/types/feathersjs__express/index.d.ts index 2bce8b54dd..eb49f00a78 100644 --- a/types/feathersjs__express/index.d.ts +++ b/types/feathersjs__express/index.d.ts @@ -5,6 +5,44 @@ // TypeScript Version: 2.2 import { Application as FeathersApplication } from '@feathersjs/feathers'; -import { Application as ExpressApplication } from 'express'; +import * as express from 'express'; -export default function feathersExpress(app: FeathersApplication): ExpressApplication & FeathersApplication; +export default function feathersExpress(app: FeathersApplication): Application; +export type Application = express.Application & FeathersApplication; + +export function errorHandler(options?: any): express.ErrorRequestHandler; +export function notFound(): express.RequestHandler; +export const rest: { + (): () => void; + formatter: express.RequestHandler; +}; + +/* + * Re-export of the express package. + **/ + +export { + CookieOptions, + Errback, + ErrorRequestHandler, + Express, + Handler, + IRoute, + IRouter, + IRouterHandler, + IRouterMatcher, + json, + MediaType, + NextFunction, + Request, + RequestHandler, + RequestParamHandler, + Response, + Router, + RouterOptions, + Send, + static, + urlencoded +} from 'express'; + +export const original: typeof express; diff --git a/types/feathersjs__express/tsconfig.json b/types/feathersjs__express/tsconfig.json index 8489861fc9..11bee295a0 100644 --- a/types/feathersjs__express/tsconfig.json +++ b/types/feathersjs__express/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/express": ["feathersjs__express"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/express": [ + "feathersjs__express" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__express-tests.ts" + "index.d.ts", + "feathersjs__express-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__feathers/tsconfig.json b/types/feathersjs__feathers/tsconfig.json index b4eeb705cc..883aecabb3 100644 --- a/types/feathersjs__feathers/tsconfig.json +++ b/types/feathersjs__feathers/tsconfig.json @@ -15,11 +15,15 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__feathers-tests.ts" + "index.d.ts", + "feathersjs__feathers-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__primus-client/tsconfig.json b/types/feathersjs__primus-client/tsconfig.json index 2c798b2f88..504dce34d1 100644 --- a/types/feathersjs__primus-client/tsconfig.json +++ b/types/feathersjs__primus-client/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/primus-client": ["feathersjs__primus-client"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/primus-client": [ + "feathersjs__primus-client" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__primus-client-tests.ts" + "index.d.ts", + "feathersjs__primus-client-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__primus/index.d.ts b/types/feathersjs__primus/index.d.ts index 9218a6a40e..5d93843822 100644 --- a/types/feathersjs__primus/index.d.ts +++ b/types/feathersjs__primus/index.d.ts @@ -2,6 +2,9 @@ // Project: http://feathersjs.com/ // Definitions by: Jan Lohage // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.3 + +/// // primus removed its typings from the repo https://github.com/primus/primus/pull/623, as of 01/2018 there are none on DT export default function feathersPrimus(options: any, callback?: (primus: any) => void): () => void; diff --git a/types/feathersjs__primus/tsconfig.json b/types/feathersjs__primus/tsconfig.json index ca7b8a3077..b7815424ec 100644 --- a/types/feathersjs__primus/tsconfig.json +++ b/types/feathersjs__primus/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/primus": ["feathersjs__primus"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/primus": [ + "feathersjs__primus" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__primus-tests.ts" + "index.d.ts", + "feathersjs__primus-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__rest-client/tsconfig.json b/types/feathersjs__rest-client/tsconfig.json index f63a18a220..7a4207ff11 100644 --- a/types/feathersjs__rest-client/tsconfig.json +++ b/types/feathersjs__rest-client/tsconfig.json @@ -15,11 +15,15 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/rest-client": ["feathersjs__rest-client"] + "@feathersjs/rest-client": [ + "feathersjs__rest-client" + ] } }, "files": [ - "index.d.ts", "feathersjs__rest-client-tests.ts" + "index.d.ts", + "feathersjs__rest-client-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__socket-commons/feathers.d.ts b/types/feathersjs__socket-commons/feathers.d.ts deleted file mode 100644 index 08438e4899..0000000000 --- a/types/feathersjs__socket-commons/feathers.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -declare module '@feathersjs/feathers' { - import { Channel } from '@feathersjs/socket-commons'; - import { HookContext } from '@feathersjs/feathers'; - - export interface ServiceAddons { - publish(callback: (data: T, hook: HookContext) => Channel): this - - publish(event: string, callback: (data: T, hook: HookContext) => Channel): this - } - - export interface Application { - channel(...names: string[]): Channel; - - publish(callback: (data: T, hook: HookContext) => Channel | Channel[]): Application; - - publish(event: string, callback: (data: T, hook: HookContext) => Channel | Channel[]): Application; - } -} diff --git a/types/feathersjs__socket-commons/feathersjs__socket-commons-tests.ts b/types/feathersjs__socket-commons/feathersjs__socket-commons-tests.ts index 2b7e49481e..e52fa00d78 100644 --- a/types/feathersjs__socket-commons/feathersjs__socket-commons-tests.ts +++ b/types/feathersjs__socket-commons/feathersjs__socket-commons-tests.ts @@ -1 +1,9 @@ -const dummy: any = null; +import feathers from '@feathersjs/feathers'; + +const app = feathers(); + +app.channel('abc').send({}); + +// check if the non-augmented @feathersjs/feathers typings still work +app.on('asd', () => {}); +app.service('asd').get(0).then(() => {}); diff --git a/types/feathersjs__socket-commons/index.d.ts b/types/feathersjs__socket-commons/index.d.ts index 38d46a0ec5..fca658bf76 100644 --- a/types/feathersjs__socket-commons/index.d.ts +++ b/types/feathersjs__socket-commons/index.d.ts @@ -2,6 +2,34 @@ // Project: http://feathersjs.com/ // Definitions by: Jan Lohage // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.3 -import './socket-commons'; -import './feathers'; +import { HookContext } from '@feathersjs/feathers'; + +export type Connection = any; // todo: spec connection + +export interface Channel { + join(...connections: Connection[]): this; + + leave(...connections: Connection[]): this; + + filter(callback: (connection: Connection) => boolean): Channel; + + send(data: any): this; +} + +declare module '@feathersjs/feathers' { + interface ServiceAddons { + publish(callback: (data: T, hook: HookContext) => Channel): this; + + publish(event: string, callback: (data: T, hook: HookContext) => Channel): this; + } + + interface Application { + channel(...names: string[]): Channel; + + publish(callback: (data: T, hook: HookContext) => Channel | Channel[]): Application; + + publish(event: string, callback: (data: T, hook: HookContext) => Channel | Channel[]): Application; + } +} diff --git a/types/feathersjs__socket-commons/socket-commons.d.ts b/types/feathersjs__socket-commons/socket-commons.d.ts deleted file mode 100644 index 2f32f24bd4..0000000000 --- a/types/feathersjs__socket-commons/socket-commons.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare module '@feathersjs/socket-commons' { - export type Connection = any; // todo: spec connection - - export interface Channel { - join(...connections: Connection[]): this; - - leave(...connections: Connection[]): this; - - filter(callback: (connection: Connection) => boolean): Channel; - - send(data: any): this; - } -} diff --git a/types/feathersjs__socket-commons/tsconfig.json b/types/feathersjs__socket-commons/tsconfig.json index 6532818264..8e63744a7f 100644 --- a/types/feathersjs__socket-commons/tsconfig.json +++ b/types/feathersjs__socket-commons/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/socket-commons": ["feathersjs__socket-commons"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/socket-commons": [ + "feathersjs__socket-commons" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__socket-commons-tests.ts" + "index.d.ts", + "feathersjs__socket-commons-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__socketio-client/tsconfig.json b/types/feathersjs__socketio-client/tsconfig.json index ffea4d4f91..c526cdcb5c 100644 --- a/types/feathersjs__socketio-client/tsconfig.json +++ b/types/feathersjs__socketio-client/tsconfig.json @@ -15,13 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/socketio-client": ["feathersjs__socketio-client"], - "@feathersjs/feathers": ["feathersjs__feathers"] - + "@feathersjs/socketio-client": [ + "feathersjs__socketio-client" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__socketio-client-tests.ts" + "index.d.ts", + "feathersjs__socketio-client-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feathersjs__socketio/index.d.ts b/types/feathersjs__socketio/index.d.ts index 3994f73537..34b78eb749 100644 --- a/types/feathersjs__socketio/index.d.ts +++ b/types/feathersjs__socketio/index.d.ts @@ -2,8 +2,10 @@ // Project: http://feathersjs.com/ // Definitions by: Jan Lohage // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript +// TypeScript Version: 2.3 /// +/// export default function feathersSocketIO(callback: (io: SocketIO.Server) => void): () => void; export default function feathersSocketIO(options: number | SocketIO.ServerOptions, callback?: (io: SocketIO.Server) => void): () => void; diff --git a/types/feathersjs__socketio/tsconfig.json b/types/feathersjs__socketio/tsconfig.json index 2b3cc51adc..69a3f5c66f 100644 --- a/types/feathersjs__socketio/tsconfig.json +++ b/types/feathersjs__socketio/tsconfig.json @@ -15,12 +15,18 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { - "@feathersjs/socketio": ["feathersjs__socketio"], - "@feathersjs/feathers": ["feathersjs__feathers"] + "@feathersjs/socketio": [ + "feathersjs__socketio" + ], + "@feathersjs/feathers": [ + "feathersjs__feathers" + ] } }, "files": [ - "index.d.ts", "feathersjs__socketio-tests.ts" + "index.d.ts", + "feathersjs__socketio-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/feedme/tsconfig.json b/types/feedme/tsconfig.json index aa5f186309..cdd8460fac 100644 --- a/types/feedme/tsconfig.json +++ b/types/feedme/tsconfig.json @@ -14,7 +14,8 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "strictFunctionTypes" : false + "esModuleInterop": true, + "strictFunctionTypes": false }, "files": [ "index.d.ts", diff --git a/types/feedparser/feedparser-tests.ts b/types/feedparser/feedparser-tests.ts index 25d652de8c..1b35498a5e 100644 --- a/types/feedparser/feedparser-tests.ts +++ b/types/feedparser/feedparser-tests.ts @@ -1,5 +1,5 @@ import request = require('request'); -import * as FeedParser from "feedparser"; +import FeedParser = require("feedparser"); const req = request('https://news.google.com/news?cf=all&hl=en&pz=1&ned=us&output=rss'); const feedparser = new FeedParser({}); diff --git a/types/feedparser/tsconfig.json b/types/feedparser/tsconfig.json index 683adf9415..d60dcdde12 100644 --- a/types/feedparser/tsconfig.json +++ b/types/feedparser/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "feedparser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fetch-jsonp/tsconfig.json b/types/fetch-jsonp/tsconfig.json index 885a787152..2a4c7fd15f 100644 --- a/types/fetch-jsonp/tsconfig.json +++ b/types/fetch-jsonp/tsconfig.json @@ -17,6 +17,7 @@ "noImplicitAny": true, "noImplicitThis": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/fetch-mock/tsconfig.json b/types/fetch-mock/tsconfig.json index 0c410ec0ae..b43553f18a 100644 --- a/types/fetch-mock/tsconfig.json +++ b/types/fetch-mock/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fetch.io/tsconfig.json b/types/fetch.io/tsconfig.json index b47cf8f3bf..caccfa9ed6 100644 --- a/types/fetch.io/tsconfig.json +++ b/types/fetch.io/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ffi/tsconfig.json b/types/ffi/tsconfig.json index db74f21b0e..2802ced44b 100644 --- a/types/ffi/tsconfig.json +++ b/types/ffi/tsconfig.json @@ -14,11 +14,12 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "node-ffi-buffer.d.ts", "ffi-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/ffmpeg-static/tsconfig.json b/types/ffmpeg-static/tsconfig.json index 8a1635e82c..1dcc13635e 100644 --- a/types/ffmpeg-static/tsconfig.json +++ b/types/ffmpeg-static/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ffprobe-static/tsconfig.json b/types/ffprobe-static/tsconfig.json index fab3495614..fe2dcc110e 100644 --- a/types/ffprobe-static/tsconfig.json +++ b/types/ffprobe-static/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fhir/tsconfig.json b/types/fhir/tsconfig.json index 8b4970200f..f8f2b46903 100644 --- a/types/fhir/tsconfig.json +++ b/types/fhir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fibers/tsconfig.json b/types/fibers/tsconfig.json index 99e4865e3c..9e73063f35 100644 --- a/types/fibers/tsconfig.json +++ b/types/fibers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/field/tsconfig.json b/types/field/tsconfig.json index 219fa4963d..f4ee4fe059 100644 --- a/types/field/tsconfig.json +++ b/types/field/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/figures/tsconfig.json b/types/figures/tsconfig.json index 720529ea45..34cd5b28e7 100644 --- a/types/figures/tsconfig.json +++ b/types/figures/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/file-exists/tsconfig.json b/types/file-exists/tsconfig.json index ffdee8351c..a1029d7f76 100644 --- a/types/file-exists/tsconfig.json +++ b/types/file-exists/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/file-saver/tsconfig.json b/types/file-saver/tsconfig.json index 803ff5f510..dcffa809ea 100644 --- a/types/file-saver/tsconfig.json +++ b/types/file-saver/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "file-saver-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/file-type/tsconfig.json b/types/file-type/tsconfig.json index 499b81459c..ab07d788b2 100644 --- a/types/file-type/tsconfig.json +++ b/types/file-type/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/file-url/tsconfig.json b/types/file-url/tsconfig.json index 4a6e413ce0..d42d45f1a9 100644 --- a/types/file-url/tsconfig.json +++ b/types/file-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/filenamify/tsconfig.json b/types/filenamify/tsconfig.json index 0d41b23a0d..1cd1fae6ab 100644 --- a/types/filenamify/tsconfig.json +++ b/types/filenamify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/filesize/tsconfig.json b/types/filesize/tsconfig.json index 350e88d4ad..885c875de6 100644 --- a/types/filesize/tsconfig.json +++ b/types/filesize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/filesystem/tsconfig.json b/types/filesystem/tsconfig.json index 6512ab1028..f9366bd879 100644 --- a/types/filesystem/tsconfig.json +++ b/types/filesystem/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/filewriter/tsconfig.json b/types/filewriter/tsconfig.json index 7cba1a1289..c1ce1dcc0a 100644 --- a/types/filewriter/tsconfig.json +++ b/types/filewriter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fill-pdf/tsconfig.json b/types/fill-pdf/tsconfig.json index 4cbe1dad24..7caa55c8f6 100644 --- a/types/fill-pdf/tsconfig.json +++ b/types/fill-pdf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/finalhandler/finalhandler-tests.ts b/types/finalhandler/finalhandler-tests.ts index 81b9565404..3b40b217d0 100644 --- a/types/finalhandler/finalhandler-tests.ts +++ b/types/finalhandler/finalhandler-tests.ts @@ -1,6 +1,5 @@ - import { ServerRequest, ServerResponse } from "http"; -import * as finalHandler from "finalhandler"; +import finalHandler = require("finalhandler"); let req: ServerRequest; let res: ServerResponse; diff --git a/types/finalhandler/tsconfig.json b/types/finalhandler/tsconfig.json index dd03198a83..dece053e4f 100644 --- a/types/finalhandler/tsconfig.json +++ b/types/finalhandler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/finch/tsconfig.json b/types/finch/tsconfig.json index dfb658a6b2..1f581e19fa 100644 --- a/types/finch/tsconfig.json +++ b/types/finch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/find-root/tsconfig.json b/types/find-root/tsconfig.json index 72d7b324a3..d4589574b0 100644 --- a/types/find-root/tsconfig.json +++ b/types/find-root/tsconfig.json @@ -1,23 +1,24 @@ { "compilerOptions": { - "module": "commonjs", - "lib": [ + "module": "commonjs", + "lib": [ "es6" ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ "../" ], - "types": [], - "noEmit": true, + "types": [], + "noEmit": true, "forceConsistentCasingInFileNames": true, - "strictFunctionTypes": true + "esModuleInterop": true, + "strictFunctionTypes": true }, - "files": [ + "files": [ "index.d.ts", "find-root-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/find-up/tsconfig.json b/types/find-up/tsconfig.json index ea6bf9d1ad..4940987639 100644 --- a/types/find-up/tsconfig.json +++ b/types/find-up/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/find/tsconfig.json b/types/find/tsconfig.json index e231e78ff5..219a8c1831 100644 --- a/types/find/tsconfig.json +++ b/types/find/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "find-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/findup-sync/tsconfig.json b/types/findup-sync/tsconfig.json index fd44ee7c99..9afac34cac 100644 --- a/types/findup-sync/tsconfig.json +++ b/types/findup-sync/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fingerprintjs/tsconfig.json b/types/fingerprintjs/tsconfig.json index 35166934d4..1443b165be 100644 --- a/types/fingerprintjs/tsconfig.json +++ b/types/fingerprintjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fingerprintjs2/tsconfig.json b/types/fingerprintjs2/tsconfig.json index b274c3c488..1137ce7a3b 100644 --- a/types/fingerprintjs2/tsconfig.json +++ b/types/fingerprintjs2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firebase-client/tsconfig.json b/types/firebase-client/tsconfig.json index 4510d3f56d..674b6d8e11 100644 --- a/types/firebase-client/tsconfig.json +++ b/types/firebase-client/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firebase-token-generator/tsconfig.json b/types/firebase-token-generator/tsconfig.json index e6620557a2..8b11cf18fb 100644 --- a/types/firebase-token-generator/tsconfig.json +++ b/types/firebase-token-generator/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firebird/tsconfig.json b/types/firebird/tsconfig.json index e5e2d1b6ac..b21033b4ae 100644 --- a/types/firebird/tsconfig.json +++ b/types/firebird/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firefox-webext-browser/tsconfig.json b/types/firefox-webext-browser/tsconfig.json index 202f6824d1..b3c2877928 100644 --- a/types/firefox-webext-browser/tsconfig.json +++ b/types/firefox-webext-browser/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "firefox-webext-browser-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/firefox/tsconfig.json b/types/firefox/tsconfig.json index 44ef93219e..53908aec19 100644 --- a/types/firefox/tsconfig.json +++ b/types/firefox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/firmata/firmata-tests.ts b/types/firmata/firmata-tests.ts index d50160e2dd..9a3137ea39 100644 --- a/types/firmata/firmata-tests.ts +++ b/types/firmata/firmata-tests.ts @@ -1,4 +1,4 @@ -import * as Board from 'firmata'; +import Board = require('firmata'); function test_basic_board() { const board = new Board(''); diff --git a/types/firmata/index.d.ts b/types/firmata/index.d.ts index 6f72107a07..21dfa03820 100644 --- a/types/firmata/index.d.ts +++ b/types/firmata/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for firmata.js 0.15 +// Type definitions for firmata.js 0.19 // Project: https://github.com/firmata/firmata.js // Definitions by: Troy W. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -16,7 +16,7 @@ export = Board; * guarantee that it cannot be improved. */ declare class Board extends NodeJS.EventEmitter { - constructor(serialPort: string, optionsOrCallback?: Board.Options|((error: any) => void), callback?: (error: any) => void) + constructor(serialPort: any, optionsOrCallback?: Board.Options|((error: any) => void), callback?: (error: any) => void) MODES: Board.PinModes; STEPPER: Board.StepperConstants; I2C_MODES: Board.I2cModes; @@ -153,9 +153,12 @@ declare class Board extends NodeJS.EventEmitter { declare namespace Board { // https://github.com/firmata/firmata.js/blob/master/lib/firmata.js#L429-L451 interface Options { + skipCapabilities?: boolean; reportVersionTimeout?: number; samplingInterval?: number; serialport?: SerialPort.Options; + pins?: Pins[]; + analogPins?: number[]; } interface PinModes { diff --git a/types/firmata/tsconfig.json b/types/firmata/tsconfig.json index d843e1300d..8a684319aa 100644 --- a/types/firmata/tsconfig.json +++ b/types/firmata/tsconfig.json @@ -13,11 +13,14 @@ "../" ], "paths": { - "serialport": ["serialport/v4"] + "serialport": [ + "serialport/v4" + ] }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/first-mate/tsconfig.json b/types/first-mate/tsconfig.json index 3c11f8dbb2..7df84484f9 100644 --- a/types/first-mate/tsconfig.json +++ b/types/first-mate/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "first-mate-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fixed-data-table-2/tsconfig.json b/types/fixed-data-table-2/tsconfig.json index c548d5c369..5cd1ad16ef 100644 --- a/types/fixed-data-table-2/tsconfig.json +++ b/types/fixed-data-table-2/tsconfig.json @@ -5,8 +5,11 @@ ], "compilerOptions": { "module": "commonjs", - "lib": ["es6", "dom"], - "jsx":"preserve", + "lib": [ + "es6", + "dom" + ], + "jsx": "preserve", "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, @@ -17,6 +20,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } -} +} \ No newline at end of file diff --git a/types/fixed-data-table/tsconfig.json b/types/fixed-data-table/tsconfig.json index 02ba840d0b..73c385c8b6 100644 --- a/types/fixed-data-table/tsconfig.json +++ b/types/fixed-data-table/tsconfig.json @@ -20,6 +20,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/flake-idgen/tsconfig.json b/types/flake-idgen/tsconfig.json index 0275fb0c23..5f6690f284 100644 --- a/types/flake-idgen/tsconfig.json +++ b/types/flake-idgen/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flat/tsconfig.json b/types/flat/tsconfig.json index 7cc1467b3f..5641722c8a 100644 --- a/types/flat/tsconfig.json +++ b/types/flat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flatbuffers/tsconfig.json b/types/flatbuffers/tsconfig.json index fe3421fa5b..9ec0f4dba5 100644 --- a/types/flatbuffers/tsconfig.json +++ b/types/flatbuffers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flexslider/tsconfig.json b/types/flexslider/tsconfig.json index 4ced617dd6..0339ecf2bf 100644 --- a/types/flexslider/tsconfig.json +++ b/types/flexslider/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flickity/tsconfig.json b/types/flickity/tsconfig.json index e6d8dcef00..387c655e41 100644 --- a/types/flickity/tsconfig.json +++ b/types/flickity/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flight/tsconfig.json b/types/flight/tsconfig.json index 18060e6903..36bfff03c9 100644 --- a/types/flight/tsconfig.json +++ b/types/flight/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flightplan/tsconfig.json b/types/flightplan/tsconfig.json index be4eb41ec5..24de7ee0b1 100644 --- a/types/flightplan/tsconfig.json +++ b/types/flightplan/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flipsnap/tsconfig.json b/types/flipsnap/tsconfig.json index 435b186eb4..8712fa1972 100644 --- a/types/flipsnap/tsconfig.json +++ b/types/flipsnap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flot/tsconfig.json b/types/flot/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/flot/tsconfig.json +++ b/types/flot/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/flowjs/tsconfig.json b/types/flowjs/tsconfig.json index e797332c13..6cb7be27d6 100644 --- a/types/flowjs/tsconfig.json +++ b/types/flowjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fluent-ffmpeg/tsconfig.json b/types/fluent-ffmpeg/tsconfig.json index 657e97adf6..91b742fb17 100644 --- a/types/fluent-ffmpeg/tsconfig.json +++ b/types/fluent-ffmpeg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/flux/index.d.ts b/types/flux/index.d.ts index 9a95368afb..ae63f1349b 100644 --- a/types/flux/index.d.ts +++ b/types/flux/index.d.ts @@ -5,7 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as Dispatcher from "./lib/Dispatcher"; +import Dispatcher = require("./lib/Dispatcher"); export { Dispatcher diff --git a/types/flux/lib/FluxReduceStore.d.ts b/types/flux/lib/FluxReduceStore.d.ts index 71a7968812..cda93a54e9 100644 --- a/types/flux/lib/FluxReduceStore.d.ts +++ b/types/flux/lib/FluxReduceStore.d.ts @@ -1,4 +1,4 @@ -import * as Store from "./FluxStore"; +import Store = require("./FluxStore"); declare namespace FluxReduceStore { } diff --git a/types/flux/tsconfig.json b/types/flux/tsconfig.json index dd78eff24c..60191d3789 100644 --- a/types/flux/tsconfig.json +++ b/types/flux/tsconfig.json @@ -16,6 +16,7 @@ "strictNullChecks": false, "strictFunctionTypes": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/flux/utils.d.ts b/types/flux/utils.d.ts index 4eb3d96e99..d9ced309db 100644 --- a/types/flux/utils.d.ts +++ b/types/flux/utils.d.ts @@ -1,7 +1,7 @@ -import * as Container from "./lib/FluxContainer"; -import * as Mixin from "./lib/FluxMixinLegacy"; -import * as ReduceStore from "./lib/FluxReduceStore"; -import * as Store from "./lib/FluxStore"; +import Container = require("./lib/FluxContainer"); +import Mixin = require("./lib/FluxMixinLegacy"); +import ReduceStore = require("./lib/FluxReduceStore"); +import Store = require("./lib/FluxStore"); export { Container, diff --git a/types/fluxxor/tsconfig.json b/types/fluxxor/tsconfig.json index 7bc0068190..bd6b27cda1 100644 --- a/types/fluxxor/tsconfig.json +++ b/types/fluxxor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fm-websync/tsconfig.json b/types/fm-websync/tsconfig.json index c0b2f14445..746eea4553 100644 --- a/types/fm-websync/tsconfig.json +++ b/types/fm-websync/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fontfaceobserver/tsconfig.json b/types/fontfaceobserver/tsconfig.json index 3695935f67..68e75c4b62 100644 --- a/types/fontfaceobserver/tsconfig.json +++ b/types/fontfaceobserver/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fontoxml/tsconfig.json b/types/fontoxml/tsconfig.json index 6d62b697a0..f90f6bb073 100644 --- a/types/fontoxml/tsconfig.json +++ b/types/fontoxml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/forever-monitor/tsconfig.json b/types/forever-monitor/tsconfig.json index 30bf59fa63..52bc473a2b 100644 --- a/types/forever-monitor/tsconfig.json +++ b/types/forever-monitor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/forge-di/tsconfig.json b/types/forge-di/tsconfig.json index 14aa632323..1936a2e5a4 100644 --- a/types/forge-di/tsconfig.json +++ b/types/forge-di/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/form-data/tsconfig.json b/types/form-data/tsconfig.json index d1cdfefaf0..2d98b9d238 100644 --- a/types/form-data/tsconfig.json +++ b/types/form-data/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/form-serializer/tsconfig.json b/types/form-serializer/tsconfig.json index 0e7f5bba79..2a1a008cbf 100644 --- a/types/form-serializer/tsconfig.json +++ b/types/form-serializer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/form-urlencoded/tsconfig.json b/types/form-urlencoded/tsconfig.json index 4eefbe0a12..5dd924ceb9 100644 --- a/types/form-urlencoded/tsconfig.json +++ b/types/form-urlencoded/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "form-urlencoded-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/format-duration/tsconfig.json b/types/format-duration/tsconfig.json index f17a4f7c6c..453b0def6d 100644 --- a/types/format-duration/tsconfig.json +++ b/types/format-duration/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "format-duration-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/format-io/tsconfig.json b/types/format-io/tsconfig.json index 29333d35cf..af99cdb3b1 100644 --- a/types/format-io/tsconfig.json +++ b/types/format-io/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "format-io-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/format-unicorn/tsconfig.json b/types/format-unicorn/tsconfig.json index 84864d0f7e..a14223efb4 100644 --- a/types/format-unicorn/tsconfig.json +++ b/types/format-unicorn/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/formidable/tsconfig.json b/types/formidable/tsconfig.json index e5b9877247..cca3f74f31 100644 --- a/types/formidable/tsconfig.json +++ b/types/formidable/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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..aad7419eea --- /dev/null +++ b/types/forms/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "forms-tests.ts" + ] +} \ No newline at end of file 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" } diff --git a/types/forwarded/tsconfig.json b/types/forwarded/tsconfig.json index 58cbcdee21..5fd0798e3f 100644 --- a/types/forwarded/tsconfig.json +++ b/types/forwarded/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fossil-delta/tsconfig.json b/types/fossil-delta/tsconfig.json index 29b7c7e933..01a233092c 100644 --- a/types/fossil-delta/tsconfig.json +++ b/types/fossil-delta/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/foundation/tsconfig.json b/types/foundation/tsconfig.json index 5ddb587b52..a8fd93f7b1 100644 --- a/types/foundation/tsconfig.json +++ b/types/foundation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fpsmeter/tsconfig.json b/types/fpsmeter/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/fpsmeter/tsconfig.json +++ b/types/fpsmeter/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/framebus/tsconfig.json b/types/framebus/tsconfig.json index eec501f70b..aac56ce964 100644 --- a/types/framebus/tsconfig.json +++ b/types/framebus/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/freedom/tsconfig.json b/types/freedom/tsconfig.json index dd0bd2e13c..6377018113 100644 --- a/types/freedom/tsconfig.json +++ b/types/freedom/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/freeport/tsconfig.json b/types/freeport/tsconfig.json index f6b6ef7b66..ccd3f7b895 100644 --- a/types/freeport/tsconfig.json +++ b/types/freeport/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fresh/tsconfig.json b/types/fresh/tsconfig.json index 298a5c3fae..75aa6f7dbb 100644 --- a/types/fresh/tsconfig.json +++ b/types/fresh/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/friendly-errors-webpack-plugin/friendly-errors-webpack-plugin-tests.ts b/types/friendly-errors-webpack-plugin/friendly-errors-webpack-plugin-tests.ts index 4ce3828f3f..11f9395974 100644 --- a/types/friendly-errors-webpack-plugin/friendly-errors-webpack-plugin-tests.ts +++ b/types/friendly-errors-webpack-plugin/friendly-errors-webpack-plugin-tests.ts @@ -1,5 +1,5 @@ -import * as webpack from 'webpack'; -import * as FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin'; +import webpack = require('webpack'); +import FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin'); const compiler = webpack({ plugins: [ diff --git a/types/friendly-errors-webpack-plugin/tsconfig.json b/types/friendly-errors-webpack-plugin/tsconfig.json index f519c3b954..4dc4ac0262 100644 --- a/types/friendly-errors-webpack-plugin/tsconfig.json +++ b/types/friendly-errors-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/frisby/tsconfig.json b/types/frisby/tsconfig.json index 725ebf48f1..f126fc2232 100644 --- a/types/frisby/tsconfig.json +++ b/types/frisby/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/from/tsconfig.json b/types/from/tsconfig.json index 649c0d1866..7f153fba36 100644 --- a/types/from/tsconfig.json +++ b/types/from/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/from2/tsconfig.json b/types/from2/tsconfig.json index 641eda4cf5..b5ef31433c 100644 --- a/types/from2/tsconfig.json +++ b/types/from2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fromjs/tsconfig.json b/types/fromjs/tsconfig.json index 4c5e05b65a..7166dc031c 100644 --- a/types/fromjs/tsconfig.json +++ b/types/fromjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fromnow/tsconfig.json b/types/fromnow/tsconfig.json index 56e959f305..52471d205f 100644 --- a/types/fromnow/tsconfig.json +++ b/types/fromnow/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-cson/tsconfig.json b/types/fs-cson/tsconfig.json index fcd9242b1d..88fa1daf3c 100644 --- a/types/fs-cson/tsconfig.json +++ b/types/fs-cson/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fs-cson-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fs-ext/tsconfig.json b/types/fs-ext/tsconfig.json index 18df84572d..40fd47fbd8 100644 --- a/types/fs-ext/tsconfig.json +++ b/types/fs-ext/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-extra-promise-es6/tsconfig.json b/types/fs-extra-promise-es6/tsconfig.json index b7e6f664f2..7a94f2f204 100644 --- a/types/fs-extra-promise-es6/tsconfig.json +++ b/types/fs-extra-promise-es6/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-extra-promise/tsconfig.json b/types/fs-extra-promise/tsconfig.json index 4a4fc0f60b..412ab9c171 100644 --- a/types/fs-extra-promise/tsconfig.json +++ b/types/fs-extra-promise/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-extra/tsconfig.json b/types/fs-extra/tsconfig.json index d43823dee8..6441117056 100644 --- a/types/fs-extra/tsconfig.json +++ b/types/fs-extra/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-extra/v4/tsconfig.json b/types/fs-extra/v4/tsconfig.json index 80435f4ede..053ba23f12 100644 --- a/types/fs-extra/v4/tsconfig.json +++ b/types/fs-extra/v4/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-finder/tsconfig.json b/types/fs-finder/tsconfig.json index 300e950feb..8df4e87cd3 100644 --- a/types/fs-finder/tsconfig.json +++ b/types/fs-finder/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-mock/tsconfig.json b/types/fs-mock/tsconfig.json index f468b62a55..8967149914 100644 --- a/types/fs-mock/tsconfig.json +++ b/types/fs-mock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-plus/tsconfig.json b/types/fs-plus/tsconfig.json index 1ab0098d52..ae0059f221 100644 --- a/types/fs-plus/tsconfig.json +++ b/types/fs-plus/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fs-plus-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fs-promise/tsconfig.json b/types/fs-promise/tsconfig.json index 377d4623d9..9a5d721107 100644 --- a/types/fs-promise/tsconfig.json +++ b/types/fs-promise/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-readdir-recursive/tsconfig.json b/types/fs-readdir-recursive/tsconfig.json index d33141f321..142c4bd90f 100644 --- a/types/fs-readdir-recursive/tsconfig.json +++ b/types/fs-readdir-recursive/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fs-readfile-promise/fs-readfile-promise-tests.ts b/types/fs-readfile-promise/fs-readfile-promise-tests.ts index 9bd1ac070c..1871207710 100644 --- a/types/fs-readfile-promise/fs-readfile-promise-tests.ts +++ b/types/fs-readfile-promise/fs-readfile-promise-tests.ts @@ -1,4 +1,4 @@ -import * as readFile from "fs-readfile-promise"; +import readFile = require("fs-readfile-promise"); declare const path: string; declare const encoding: string; diff --git a/types/fs-readfile-promise/tsconfig.json b/types/fs-readfile-promise/tsconfig.json index 3496c329e5..9b890c41f3 100644 --- a/types/fs-readfile-promise/tsconfig.json +++ b/types/fs-readfile-promise/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fscreen/tsconfig.json b/types/fscreen/tsconfig.json index e352d9fd2e..7243196e30 100644 --- a/types/fscreen/tsconfig.json +++ b/types/fscreen/tsconfig.json @@ -16,10 +16,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fscreen-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fsevents/tsconfig.json b/types/fsevents/tsconfig.json index 2937460740..003cbb5bd5 100644 --- a/types/fsevents/tsconfig.json +++ b/types/fsevents/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ftdomdelegate/tsconfig.json b/types/ftdomdelegate/tsconfig.json index 0220e74665..ea2d05abf2 100644 --- a/types/ftdomdelegate/tsconfig.json +++ b/types/ftdomdelegate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ftp/tsconfig.json b/types/ftp/tsconfig.json index 6a0f57a1fc..e8e843855e 100644 --- a/types/ftp/tsconfig.json +++ b/types/ftp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ftpd/tsconfig.json b/types/ftpd/tsconfig.json index 24702aad8b..c1b9a8fa8f 100644 --- a/types/ftpd/tsconfig.json +++ b/types/ftpd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/fullname/tsconfig.json b/types/fullname/tsconfig.json index a086692e32..8fb03b2727 100644 --- a/types/fullname/tsconfig.json +++ b/types/fullname/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fullpage.js/tsconfig.json b/types/fullpage.js/tsconfig.json index d20953732c..615d06bafa 100644 --- a/types/fullpage.js/tsconfig.json +++ b/types/fullpage.js/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fullpage.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fuse/tsconfig.json b/types/fuse/tsconfig.json index 8f6b34f5d3..da4e30c7a2 100644 --- a/types/fuse/tsconfig.json +++ b/types/fuse/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fusioncharts/tsconfig.json b/types/fusioncharts/tsconfig.json index f41f53056a..a48802a4d4 100644 --- a/types/fusioncharts/tsconfig.json +++ b/types/fusioncharts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fuzzaldrin-plus/tsconfig.json b/types/fuzzaldrin-plus/tsconfig.json index 02e987df6d..ce5b104868 100644 --- a/types/fuzzaldrin-plus/tsconfig.json +++ b/types/fuzzaldrin-plus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fuzzaldrin/tsconfig.json b/types/fuzzaldrin/tsconfig.json index 2e1263faf8..b62c85debf 100644 --- a/types/fuzzaldrin/tsconfig.json +++ b/types/fuzzaldrin/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fuzzaldrin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fuzzyset.js/tsconfig.json b/types/fuzzyset.js/tsconfig.json index a1eeb06b97..fc659fa22e 100644 --- a/types/fuzzyset.js/tsconfig.json +++ b/types/fuzzyset.js/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "fuzzyset.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/fuzzyset/tsconfig.json b/types/fuzzyset/tsconfig.json index 4ccf3898d4..f17bb2e723 100644 --- a/types/fuzzyset/tsconfig.json +++ b/types/fuzzyset/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/fxn/tsconfig.json b/types/fxn/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/fxn/tsconfig.json +++ b/types/fxn/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gae.channel.api/tsconfig.json b/types/gae.channel.api/tsconfig.json index 37424f5ae4..12057a214d 100644 --- a/types/gae.channel.api/tsconfig.json +++ b/types/gae.channel.api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gamepad/tsconfig.json b/types/gamepad/tsconfig.json index 4cb63f3d80..6189bd3866 100644 --- a/types/gamepad/tsconfig.json +++ b/types/gamepad/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gamequery/tsconfig.json b/types/gamequery/tsconfig.json index 9acbbdf6ea..bf4707af6f 100644 --- a/types/gamequery/tsconfig.json +++ b/types/gamequery/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gandi-livedns/tsconfig.json b/types/gandi-livedns/tsconfig.json index 709af92138..1b8ab220e1 100644 --- a/types/gandi-livedns/tsconfig.json +++ b/types/gandi-livedns/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gapi.analytics/tsconfig.json b/types/gapi.analytics/tsconfig.json index 7ea23b6882..2f420134d3 100644 --- a/types/gapi.analytics/tsconfig.json +++ b/types/gapi.analytics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gapi.auth2/tsconfig.json b/types/gapi.auth2/tsconfig.json index 8757ec8333..594913d8b0 100644 --- a/types/gapi.auth2/tsconfig.json +++ b/types/gapi.auth2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gapi.calendar/tsconfig.json b/types/gapi.calendar/tsconfig.json index 2d138f7ac9..78c7e4a32e 100644 --- a/types/gapi.calendar/tsconfig.json +++ b/types/gapi.calendar/tsconfig.json @@ -15,6 +15,7 @@ "noImplicitAny": true, "noImplicitThis": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/gapi.client.acceleratedmobilepageurl/tsconfig.json b/types/gapi.client.acceleratedmobilepageurl/tsconfig.json index 60d81925fe..7ca46199d1 100644 --- a/types/gapi.client.acceleratedmobilepageurl/tsconfig.json +++ b/types/gapi.client.acceleratedmobilepageurl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adexchangebuyer/tsconfig.json b/types/gapi.client.adexchangebuyer/tsconfig.json index a6ddc40ec7..ecef1dc650 100644 --- a/types/gapi.client.adexchangebuyer/tsconfig.json +++ b/types/gapi.client.adexchangebuyer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adexchangebuyer2/tsconfig.json b/types/gapi.client.adexchangebuyer2/tsconfig.json index 453ca167ee..6885a64bc3 100644 --- a/types/gapi.client.adexchangebuyer2/tsconfig.json +++ b/types/gapi.client.adexchangebuyer2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adexchangeseller/tsconfig.json b/types/gapi.client.adexchangeseller/tsconfig.json index a38d57f5b8..b5c5e81e25 100644 --- a/types/gapi.client.adexchangeseller/tsconfig.json +++ b/types/gapi.client.adexchangeseller/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adexperiencereport/tsconfig.json b/types/gapi.client.adexperiencereport/tsconfig.json index 968c080cf9..b0049ec537 100644 --- a/types/gapi.client.adexperiencereport/tsconfig.json +++ b/types/gapi.client.adexperiencereport/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.admin/tsconfig.json b/types/gapi.client.admin/tsconfig.json index 840f1feb2d..339a673cf6 100644 --- a/types/gapi.client.admin/tsconfig.json +++ b/types/gapi.client.admin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adsense/tsconfig.json b/types/gapi.client.adsense/tsconfig.json index 49b1e08a5a..ee48e54b1f 100644 --- a/types/gapi.client.adsense/tsconfig.json +++ b/types/gapi.client.adsense/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.adsensehost/tsconfig.json b/types/gapi.client.adsensehost/tsconfig.json index 5cee9dc200..1bc4586345 100644 --- a/types/gapi.client.adsensehost/tsconfig.json +++ b/types/gapi.client.adsensehost/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.analytics/tsconfig.json b/types/gapi.client.analytics/tsconfig.json index 24b9a3e308..bf021b2158 100644 --- a/types/gapi.client.analytics/tsconfig.json +++ b/types/gapi.client.analytics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.analyticsreporting/tsconfig.json b/types/gapi.client.analyticsreporting/tsconfig.json index 2f65484898..4f15864f1a 100644 --- a/types/gapi.client.analyticsreporting/tsconfig.json +++ b/types/gapi.client.analyticsreporting/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.androiddeviceprovisioning/tsconfig.json b/types/gapi.client.androiddeviceprovisioning/tsconfig.json index 953923be00..0bf5432081 100644 --- a/types/gapi.client.androiddeviceprovisioning/tsconfig.json +++ b/types/gapi.client.androiddeviceprovisioning/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.androidenterprise/tsconfig.json b/types/gapi.client.androidenterprise/tsconfig.json index d641db9824..aa914d683d 100644 --- a/types/gapi.client.androidenterprise/tsconfig.json +++ b/types/gapi.client.androidenterprise/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.androidmanagement/tsconfig.json b/types/gapi.client.androidmanagement/tsconfig.json index 3cfbad08e0..800f1fb763 100644 --- a/types/gapi.client.androidmanagement/tsconfig.json +++ b/types/gapi.client.androidmanagement/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.androidpublisher/tsconfig.json b/types/gapi.client.androidpublisher/tsconfig.json index 6f724fe172..141590dbbf 100644 --- a/types/gapi.client.androidpublisher/tsconfig.json +++ b/types/gapi.client.androidpublisher/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.appengine/tsconfig.json b/types/gapi.client.appengine/tsconfig.json index 0af2b9eade..b8ec56c5d7 100644 --- a/types/gapi.client.appengine/tsconfig.json +++ b/types/gapi.client.appengine/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.appsactivity/tsconfig.json b/types/gapi.client.appsactivity/tsconfig.json index 0afc87f3ad..afcfd4b989 100644 --- a/types/gapi.client.appsactivity/tsconfig.json +++ b/types/gapi.client.appsactivity/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.appstate/tsconfig.json b/types/gapi.client.appstate/tsconfig.json index e9b5b7a850..a751adc9f9 100644 --- a/types/gapi.client.appstate/tsconfig.json +++ b/types/gapi.client.appstate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.bigquery/tsconfig.json b/types/gapi.client.bigquery/tsconfig.json index 23f55a96a4..f96f22a938 100644 --- a/types/gapi.client.bigquery/tsconfig.json +++ b/types/gapi.client.bigquery/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.bigquerydatatransfer/tsconfig.json b/types/gapi.client.bigquerydatatransfer/tsconfig.json index 312df37f3f..dc90ae3640 100644 --- a/types/gapi.client.bigquerydatatransfer/tsconfig.json +++ b/types/gapi.client.bigquerydatatransfer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.blogger/tsconfig.json b/types/gapi.client.blogger/tsconfig.json index 1b5be0ad2b..14c778be8f 100644 --- a/types/gapi.client.blogger/tsconfig.json +++ b/types/gapi.client.blogger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.books/tsconfig.json b/types/gapi.client.books/tsconfig.json index d011bdcf5c..d5b6f224fd 100644 --- a/types/gapi.client.books/tsconfig.json +++ b/types/gapi.client.books/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.calendar/tsconfig.json b/types/gapi.client.calendar/tsconfig.json index 5d44c3d92a..4a3cc57200 100644 --- a/types/gapi.client.calendar/tsconfig.json +++ b/types/gapi.client.calendar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.civicinfo/tsconfig.json b/types/gapi.client.civicinfo/tsconfig.json index 6c3ced88c9..c144ad988f 100644 --- a/types/gapi.client.civicinfo/tsconfig.json +++ b/types/gapi.client.civicinfo/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.classroom/tsconfig.json b/types/gapi.client.classroom/tsconfig.json index 4e1a97323a..1c09dcba49 100644 --- a/types/gapi.client.classroom/tsconfig.json +++ b/types/gapi.client.classroom/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudbilling/tsconfig.json b/types/gapi.client.cloudbilling/tsconfig.json index 66cfdbefe4..bf15149044 100644 --- a/types/gapi.client.cloudbilling/tsconfig.json +++ b/types/gapi.client.cloudbilling/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudbuild/tsconfig.json b/types/gapi.client.cloudbuild/tsconfig.json index 22d8d6d390..193b0bb7bc 100644 --- a/types/gapi.client.cloudbuild/tsconfig.json +++ b/types/gapi.client.cloudbuild/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.clouddebugger/tsconfig.json b/types/gapi.client.clouddebugger/tsconfig.json index de9d4c94bc..773cb6f623 100644 --- a/types/gapi.client.clouddebugger/tsconfig.json +++ b/types/gapi.client.clouddebugger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.clouderrorreporting/tsconfig.json b/types/gapi.client.clouderrorreporting/tsconfig.json index cc1296f8ee..5a0a7e1605 100644 --- a/types/gapi.client.clouderrorreporting/tsconfig.json +++ b/types/gapi.client.clouderrorreporting/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudfunctions/tsconfig.json b/types/gapi.client.cloudfunctions/tsconfig.json index 720b272f2e..d0ad0ec792 100644 --- a/types/gapi.client.cloudfunctions/tsconfig.json +++ b/types/gapi.client.cloudfunctions/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudiot/tsconfig.json b/types/gapi.client.cloudiot/tsconfig.json index 03ed93c76d..6619e1273b 100644 --- a/types/gapi.client.cloudiot/tsconfig.json +++ b/types/gapi.client.cloudiot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudkms/tsconfig.json b/types/gapi.client.cloudkms/tsconfig.json index ff982b97d1..30e1a47d30 100644 --- a/types/gapi.client.cloudkms/tsconfig.json +++ b/types/gapi.client.cloudkms/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudmonitoring/tsconfig.json b/types/gapi.client.cloudmonitoring/tsconfig.json index e007418ca9..aa98b060a4 100644 --- a/types/gapi.client.cloudmonitoring/tsconfig.json +++ b/types/gapi.client.cloudmonitoring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudresourcemanager/tsconfig.json b/types/gapi.client.cloudresourcemanager/tsconfig.json index c82cbc16f6..bf64d30483 100644 --- a/types/gapi.client.cloudresourcemanager/tsconfig.json +++ b/types/gapi.client.cloudresourcemanager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudtasks/tsconfig.json b/types/gapi.client.cloudtasks/tsconfig.json index d4240ab7d4..a2d8c58245 100644 --- a/types/gapi.client.cloudtasks/tsconfig.json +++ b/types/gapi.client.cloudtasks/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.cloudtrace/tsconfig.json b/types/gapi.client.cloudtrace/tsconfig.json index 977a1fd91f..deb00da08f 100644 --- a/types/gapi.client.cloudtrace/tsconfig.json +++ b/types/gapi.client.cloudtrace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.clouduseraccounts/tsconfig.json b/types/gapi.client.clouduseraccounts/tsconfig.json index a6e3b9ffec..7ef79a3b37 100644 --- a/types/gapi.client.clouduseraccounts/tsconfig.json +++ b/types/gapi.client.clouduseraccounts/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.compute/tsconfig.json b/types/gapi.client.compute/tsconfig.json index 496204435b..f0d8a0d986 100644 --- a/types/gapi.client.compute/tsconfig.json +++ b/types/gapi.client.compute/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.consumersurveys/tsconfig.json b/types/gapi.client.consumersurveys/tsconfig.json index e8c3646083..cd7fe30013 100644 --- a/types/gapi.client.consumersurveys/tsconfig.json +++ b/types/gapi.client.consumersurveys/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.container/tsconfig.json b/types/gapi.client.container/tsconfig.json index 51ff6c98bb..119d6c3ba5 100644 --- a/types/gapi.client.container/tsconfig.json +++ b/types/gapi.client.container/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.content/tsconfig.json b/types/gapi.client.content/tsconfig.json index 566c98a224..032eaa64a4 100644 --- a/types/gapi.client.content/tsconfig.json +++ b/types/gapi.client.content/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.customsearch/tsconfig.json b/types/gapi.client.customsearch/tsconfig.json index 9b5c4f447d..c59bef0b1a 100644 --- a/types/gapi.client.customsearch/tsconfig.json +++ b/types/gapi.client.customsearch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.dataflow/tsconfig.json b/types/gapi.client.dataflow/tsconfig.json index 08c1fced14..8e23104a37 100644 --- a/types/gapi.client.dataflow/tsconfig.json +++ b/types/gapi.client.dataflow/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.dataproc/tsconfig.json b/types/gapi.client.dataproc/tsconfig.json index 83a765706a..31c48ab1f7 100644 --- a/types/gapi.client.dataproc/tsconfig.json +++ b/types/gapi.client.dataproc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.datastore/tsconfig.json b/types/gapi.client.datastore/tsconfig.json index a84cddd73f..7fce15fad9 100644 --- a/types/gapi.client.datastore/tsconfig.json +++ b/types/gapi.client.datastore/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.deploymentmanager/tsconfig.json b/types/gapi.client.deploymentmanager/tsconfig.json index 76527cf87c..f2b606045e 100644 --- a/types/gapi.client.deploymentmanager/tsconfig.json +++ b/types/gapi.client.deploymentmanager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.dfareporting/tsconfig.json b/types/gapi.client.dfareporting/tsconfig.json index 78bcd11678..f5a5e85bff 100644 --- a/types/gapi.client.dfareporting/tsconfig.json +++ b/types/gapi.client.dfareporting/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.discovery/tsconfig.json b/types/gapi.client.discovery/tsconfig.json index b597d1b278..8bdae68cac 100644 --- a/types/gapi.client.discovery/tsconfig.json +++ b/types/gapi.client.discovery/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.dlp/tsconfig.json b/types/gapi.client.dlp/tsconfig.json index b7ab822674..28654dd0d1 100644 --- a/types/gapi.client.dlp/tsconfig.json +++ b/types/gapi.client.dlp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.dns/tsconfig.json b/types/gapi.client.dns/tsconfig.json index 93f3858c6c..032a207928 100644 --- a/types/gapi.client.dns/tsconfig.json +++ b/types/gapi.client.dns/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.doubleclickbidmanager/tsconfig.json b/types/gapi.client.doubleclickbidmanager/tsconfig.json index 1e00b8c904..081c1f2e74 100644 --- a/types/gapi.client.doubleclickbidmanager/tsconfig.json +++ b/types/gapi.client.doubleclickbidmanager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.doubleclicksearch/tsconfig.json b/types/gapi.client.doubleclicksearch/tsconfig.json index fb0d0a44bd..a76616840d 100644 --- a/types/gapi.client.doubleclicksearch/tsconfig.json +++ b/types/gapi.client.doubleclicksearch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.drive/tsconfig.json b/types/gapi.client.drive/tsconfig.json index 6d5901b410..05060ca3af 100644 --- a/types/gapi.client.drive/tsconfig.json +++ b/types/gapi.client.drive/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.firebasedynamiclinks/tsconfig.json b/types/gapi.client.firebasedynamiclinks/tsconfig.json index e43d9944a4..9ad2b5eac8 100644 --- a/types/gapi.client.firebasedynamiclinks/tsconfig.json +++ b/types/gapi.client.firebasedynamiclinks/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.firebaseremoteconfig/tsconfig.json b/types/gapi.client.firebaseremoteconfig/tsconfig.json index 9366ffa276..40ed96539d 100644 --- a/types/gapi.client.firebaseremoteconfig/tsconfig.json +++ b/types/gapi.client.firebaseremoteconfig/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.firebaserules/tsconfig.json b/types/gapi.client.firebaserules/tsconfig.json index fe476614b8..981e890c45 100644 --- a/types/gapi.client.firebaserules/tsconfig.json +++ b/types/gapi.client.firebaserules/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.firestore/tsconfig.json b/types/gapi.client.firestore/tsconfig.json index c15195612c..4973b52381 100644 --- a/types/gapi.client.firestore/tsconfig.json +++ b/types/gapi.client.firestore/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.fitness/tsconfig.json b/types/gapi.client.fitness/tsconfig.json index d165e53085..38f88be095 100644 --- a/types/gapi.client.fitness/tsconfig.json +++ b/types/gapi.client.fitness/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.fusiontables/tsconfig.json b/types/gapi.client.fusiontables/tsconfig.json index 74936cb7a6..ccc96c9ba0 100644 --- a/types/gapi.client.fusiontables/tsconfig.json +++ b/types/gapi.client.fusiontables/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.games/tsconfig.json b/types/gapi.client.games/tsconfig.json index d2bbd017e2..c166ca72a7 100644 --- a/types/gapi.client.games/tsconfig.json +++ b/types/gapi.client.games/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.gamesconfiguration/tsconfig.json b/types/gapi.client.gamesconfiguration/tsconfig.json index 66a95276f8..815cced1eb 100644 --- a/types/gapi.client.gamesconfiguration/tsconfig.json +++ b/types/gapi.client.gamesconfiguration/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.gamesmanagement/tsconfig.json b/types/gapi.client.gamesmanagement/tsconfig.json index 91d2485de8..0a7c716384 100644 --- a/types/gapi.client.gamesmanagement/tsconfig.json +++ b/types/gapi.client.gamesmanagement/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.genomics/tsconfig.json b/types/gapi.client.genomics/tsconfig.json index f3814992d0..5ce49ae151 100644 --- a/types/gapi.client.genomics/tsconfig.json +++ b/types/gapi.client.genomics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.gmail/tsconfig.json b/types/gapi.client.gmail/tsconfig.json index f0a8989f4f..993382c1a5 100644 --- a/types/gapi.client.gmail/tsconfig.json +++ b/types/gapi.client.gmail/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.groupsmigration/tsconfig.json b/types/gapi.client.groupsmigration/tsconfig.json index e790df35fc..f911d8b0d0 100644 --- a/types/gapi.client.groupsmigration/tsconfig.json +++ b/types/gapi.client.groupsmigration/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.groupssettings/tsconfig.json b/types/gapi.client.groupssettings/tsconfig.json index 855b1f2828..cfc7f790d6 100644 --- a/types/gapi.client.groupssettings/tsconfig.json +++ b/types/gapi.client.groupssettings/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.iam/tsconfig.json b/types/gapi.client.iam/tsconfig.json index 4cfc571a22..16013cf2d4 100644 --- a/types/gapi.client.iam/tsconfig.json +++ b/types/gapi.client.iam/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.identitytoolkit/tsconfig.json b/types/gapi.client.identitytoolkit/tsconfig.json index 558805120e..665942fe98 100644 --- a/types/gapi.client.identitytoolkit/tsconfig.json +++ b/types/gapi.client.identitytoolkit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.kgsearch/tsconfig.json b/types/gapi.client.kgsearch/tsconfig.json index 3dc92ba79b..ea233a6419 100644 --- a/types/gapi.client.kgsearch/tsconfig.json +++ b/types/gapi.client.kgsearch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.language/tsconfig.json b/types/gapi.client.language/tsconfig.json index 12044b7569..2b9df43adb 100644 --- a/types/gapi.client.language/tsconfig.json +++ b/types/gapi.client.language/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.licensing/tsconfig.json b/types/gapi.client.licensing/tsconfig.json index 2cde1d0a5f..2062e11df6 100644 --- a/types/gapi.client.licensing/tsconfig.json +++ b/types/gapi.client.licensing/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.logging/tsconfig.json b/types/gapi.client.logging/tsconfig.json index 315ea3a5e0..30c1d9cd1c 100644 --- a/types/gapi.client.logging/tsconfig.json +++ b/types/gapi.client.logging/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.manufacturers/tsconfig.json b/types/gapi.client.manufacturers/tsconfig.json index 143de33ad9..a0f3dcb6be 100644 --- a/types/gapi.client.manufacturers/tsconfig.json +++ b/types/gapi.client.manufacturers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.mirror/tsconfig.json b/types/gapi.client.mirror/tsconfig.json index 3404622c43..52ff31962a 100644 --- a/types/gapi.client.mirror/tsconfig.json +++ b/types/gapi.client.mirror/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.ml/tsconfig.json b/types/gapi.client.ml/tsconfig.json index e665f45a5b..3f8f98f9d3 100644 --- a/types/gapi.client.ml/tsconfig.json +++ b/types/gapi.client.ml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.monitoring/tsconfig.json b/types/gapi.client.monitoring/tsconfig.json index 4c5c8d9129..0f40410ea1 100644 --- a/types/gapi.client.monitoring/tsconfig.json +++ b/types/gapi.client.monitoring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.oauth2/tsconfig.json b/types/gapi.client.oauth2/tsconfig.json index 593137d956..e0db730e80 100644 --- a/types/gapi.client.oauth2/tsconfig.json +++ b/types/gapi.client.oauth2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.oslogin/tsconfig.json b/types/gapi.client.oslogin/tsconfig.json index bcf0faa3cb..d0512f2a9b 100644 --- a/types/gapi.client.oslogin/tsconfig.json +++ b/types/gapi.client.oslogin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.pagespeedonline/tsconfig.json b/types/gapi.client.pagespeedonline/tsconfig.json index 38b680e5ae..a56ae8eb21 100644 --- a/types/gapi.client.pagespeedonline/tsconfig.json +++ b/types/gapi.client.pagespeedonline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.partners/tsconfig.json b/types/gapi.client.partners/tsconfig.json index cbecfb7e6e..ffcef1527d 100644 --- a/types/gapi.client.partners/tsconfig.json +++ b/types/gapi.client.partners/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.people/tsconfig.json b/types/gapi.client.people/tsconfig.json index 4a64b3a83d..65c26e2e37 100644 --- a/types/gapi.client.people/tsconfig.json +++ b/types/gapi.client.people/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.playcustomapp/tsconfig.json b/types/gapi.client.playcustomapp/tsconfig.json index 432fd7ebe4..933673854d 100644 --- a/types/gapi.client.playcustomapp/tsconfig.json +++ b/types/gapi.client.playcustomapp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.playmoviespartner/tsconfig.json b/types/gapi.client.playmoviespartner/tsconfig.json index 9751ed88eb..3ef754e191 100644 --- a/types/gapi.client.playmoviespartner/tsconfig.json +++ b/types/gapi.client.playmoviespartner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.plus/tsconfig.json b/types/gapi.client.plus/tsconfig.json index 933d6c865a..576c937104 100644 --- a/types/gapi.client.plus/tsconfig.json +++ b/types/gapi.client.plus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.plusdomains/tsconfig.json b/types/gapi.client.plusdomains/tsconfig.json index aad16ba9c1..56557f1fe0 100644 --- a/types/gapi.client.plusdomains/tsconfig.json +++ b/types/gapi.client.plusdomains/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.prediction/tsconfig.json b/types/gapi.client.prediction/tsconfig.json index 15c0255ef0..3077afc226 100644 --- a/types/gapi.client.prediction/tsconfig.json +++ b/types/gapi.client.prediction/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.proximitybeacon/tsconfig.json b/types/gapi.client.proximitybeacon/tsconfig.json index 8f240f1352..0615652a78 100644 --- a/types/gapi.client.proximitybeacon/tsconfig.json +++ b/types/gapi.client.proximitybeacon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.pubsub/tsconfig.json b/types/gapi.client.pubsub/tsconfig.json index c5b386832c..50798418ff 100644 --- a/types/gapi.client.pubsub/tsconfig.json +++ b/types/gapi.client.pubsub/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.qpxexpress/tsconfig.json b/types/gapi.client.qpxexpress/tsconfig.json index 759fd511d6..8d0bc8414b 100644 --- a/types/gapi.client.qpxexpress/tsconfig.json +++ b/types/gapi.client.qpxexpress/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.reseller/tsconfig.json b/types/gapi.client.reseller/tsconfig.json index 62660a16cc..fc68d23c53 100644 --- a/types/gapi.client.reseller/tsconfig.json +++ b/types/gapi.client.reseller/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.resourceviews/tsconfig.json b/types/gapi.client.resourceviews/tsconfig.json index d910ac6b45..1954aa9170 100644 --- a/types/gapi.client.resourceviews/tsconfig.json +++ b/types/gapi.client.resourceviews/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.runtimeconfig/tsconfig.json b/types/gapi.client.runtimeconfig/tsconfig.json index 5e27079b43..f306447ecb 100644 --- a/types/gapi.client.runtimeconfig/tsconfig.json +++ b/types/gapi.client.runtimeconfig/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.safebrowsing/tsconfig.json b/types/gapi.client.safebrowsing/tsconfig.json index 3545ceeab3..d4fef368c8 100644 --- a/types/gapi.client.safebrowsing/tsconfig.json +++ b/types/gapi.client.safebrowsing/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.script/tsconfig.json b/types/gapi.client.script/tsconfig.json index 2ee2653a1f..7d36f916b1 100644 --- a/types/gapi.client.script/tsconfig.json +++ b/types/gapi.client.script/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.searchconsole/tsconfig.json b/types/gapi.client.searchconsole/tsconfig.json index f2e33ebce6..b7e6c12490 100644 --- a/types/gapi.client.searchconsole/tsconfig.json +++ b/types/gapi.client.searchconsole/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.servicecontrol/tsconfig.json b/types/gapi.client.servicecontrol/tsconfig.json index 14d7667280..d49010f92f 100644 --- a/types/gapi.client.servicecontrol/tsconfig.json +++ b/types/gapi.client.servicecontrol/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.servicemanagement/tsconfig.json b/types/gapi.client.servicemanagement/tsconfig.json index c1ec19c789..bf2babb733 100644 --- a/types/gapi.client.servicemanagement/tsconfig.json +++ b/types/gapi.client.servicemanagement/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.serviceuser/tsconfig.json b/types/gapi.client.serviceuser/tsconfig.json index 3213e6fbe7..ca53c7b183 100644 --- a/types/gapi.client.serviceuser/tsconfig.json +++ b/types/gapi.client.serviceuser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.sheets/tsconfig.json b/types/gapi.client.sheets/tsconfig.json index 23b7d8ecf0..1d3e881b9d 100644 --- a/types/gapi.client.sheets/tsconfig.json +++ b/types/gapi.client.sheets/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.siteverification/tsconfig.json b/types/gapi.client.siteverification/tsconfig.json index a32d7d01b6..a8a7d2ca1a 100644 --- a/types/gapi.client.siteverification/tsconfig.json +++ b/types/gapi.client.siteverification/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.slides/tsconfig.json b/types/gapi.client.slides/tsconfig.json index 94b7cd8068..67cef5659a 100644 --- a/types/gapi.client.slides/tsconfig.json +++ b/types/gapi.client.slides/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.sourcerepo/tsconfig.json b/types/gapi.client.sourcerepo/tsconfig.json index 1b6a4b8191..95662d947f 100644 --- a/types/gapi.client.sourcerepo/tsconfig.json +++ b/types/gapi.client.sourcerepo/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.spanner/tsconfig.json b/types/gapi.client.spanner/tsconfig.json index a4fcfe1835..1a1ff65ad6 100644 --- a/types/gapi.client.spanner/tsconfig.json +++ b/types/gapi.client.spanner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.spectrum/tsconfig.json b/types/gapi.client.spectrum/tsconfig.json index 6dcfe9f1ea..d011e50d68 100644 --- a/types/gapi.client.spectrum/tsconfig.json +++ b/types/gapi.client.spectrum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.speech/tsconfig.json b/types/gapi.client.speech/tsconfig.json index 694c7824cb..40c1c0386d 100644 --- a/types/gapi.client.speech/tsconfig.json +++ b/types/gapi.client.speech/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.sqladmin/tsconfig.json b/types/gapi.client.sqladmin/tsconfig.json index a8bd3bb164..3ecdc24928 100644 --- a/types/gapi.client.sqladmin/tsconfig.json +++ b/types/gapi.client.sqladmin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.storage/tsconfig.json b/types/gapi.client.storage/tsconfig.json index 761e1e8caa..c7bea50dd7 100644 --- a/types/gapi.client.storage/tsconfig.json +++ b/types/gapi.client.storage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.storagetransfer/tsconfig.json b/types/gapi.client.storagetransfer/tsconfig.json index 4eb74edeea..a6fcdaa7fe 100644 --- a/types/gapi.client.storagetransfer/tsconfig.json +++ b/types/gapi.client.storagetransfer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.streetviewpublish/tsconfig.json b/types/gapi.client.streetviewpublish/tsconfig.json index 1e2afe51e0..780af27cc9 100644 --- a/types/gapi.client.streetviewpublish/tsconfig.json +++ b/types/gapi.client.streetviewpublish/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.surveys/tsconfig.json b/types/gapi.client.surveys/tsconfig.json index c0230c586d..75ad3c18bd 100644 --- a/types/gapi.client.surveys/tsconfig.json +++ b/types/gapi.client.surveys/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.tagmanager/tsconfig.json b/types/gapi.client.tagmanager/tsconfig.json index 92a3d1732b..9b9e86b11a 100644 --- a/types/gapi.client.tagmanager/tsconfig.json +++ b/types/gapi.client.tagmanager/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.taskqueue/tsconfig.json b/types/gapi.client.taskqueue/tsconfig.json index 95db41d7b6..ee54bf18cb 100644 --- a/types/gapi.client.taskqueue/tsconfig.json +++ b/types/gapi.client.taskqueue/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.tasks/tsconfig.json b/types/gapi.client.tasks/tsconfig.json index a8ac77689b..7d9fb8a32d 100644 --- a/types/gapi.client.tasks/tsconfig.json +++ b/types/gapi.client.tasks/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.testing/tsconfig.json b/types/gapi.client.testing/tsconfig.json index 88e8341cfb..ab82eee9be 100644 --- a/types/gapi.client.testing/tsconfig.json +++ b/types/gapi.client.testing/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.toolresults/tsconfig.json b/types/gapi.client.toolresults/tsconfig.json index 2e0b9eee8b..7eac8dd678 100644 --- a/types/gapi.client.toolresults/tsconfig.json +++ b/types/gapi.client.toolresults/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.translate/tsconfig.json b/types/gapi.client.translate/tsconfig.json index 6f75322a8d..c677c65b30 100644 --- a/types/gapi.client.translate/tsconfig.json +++ b/types/gapi.client.translate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.urlshortener/tsconfig.json b/types/gapi.client.urlshortener/tsconfig.json index d66d384a36..91e231c6ae 100644 --- a/types/gapi.client.urlshortener/tsconfig.json +++ b/types/gapi.client.urlshortener/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.vault/tsconfig.json b/types/gapi.client.vault/tsconfig.json index f6f0c61f24..c57aa9ac5e 100644 --- a/types/gapi.client.vault/tsconfig.json +++ b/types/gapi.client.vault/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.videointelligence/tsconfig.json b/types/gapi.client.videointelligence/tsconfig.json index 5db40cf349..4274056d08 100644 --- a/types/gapi.client.videointelligence/tsconfig.json +++ b/types/gapi.client.videointelligence/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.vision/tsconfig.json b/types/gapi.client.vision/tsconfig.json index 300f812220..3db7a9f0ae 100644 --- a/types/gapi.client.vision/tsconfig.json +++ b/types/gapi.client.vision/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.webfonts/tsconfig.json b/types/gapi.client.webfonts/tsconfig.json index 99419f718b..35eb4f3573 100644 --- a/types/gapi.client.webfonts/tsconfig.json +++ b/types/gapi.client.webfonts/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.webmasters/tsconfig.json b/types/gapi.client.webmasters/tsconfig.json index f542550a2f..ed4d12edf2 100644 --- a/types/gapi.client.webmasters/tsconfig.json +++ b/types/gapi.client.webmasters/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.youtube/tsconfig.json b/types/gapi.client.youtube/tsconfig.json index 727bee6a41..69c7503ec1 100644 --- a/types/gapi.client.youtube/tsconfig.json +++ b/types/gapi.client.youtube/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.youtubeanalytics/tsconfig.json b/types/gapi.client.youtubeanalytics/tsconfig.json index 84b8975062..455e3dc970 100644 --- a/types/gapi.client.youtubeanalytics/tsconfig.json +++ b/types/gapi.client.youtubeanalytics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client.youtubereporting/tsconfig.json b/types/gapi.client.youtubereporting/tsconfig.json index 05e2060796..20524d4d05 100644 --- a/types/gapi.client.youtubereporting/tsconfig.json +++ b/types/gapi.client.youtubereporting/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.client/tsconfig.json b/types/gapi.client/tsconfig.json index 09471da3d2..b0836a651d 100644 --- a/types/gapi.client/tsconfig.json +++ b/types/gapi.client/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ diff --git a/types/gapi.drive/tsconfig.json b/types/gapi.drive/tsconfig.json index 4e5f340f58..6c3650f3d6 100644 --- a/types/gapi.drive/tsconfig.json +++ b/types/gapi.drive/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gapi.pagespeedonline/tsconfig.json b/types/gapi.pagespeedonline/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/gapi.pagespeedonline/tsconfig.json +++ b/types/gapi.pagespeedonline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gapi.people/tsconfig.json b/types/gapi.people/tsconfig.json index 1fbbd65218..371c13635b 100644 --- a/types/gapi.people/tsconfig.json +++ b/types/gapi.people/tsconfig.json @@ -15,6 +15,7 @@ "noImplicitAny": true, "noImplicitThis": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/gapi.plus/tsconfig.json b/types/gapi.plus/tsconfig.json index 1ecc447591..90258a43c7 100644 --- a/types/gapi.plus/tsconfig.json +++ b/types/gapi.plus/tsconfig.json @@ -15,6 +15,7 @@ "noImplicitAny": true, "noImplicitThis": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/gapi.translate/tsconfig.json b/types/gapi.translate/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/gapi.translate/tsconfig.json +++ b/types/gapi.translate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gapi.urlshortener/tsconfig.json b/types/gapi.urlshortener/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/gapi.urlshortener/tsconfig.json +++ b/types/gapi.urlshortener/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gapi.youtube/tsconfig.json b/types/gapi.youtube/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/gapi.youtube/tsconfig.json +++ b/types/gapi.youtube/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gapi.youtubeanalytics/tsconfig.json b/types/gapi.youtubeanalytics/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/gapi.youtubeanalytics/tsconfig.json +++ b/types/gapi.youtubeanalytics/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/gapi/tsconfig.json b/types/gapi/tsconfig.json index 18f0162c51..c0518c28b2 100644 --- a/types/gapi/tsconfig.json +++ b/types/gapi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gaussian/tsconfig.json b/types/gaussian/tsconfig.json index 30e363a435..125874fdd0 100644 --- a/types/gaussian/tsconfig.json +++ b/types/gaussian/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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..d77714c750 --- /dev/null +++ b/types/geetest/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "geetest-tests.ts" + ] +} \ No newline at end of file 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" } diff --git a/types/gen-readlines/tsconfig.json b/types/gen-readlines/tsconfig.json index 18d185012c..e33972871a 100644 --- a/types/gen-readlines/tsconfig.json +++ b/types/gen-readlines/tsconfig.json @@ -15,10 +15,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "strictFunctionTypes" : true + "esModuleInterop": true, + "strictFunctionTypes": true }, "files": [ "index.d.ts", "gen-readlines-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/generic-functions/tsconfig.json b/types/generic-functions/tsconfig.json index 7476e09445..8194acf8f1 100644 --- a/types/generic-functions/tsconfig.json +++ b/types/generic-functions/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/generic-pool/tsconfig.json b/types/generic-pool/tsconfig.json index 070951dc15..f7814076e4 100644 --- a/types/generic-pool/tsconfig.json +++ b/types/generic-pool/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gently/tsconfig.json b/types/gently/tsconfig.json index 0bb239c702..a204c2dbe2 100644 --- a/types/gently/tsconfig.json +++ b/types/gently/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geodesy/tsconfig.json b/types/geodesy/tsconfig.json index 3b785b83fb..44f04c33a8 100644 --- a/types/geodesy/tsconfig.json +++ b/types/geodesy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geoip-lite/tsconfig.json b/types/geoip-lite/tsconfig.json index 28668d80f3..2048399bfd 100644 --- a/types/geoip-lite/tsconfig.json +++ b/types/geoip-lite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geojson/index.d.ts b/types/geojson/index.d.ts index e6783255eb..85f02aaad0 100644 --- a/types/geojson/index.d.ts +++ b/types/geojson/index.d.ts @@ -161,5 +161,6 @@ export interface Feature extend * https://tools.ietf.org/html/rfc7946#section-3.3 */ export interface FeatureCollection extends GeoJsonObject { + type: "FeatureCollection"; features: Array>; } diff --git a/types/geojson/tsconfig.json b/types/geojson/tsconfig.json index 071f17c65d..18526751b5 100644 --- a/types/geojson/tsconfig.json +++ b/types/geojson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geojson2osm/tsconfig.json b/types/geojson2osm/tsconfig.json index 98f1b66e4e..b6301a0296 100644 --- a/types/geojson2osm/tsconfig.json +++ b/types/geojson2osm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geokdbush/tsconfig.json b/types/geokdbush/tsconfig.json index 655591f4e8..29ef327d5b 100644 --- a/types/geokdbush/tsconfig.json +++ b/types/geokdbush/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geometry-dom/tsconfig.json b/types/geometry-dom/tsconfig.json index f845e8f11a..ed33cabecd 100644 --- a/types/geometry-dom/tsconfig.json +++ b/types/geometry-dom/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/geopattern/tsconfig.json b/types/geopattern/tsconfig.json index 6804c9374d..ffde596485 100644 --- a/types/geopattern/tsconfig.json +++ b/types/geopattern/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/get-node-dimensions/tsconfig.json b/types/get-node-dimensions/tsconfig.json index 63d26048ed..04ee74158c 100644 --- a/types/get-node-dimensions/tsconfig.json +++ b/types/get-node-dimensions/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/get-port/tsconfig.json b/types/get-port/tsconfig.json index c221d4e9fd..459facdfa8 100644 --- a/types/get-port/tsconfig.json +++ b/types/get-port/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/get-stdin/tsconfig.json b/types/get-stdin/tsconfig.json index 1052b48f11..6c25eedcf8 100644 --- a/types/get-stdin/tsconfig.json +++ b/types/get-stdin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/get-stream/tsconfig.json b/types/get-stream/tsconfig.json index 7d3b35d42d..9c36478bae 100644 --- a/types/get-stream/tsconfig.json +++ b/types/get-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/getos/tsconfig.json b/types/getos/tsconfig.json index fbcc09cf87..7d14fec0fc 100644 --- a/types/getos/tsconfig.json +++ b/types/getos/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gettext.js/tsconfig.json b/types/gettext.js/tsconfig.json index 3812c6244c..87273714e2 100644 --- a/types/gettext.js/tsconfig.json +++ b/types/gettext.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gifffer/tsconfig.json b/types/gifffer/tsconfig.json index 273e998048..e5d099d008 100644 --- a/types/gifffer/tsconfig.json +++ b/types/gifffer/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gifffer-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gijgo/tsconfig.json b/types/gijgo/tsconfig.json index 36530a70b9..6bb0ae1403 100644 --- a/types/gijgo/tsconfig.json +++ b/types/gijgo/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/giraffe/tsconfig.json b/types/giraffe/tsconfig.json index 0602e0fbb5..a469396dd4 100644 --- a/types/giraffe/tsconfig.json +++ b/types/giraffe/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/git-config/tsconfig.json b/types/git-config/tsconfig.json index 48e528d1cc..605c7505c3 100644 --- a/types/git-config/tsconfig.json +++ b/types/git-config/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/git-remote-origin-url/tsconfig.json b/types/git-remote-origin-url/tsconfig.json index 063c49bfe3..9d83cc0c47 100644 --- a/types/git-remote-origin-url/tsconfig.json +++ b/types/git-remote-origin-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/git-rev/tsconfig.json b/types/git-rev/tsconfig.json index 95396b43c2..7a8cbf36cf 100644 --- a/types/git-rev/tsconfig.json +++ b/types/git-rev/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/git/tsconfig.json b/types/git/tsconfig.json index 397dfc4ac3..959a2ac25e 100644 --- a/types/git/tsconfig.json +++ b/types/git/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/github-username-regex/tsconfig.json b/types/github-username-regex/tsconfig.json index 4a30cf07ad..4564596c08 100644 --- a/types/github-username-regex/tsconfig.json +++ b/types/github-username-regex/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "github-username-regex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gl-matrix/tsconfig.json b/types/gl-matrix/tsconfig.json index ec26405a08..fd83be79a8 100644 --- a/types/gl-matrix/tsconfig.json +++ b/types/gl-matrix/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gldatepicker/tsconfig.json b/types/gldatepicker/tsconfig.json index 93ae16bff0..8d80a4c096 100644 --- a/types/gldatepicker/tsconfig.json +++ b/types/gldatepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/glidejs/tsconfig.json b/types/glidejs/tsconfig.json index 5659d4d355..5d075c7637 100644 --- a/types/glidejs/tsconfig.json +++ b/types/glidejs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/glob-base/tsconfig.json b/types/glob-base/tsconfig.json index b5cd160770..2013ef4332 100644 --- a/types/glob-base/tsconfig.json +++ b/types/glob-base/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/glob-expand/glob-expand-tests.ts b/types/glob-expand/glob-expand-tests.ts index 70275ea0cf..1e61bc0c49 100644 --- a/types/glob-expand/glob-expand-tests.ts +++ b/types/glob-expand/glob-expand-tests.ts @@ -1,5 +1,4 @@ - -import * as expand from "glob-expand"; +import expand = require("glob-expand"); expand({ filter: 'isFile', cwd: '../' }, ['**/*.*', '!exclude/these/**/*.*']); // returns all files in cwd ['file1', 'file2',...] but excluding diff --git a/types/glob-expand/tsconfig.json b/types/glob-expand/tsconfig.json index 4c028e61f8..670f966d8f 100644 --- a/types/glob-expand/tsconfig.json +++ b/types/glob-expand/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/glob-parent/tsconfig.json b/types/glob-parent/tsconfig.json index 1e74b9bc82..ee2853601f 100644 --- a/types/glob-parent/tsconfig.json +++ b/types/glob-parent/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "glob-parent-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/glob-stream/tsconfig.json b/types/glob-stream/tsconfig.json index 06d8e7ca71..c199b4c07c 100644 --- a/types/glob-stream/tsconfig.json +++ b/types/glob-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/glob/index.d.ts b/types/glob/index.d.ts index f7628d5ab7..92c2532e79 100644 --- a/types/glob/index.d.ts +++ b/types/glob/index.d.ts @@ -14,6 +14,8 @@ declare function G(pattern: string, cb: (err: Error | null, matches: string[]) = declare function G(pattern: string, options: G.IOptions, cb: (err: Error | null, matches: string[]) => void): void; declare namespace G { + function __promisify__(pattern: string, options?: IOptions): Promise; + function sync(pattern: string, options?: IOptions): string[]; function hasMagic(pattern: string, options?: IOptions): boolean; diff --git a/types/glob/tsconfig.json b/types/glob/tsconfig.json index 46faaf718d..8e1cef6b05 100644 --- a/types/glob/tsconfig.json +++ b/types/glob/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/global-tunnel-ng/tsconfig.json b/types/global-tunnel-ng/tsconfig.json index e36f343474..362aca1f3f 100644 --- a/types/global-tunnel-ng/tsconfig.json +++ b/types/global-tunnel-ng/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/globalize-compiler/tsconfig.json b/types/globalize-compiler/tsconfig.json index 7c4ac18956..6c21504dec 100644 --- a/types/globalize-compiler/tsconfig.json +++ b/types/globalize-compiler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/globalize/tsconfig.json b/types/globalize/tsconfig.json index b83bbf7b09..a05e92e969 100644 --- a/types/globalize/tsconfig.json +++ b/types/globalize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/globby/globby-tests.ts b/types/globby/globby-tests.ts index 68acb7cde8..1c3c1842d4 100644 --- a/types/globby/globby-tests.ts +++ b/types/globby/globby-tests.ts @@ -1,6 +1,6 @@ import { IOptions } from 'glob'; -import * as globby from "globby"; +import globby = require("globby"); (async () => { let result: string[]; diff --git a/types/globby/tsconfig.json b/types/globby/tsconfig.json index 5cc0a3fe62..3992324f85 100644 --- a/types/globby/tsconfig.json +++ b/types/globby/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/globule/tsconfig.json b/types/globule/tsconfig.json index 9e410fc88b..973d69a02d 100644 --- a/types/globule/tsconfig.json +++ b/types/globule/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gm/tsconfig.json b/types/gm/tsconfig.json index 234c57dbf5..e7b6667e75 100644 --- a/types/gm/tsconfig.json +++ b/types/gm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/go/tsconfig.json b/types/go/tsconfig.json index 3c8880bab1..02839eea7b 100644 --- a/types/go/tsconfig.json +++ b/types/go/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-adwords-scripts/tsconfig.json b/types/google-adwords-scripts/tsconfig.json index 748cf4a694..a515e74b27 100644 --- a/types/google-adwords-scripts/tsconfig.json +++ b/types/google-adwords-scripts/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-apps-script-oauth2/tsconfig.json b/types/google-apps-script-oauth2/tsconfig.json index bc09dd70b9..db6e6d4421 100644 --- a/types/google-apps-script-oauth2/tsconfig.json +++ b/types/google-apps-script-oauth2/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "google-apps-script-oauth2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/google-apps-script/tsconfig.json b/types/google-apps-script/tsconfig.json index d61786dd17..483cc8d9d7 100644 --- a/types/google-apps-script/tsconfig.json +++ b/types/google-apps-script/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-closure-compiler/tsconfig.json b/types/google-closure-compiler/tsconfig.json index a4c312936e..5e74e98a7e 100644 --- a/types/google-closure-compiler/tsconfig.json +++ b/types/google-closure-compiler/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-cloud__datastore/tsconfig.json b/types/google-cloud__datastore/tsconfig.json index a65f9d3218..1fb6feb9ab 100644 --- a/types/google-cloud__datastore/tsconfig.json +++ b/types/google-cloud__datastore/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-cloud__pubsub/google-cloud__pubsub-tests.ts b/types/google-cloud__pubsub/google-cloud__pubsub-tests.ts index 7a9b9905c2..3d31dd7291 100644 --- a/types/google-cloud__pubsub/google-cloud__pubsub-tests.ts +++ b/types/google-cloud__pubsub/google-cloud__pubsub-tests.ts @@ -1,4 +1,4 @@ -import * as PubSub from '@google-cloud/pubsub'; +import PubSub = require('@google-cloud/pubsub'); // AUTHOR NOTES: We use the examples directly from the library documentation // where possible. If there is a problem with a given example (e.g. undocumented diff --git a/types/google-cloud__pubsub/tsconfig.json b/types/google-cloud__pubsub/tsconfig.json index f71eb2a331..0d2fd84b97 100644 --- a/types/google-cloud__pubsub/tsconfig.json +++ b/types/google-cloud__pubsub/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-cloud__storage/google-cloud__storage-tests.ts b/types/google-cloud__storage/google-cloud__storage-tests.ts index 24d300b8e6..dec2846f26 100644 --- a/types/google-cloud__storage/google-cloud__storage-tests.ts +++ b/types/google-cloud__storage/google-cloud__storage-tests.ts @@ -26,7 +26,7 @@ import { WriteStreamOptions, UploadOptions } from "@google-cloud/storage"; -import * as CloudStorage from "@google-cloud/storage"; +import CloudStorage = require("@google-cloud/storage"); /** * Test the storage service. diff --git a/types/google-cloud__storage/tsconfig.json b/types/google-cloud__storage/tsconfig.json index fe05cce995..bc37173f6e 100644 --- a/types/google-cloud__storage/tsconfig.json +++ b/types/google-cloud__storage/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-drive-realtime-api/tsconfig.json b/types/google-drive-realtime-api/tsconfig.json index 17d47ba0dc..0cc6a81613 100644 --- a/types/google-drive-realtime-api/tsconfig.json +++ b/types/google-drive-realtime-api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-earth/tsconfig.json b/types/google-earth/tsconfig.json index 1ed0784589..d59ac2953b 100644 --- a/types/google-earth/tsconfig.json +++ b/types/google-earth/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-images/tsconfig.json b/types/google-images/tsconfig.json index 017e9116b8..9f12194366 100644 --- a/types/google-images/tsconfig.json +++ b/types/google-images/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-libphonenumber/index.d.ts b/types/google-libphonenumber/index.d.ts index 0e410e121c..9a46ac69a6 100644 --- a/types/google-libphonenumber/index.d.ts +++ b/types/google-libphonenumber/index.d.ts @@ -42,7 +42,6 @@ declare namespace libphonenumber { hasCountryCode(): boolean; countryCodeCount(): number; clearCountryCode(): void; - getNationalNumber(): number | undefined; getNationalNumberOrDefault(): number; setNationalNumber(value: number): number; @@ -115,6 +114,7 @@ declare namespace libphonenumber { format(phoneNumber: PhoneNumber, format: PhoneNumberFormat): string; getNddPrefixForRegion(regionCode?: string, stripNonDigits?: boolean): string | undefined; getNumberType(phoneNumber: PhoneNumber): PhoneNumberType; + getCountryCodeForRegion(supportedRegion:string):string; getRegionCodeForCountryCode(countryCallingCode: number): string; getRegionCodeForNumber(phoneNumber: PhoneNumber): string | undefined; getSupportedRegions():string []; diff --git a/types/google-libphonenumber/tsconfig.json b/types/google-libphonenumber/tsconfig.json index e6e1f550b1..39c07d5ffb 100644 --- a/types/google-libphonenumber/tsconfig.json +++ b/types/google-libphonenumber/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-map-react/index.d.ts b/types/google-map-react/index.d.ts index 037ebb5f13..ec2f08d2ab 100644 --- a/types/google-map-react/index.d.ts +++ b/types/google-map-react/index.d.ts @@ -84,6 +84,7 @@ export interface Props { options?: Options | ((maps: Maps) => Options); margin?: any[]; debounced?: boolean; + draggable?: boolean; layerTypes?: string[]; onClick?(value: ClickEventValue): any; onChange?(value: ChangeEventValue): any; diff --git a/types/google-map-react/tsconfig.json b/types/google-map-react/tsconfig.json index 0fc3a3107f..4f02fa811b 100644 --- a/types/google-map-react/tsconfig.json +++ b/types/google-map-react/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-maps/tsconfig.json b/types/google-maps/tsconfig.json index e43916774d..606c1d115c 100644 --- a/types/google-maps/tsconfig.json +++ b/types/google-maps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google-protobuf/tsconfig.json b/types/google-protobuf/tsconfig.json index b20bd4433e..958728f6a6 100644 --- a/types/google-protobuf/tsconfig.json +++ b/types/google-protobuf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google.analytics/index.d.ts b/types/google.analytics/index.d.ts index b0412a362f..b7d4a8a6f4 100644 --- a/types/google.analytics/index.d.ts +++ b/types/google.analytics/index.d.ts @@ -39,9 +39,8 @@ interface GoogleAnalytics { declare namespace UniversalAnalytics { // https://developers.google.com/analytics/devguides/collection/analyticsjs/method-reference - enum HitType { - 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing' - } + // https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#hitType + type HitType = 'pageview' | 'screenview' | 'event' | 'transaction' | 'item' | 'social' | 'exception' | 'timing'; // https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference @@ -294,7 +293,7 @@ declare namespace UniversalAnalytics { flashVersion?: string; forceSSL?: boolean; hitCallback?(): void; - hitType?: string; + hitType?: HitType; hostname?: string; id?: string; javaEnabled?: boolean; diff --git a/types/google.analytics/tsconfig.json b/types/google.analytics/tsconfig.json index 45e71871b6..a678b0c7e3 100644 --- a/types/google.analytics/tsconfig.json +++ b/types/google.analytics/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google.feeds/tsconfig.json b/types/google.feeds/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/google.feeds/tsconfig.json +++ b/types/google.feeds/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/google.fonts/tsconfig.json b/types/google.fonts/tsconfig.json index c4aa4943d3..4177da42c1 100644 --- a/types/google.fonts/tsconfig.json +++ b/types/google.fonts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google.geolocation/tsconfig.json b/types/google.geolocation/tsconfig.json index 71c8196435..360cecb0c9 100644 --- a/types/google.geolocation/tsconfig.json +++ b/types/google.geolocation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google.picker/tsconfig.json b/types/google.picker/tsconfig.json index 33502e21db..ddb1723be6 100644 --- a/types/google.picker/tsconfig.json +++ b/types/google.picker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/google.visualization/tsconfig.json b/types/google.visualization/tsconfig.json index ad7ea5ef90..4dc584c1d4 100644 --- a/types/google.visualization/tsconfig.json +++ b/types/google.visualization/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/googlemaps.infobubble/tsconfig.json b/types/googlemaps.infobubble/tsconfig.json index 12fd60b566..d1bc655d54 100644 --- a/types/googlemaps.infobubble/tsconfig.json +++ b/types/googlemaps.infobubble/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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; diff --git a/types/googlemaps/tsconfig.json b/types/googlemaps/tsconfig.json index 7cd79e5d79..024177069c 100644 --- a/types/googlemaps/tsconfig.json +++ b/types/googlemaps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/got/tsconfig.json b/types/got/tsconfig.json index 743441a0b9..f13cc4607a 100644 --- a/types/got/tsconfig.json +++ b/types/got/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graceful-fs/tsconfig.json b/types/graceful-fs/tsconfig.json index 6c2ec1116e..c3fa569830 100644 --- a/types/graceful-fs/tsconfig.json +++ b/types/graceful-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graceful-fs/v2/tsconfig.json b/types/graceful-fs/v2/tsconfig.json index d22f218ed4..6eb67ef820 100644 --- a/types/graceful-fs/v2/tsconfig.json +++ b/types/graceful-fs/v2/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graham_scan/tsconfig.json b/types/graham_scan/tsconfig.json index 3a7a6efef0..3cf0c64668 100644 --- a/types/graham_scan/tsconfig.json +++ b/types/graham_scan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphite-udp/tsconfig.json b/types/graphite-udp/tsconfig.json index 936a1657f4..f0804cdc58 100644 --- a/types/graphite-udp/tsconfig.json +++ b/types/graphite-udp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphlib/tsconfig.json b/types/graphlib/tsconfig.json index 994651b021..389baac591 100644 --- a/types/graphlib/tsconfig.json +++ b/types/graphlib/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphql-date/tsconfig.json b/types/graphql-date/tsconfig.json index c55674e246..603ec788c9 100644 --- a/types/graphql-date/tsconfig.json +++ b/types/graphql-date/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphql-iso-date/graphql-iso-date-tests.ts b/types/graphql-iso-date/graphql-iso-date-tests.ts new file mode 100644 index 0000000000..abc417cf5a --- /dev/null +++ b/types/graphql-iso-date/graphql-iso-date-tests.ts @@ -0,0 +1,5 @@ +import { GraphQLDate, GraphQLTime, GraphQLDateTime } from "graphql-iso-date"; + +GraphQLDate.name; +GraphQLTime.name; +GraphQLDateTime.name; diff --git a/types/graphql-iso-date/index.d.ts b/types/graphql-iso-date/index.d.ts new file mode 100644 index 0000000000..7f0731478e --- /dev/null +++ b/types/graphql-iso-date/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for graphql-iso-date 3.3 +// Project: https://github.com/excitement-engineer/graphql-iso-date +// Definitions by: Jason Waldrip +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { GraphQLScalarType } from "graphql"; + +export const GraphQLDate: GraphQLScalarType; +export const GraphQLTime: GraphQLScalarType; +export const GraphQLDateTime: GraphQLScalarType; diff --git a/types/graphql-iso-date/tsconfig.json b/types/graphql-iso-date/tsconfig.json new file mode 100644 index 0000000000..57320b7caa --- /dev/null +++ b/types/graphql-iso-date/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "graphql-iso-date-tests.ts" + ] +} \ No newline at end of file diff --git a/types/graphql-iso-date/tslint.json b/types/graphql-iso-date/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/graphql-iso-date/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/graphql-relay/tsconfig.json b/types/graphql-relay/tsconfig.json index bf5b3ba6b6..b94d59db9d 100644 --- a/types/graphql-relay/tsconfig.json +++ b/types/graphql-relay/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphql-type-json/tsconfig.json b/types/graphql-type-json/tsconfig.json index 479196f574..5eac54c86a 100644 --- a/types/graphql-type-json/tsconfig.json +++ b/types/graphql-type-json/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphql/error/GraphQLError.d.ts b/types/graphql/error/GraphQLError.d.ts index fbafcb1e30..116f17c3fa 100644 --- a/types/graphql/error/GraphQLError.d.ts +++ b/types/graphql/error/GraphQLError.d.ts @@ -9,60 +9,60 @@ import { Source } from '../language/source'; * GraphQL document and/or execution result that correspond to the Error. */ export class GraphQLError extends Error { - /** - * A message describing the Error for debugging purposes. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - message: string; + /** + * A message describing the Error for debugging purposes. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + message: string; - /** - * An array of { line, column } locations within the source GraphQL document - * which correspond to this error. - * - * Errors during validation often contain multiple locations, for example to - * point out two things with the same name. Errors during execution include a - * single location, the field which produced the error. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - locations?: Array<{ line: number, column: number }> | undefined; + /** + * An array of { line, column } locations within the source GraphQL document + * which correspond to this error. + * + * Errors during validation often contain multiple locations, for example to + * point out two things with the same name. Errors during execution include a + * single location, the field which produced the error. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + locations?: Array<{ line: number; column: number }> | undefined; - /** - * An array describing the JSON-path into the execution response which - * corresponds to this error. Only included for errors during execution. - * - * Enumerable, and appears in the result of JSON.stringify(). - */ - path?: Array | undefined; + /** + * An array describing the JSON-path into the execution response which + * corresponds to this error. Only included for errors during execution. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + path?: Array | undefined; - /** - * An array of GraphQL AST Nodes corresponding to this error. - */ - nodes?: ASTNode[] | undefined; + /** + * An array of GraphQL AST Nodes corresponding to this error. + */ + nodes?: ASTNode[] | undefined; - /** - * The source GraphQL document corresponding to this error. - */ - source?: Source | undefined; + /** + * The source GraphQL document corresponding to this error. + */ + source?: Source | undefined; - /** - * An array of character offsets within the source GraphQL document - * which correspond to this error. - */ - positions?: number[] | undefined; + /** + * An array of character offsets within the source GraphQL document + * which correspond to this error. + */ + positions?: number[] | undefined; - /** - * The original error thrown from a field resolver during execution. - */ - originalError?: Error; + /** + * The original error thrown from a field resolver during execution. + */ + originalError?: Error; - constructor( - message: string, - nodes?: any[], - source?: Source, - positions?: number[], - path?: Array, - originalError?: Error, - ); + constructor( + message: string, + nodes?: any[], + source?: Source, + positions?: number[], + path?: Array, + originalError?: Error, + ); } diff --git a/types/graphql/error/formatError.d.ts b/types/graphql/error/formatError.d.ts index fbb31cdb23..26dbe0f743 100644 --- a/types/graphql/error/formatError.d.ts +++ b/types/graphql/error/formatError.d.ts @@ -7,12 +7,12 @@ import { GraphQLError } from './GraphQLError'; export function formatError(error: GraphQLError): GraphQLFormattedError; export interface GraphQLFormattedError { - message: string; - locations?: GraphQLErrorLocation[]; - path?: Array; + message: string; + locations?: GraphQLErrorLocation[]; + path?: Array; } export interface GraphQLErrorLocation { - line: number; - column: number; + line: number; + column: number; } diff --git a/types/graphql/error/index.d.ts b/types/graphql/error/index.d.ts index cfb5b92740..0e9a557794 100644 --- a/types/graphql/error/index.d.ts +++ b/types/graphql/error/index.d.ts @@ -1,4 +1,8 @@ export { GraphQLError } from './GraphQLError'; export { syntaxError } from './syntaxError'; export { locatedError } from './locatedError'; -export { formatError, GraphQLFormattedError, GraphQLErrorLocation } from './formatError'; +export { + formatError, + GraphQLFormattedError, + GraphQLErrorLocation, +} from './formatError'; diff --git a/types/graphql/error/locatedError.d.ts b/types/graphql/error/locatedError.d.ts index c827f8ede8..64fadf49f4 100644 --- a/types/graphql/error/locatedError.d.ts +++ b/types/graphql/error/locatedError.d.ts @@ -6,7 +6,7 @@ import { GraphQLError } from './GraphQLError'; * document responsible for the original Error. */ export function locatedError( - originalError: Error, - nodes: T[], - path: Array + originalError: Error, + nodes: T[], + path: Array, ): GraphQLError; diff --git a/types/graphql/error/syntaxError.d.ts b/types/graphql/error/syntaxError.d.ts index 80c4453e03..ccf84044ca 100644 --- a/types/graphql/error/syntaxError.d.ts +++ b/types/graphql/error/syntaxError.d.ts @@ -6,7 +6,7 @@ import { GraphQLError } from './GraphQLError'; * descriptive information about the syntax error's position in the source. */ export function syntaxError( - source: Source, - position: number, - description: string + source: Source, + position: number, + description: string, ): GraphQLError; diff --git a/types/graphql/execution/execute.d.ts b/types/graphql/execution/execute.d.ts index c8ee7d9215..ea6ab8ed39 100644 --- a/types/graphql/execution/execute.d.ts +++ b/types/graphql/execution/execute.d.ts @@ -1,14 +1,18 @@ import { GraphQLError, locatedError } from '../error'; import { GraphQLSchema } from '../type/schema'; -import { GraphQLField, GraphQLFieldResolver, ResponsePath } from '../type/definition'; import { - DirectiveNode, - DocumentNode, - OperationDefinitionNode, - SelectionSetNode, - FieldNode, - InlineFragmentNode, - FragmentDefinitionNode, + GraphQLField, + GraphQLFieldResolver, + ResponsePath, +} from '../type/definition'; +import { + DirectiveNode, + DocumentNode, + OperationDefinitionNode, + SelectionSetNode, + FieldNode, + InlineFragmentNode, + FragmentDefinitionNode, } from '../language/ast'; /** * Data that must be available at all points during query execution. @@ -17,13 +21,13 @@ import { * and the fragments defined in the query document */ export interface ExecutionContext { - schema: GraphQLSchema; - fragments: { [key: string]: FragmentDefinitionNode }; - rootValue: any; - operation: OperationDefinitionNode; - variableValues: { [key: string]: any }; - fieldResolver: GraphQLFieldResolver; - errors: GraphQLError[]; + schema: GraphQLSchema; + fragments: { [key: string]: FragmentDefinitionNode }; + rootValue: any; + operation: OperationDefinitionNode; + variableValues: { [key: string]: any }; + fieldResolver: GraphQLFieldResolver; + errors: GraphQLError[]; } /** @@ -33,19 +37,19 @@ export interface ExecutionContext { * non-empty array if an error occurred. */ export interface ExecutionResult { - data?: { [key: string]: any }; - extensions?: { [key: string]: any }; - errors?: GraphQLError[]; + data?: { [key: string]: any }; + extensions?: { [key: string]: any }; + errors?: GraphQLError[]; } export type ExecutionArgs = { - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: {[key: string]: any}, - operationName?: string, - fieldResolver?: GraphQLFieldResolver + schema: GraphQLSchema; + document: DocumentNode; + rootValue?: any; + contextValue?: any; + variableValues?: { [key: string]: any }; + operationName?: string; + fieldResolver?: GraphQLFieldResolver; }; /** @@ -60,24 +64,22 @@ export type ExecutionArgs = { */ export function execute(args: ExecutionArgs): Promise; export function execute( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { + [key: string]: any; + }, + operationName?: string, + fieldResolver?: GraphQLFieldResolver, ): Promise; /** * Given a ResponsePath (found in the `path` entry in the information provided * as the last argument to a field resolver), return an Array of the path keys. */ -export function responsePathAsArray( - path: ResponsePath -): Array; +export function responsePathAsArray(path: ResponsePath): Array; export function addPath(prev: ResponsePath, key: string | number): any; diff --git a/types/graphql/execution/index.d.ts b/types/graphql/execution/index.d.ts index 4bf4e395ab..a5c4980c0a 100644 --- a/types/graphql/execution/index.d.ts +++ b/types/graphql/execution/index.d.ts @@ -1,9 +1,9 @@ export { - execute, - defaultFieldResolver, - responsePathAsArray, - ExecutionArgs, - ExecutionResult + execute, + defaultFieldResolver, + responsePathAsArray, + ExecutionArgs, + ExecutionResult, } from './execute'; export { getDirectiveValues } from './values'; diff --git a/types/graphql/execution/values.d.ts b/types/graphql/execution/values.d.ts index 79a0176f8d..08e6041aa2 100644 --- a/types/graphql/execution/values.d.ts +++ b/types/graphql/execution/values.d.ts @@ -1,7 +1,15 @@ -import { GraphQLInputType, GraphQLField, GraphQLArgument } from '../type/definition'; +import { + GraphQLInputType, + GraphQLField, + GraphQLArgument, +} from '../type/definition'; import { GraphQLDirective } from '../type/directives'; import { GraphQLSchema } from '../type/schema'; -import { FieldNode, DirectiveNode, VariableDefinitionNode } from '../language/ast'; +import { + FieldNode, + DirectiveNode, + VariableDefinitionNode, +} from '../language/ast'; /** * Prepares an object map of variableValues of the correct type based on the @@ -9,9 +17,9 @@ import { FieldNode, DirectiveNode, VariableDefinitionNode } from '../language/as * parsed to match the variable definitions, a GraphQLError will be thrown. */ export function getVariableValues( - schema: GraphQLSchema, - varDefNodes: VariableDefinitionNode[], - inputs: { [key: string]: any } + schema: GraphQLSchema, + varDefNodes: VariableDefinitionNode[], + inputs: { [key: string]: any }, ): { [key: string]: any }; /** @@ -19,9 +27,9 @@ export function getVariableValues( * definitions and list of argument AST nodes. */ export function getArgumentValues( - def: GraphQLField | GraphQLDirective, - node: FieldNode | DirectiveNode, - variableValues?: { [key: string]: any } + def: GraphQLField | GraphQLDirective, + node: FieldNode | DirectiveNode, + variableValues?: { [key: string]: any }, ): { [key: string]: any }; /** @@ -32,7 +40,7 @@ export function getArgumentValues( * If the directive does not exist on the node, returns undefined. */ export function getDirectiveValues( - directiveDef: GraphQLDirective, - node: { directives?: Array }, - variableValues?: { [key: string]: any } + directiveDef: GraphQLDirective, + node: { directives?: Array }, + variableValues?: { [key: string]: any }, ): void | { [key: string]: any }; diff --git a/types/graphql/language/ast.d.ts b/types/graphql/language/ast.d.ts index 24344fe904..1873caeb1f 100644 --- a/types/graphql/language/ast.d.ts +++ b/types/graphql/language/ast.d.ts @@ -5,30 +5,30 @@ import { Source } from './source'; * identify the region of the source from which the AST derived. */ export interface Location { - /** - * The character offset at which this Node begins. - */ - start: number; + /** + * The character offset at which this Node begins. + */ + start: number; - /** - * The character offset at which this Node ends. - */ - end: number; + /** + * The character offset at which this Node ends. + */ + end: number; - /** - * The Token at which this Node begins. - */ - startToken: Token; + /** + * The Token at which this Node begins. + */ + startToken: Token; - /** - * The Token at which this Node ends. - */ - endToken: Token; + /** + * The Token at which this Node ends. + */ + endToken: Token; - /** - * The Source document the AST represents. - */ - source: Source; + /** + * The Source document the AST represents. + */ + source: Source; } /** @@ -37,181 +37,181 @@ export interface Location { * *only*. */ type TokenKind = - | '' - | '' - | '!' - | '$' - | '(' - | ')' - | '...' - | ':' - | '=' - | '@' - | '[' - | ']' - | '{' - | '|' - | '}' - | 'Name' - | 'Int' - | 'Float' - | 'String' - | 'BlockString' - | 'Comment'; + | '' + | '' + | '!' + | '$' + | '(' + | ')' + | '...' + | ':' + | '=' + | '@' + | '[' + | ']' + | '{' + | '|' + | '}' + | 'Name' + | 'Int' + | 'Float' + | 'String' + | 'BlockString' + | 'Comment'; /** * Represents a range of characters represented by a lexical token * within a Source. */ export interface Token { - /** - * The kind of Token. - */ - kind: TokenKind; + /** + * The kind of Token. + */ + kind: TokenKind; - /** - * The character offset at which this Node begins. - */ - start: number; + /** + * The character offset at which this Node begins. + */ + start: number; - /** - * The character offset at which this Node ends. - */ - end: number; + /** + * The character offset at which this Node ends. + */ + end: number; - /** - * The 1-indexed line number on which this Token appears. - */ - line: number; + /** + * The 1-indexed line number on which this Token appears. + */ + line: number; - /** - * The 1-indexed column number at which this Token begins. - */ - column: number; + /** + * The 1-indexed column number at which this Token begins. + */ + column: number; - /** - * For non-punctuation tokens, represents the interpreted value of the token. - */ - value: string | undefined; + /** + * For non-punctuation tokens, represents the interpreted value of the token. + */ + value: string | undefined; - /** - * Tokens exist as nodes in a double-linked-list amongst all tokens - * including ignored tokens. is always the first node and - * the last. - */ - prev?: Token; - next?: Token; + /** + * Tokens exist as nodes in a double-linked-list amongst all tokens + * including ignored tokens. is always the first node and + * the last. + */ + prev?: Token; + next?: Token; } /** * The list of all possible AST node types. */ export type ASTNode = - | NameNode - | DocumentNode - | OperationDefinitionNode - | VariableDefinitionNode - | VariableNode - | SelectionSetNode - | FieldNode - | ArgumentNode - | FragmentSpreadNode - | InlineFragmentNode - | FragmentDefinitionNode - | IntValueNode - | FloatValueNode - | StringValueNode - | BooleanValueNode - | NullValueNode - | EnumValueNode - | ListValueNode - | ObjectValueNode - | ObjectFieldNode - | DirectiveNode - | NamedTypeNode - | ListTypeNode - | NonNullTypeNode - | SchemaDefinitionNode - | OperationTypeDefinitionNode - | ScalarTypeDefinitionNode - | ObjectTypeDefinitionNode - | FieldDefinitionNode - | InputValueDefinitionNode - | InterfaceTypeDefinitionNode - | UnionTypeDefinitionNode - | EnumTypeDefinitionNode - | EnumValueDefinitionNode - | InputObjectTypeDefinitionNode - | ScalarTypeExtensionNode - | ObjectTypeExtensionNode - | InterfaceTypeExtensionNode - | UnionTypeExtensionNode - | EnumTypeExtensionNode - | InputObjectTypeExtensionNode - | DirectiveDefinitionNode; + | NameNode + | DocumentNode + | OperationDefinitionNode + | VariableDefinitionNode + | VariableNode + | SelectionSetNode + | FieldNode + | ArgumentNode + | FragmentSpreadNode + | InlineFragmentNode + | FragmentDefinitionNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode + | ObjectFieldNode + | DirectiveNode + | NamedTypeNode + | ListTypeNode + | NonNullTypeNode + | SchemaDefinitionNode + | OperationTypeDefinitionNode + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | FieldDefinitionNode + | InputValueDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | EnumValueDefinitionNode + | InputObjectTypeDefinitionNode + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode + | DirectiveDefinitionNode; /** * Utility type listing all nodes indexed by their kind. */ export interface ASTKindToNode { - Name: NameNode; - Document: DocumentNode; - OperationDefinition: OperationDefinitionNode; - VariableDefinition: VariableDefinitionNode; - Variable: VariableNode; - SelectionSet: SelectionSetNode; - Field: FieldNode; - Argument: ArgumentNode; - FragmentSpread: FragmentSpreadNode; - InlineFragment: InlineFragmentNode; - FragmentDefinition: FragmentDefinitionNode; - IntValue: IntValueNode; - FloatValue: FloatValueNode; - StringValue: StringValueNode; - BooleanValue: BooleanValueNode; - NullValue: NullValueNode; - EnumValue: EnumValueNode; - ListValue: ListValueNode; - ObjectValue: ObjectValueNode; - ObjectField: ObjectFieldNode; - Directive: DirectiveNode; - NamedType: NamedTypeNode; - ListType: ListTypeNode; - NonNullType: NonNullTypeNode; - SchemaDefinition: SchemaDefinitionNode; - OperationTypeDefinition: OperationTypeDefinitionNode; - ScalarTypeDefinition: ScalarTypeDefinitionNode; - ObjectTypeDefinition: ObjectTypeDefinitionNode; - FieldDefinition: FieldDefinitionNode; - InputValueDefinition: InputValueDefinitionNode; - InterfaceTypeDefinition: InterfaceTypeDefinitionNode; - UnionTypeDefinition: UnionTypeDefinitionNode; - EnumTypeDefinition: EnumTypeDefinitionNode; - EnumValueDefinition: EnumValueDefinitionNode; - InputObjectTypeDefinition: InputObjectTypeDefinitionNode; - ScalarTypeExtension: ScalarTypeExtensionNode; - ObjectTypeExtension: ObjectTypeExtensionNode; - InterfaceTypeExtension: InterfaceTypeExtensionNode; - UnionTypeExtension: UnionTypeExtensionNode; - EnumTypeExtension: EnumTypeExtensionNode; - InputObjectTypeExtension: InputObjectTypeExtensionNode; - DirectiveDefinition: DirectiveDefinitionNode; + Name: NameNode; + Document: DocumentNode; + OperationDefinition: OperationDefinitionNode; + VariableDefinition: VariableDefinitionNode; + Variable: VariableNode; + SelectionSet: SelectionSetNode; + Field: FieldNode; + Argument: ArgumentNode; + FragmentSpread: FragmentSpreadNode; + InlineFragment: InlineFragmentNode; + FragmentDefinition: FragmentDefinitionNode; + IntValue: IntValueNode; + FloatValue: FloatValueNode; + StringValue: StringValueNode; + BooleanValue: BooleanValueNode; + NullValue: NullValueNode; + EnumValue: EnumValueNode; + ListValue: ListValueNode; + ObjectValue: ObjectValueNode; + ObjectField: ObjectFieldNode; + Directive: DirectiveNode; + NamedType: NamedTypeNode; + ListType: ListTypeNode; + NonNullType: NonNullTypeNode; + SchemaDefinition: SchemaDefinitionNode; + OperationTypeDefinition: OperationTypeDefinitionNode; + ScalarTypeDefinition: ScalarTypeDefinitionNode; + ObjectTypeDefinition: ObjectTypeDefinitionNode; + FieldDefinition: FieldDefinitionNode; + InputValueDefinition: InputValueDefinitionNode; + InterfaceTypeDefinition: InterfaceTypeDefinitionNode; + UnionTypeDefinition: UnionTypeDefinitionNode; + EnumTypeDefinition: EnumTypeDefinitionNode; + EnumValueDefinition: EnumValueDefinitionNode; + InputObjectTypeDefinition: InputObjectTypeDefinitionNode; + ScalarTypeExtension: ScalarTypeExtensionNode; + ObjectTypeExtension: ObjectTypeExtensionNode; + InterfaceTypeExtension: InterfaceTypeExtensionNode; + UnionTypeExtension: UnionTypeExtensionNode; + EnumTypeExtension: EnumTypeExtensionNode; + InputObjectTypeExtension: InputObjectTypeExtensionNode; + DirectiveDefinition: DirectiveDefinitionNode; } // Name export interface NameNode { - kind: 'Name'; - loc?: Location; - value: string; + kind: 'Name'; + loc?: Location; + value: string; } // Document export interface DocumentNode { - kind: 'Document'; - loc?: Location; - definitions: DefinitionNode[]; + kind: 'Document'; + loc?: Location; + definitions: DefinitionNode[]; } export type DefinitionNode = @@ -223,300 +223,294 @@ export type ExecutableDefinitionNode = | FragmentDefinitionNode; export interface OperationDefinitionNode { - kind: 'OperationDefinition'; - loc?: Location; - operation: OperationTypeNode; - name?: NameNode; - variableDefinitions?: VariableDefinitionNode[]; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + kind: 'OperationDefinition'; + loc?: Location; + operation: OperationTypeNode; + name?: NameNode; + variableDefinitions?: VariableDefinitionNode[]; + directives?: DirectiveNode[]; + selectionSet: SelectionSetNode; } // Note: subscription is an experimental non-spec addition. export type OperationTypeNode = 'query' | 'mutation' | 'subscription'; export interface VariableDefinitionNode { - kind: 'VariableDefinition'; - loc?: Location; - variable: VariableNode; - type: TypeNode; - defaultValue?: ValueNode; + kind: 'VariableDefinition'; + loc?: Location; + variable: VariableNode; + type: TypeNode; + defaultValue?: ValueNode; } export interface VariableNode { - kind: 'Variable'; - loc?: Location; - name: NameNode; + kind: 'Variable'; + loc?: Location; + name: NameNode; } export interface SelectionSetNode { - kind: 'SelectionSet'; - loc?: Location; - selections: SelectionNode[]; + kind: 'SelectionSet'; + loc?: Location; + selections: SelectionNode[]; } -export type SelectionNode = - | FieldNode - | FragmentSpreadNode - | InlineFragmentNode; +export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; export interface FieldNode { - kind: 'Field'; - loc?: Location; - alias?: NameNode; - name: NameNode; - arguments?: ArgumentNode[]; - directives?: DirectiveNode[]; - selectionSet?: SelectionSetNode; + kind: 'Field'; + loc?: Location; + alias?: NameNode; + name: NameNode; + arguments?: ArgumentNode[]; + directives?: DirectiveNode[]; + selectionSet?: SelectionSetNode; } export interface ArgumentNode { - kind: 'Argument'; - loc?: Location; - name: NameNode; - value: ValueNode; + kind: 'Argument'; + loc?: Location; + name: NameNode; + value: ValueNode; } // Fragments export interface FragmentSpreadNode { - kind: 'FragmentSpread'; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; + kind: 'FragmentSpread'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; } export interface InlineFragmentNode { - kind: 'InlineFragment'; - loc?: Location; - typeCondition?: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + kind: 'InlineFragment'; + loc?: Location; + typeCondition?: NamedTypeNode; + directives?: DirectiveNode[]; + selectionSet: SelectionSetNode; } export interface FragmentDefinitionNode { - kind: 'FragmentDefinition'; - loc?: Location; - name: NameNode; - // Note: fragment variable definitions are experimental and may be changed - // or removed in the future. - variableDefinitions?: VariableDefinitionNode[]; - typeCondition: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + kind: 'FragmentDefinition'; + loc?: Location; + name: NameNode; + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + variableDefinitions?: VariableDefinitionNode[]; + typeCondition: NamedTypeNode; + directives?: DirectiveNode[]; + selectionSet: SelectionSetNode; } // Values export type ValueNode = - | VariableNode - | IntValueNode - | FloatValueNode - | StringValueNode - | BooleanValueNode - | NullValueNode - | EnumValueNode - | ListValueNode - | ObjectValueNode; + | VariableNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode; export interface IntValueNode { - kind: 'IntValue'; - loc?: Location; - value: string; + kind: 'IntValue'; + loc?: Location; + value: string; } export interface FloatValueNode { - kind: 'FloatValue'; - loc?: Location; - value: string; + kind: 'FloatValue'; + loc?: Location; + value: string; } export interface StringValueNode { - kind: 'StringValue'; - loc?: Location; - value: string; + kind: 'StringValue'; + loc?: Location; + value: string; } export interface BooleanValueNode { - kind: 'BooleanValue'; - loc?: Location; - value: boolean; + kind: 'BooleanValue'; + loc?: Location; + value: boolean; } export interface NullValueNode { - kind: 'NullValue'; - loc?: Location; + kind: 'NullValue'; + loc?: Location; } export interface EnumValueNode { - kind: 'EnumValue'; - loc?: Location; - value: string; + kind: 'EnumValue'; + loc?: Location; + value: string; } export interface ListValueNode { - kind: 'ListValue'; - loc?: Location; - values: ValueNode[]; + kind: 'ListValue'; + loc?: Location; + values: ValueNode[]; } export interface ObjectValueNode { - kind: 'ObjectValue'; - loc?: Location; - fields: ObjectFieldNode[]; + kind: 'ObjectValue'; + loc?: Location; + fields: ObjectFieldNode[]; } export interface ObjectFieldNode { - kind: 'ObjectField'; - loc?: Location; - name: NameNode; - value: ValueNode; + kind: 'ObjectField'; + loc?: Location; + name: NameNode; + value: ValueNode; } // Directives export interface DirectiveNode { - kind: 'Directive'; - loc?: Location; - name: NameNode; - arguments?: ArgumentNode[]; + kind: 'Directive'; + loc?: Location; + name: NameNode; + arguments?: ArgumentNode[]; } // Type Reference -export type TypeNode = - | NamedTypeNode - | ListTypeNode - | NonNullTypeNode; +export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; export interface NamedTypeNode { - kind: 'NamedType'; - loc?: Location; - name: NameNode; + kind: 'NamedType'; + loc?: Location; + name: NameNode; } export interface ListTypeNode { - kind: 'ListType'; - loc?: Location; - type: TypeNode; + kind: 'ListType'; + loc?: Location; + type: TypeNode; } export interface NonNullTypeNode { - kind: 'NonNullType'; - loc?: Location; - type: NamedTypeNode | ListTypeNode; + kind: 'NonNullType'; + loc?: Location; + type: NamedTypeNode | ListTypeNode; } // Type System Definition export type TypeSystemDefinitionNode = - | SchemaDefinitionNode - | TypeDefinitionNode - | TypeExtensionNode - | DirectiveDefinitionNode; + | SchemaDefinitionNode + | TypeDefinitionNode + | TypeExtensionNode + | DirectiveDefinitionNode; export interface SchemaDefinitionNode { - kind: 'SchemaDefinition'; - loc?: Location; - directives: DirectiveNode[]; - operationTypes: OperationTypeDefinitionNode[]; + kind: 'SchemaDefinition'; + loc?: Location; + directives: DirectiveNode[]; + operationTypes: OperationTypeDefinitionNode[]; } export interface OperationTypeDefinitionNode { - kind: 'OperationTypeDefinition'; - loc?: Location; - operation: OperationTypeNode; - type: NamedTypeNode; + kind: 'OperationTypeDefinition'; + loc?: Location; + operation: OperationTypeNode; + type: NamedTypeNode; } export type TypeDefinitionNode = - | ScalarTypeDefinitionNode - | ObjectTypeDefinitionNode - | InterfaceTypeDefinitionNode - | UnionTypeDefinitionNode - | EnumTypeDefinitionNode - | InputObjectTypeDefinitionNode; + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | InputObjectTypeDefinitionNode; export interface ScalarTypeDefinitionNode { - kind: 'ScalarTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; + kind: 'ScalarTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; } export interface ObjectTypeDefinitionNode { - kind: 'ObjectTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - interfaces?: NamedTypeNode[]; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + kind: 'ObjectTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + interfaces?: NamedTypeNode[]; + directives?: DirectiveNode[]; + fields: FieldDefinitionNode[]; } export interface FieldDefinitionNode { - kind: 'FieldDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - arguments: InputValueDefinitionNode[]; - type: TypeNode; - directives?: DirectiveNode[]; + kind: 'FieldDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + arguments: InputValueDefinitionNode[]; + type: TypeNode; + directives?: DirectiveNode[]; } export interface InputValueDefinitionNode { - kind: 'InputValueDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - type: TypeNode; - defaultValue?: ValueNode; - directives?: DirectiveNode[]; + kind: 'InputValueDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + type: TypeNode; + defaultValue?: ValueNode; + directives?: DirectiveNode[]; } export interface InterfaceTypeDefinitionNode { - kind: 'InterfaceTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + kind: 'InterfaceTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + fields: FieldDefinitionNode[]; } export interface UnionTypeDefinitionNode { - kind: 'UnionTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - types: NamedTypeNode[]; + kind: 'UnionTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + types: NamedTypeNode[]; } export interface EnumTypeDefinitionNode { - kind: 'EnumTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - values: EnumValueDefinitionNode[]; + kind: 'EnumTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + values: EnumValueDefinitionNode[]; } export interface EnumValueDefinitionNode { - kind: 'EnumValueDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; + kind: 'EnumValueDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; } export interface InputObjectTypeDefinitionNode { - kind: 'InputObjectTypeDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - fields: InputValueDefinitionNode[]; + kind: 'InputObjectTypeDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + directives?: DirectiveNode[]; + fields: InputValueDefinitionNode[]; } export type TypeExtensionNode = @@ -528,60 +522,60 @@ export type TypeExtensionNode = | InputObjectTypeExtensionNode; export type ScalarTypeExtensionNode = { - kind: 'ScalarTypeExtension', - loc?: Location, - name: NameNode, - directives?: DirectiveNode[], + kind: 'ScalarTypeExtension'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; }; export type ObjectTypeExtensionNode = { - kind: 'ObjectTypeExtension', - loc?: Location, - name: NameNode, - interfaces?: NamedTypeNode[], - directives?: DirectiveNode[], - fields?: FieldDefinitionNode[], + kind: 'ObjectTypeExtension'; + loc?: Location; + name: NameNode; + interfaces?: NamedTypeNode[]; + directives?: DirectiveNode[]; + fields?: FieldDefinitionNode[]; }; export type InterfaceTypeExtensionNode = { - kind: 'InterfaceTypeExtension', - loc?: Location, - name: NameNode, - directives?: DirectiveNode[], - fields?: FieldDefinitionNode[], + kind: 'InterfaceTypeExtension'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + fields?: FieldDefinitionNode[]; }; export type UnionTypeExtensionNode = { - kind: 'UnionTypeExtension', - loc?: Location, - name: NameNode, - directives?: DirectiveNode[], - types?: NamedTypeNode[], + kind: 'UnionTypeExtension'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + types?: NamedTypeNode[]; }; export type EnumTypeExtensionNode = { - kind: 'EnumTypeExtension', - loc?: Location, - name: NameNode, - directives?: DirectiveNode[], - values?: EnumValueDefinitionNode[], + kind: 'EnumTypeExtension'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + values?: EnumValueDefinitionNode[]; }; export type InputObjectTypeExtensionNode = { - kind: 'InputObjectTypeExtension', - loc?: Location, - name: NameNode, - directives?: DirectiveNode[], - fields?: InputValueDefinitionNode[], + kind: 'InputObjectTypeExtension'; + loc?: Location; + name: NameNode; + directives?: DirectiveNode[]; + fields?: InputValueDefinitionNode[]; }; // Directive Definitions export interface DirectiveDefinitionNode { - kind: 'DirectiveDefinition'; - loc?: Location; - description?: StringValueNode; - name: NameNode; - arguments?: InputValueDefinitionNode[]; - locations: NameNode[]; + kind: 'DirectiveDefinition'; + loc?: Location; + description?: StringValueNode; + name: NameNode; + arguments?: InputValueDefinitionNode[]; + locations: NameNode[]; } diff --git a/types/graphql/language/index.d.ts b/types/graphql/language/index.d.ts index bc00bb243d..c8fe4b13ec 100644 --- a/types/graphql/language/index.d.ts +++ b/types/graphql/language/index.d.ts @@ -7,9 +7,9 @@ export { parse, parseValue, parseType, ParseOptions } from './parser'; export { print } from './printer'; export { Source } from './source'; export { - visit, - visitInParallel, - visitWithTypeInfo, - getVisitFn, - BREAK + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + BREAK, } from './visitor'; diff --git a/types/graphql/language/lexer.d.ts b/types/graphql/language/lexer.d.ts index 4a55f03dc2..0db85434e2 100644 --- a/types/graphql/language/lexer.d.ts +++ b/types/graphql/language/lexer.d.ts @@ -11,41 +11,41 @@ import { syntaxError } from '../error'; * whenever called. */ export function createLexer( - source: Source, - options: TOptions + source: Source, + options: TOptions, ): Lexer; /** * The return type of createLexer. */ export interface Lexer { - source: Source; - options: TOptions; + source: Source; + options: TOptions; - /** - * The previously focused non-ignored token. - */ - lastToken: Token; + /** + * The previously focused non-ignored token. + */ + lastToken: Token; - /** - * The currently focused non-ignored token. - */ - token: Token; + /** + * The currently focused non-ignored token. + */ + token: Token; - /** - * The (1-indexed) line containing the current token. - */ - line: number; + /** + * The (1-indexed) line containing the current token. + */ + line: number; - /** - * The character offset at which the current line begins. - */ - lineStart: number; + /** + * The character offset at which the current line begins. + */ + lineStart: number; - /** - * Advances the token stream to the next non-ignored token. - */ - advance(): Token; + /** + * Advances the token stream to the next non-ignored token. + */ + advance(): Token; } /** @@ -53,26 +53,26 @@ export interface Lexer { * lexer emits. */ export const TokenKind: { - SOF: '' - EOF: '' - BANG: '!' - DOLLAR: '$' - PAREN_L: '(' - PAREN_R: ')' - SPREAD: '...' - COLON: ':' - EQUALS: '=' - AT: '@' - BRACKET_L: '[' - BRACKET_R: ']' - BRACE_L: '{' - PIPE: '|' - BRACE_R: '}' - NAME: 'Name' - INT: 'Int' - FLOAT: 'Float' - STRING: 'String' - COMMENT: 'Comment' + SOF: ''; + EOF: ''; + BANG: '!'; + DOLLAR: '$'; + PAREN_L: '('; + PAREN_R: ')'; + SPREAD: '...'; + COLON: ':'; + EQUALS: '='; + AT: '@'; + BRACKET_L: '['; + BRACKET_R: ']'; + BRACE_L: '{'; + PIPE: '|'; + BRACE_R: '}'; + NAME: 'Name'; + INT: 'Int'; + FLOAT: 'Float'; + STRING: 'String'; + COMMENT: 'Comment'; }; /** diff --git a/types/graphql/language/location.d.ts b/types/graphql/language/location.d.ts index 4d7a13e314..cb9744e0d5 100644 --- a/types/graphql/language/location.d.ts +++ b/types/graphql/language/location.d.ts @@ -1,8 +1,8 @@ -import { Source } from "./source"; +import { Source } from './source'; export interface SourceLocation { - line: number; - column: number; + line: number; + column: number; } export function getLocation(source: Source, position: number): SourceLocation; diff --git a/types/graphql/language/parser.d.ts b/types/graphql/language/parser.d.ts index 5aa195ddd4..a0b8a0c7a4 100644 --- a/types/graphql/language/parser.d.ts +++ b/types/graphql/language/parser.d.ts @@ -1,17 +1,17 @@ -import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from "./ast"; -import { Source } from "./source"; -import { Lexer } from "./lexer"; +import { NamedTypeNode, TypeNode, ValueNode, DocumentNode } from './ast'; +import { Source } from './source'; +import { Lexer } from './lexer'; /** * Configuration options to control parser behavior */ export interface ParseOptions { - /** - * By default, the parser creates AST nodes that know the location - * in the source that they correspond to. This configuration flag - * disables that behavior for performance or testing. - */ - noLocation?: boolean; + /** + * By default, the parser creates AST nodes that know the location + * in the source that they correspond to. This configuration flag + * disables that behavior for performance or testing. + */ + noLocation?: boolean; } /** @@ -19,8 +19,8 @@ export interface ParseOptions { * Throws GraphQLError if a syntax error is encountered. */ export function parse( - source: string | Source, - options?: ParseOptions + source: string | Source, + options?: ParseOptions, ): DocumentNode; /** @@ -31,8 +31,8 @@ export function parse( * in isolation of complete GraphQL documents. */ export function parseValue( - source: Source | string, - options?: ParseOptions + source: Source | string, + options?: ParseOptions, ): ValueNode; export function parseConstValue(lexer: Lexer): ValueNode; diff --git a/types/graphql/language/source.d.ts b/types/graphql/language/source.d.ts index 80e68f5557..236028b7df 100644 --- a/types/graphql/language/source.d.ts +++ b/types/graphql/language/source.d.ts @@ -1,5 +1,5 @@ export class Source { - body: string; - name: string; - constructor(body: string, name?: string); + body: string; + name: string; + constructor(body: string, name?: string); } diff --git a/types/graphql/language/visitor.d.ts b/types/graphql/language/visitor.d.ts index dc8bcc2692..e7e9d67da0 100644 --- a/types/graphql/language/visitor.d.ts +++ b/types/graphql/language/visitor.d.ts @@ -1,43 +1,43 @@ export const QueryDocumentKeys: { - Name: any[]; - Document: string[]; - OperationDefinition: string[]; - VariableDefinition: string[]; - Variable: string[]; - SelectionSet: string[]; - Field: string[]; - Argument: string[]; + Name: any[]; + Document: string[]; + OperationDefinition: string[]; + VariableDefinition: string[]; + Variable: string[]; + SelectionSet: string[]; + Field: string[]; + Argument: string[]; - FragmentSpread: string[]; - InlineFragment: string[]; - FragmentDefinition: string[]; + FragmentSpread: string[]; + InlineFragment: string[]; + FragmentDefinition: string[]; - IntValue: number[]; - FloatValue: number[]; - StringValue: string[]; - BooleanValue: boolean[]; - NullValue: null[], - EnumValue: any[]; - ListValue: string[]; - ObjectValue: string[]; - ObjectField: string[]; + IntValue: number[]; + FloatValue: number[]; + StringValue: string[]; + BooleanValue: boolean[]; + NullValue: null[]; + EnumValue: any[]; + ListValue: string[]; + ObjectValue: string[]; + ObjectField: string[]; - Directive: string[]; + Directive: string[]; - NamedType: string[]; - ListType: string[]; - NonNullType: string[]; + NamedType: string[]; + ListType: string[]; + NonNullType: string[]; - ObjectTypeDefinition: string[]; - FieldDefinition: string[]; - InputValueDefinition: string[]; - InterfaceTypeDefinition: string[]; - UnionTypeDefinition: string[]; - ScalarTypeDefinition: string[]; - EnumTypeDefinition: string[]; - EnumValueDefinition: string[]; - InputObjectTypeDefinition: string[]; - TypeExtensionDefinition: string[]; + ObjectTypeDefinition: string[]; + FieldDefinition: string[]; + InputValueDefinition: string[]; + InterfaceTypeDefinition: string[]; + UnionTypeDefinition: string[]; + ScalarTypeDefinition: string[]; + EnumTypeDefinition: string[]; + EnumValueDefinition: string[]; + InputObjectTypeDefinition: string[]; + TypeExtensionDefinition: string[]; }; export const BREAK: any; diff --git a/types/graphql/subscription/subscribe.d.ts b/types/graphql/subscription/subscribe.d.ts index 30efc010ec..dc2c096b86 100644 --- a/types/graphql/subscription/subscribe.d.ts +++ b/types/graphql/subscription/subscribe.d.ts @@ -4,26 +4,26 @@ import { GraphQLFieldResolver } from '../type/definition'; import { ExecutionResult } from '../execution/execute'; export function subscribe( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, - subscribeFieldResolver?: GraphQLFieldResolver + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { + [key: string]: any; + }, + operationName?: string, + fieldResolver?: GraphQLFieldResolver, + subscribeFieldResolver?: GraphQLFieldResolver, ): Promise | ExecutionResult>; export function createSourceEventStream( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: any, + contextValue?: any, + variableValues?: { + [key: string]: any; + }, + operationName?: string, + fieldResolver?: GraphQLFieldResolver, ): Promise>; diff --git a/types/graphql/tsconfig.json b/types/graphql/tsconfig.json index 72f0de0665..29525d3350 100644 --- a/types/graphql/tsconfig.json +++ b/types/graphql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index ed39a51db6..098f7376ef 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -1,18 +1,18 @@ import { - ScalarTypeDefinitionNode, - ObjectTypeDefinitionNode, - FieldDefinitionNode, - InputValueDefinitionNode, - InterfaceTypeDefinitionNode, - UnionTypeDefinitionNode, - EnumTypeDefinitionNode, - EnumValueDefinitionNode, - InputObjectTypeDefinitionNode, - TypeExtensionNode, - OperationDefinitionNode, - FieldNode, - FragmentDefinitionNode, - ValueNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + TypeExtensionNode, + OperationDefinitionNode, + FieldNode, + FragmentDefinitionNode, + ValueNode, } from '../language/ast'; import { GraphQLSchema } from './schema'; @@ -20,14 +20,14 @@ import { GraphQLSchema } from './schema'; * These are all of the possible kinds of types. */ export type GraphQLType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - | GraphQLNonNull; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull; export function isType(type: any): type is GraphQLType; @@ -37,15 +37,16 @@ export function assertType(type: any): GraphQLType; * These types may be used as input types for arguments and directives. */ export type GraphQLInputType = - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList>; + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + >; export function isInputType(type: GraphQLType): type is GraphQLInputType; @@ -55,19 +56,20 @@ export function assertInputType(type: GraphQLType): GraphQLInputType; * These types may be used as output types as the result of fields. */ export type GraphQLOutputType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLList>; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + >; export function isOutputType(type: GraphQLType): type is GraphQLOutputType; @@ -76,9 +78,7 @@ export function assertOutputType(type: GraphQLType): GraphQLOutputType; /** * These types may describe types which may be leaf values. */ -export type GraphQLLeafType = - | GraphQLScalarType - | GraphQLEnumType; +export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType; export function isLeafType(type: GraphQLType): type is GraphQLLeafType; @@ -88,20 +88,20 @@ export function assertLeafType(type: GraphQLType): GraphQLLeafType; * These types may describe the parent context of a selection set. */ export type GraphQLCompositeType = - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType; + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType; -export function isCompositeType(type: GraphQLType): type is GraphQLCompositeType; +export function isCompositeType( + type: GraphQLType, +): type is GraphQLCompositeType; export function assertCompositeType(type: GraphQLType): GraphQLCompositeType; /** * These types may describe the parent context of a selection set. */ -export type GraphQLAbstractType = - | GraphQLInterfaceType - | GraphQLUnionType; +export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType; export function isAbstractType(type: GraphQLType): type is GraphQLAbstractType; @@ -111,28 +111,28 @@ export function assertAbstractType(type: GraphQLType): GraphQLAbstractType; * These types can all accept null as a value. */ export type GraphQLNullableType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList; export function getNullableType( - type: T -): (T & GraphQLNullableType); + type: T, +): T & GraphQLNullableType; /** * These named types do not include modifiers like List or NonNull. */ export type GraphQLNamedType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType; + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType; export function isNamedType(type: GraphQLType): boolean; @@ -164,30 +164,30 @@ export type Thunk = (() => T) | T; * */ export class GraphQLScalarType { - name: string; - description: string; - astNode?: ScalarTypeDefinitionNode; - constructor(config: GraphQLScalarTypeConfig); + name: string; + description: string; + astNode?: ScalarTypeDefinitionNode; + constructor(config: GraphQLScalarTypeConfig); - // Serializes an internal value to include in a response. - serialize(value: any): any; + // Serializes an internal value to include in a response. + serialize(value: any): any; - // Parses an externally provided value to use as an input. - parseValue(value: any): any; + // Parses an externally provided value to use as an input. + parseValue(value: any): any; - // Parses an externally provided literal value to use as an input. - parseLiteral(valueNode: ValueNode): any; + // Parses an externally provided literal value to use as an input. + parseLiteral(valueNode: ValueNode): any; - toString(): string; + toString(): string; } export interface GraphQLScalarTypeConfig { - name: string; - description?: string; - astNode?: ScalarTypeDefinitionNode; - serialize(value: any): TExternal | null | undefined; - parseValue?(value: any): TInternal | null | undefined; - parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; + name: string; + description?: string; + astNode?: ScalarTypeDefinitionNode; + serialize(value: any): TExternal | null | undefined; + parseValue?(value: any): TInternal | null | undefined; + parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; } /** @@ -228,109 +228,123 @@ export interface GraphQLScalarTypeConfig { * */ export class GraphQLObjectType { - name: string; - description: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes: Array; - isTypeOf: GraphQLIsTypeOfFn; + name: string; + description: string; + astNode?: ObjectTypeDefinitionNode; + extensionASTNodes: Array; + isTypeOf: GraphQLIsTypeOfFn; - constructor(config: GraphQLObjectTypeConfig); - getFields(): GraphQLFieldMap; - getInterfaces(): GraphQLInterfaceType[]; - toString(): string; + constructor(config: GraphQLObjectTypeConfig); + getFields(): GraphQLFieldMap; + getInterfaces(): GraphQLInterfaceType[]; + toString(): string; } export interface GraphQLObjectTypeConfig { - name: string; - interfaces?: Thunk; - fields: Thunk>; - isTypeOf?: GraphQLIsTypeOfFn; - description?: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes?: Array; + name: string; + interfaces?: Thunk; + fields: Thunk>; + isTypeOf?: GraphQLIsTypeOfFn; + description?: string; + astNode?: ObjectTypeDefinitionNode; + extensionASTNodes?: Array; } export type GraphQLTypeResolver = ( - value: TSource, - context: TContext, - info: GraphQLResolveInfo + value: TSource, + context: TContext, + info: GraphQLResolveInfo, ) => GraphQLObjectType | string | Promise; export type GraphQLIsTypeOfFn = ( - source: TSource, - context: TContext, - info: GraphQLResolveInfo + source: TSource, + context: TContext, + info: GraphQLResolveInfo, ) => boolean | Promise; -export type GraphQLFieldResolver = ( - source: TSource, - args: TArgs, - context: TContext, - info: GraphQLResolveInfo +export type GraphQLFieldResolver< + TSource, + TContext, + TArgs = { [argName: string]: any } +> = ( + source: TSource, + args: TArgs, + context: TContext, + info: GraphQLResolveInfo, ) => any; export interface GraphQLResolveInfo { - fieldName: string; - fieldNodes: FieldNode[]; - returnType: GraphQLOutputType; - parentType: GraphQLCompositeType; - path: ResponsePath; - schema: GraphQLSchema; - fragments: { [fragmentName: string]: FragmentDefinitionNode }; - rootValue: any; - operation: OperationDefinitionNode; - variableValues: { [variableName: string]: any }; + fieldName: string; + fieldNodes: FieldNode[]; + returnType: GraphQLOutputType; + parentType: GraphQLCompositeType; + path: ResponsePath; + schema: GraphQLSchema; + fragments: { [fragmentName: string]: FragmentDefinitionNode }; + rootValue: any; + operation: OperationDefinitionNode; + variableValues: { [variableName: string]: any }; } -export type ResponsePath = { prev: ResponsePath, key: string | number } | undefined; +export type ResponsePath = + | { prev: ResponsePath; key: string | number } + | undefined; -export interface GraphQLFieldConfig { - type: GraphQLOutputType; - args?: GraphQLFieldConfigArgumentMap; - resolve?: GraphQLFieldResolver; - subscribe?: GraphQLFieldResolver; - deprecationReason?: string; - description?: string; - astNode?: FieldDefinitionNode; +export interface GraphQLFieldConfig< + TSource, + TContext, + TArgs = { [argName: string]: any } +> { + type: GraphQLOutputType; + args?: GraphQLFieldConfigArgumentMap; + resolve?: GraphQLFieldResolver; + subscribe?: GraphQLFieldResolver; + deprecationReason?: string; + description?: string; + astNode?: FieldDefinitionNode; } export interface GraphQLFieldConfigArgumentMap { - [argName: string]: GraphQLArgumentConfig; + [argName: string]: GraphQLArgumentConfig; } export interface GraphQLArgumentConfig { - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLFieldConfigMap { - [fieldName: string]: GraphQLFieldConfig; + [fieldName: string]: GraphQLFieldConfig; } -export interface GraphQLField { - name: string; - description: string; - type: GraphQLOutputType; - args: GraphQLArgument[]; - resolve?: GraphQLFieldResolver; - subscribe?: GraphQLFieldResolver; - isDeprecated?: boolean; - deprecationReason?: string; - astNode?: FieldDefinitionNode; +export interface GraphQLField< + TSource, + TContext, + TArgs = { [argName: string]: any } +> { + name: string; + description: string; + type: GraphQLOutputType; + args: GraphQLArgument[]; + resolve?: GraphQLFieldResolver; + subscribe?: GraphQLFieldResolver; + isDeprecated?: boolean; + deprecationReason?: string; + astNode?: FieldDefinitionNode; } export interface GraphQLArgument { - name: string; - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + name: string; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLFieldMap { - [fieldName: string]: GraphQLField; + [fieldName: string]: GraphQLField; } /** @@ -352,29 +366,29 @@ export interface GraphQLFieldMap { * */ export class GraphQLInterfaceType { - name: string; - description: string; - astNode?: InterfaceTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + name: string; + description: string; + astNode?: InterfaceTypeDefinitionNode; + resolveType: GraphQLTypeResolver; - constructor(config: GraphQLInterfaceTypeConfig); + constructor(config: GraphQLInterfaceTypeConfig); - getFields(): GraphQLFieldMap; + getFields(): GraphQLFieldMap; - toString(): string; + toString(): string; } export interface GraphQLInterfaceTypeConfig { - name: string; - fields: Thunk>; - /** - * Optionally provide a custom type resolver function. If one is not provided, - * the default implementation will call `isTypeOf` on each implementing - * Object type. - */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: InterfaceTypeDefinitionNode; + name: string; + fields: Thunk>; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: GraphQLTypeResolver; + description?: string; + astNode?: InterfaceTypeDefinitionNode; } /** @@ -401,29 +415,29 @@ export interface GraphQLInterfaceTypeConfig { * */ export class GraphQLUnionType { - name: string; - description: string; - astNode?: UnionTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + name: string; + description: string; + astNode?: UnionTypeDefinitionNode; + resolveType: GraphQLTypeResolver; - constructor(config: GraphQLUnionTypeConfig); + constructor(config: GraphQLUnionTypeConfig); - getTypes(): GraphQLObjectType[]; + getTypes(): GraphQLObjectType[]; - toString(): string; + toString(): string; } export interface GraphQLUnionTypeConfig { - name: string; - types: Thunk; - /** - * Optionally provide a custom type resolver function. If one is not provided, - * the default implementation will call `isTypeOf` on each implementing - * Object type. - */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: UnionTypeDefinitionNode; + name: string; + types: Thunk; + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: GraphQLTypeResolver; + description?: string; + astNode?: UnionTypeDefinitionNode; } /** @@ -448,45 +462,45 @@ export interface GraphQLUnionTypeConfig { * will be used as its internal value. */ export class GraphQLEnumType { - name: string; - description: string; - astNode?: EnumTypeDefinitionNode; + name: string; + description: string; + astNode?: EnumTypeDefinitionNode; - constructor(config: GraphQLEnumTypeConfig); - getValues(): GraphQLEnumValue[]; - getValue(name: string): GraphQLEnumValue; - isValidValue(value: any): boolean; - serialize(value: any): string; - parseValue(value: any): any; - parseLiteral(valueNode: ValueNode): any; - toString(): string; + constructor(config: GraphQLEnumTypeConfig); + getValues(): GraphQLEnumValue[]; + getValue(name: string): GraphQLEnumValue; + isValidValue(value: any): boolean; + serialize(value: any): string; + parseValue(value: any): any; + parseLiteral(valueNode: ValueNode): any; + toString(): string; } export interface GraphQLEnumTypeConfig { - name: string; - values: GraphQLEnumValueConfigMap; - description?: string; - astNode?: EnumTypeDefinitionNode; + name: string; + values: GraphQLEnumValueConfigMap; + description?: string; + astNode?: EnumTypeDefinitionNode; } export interface GraphQLEnumValueConfigMap { - [valueName: string]: GraphQLEnumValueConfig; + [valueName: string]: GraphQLEnumValueConfig; } export interface GraphQLEnumValueConfig { - value?: any; - deprecationReason?: string; - description?: string; - astNode?: EnumValueDefinitionNode; + value?: any; + deprecationReason?: string; + description?: string; + astNode?: EnumValueDefinitionNode; } export interface GraphQLEnumValue { - name: string; - description: string; - isDeprecated?: boolean; - deprecationReason: string; - astNode?: EnumValueDefinitionNode; - value: any; + name: string; + description: string; + isDeprecated?: boolean; + deprecationReason: string; + astNode?: EnumValueDefinitionNode; + value: any; } /** @@ -510,42 +524,42 @@ export interface GraphQLEnumValue { * */ export class GraphQLInputObjectType { - name: string; - description: string; - astNode?: InputObjectTypeDefinitionNode; - constructor(config: GraphQLInputObjectTypeConfig); - getFields(): GraphQLInputFieldMap; - toString(): string; + name: string; + description: string; + astNode?: InputObjectTypeDefinitionNode; + constructor(config: GraphQLInputObjectTypeConfig); + getFields(): GraphQLInputFieldMap; + toString(): string; } export interface GraphQLInputObjectTypeConfig { - name: string; - fields: Thunk; - description?: string; - astNode?: InputObjectTypeDefinitionNode; + name: string; + fields: Thunk; + description?: string; + astNode?: InputObjectTypeDefinitionNode; } export interface GraphQLInputFieldConfig { - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLInputFieldConfigMap { - [fieldName: string]: GraphQLInputFieldConfig; + [fieldName: string]: GraphQLInputFieldConfig; } export interface GraphQLInputField { - name: string; - type: GraphQLInputType; - defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + name: string; + type: GraphQLInputType; + defaultValue?: any; + description?: string; + astNode?: InputValueDefinitionNode; } export interface GraphQLInputFieldMap { - [fieldName: string]: GraphQLInputField; + [fieldName: string]: GraphQLInputField; } /** @@ -567,9 +581,9 @@ export interface GraphQLInputFieldMap { * */ export class GraphQLList { - ofType: T; - constructor(type: T); - toString(): string; + ofType: T; + constructor(type: T); + toString(): string; } /** @@ -593,9 +607,9 @@ export class GraphQLList { * Note: the enforcement of non-nullability occurs within the executor. */ export class GraphQLNonNull { - ofType: T; + ofType: T; - constructor(type: T); + constructor(type: T); - toString(): string; + toString(): string; } diff --git a/types/graphql/type/directives.d.ts b/types/graphql/type/directives.d.ts index 81befa9eba..b6962bc4ae 100644 --- a/types/graphql/type/directives.d.ts +++ b/types/graphql/type/directives.d.ts @@ -1,30 +1,27 @@ -import { - GraphQLFieldConfigArgumentMap, - GraphQLArgument -} from './definition'; +import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from './definition'; import { DirectiveDefinitionNode } from '../language/ast'; export const DirectiveLocation: { - // Operations - QUERY: 'QUERY', - MUTATION: 'MUTATION', - SUBSCRIPTION: 'SUBSCRIPTION', - FIELD: 'FIELD', - FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION', - FRAGMENT_SPREAD: 'FRAGMENT_SPREAD', - INLINE_FRAGMENT: 'INLINE_FRAGMENT', - // Schema Definitions - SCHEMA: 'SCHEMA', - SCALAR: 'SCALAR', - OBJECT: 'OBJECT', - FIELD_DEFINITION: 'FIELD_DEFINITION', - ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION', - INTERFACE: 'INTERFACE', - UNION: 'UNION', - ENUM: 'ENUM', - ENUM_VALUE: 'ENUM_VALUE', - INPUT_OBJECT: 'INPUT_OBJECT', - INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION', + // Operations + QUERY: 'QUERY'; + MUTATION: 'MUTATION'; + SUBSCRIPTION: 'SUBSCRIPTION'; + FIELD: 'FIELD'; + FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION'; + FRAGMENT_SPREAD: 'FRAGMENT_SPREAD'; + INLINE_FRAGMENT: 'INLINE_FRAGMENT'; + // Schema Definitions + SCHEMA: 'SCHEMA'; + SCALAR: 'SCALAR'; + OBJECT: 'OBJECT'; + FIELD_DEFINITION: 'FIELD_DEFINITION'; + ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION'; + INTERFACE: 'INTERFACE'; + UNION: 'UNION'; + ENUM: 'ENUM'; + ENUM_VALUE: 'ENUM_VALUE'; + INPUT_OBJECT: 'INPUT_OBJECT'; + INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'; }; export type DirectiveLocationEnum = keyof typeof DirectiveLocation; @@ -34,21 +31,21 @@ export type DirectiveLocationEnum = keyof typeof DirectiveLocation; * behavior. Type system creators will usually not create these directly. */ export class GraphQLDirective { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args: GraphQLArgument[]; - astNode?: DirectiveDefinitionNode; + name: string; + description?: string; + locations: DirectiveLocationEnum[]; + args: GraphQLArgument[]; + astNode?: DirectiveDefinitionNode; - constructor(config: GraphQLDirectiveConfig); + constructor(config: GraphQLDirectiveConfig); } export interface GraphQLDirectiveConfig { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args?: GraphQLFieldConfigArgumentMap; - astNode?: DirectiveDefinitionNode; + name: string; + description?: string; + locations: DirectiveLocationEnum[]; + args?: GraphQLFieldConfigArgumentMap; + astNode?: DirectiveDefinitionNode; } /** diff --git a/types/graphql/type/index.d.ts b/types/graphql/type/index.d.ts index ae7a81e621..5fdfb1190a 100644 --- a/types/graphql/type/index.d.ts +++ b/types/graphql/type/index.d.ts @@ -4,49 +4,44 @@ export { GraphQLSchema } from './schema'; export * from './definition'; export { - // "Enum" of Directive Locations - DirectiveLocation, - - // Directives Definition - GraphQLDirective, - - // Built-in Directives defined by the Spec - specifiedDirectives, - GraphQLIncludeDirective, - GraphQLSkipDirective, - GraphQLDeprecatedDirective, - - // Constant Deprecation Reason - DEFAULT_DEPRECATION_REASON, + // "Enum" of Directive Locations + DirectiveLocation, + // Directives Definition + GraphQLDirective, + // Built-in Directives defined by the Spec + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, } from './directives'; // Common built-in scalar instances. export { - GraphQLInt, - GraphQLFloat, - GraphQLString, - GraphQLBoolean, - GraphQLID, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, } from './scalars'; export { - // "Enum" of Type Kinds - TypeKind, - - // GraphQL Types for introspection. - __Schema, - __Directive, - __DirectiveLocation, - __Type, - __Field, - __InputValue, - __EnumValue, - __TypeKind, - - // Meta-field definitions. - SchemaMetaFieldDef, - TypeMetaFieldDef, - TypeNameMetaFieldDef, + // "Enum" of Type Kinds + TypeKind, + // GraphQL Types for introspection. + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, } from './introspection'; export { DirectiveLocationEnum } from './directives'; diff --git a/types/graphql/type/introspection.d.ts b/types/graphql/type/introspection.d.ts index 989e34a882..48ac468ed0 100644 --- a/types/graphql/type/introspection.d.ts +++ b/types/graphql/type/introspection.d.ts @@ -1,12 +1,12 @@ import { - GraphQLScalarType, - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLUnionType, - GraphQLEnumType, - GraphQLInputObjectType, - GraphQLList, - GraphQLNonNull, + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, } from './definition'; import { GraphQLField } from './definition'; @@ -19,14 +19,14 @@ export const __InputValue: GraphQLObjectType; export const __EnumValue: GraphQLObjectType; export const TypeKind: { - SCALAR: 'SCALAR', - OBJECT: 'OBJECT', - INTERFACE: 'INTERFACE', - UNION: 'UNION', - ENUM: 'ENUM', - INPUT_OBJECT: 'INPUT_OBJECT', - LIST: 'LIST', - NON_NULL: 'NON_NULL', + SCALAR: 'SCALAR'; + OBJECT: 'OBJECT'; + INTERFACE: 'INTERFACE'; + UNION: 'UNION'; + ENUM: 'ENUM'; + INPUT_OBJECT: 'INPUT_OBJECT'; + LIST: 'LIST'; + NON_NULL: 'NON_NULL'; }; export const __TypeKind: GraphQLEnumType; diff --git a/types/graphql/type/schema.d.ts b/types/graphql/type/schema.d.ts index a7f4d394f4..3263274dd9 100644 --- a/types/graphql/type/schema.d.ts +++ b/types/graphql/type/schema.d.ts @@ -1,17 +1,11 @@ +import { GraphQLObjectType } from './definition'; import { - GraphQLObjectType, + GraphQLType, + GraphQLNamedType, + GraphQLAbstractType, } from './definition'; -import { - GraphQLType, - GraphQLNamedType, - GraphQLAbstractType -} from './definition'; -import { - SchemaDefinitionNode -} from '../language/ast'; -import { - GraphQLDirective, -} from './directives'; +import { SchemaDefinitionNode } from '../language/ast'; +import { GraphQLDirective } from './directives'; /** * Schema Definition @@ -40,38 +34,38 @@ import { * */ export class GraphQLSchema { - astNode?: SchemaDefinitionNode; - // private _queryType: GraphQLObjectType; - // private _mutationType: GraphQLObjectType; - // private _subscriptionType: GraphQLObjectType; - // private _directives: Array; - // private _typeMap: TypeMap; - // private _implementations: { [interfaceName: string]: Array }; - // private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; + astNode?: SchemaDefinitionNode; + // private _queryType: GraphQLObjectType; + // private _mutationType: GraphQLObjectType; + // private _subscriptionType: GraphQLObjectType; + // private _directives: Array; + // private _typeMap: TypeMap; + // private _implementations: { [interfaceName: string]: Array }; + // private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; - constructor(config: GraphQLSchemaConfig) + constructor(config: GraphQLSchemaConfig); - getQueryType(): GraphQLObjectType; - getMutationType(): GraphQLObjectType|null|undefined; - getSubscriptionType(): GraphQLObjectType|null|undefined; - getTypeMap(): { [typeName: string]: GraphQLNamedType }; - getType(name: string): GraphQLNamedType; - getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; + getQueryType(): GraphQLObjectType; + getMutationType(): GraphQLObjectType | null | undefined; + getSubscriptionType(): GraphQLObjectType | null | undefined; + getTypeMap(): { [typeName: string]: GraphQLNamedType }; + getType(name: string): GraphQLNamedType; + getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; - isPossibleType( - abstractType: GraphQLAbstractType, - possibleType: GraphQLObjectType - ): boolean; + isPossibleType( + abstractType: GraphQLAbstractType, + possibleType: GraphQLObjectType, + ): boolean; - getDirectives(): GraphQLDirective[]; - getDirective(name: string): GraphQLDirective; + getDirectives(): GraphQLDirective[]; + getDirective(name: string): GraphQLDirective; } export interface GraphQLSchemaConfig { - query: GraphQLObjectType; - mutation?: GraphQLObjectType; - subscription?: GraphQLObjectType; - types?: GraphQLNamedType[]; - directives?: GraphQLDirective[]; - astNode?: SchemaDefinitionNode; + query: GraphQLObjectType; + mutation?: GraphQLObjectType; + subscription?: GraphQLObjectType; + types?: GraphQLNamedType[]; + directives?: GraphQLDirective[]; + astNode?: SchemaDefinitionNode; } diff --git a/types/graphql/utilities/TypeInfo.d.ts b/types/graphql/utilities/TypeInfo.d.ts index 98a53d37ef..a04a24a1a7 100644 --- a/types/graphql/utilities/TypeInfo.d.ts +++ b/types/graphql/utilities/TypeInfo.d.ts @@ -1,12 +1,12 @@ import { GraphQLSchema } from '../type/schema'; import { - GraphQLOutputType, - GraphQLCompositeType, - GraphQLInputType, - GraphQLField, - GraphQLArgument, - GraphQLEnumValue, - GraphQLType, + GraphQLOutputType, + GraphQLCompositeType, + GraphQLInputType, + GraphQLField, + GraphQLArgument, + GraphQLEnumValue, + GraphQLType, } from '../type/definition'; import { GraphQLDirective } from '../type/directives'; import { ASTNode, FieldNode } from '../language/ast'; @@ -17,27 +17,27 @@ import { ASTNode, FieldNode } from '../language/ast'; * AST during a recursive descent by calling `enter(node)` and `leave(node)`. */ export class TypeInfo { - constructor( - schema: GraphQLSchema, - // NOTE: this experimental optional second parameter is only needed in order - // to support non-spec-compliant codebases. You should never need to use it. - // It may disappear in the future. - getFieldDefFn?: getFieldDef - ); + constructor( + schema: GraphQLSchema, + // NOTE: this experimental optional second parameter is only needed in order + // to support non-spec-compliant codebases. You should never need to use it. + // It may disappear in the future. + getFieldDefFn?: getFieldDef, + ); - getType(): GraphQLOutputType; - getParentType(): GraphQLCompositeType; - getInputType(): GraphQLInputType; - getFieldDef(): GraphQLField; - getDirective(): GraphQLDirective; - getArgument(): GraphQLArgument; - getEnumValue(): GraphQLEnumValue; - enter(node: ASTNode): any; - leave(node: ASTNode): any; + getType(): GraphQLOutputType; + getParentType(): GraphQLCompositeType; + getInputType(): GraphQLInputType; + getFieldDef(): GraphQLField; + getDirective(): GraphQLDirective; + getArgument(): GraphQLArgument; + getEnumValue(): GraphQLEnumValue; + enter(node: ASTNode): any; + leave(node: ASTNode): any; } export type getFieldDef = ( - schema: GraphQLSchema, - parentType: GraphQLType, - fieldNode: FieldNode, + schema: GraphQLSchema, + parentType: GraphQLType, + fieldNode: FieldNode, ) => GraphQLField; diff --git a/types/graphql/utilities/astFromValue.d.ts b/types/graphql/utilities/astFromValue.d.ts index 44745c5e6c..557a07dd9d 100644 --- a/types/graphql/utilities/astFromValue.d.ts +++ b/types/graphql/utilities/astFromValue.d.ts @@ -1,6 +1,6 @@ import { - ValueNode, - /* + ValueNode, + /* TODO: IntValueNode, FloatValueNode, @@ -30,7 +30,4 @@ import { GraphQLInputType } from '../type/definition'; * */ // TODO: this should set overloads according to above the table -export function astFromValue( - value: any, - type: GraphQLInputType -): ValueNode; // Warning: there is a code in bottom: throw new TypeError +export function astFromValue(value: any, type: GraphQLInputType): ValueNode; // Warning: there is a code in bottom: throw new TypeError diff --git a/types/graphql/utilities/buildClientSchema.d.ts b/types/graphql/utilities/buildClientSchema.d.ts index 166ec43cf7..bdf898bc2b 100644 --- a/types/graphql/utilities/buildClientSchema.d.ts +++ b/types/graphql/utilities/buildClientSchema.d.ts @@ -11,5 +11,5 @@ import { GraphQLSchema } from '../type/schema'; * server-internal mechanisms. */ export function buildClientSchema( - introspection: IntrospectionQuery + introspection: IntrospectionQuery, ): GraphQLSchema; diff --git a/types/graphql/utilities/extendSchema.d.ts b/types/graphql/utilities/extendSchema.d.ts index f7d00b2fee..389bd02d8b 100644 --- a/types/graphql/utilities/extendSchema.d.ts +++ b/types/graphql/utilities/extendSchema.d.ts @@ -14,6 +14,6 @@ import { GraphQLSchema } from '../type/schema'; * producing the copy. The original schema remains unaltered. */ export function extendSchema( - schema: GraphQLSchema, - documentAST: DocumentNode + schema: GraphQLSchema, + documentAST: DocumentNode, ): GraphQLSchema; diff --git a/types/graphql/utilities/findBreakingChanges.d.ts b/types/graphql/utilities/findBreakingChanges.d.ts index 78d5a5a95b..0d5fc0041a 100644 --- a/types/graphql/utilities/findBreakingChanges.d.ts +++ b/types/graphql/utilities/findBreakingChanges.d.ts @@ -1,35 +1,35 @@ import { - getNamedType, - GraphQLScalarType, - GraphQLEnumType, - GraphQLInputObjectType, - GraphQLInterfaceType, - GraphQLObjectType, - GraphQLUnionType, - GraphQLNamedType, + getNamedType, + GraphQLScalarType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLUnionType, + GraphQLNamedType, } from '../type/definition'; import { GraphQLSchema } from '../type/schema'; export const BreakingChangeType: { - FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND', - FIELD_REMOVED: 'FIELD_REMOVED', - TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND', - TYPE_REMOVED: 'TYPE_REMOVED', - TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION', - VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM', + FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND'; + FIELD_REMOVED: 'FIELD_REMOVED'; + TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND'; + TYPE_REMOVED: 'TYPE_REMOVED'; + TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION'; + VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM'; }; export type BreakingChangeKey = - | 'FIELD_CHANGED_KIND' - | 'FIELD_REMOVED' - | 'TYPE_CHANGED_KIND' - | 'TYPE_REMOVED' - | 'TYPE_REMOVED_FROM_UNION' - | 'VALUE_REMOVED_FROM_ENUM'; + | 'FIELD_CHANGED_KIND' + | 'FIELD_REMOVED' + | 'TYPE_CHANGED_KIND' + | 'TYPE_REMOVED' + | 'TYPE_REMOVED_FROM_UNION' + | 'VALUE_REMOVED_FROM_ENUM'; export interface BreakingChange { - type: BreakingChangeKey; - description: string; + type: BreakingChangeKey; + description: string; } /** @@ -37,8 +37,8 @@ export interface BreakingChange { * of breaking changes covered by the other functions down below. */ export function findBreakingChanges( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; /** @@ -46,8 +46,8 @@ export function findBreakingChanges( * changes in the newSchema related to removing an entire type. */ export function findRemovedTypes( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; /** @@ -55,8 +55,8 @@ export function findRemovedTypes( * changes in the newSchema related to changing the type of a type. */ export function findTypesThatChangedKind( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; /** @@ -65,8 +65,8 @@ export function findTypesThatChangedKind( * a field has been removed from a type or if a field has changed type. */ export function findFieldsThatChangedType( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; /** @@ -74,8 +74,8 @@ export function findFieldsThatChangedType( * changes in the newSchema related to removing types from a union type. */ export function findTypesRemovedFromUnions( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; /** @@ -83,6 +83,6 @@ export function findTypesRemovedFromUnions( * changes in the newSchema related to removing values from an enum type. */ export function findValuesRemovedFromEnums( - oldSchema: GraphQLSchema, - newSchema: GraphQLSchema + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, ): BreakingChange[]; diff --git a/types/graphql/utilities/findDeprecatedUsages.d.ts b/types/graphql/utilities/findDeprecatedUsages.d.ts index 8f6ff48239..8cd844e15f 100644 --- a/types/graphql/utilities/findDeprecatedUsages.d.ts +++ b/types/graphql/utilities/findDeprecatedUsages.d.ts @@ -8,6 +8,6 @@ import { GraphQLError } from '../error/GraphQLError'; * Returns a list of GraphQLError instances describing each deprecated use. */ export function findDeprecatedUsages( - schema: GraphQLSchema, - ast: DocumentNode + schema: GraphQLSchema, + ast: DocumentNode, ): GraphQLError[]; diff --git a/types/graphql/utilities/getOperationAST.d.ts b/types/graphql/utilities/getOperationAST.d.ts index ce99d39b2b..0d5064d48d 100644 --- a/types/graphql/utilities/getOperationAST.d.ts +++ b/types/graphql/utilities/getOperationAST.d.ts @@ -6,6 +6,6 @@ import { DocumentNode, OperationDefinitionNode } from '../language/ast'; * provided in the document. */ export function getOperationAST( - documentAST: DocumentNode, - operationName?: string + documentAST: DocumentNode, + operationName?: string, ): OperationDefinitionNode; diff --git a/types/graphql/utilities/index.d.ts b/types/graphql/utilities/index.d.ts index 8815046735..cd0e23948f 100644 --- a/types/graphql/utilities/index.d.ts +++ b/types/graphql/utilities/index.d.ts @@ -1,23 +1,23 @@ // The GraphQL query recommended for a full schema introspection. export { introspectionQuery } from './introspectionQuery'; export { - IntrospectionQuery, - IntrospectionSchema, - IntrospectionType, - IntrospectionScalarType, - IntrospectionObjectType, - IntrospectionInterfaceType, - IntrospectionUnionType, - IntrospectionEnumType, - IntrospectionInputObjectType, - IntrospectionTypeRef, - IntrospectionNamedTypeRef, - IntrospectionListTypeRef, - IntrospectionNonNullTypeRef, - IntrospectionField, - IntrospectionInputValue, - IntrospectionEnumValue, - IntrospectionDirective, + IntrospectionQuery, + IntrospectionSchema, + IntrospectionType, + IntrospectionScalarType, + IntrospectionObjectType, + IntrospectionInterfaceType, + IntrospectionUnionType, + IntrospectionEnumType, + IntrospectionInputObjectType, + IntrospectionTypeRef, + IntrospectionNamedTypeRef, + IntrospectionListTypeRef, + IntrospectionNonNullTypeRef, + IntrospectionField, + IntrospectionInputValue, + IntrospectionEnumValue, + IntrospectionDirective, } from './introspectionQuery'; // Gets the target Operation from a Document @@ -33,7 +33,11 @@ export { buildASTSchema, buildSchema } from './buildASTSchema'; export { extendSchema } from './extendSchema'; // Print a GraphQLSchema to GraphQL Schema language. -export { printSchema, printType, printIntrospectionSchema } from './schemaPrinter'; +export { + printSchema, + printType, + printIntrospectionSchema, +} from './schemaPrinter'; // Create a GraphQLType from a GraphQL language AST. export { typeFromAST } from './typeFromAST'; @@ -62,9 +66,9 @@ export { separateOperations } from './separateOperations'; // Comparators for types export { - isEqualType, - isTypeSubTypeOf, - doTypesOverlap + isEqualType, + isTypeSubTypeOf, + doTypesOverlap, } from './typeComparators'; // Asserts that a string is a valid GraphQL name diff --git a/types/graphql/utilities/introspectionQuery.d.ts b/types/graphql/utilities/introspectionQuery.d.ts index a89c5c1fec..f16b873a3a 100644 --- a/types/graphql/utilities/introspectionQuery.d.ts +++ b/types/graphql/utilities/introspectionQuery.d.ts @@ -96,114 +96,114 @@ fragment TypeRef on __Type { export const introspectionQuery: string; export interface IntrospectionQuery { - __schema: IntrospectionSchema; + __schema: IntrospectionSchema; } export interface IntrospectionSchema { - queryType: IntrospectionNamedTypeRef; - mutationType?: IntrospectionNamedTypeRef; - subscriptionType?: IntrospectionNamedTypeRef; - types: IntrospectionType[]; - directives: IntrospectionDirective[]; + queryType: IntrospectionNamedTypeRef; + mutationType?: IntrospectionNamedTypeRef; + subscriptionType?: IntrospectionNamedTypeRef; + types: IntrospectionType[]; + directives: IntrospectionDirective[]; } export type IntrospectionType = - | IntrospectionScalarType - | IntrospectionObjectType - | IntrospectionInterfaceType - | IntrospectionUnionType - | IntrospectionEnumType - | IntrospectionInputObjectType; + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType + | IntrospectionInputObjectType; export interface IntrospectionScalarType { - kind: 'SCALAR'; - name: string; - description?: string; + kind: 'SCALAR'; + name: string; + description?: string; } export interface IntrospectionObjectType { - kind: 'OBJECT'; - name: string; - description?: string; - fields: IntrospectionField[]; - interfaces: IntrospectionNamedTypeRef[]; + kind: 'OBJECT'; + name: string; + description?: string; + fields: IntrospectionField[]; + interfaces: IntrospectionNamedTypeRef[]; } export interface IntrospectionInterfaceType { - kind: 'INTERFACE'; - name: string; - description?: string; - fields: IntrospectionField[]; - possibleTypes: IntrospectionNamedTypeRef[]; + kind: 'INTERFACE'; + name: string; + description?: string; + fields: IntrospectionField[]; + possibleTypes: IntrospectionNamedTypeRef[]; } export interface IntrospectionUnionType { - kind: 'UNION'; - name: string; - description?: string; - possibleTypes: IntrospectionNamedTypeRef[]; + kind: 'UNION'; + name: string; + description?: string; + possibleTypes: IntrospectionNamedTypeRef[]; } export interface IntrospectionEnumType { - kind: 'ENUM'; - name: string; - description?: string; - enumValues: IntrospectionEnumValue[]; + kind: 'ENUM'; + name: string; + description?: string; + enumValues: IntrospectionEnumValue[]; } export interface IntrospectionInputObjectType { - kind: 'INPUT_OBJECT'; - name: string; - description?: string; - inputFields: IntrospectionInputValue[]; + kind: 'INPUT_OBJECT'; + name: string; + description?: string; + inputFields: IntrospectionInputValue[]; } export type IntrospectionTypeRef = - | IntrospectionNamedTypeRef - | IntrospectionListTypeRef - | IntrospectionNonNullTypeRef; + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef; export interface IntrospectionNamedTypeRef { - kind: string; - name: string; + kind: string; + name: string; } export interface IntrospectionListTypeRef { - kind: 'LIST'; - ofType?: IntrospectionTypeRef; + kind: 'LIST'; + ofType?: IntrospectionTypeRef; } export interface IntrospectionNonNullTypeRef { - kind: 'NON_NULL'; - ofType?: IntrospectionTypeRef; + kind: 'NON_NULL'; + ofType?: IntrospectionTypeRef; } export interface IntrospectionField { - name: string; - description?: string; - args: IntrospectionInputValue[]; - type: IntrospectionTypeRef; - isDeprecated: boolean; - deprecationReason?: string; + name: string; + description?: string; + args: IntrospectionInputValue[]; + type: IntrospectionTypeRef; + isDeprecated: boolean; + deprecationReason?: string; } export interface IntrospectionInputValue { - name: string; - description?: string; - type: IntrospectionTypeRef; - defaultValue?: string; + name: string; + description?: string; + type: IntrospectionTypeRef; + defaultValue?: string; } export interface IntrospectionEnumValue { - name: string; - description?: string; - isDeprecated: boolean; - deprecationReason?: string; + name: string; + description?: string; + isDeprecated: boolean; + deprecationReason?: string; } export interface IntrospectionDirective { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args: IntrospectionInputValue[]; + name: string; + description?: string; + locations: DirectiveLocationEnum[]; + args: IntrospectionInputValue[]; } diff --git a/types/graphql/utilities/isValidJSValue.d.ts b/types/graphql/utilities/isValidJSValue.d.ts index cd11014579..911d8fea67 100644 --- a/types/graphql/utilities/isValidJSValue.d.ts +++ b/types/graphql/utilities/isValidJSValue.d.ts @@ -5,7 +5,4 @@ import { GraphQLInputType } from '../type/definition'; * accepted for that type. This is primarily useful for validating the * runtime values of query variables. */ -export function isValidJSValue( - value: any, - type: GraphQLInputType -): string[]; +export function isValidJSValue(value: any, type: GraphQLInputType): string[]; diff --git a/types/graphql/utilities/isValidLiteralValue.d.ts b/types/graphql/utilities/isValidLiteralValue.d.ts index 697c8eb97e..4ad03d1013 100644 --- a/types/graphql/utilities/isValidLiteralValue.d.ts +++ b/types/graphql/utilities/isValidLiteralValue.d.ts @@ -9,6 +9,6 @@ import { GraphQLInputType } from '../type/definition'; * provide values of the correct type. */ export function isValidLiteralValue( - type: GraphQLInputType, - valueNode: ValueNode + type: GraphQLInputType, + valueNode: ValueNode, ): string[]; diff --git a/types/graphql/utilities/schemaPrinter.d.ts b/types/graphql/utilities/schemaPrinter.d.ts index 2bd40f1b96..f9cf9ad209 100644 --- a/types/graphql/utilities/schemaPrinter.d.ts +++ b/types/graphql/utilities/schemaPrinter.d.ts @@ -1,8 +1,12 @@ import { GraphQLSchema } from '../type/schema'; import { GraphQLType } from '../type/definition'; -export function printSchema(schema: GraphQLSchema): string; +export interface PrinterOptions { + commentDescriptions?: boolean; +} -export function printIntrospectionSchema(schema: GraphQLSchema): string; +export function printSchema(schema: GraphQLSchema, options?: PrinterOptions): string; -export function printType(type: GraphQLType): string; +export function printIntrospectionSchema(schema: GraphQLSchema, options?: PrinterOptions): string; + +export function printType(type: GraphQLType, options?: PrinterOptions): string; diff --git a/types/graphql/utilities/separateOperations.d.ts b/types/graphql/utilities/separateOperations.d.ts index 4b4106df53..a10ad0a29e 100644 --- a/types/graphql/utilities/separateOperations.d.ts +++ b/types/graphql/utilities/separateOperations.d.ts @@ -1,8 +1,5 @@ -import { - DocumentNode, - OperationDefinitionNode, -} from '../language/ast'; +import { DocumentNode, OperationDefinitionNode } from '../language/ast'; export function separateOperations( - documentAST: DocumentNode + documentAST: DocumentNode, ): { [operationName: string]: DocumentNode }; diff --git a/types/graphql/utilities/typeComparators.d.ts b/types/graphql/utilities/typeComparators.d.ts index 16e6acd680..ca0cdaf6c2 100644 --- a/types/graphql/utilities/typeComparators.d.ts +++ b/types/graphql/utilities/typeComparators.d.ts @@ -1,11 +1,9 @@ import { - GraphQLType, - GraphQLCompositeType, - GraphQLAbstractType + GraphQLType, + GraphQLCompositeType, + GraphQLAbstractType, } from '../type/definition'; -import { - GraphQLSchema -} from '../type/schema'; +import { GraphQLSchema } from '../type/schema'; /** * Provided two types, return true if the types are equal (invariant). @@ -17,9 +15,9 @@ export function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean; * equal or a subset of the second super type (covariant). */ export function isTypeSubTypeOf( - schema: GraphQLSchema, - maybeSubType: GraphQLType, - superType: GraphQLType + schema: GraphQLSchema, + maybeSubType: GraphQLType, + superType: GraphQLType, ): boolean; /** @@ -32,7 +30,7 @@ export function isTypeSubTypeOf( * This function is commutative. */ export function doTypesOverlap( - schema: GraphQLSchema, - typeA: GraphQLCompositeType, - typeB: GraphQLCompositeType + schema: GraphQLSchema, + typeA: GraphQLCompositeType, + typeB: GraphQLCompositeType, ): boolean; diff --git a/types/graphql/utilities/typeFromAST.d.ts b/types/graphql/utilities/typeFromAST.d.ts index c3cacf90df..415cbd2636 100644 --- a/types/graphql/utilities/typeFromAST.d.ts +++ b/types/graphql/utilities/typeFromAST.d.ts @@ -3,6 +3,6 @@ import { GraphQLType, GraphQLNullableType } from '../type/definition'; import { GraphQLSchema } from '../type/schema'; export function typeFromAST( - schema: GraphQLSchema, - typeNode: TypeNode + schema: GraphQLSchema, + typeNode: TypeNode, ): GraphQLType; diff --git a/types/graphql/utilities/valueFromAST.d.ts b/types/graphql/utilities/valueFromAST.d.ts index 24dd435448..0bfbf04981 100644 --- a/types/graphql/utilities/valueFromAST.d.ts +++ b/types/graphql/utilities/valueFromAST.d.ts @@ -1,15 +1,15 @@ import { GraphQLInputType } from '../type/definition'; import { - ValueNode, - VariableNode, - ListValueNode, - ObjectValueNode + ValueNode, + VariableNode, + ListValueNode, + ObjectValueNode, } from '../language/ast'; export function valueFromAST( - valueNode: ValueNode, - type: GraphQLInputType, - variables?: { - [key: string]: any - } + valueNode: ValueNode, + type: GraphQLInputType, + variables?: { + [key: string]: any; + }, ): any; diff --git a/types/graphql/validation/index.d.ts b/types/graphql/validation/index.d.ts index 7f897fe78d..b8cb9ddd00 100644 --- a/types/graphql/validation/index.d.ts +++ b/types/graphql/validation/index.d.ts @@ -3,130 +3,126 @@ export { specifiedRules } from './specifiedRules'; // Spec Section: "Argument Values Type Correctness" export { - ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule + ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule, } from './rules/ArgumentsOfCorrectType'; // Spec Section: "Variable Default Values Are Correctly Typed" export { - DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule + DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule, } from './rules/DefaultValuesOfCorrectType'; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" export { - FieldsOnCorrectType as FieldsOnCorrectTypeRule + FieldsOnCorrectType as FieldsOnCorrectTypeRule, } from './rules/FieldsOnCorrectType'; // Spec Section: "Fragments on Composite Types" export { - FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule + FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule, } from './rules/FragmentsOnCompositeTypes'; // Spec Section: "Argument Names" export { - KnownArgumentNames as KnownArgumentNamesRule + KnownArgumentNames as KnownArgumentNamesRule, } from './rules/KnownArgumentNames'; // Spec Section: "Directives Are Defined" export { - KnownDirectives as KnownDirectivesRule + KnownDirectives as KnownDirectivesRule, } from './rules/KnownDirectives'; // Spec Section: "Fragment spread target defined" export { - KnownFragmentNames as KnownFragmentNamesRule + KnownFragmentNames as KnownFragmentNamesRule, } from './rules/KnownFragmentNames'; // Spec Section: "Fragment Spread Type Existence" -export { - KnownTypeNames as KnownTypeNamesRule -} from './rules/KnownTypeNames'; +export { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames'; // Spec Section: "Lone Anonymous Operation" export { - LoneAnonymousOperation as LoneAnonymousOperationRule + LoneAnonymousOperation as LoneAnonymousOperationRule, } from './rules/LoneAnonymousOperation'; // Spec Section: "Fragments must not form cycles" export { - NoFragmentCycles as NoFragmentCyclesRule + NoFragmentCycles as NoFragmentCyclesRule, } from './rules/NoFragmentCycles'; // Spec Section: "All Variable Used Defined" export { - NoUndefinedVariables as NoUndefinedVariablesRule + NoUndefinedVariables as NoUndefinedVariablesRule, } from './rules/NoUndefinedVariables'; // Spec Section: "Fragments must be used" export { - NoUnusedFragments as NoUnusedFragmentsRule + NoUnusedFragments as NoUnusedFragmentsRule, } from './rules/NoUnusedFragments'; // Spec Section: "All Variables Used" export { - NoUnusedVariables as NoUnusedVariablesRule + NoUnusedVariables as NoUnusedVariablesRule, } from './rules/NoUnusedVariables'; // Spec Section: "Field Selection Merging" export { - OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule + OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule, } from './rules/OverlappingFieldsCanBeMerged'; // Spec Section: "Fragment spread is possible" export { - PossibleFragmentSpreads as PossibleFragmentSpreadsRule + PossibleFragmentSpreads as PossibleFragmentSpreadsRule, } from './rules/PossibleFragmentSpreads'; // Spec Section: "Argument Optionality" export { - ProvidedNonNullArguments as ProvidedNonNullArgumentsRule + ProvidedNonNullArguments as ProvidedNonNullArgumentsRule, } from './rules/ProvidedNonNullArguments'; // Spec Section: "Leaf Field Selections" -export { - ScalarLeafs as ScalarLeafsRule -} from './rules/ScalarLeafs'; +export { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs'; // Spec Section: "Subscriptions with Single Root Field" export { - SingleFieldSubscriptions as SingleFieldSubscriptionsRule + SingleFieldSubscriptions as SingleFieldSubscriptionsRule, } from './rules/SingleFieldSubscriptions'; // Spec Section: "Argument Uniqueness" export { - UniqueArgumentNames as UniqueArgumentNamesRule + UniqueArgumentNames as UniqueArgumentNamesRule, } from './rules/UniqueArgumentNames'; // Spec Section: "Directives Are Unique Per Location" export { - UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule + UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule, } from './rules/UniqueDirectivesPerLocation'; // Spec Section: "Fragment Name Uniqueness" export { - UniqueFragmentNames as UniqueFragmentNamesRule + UniqueFragmentNames as UniqueFragmentNamesRule, } from './rules/UniqueFragmentNames'; // Spec Section: "Input Object Field Uniqueness" export { - UniqueInputFieldNames as UniqueInputFieldNamesRule + UniqueInputFieldNames as UniqueInputFieldNamesRule, } from './rules/UniqueInputFieldNames'; // Spec Section: "Operation Name Uniqueness" export { - UniqueOperationNames as UniqueOperationNamesRule + UniqueOperationNames as UniqueOperationNamesRule, } from './rules/UniqueOperationNames'; // Spec Section: "Variable Uniqueness" export { - UniqueVariableNames as UniqueVariableNamesRule + UniqueVariableNames as UniqueVariableNamesRule, } from './rules/UniqueVariableNames'; // Spec Section: "Variables are Input Types" export { - VariablesAreInputTypes as VariablesAreInputTypesRule + VariablesAreInputTypes as VariablesAreInputTypesRule, } from './rules/VariablesAreInputTypes'; // Spec Section: "All Variable Usages Are Allowed" export { - VariablesInAllowedPosition as VariablesInAllowedPositionRule + VariablesInAllowedPosition as VariablesInAllowedPositionRule, } from './rules/VariablesInAllowedPosition'; diff --git a/types/graphql/validation/validate.d.ts b/types/graphql/validation/validate.d.ts index a4b628777e..9e2fd479f1 100644 --- a/types/graphql/validation/validate.d.ts +++ b/types/graphql/validation/validate.d.ts @@ -1,19 +1,19 @@ import { GraphQLError } from '../error'; import { - DocumentNode, - OperationDefinitionNode, - VariableNode, - SelectionSetNode, - FragmentSpreadNode, - FragmentDefinitionNode, + DocumentNode, + OperationDefinitionNode, + VariableNode, + SelectionSetNode, + FragmentSpreadNode, + FragmentDefinitionNode, } from '../language/ast'; import { GraphQLSchema } from '../type/schema'; import { - GraphQLInputType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, - GraphQLArgument + GraphQLInputType, + GraphQLOutputType, + GraphQLCompositeType, + GraphQLField, + GraphQLArgument, } from '../type/definition'; import { GraphQLDirective } from '../type/directives'; import { TypeInfo } from '../utilities/TypeInfo'; @@ -33,9 +33,9 @@ import { specifiedRules } from './specifiedRules'; * GraphQLErrors, or Arrays of GraphQLErrors when invalid. */ export function validate( - schema: GraphQLSchema, - ast: DocumentNode, - rules?: any[] + schema: GraphQLSchema, + ast: DocumentNode, + rules?: any[], ): GraphQLError[]; /** @@ -45,16 +45,18 @@ export function validate( * @internal */ export function visitUsingRules( - schema: GraphQLSchema, - typeInfo: TypeInfo, - documentAST: DocumentNode, - rules: any[] + schema: GraphQLSchema, + typeInfo: TypeInfo, + documentAST: DocumentNode, + rules: any[], ): GraphQLError[]; -export type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; +export type NodeWithSelectionSet = + | OperationDefinitionNode + | FragmentDefinitionNode; export interface VariableUsage { - node: VariableNode; - type: GraphQLInputType; + node: VariableNode; + type: GraphQLInputType; } /** @@ -63,38 +65,38 @@ export interface VariableUsage { * validation rule. */ export class ValidationContext { - constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); - reportError(error: GraphQLError): void; + constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); + reportError(error: GraphQLError): void; - getErrors(): GraphQLError[]; + getErrors(): GraphQLError[]; - getSchema(): GraphQLSchema; + getSchema(): GraphQLSchema; - getDocument(): DocumentNode; + getDocument(): DocumentNode; - getFragment(name: string): FragmentDefinitionNode; + getFragment(name: string): FragmentDefinitionNode; - getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; + getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; - getRecursivelyReferencedFragments( - operation: OperationDefinitionNode - ): FragmentDefinitionNode[]; + getRecursivelyReferencedFragments( + operation: OperationDefinitionNode, + ): FragmentDefinitionNode[]; - getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; + getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; - getRecursiveVariableUsages( - operation: OperationDefinitionNode - ): VariableUsage[]; + getRecursiveVariableUsages( + operation: OperationDefinitionNode, + ): VariableUsage[]; - getType(): GraphQLOutputType; + getType(): GraphQLOutputType; - getParentType(): GraphQLCompositeType; + getParentType(): GraphQLCompositeType; - getInputType(): GraphQLInputType; + getInputType(): GraphQLInputType; - getFieldDef(): GraphQLField; + getFieldDef(): GraphQLField; - getDirective(): GraphQLDirective; + getDirective(): GraphQLDirective; - getArgument(): GraphQLArgument; + getArgument(): GraphQLArgument; } diff --git a/types/graphviz/tsconfig.json b/types/graphviz/tsconfig.json index ec9897523b..74188c2437 100644 --- a/types/graphviz/tsconfig.json +++ b/types/graphviz/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/grasp/grasp-tests.ts b/types/grasp/grasp-tests.ts index 647f57d8fd..87da0b8d45 100644 --- a/types/grasp/grasp-tests.ts +++ b/types/grasp/grasp-tests.ts @@ -1,5 +1,5 @@ import fs = require("fs"); -import * as grasp from "grasp"; +import grasp = require("grasp"); grasp(); // $ExpectError grasp({ args: [] }); // $ExpectType void diff --git a/types/grasp/tsconfig.json b/types/grasp/tsconfig.json index e0996e4408..2a87034f8c 100644 --- a/types/grasp/tsconfig.json +++ b/types/grasp/tsconfig.json @@ -1,16 +1,24 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": ["index.d.ts", "grasp-tests.ts"] -} + "files": [ + "index.d.ts", + "grasp-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gravatar-url/tsconfig.json b/types/gravatar-url/tsconfig.json index 8e61e09590..7dc0c7a0d6 100644 --- a/types/gravatar-url/tsconfig.json +++ b/types/gravatar-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gravatar/tsconfig.json b/types/gravatar/tsconfig.json index d90f933a40..eade609d2e 100644 --- a/types/gravatar/tsconfig.json +++ b/types/gravatar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/greasemonkey/tsconfig.json b/types/greasemonkey/tsconfig.json index f051af1bc4..84c32d764f 100644 --- a/types/greasemonkey/tsconfig.json +++ b/types/greasemonkey/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/grecaptcha/tsconfig.json b/types/grecaptcha/tsconfig.json index 0265247984..485acc7e0f 100644 --- a/types/grecaptcha/tsconfig.json +++ b/types/grecaptcha/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/grecaptcha/v0/tsconfig.json b/types/grecaptcha/v0/tsconfig.json index b75ce228e8..af6bc27262 100644 --- a/types/grecaptcha/v0/tsconfig.json +++ b/types/grecaptcha/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gregorian-calendar/tsconfig.json b/types/gregorian-calendar/tsconfig.json index 2cad93c35f..a80ec039b1 100644 --- a/types/gregorian-calendar/tsconfig.json +++ b/types/gregorian-calendar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gridfs-stream/tsconfig.json b/types/gridfs-stream/tsconfig.json index c6d9bffb02..e3b113310a 100644 --- a/types/gridfs-stream/tsconfig.json +++ b/types/gridfs-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gridstack/tsconfig.json b/types/gridstack/tsconfig.json index 1e4548ab3a..9350c8721c 100644 --- a/types/gridstack/tsconfig.json +++ b/types/gridstack/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/grunt/tsconfig.json b/types/grunt/tsconfig.json index af329ced3c..53469dd2a1 100644 --- a/types/grunt/tsconfig.json +++ b/types/grunt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gsap/TweenConfig.d.ts b/types/gsap/TweenConfig.d.ts index 59c472bea2..33cde9c6ae 100644 --- a/types/gsap/TweenConfig.d.ts +++ b/types/gsap/TweenConfig.d.ts @@ -1,6 +1,9 @@ declare namespace gsap { export interface TweenConfig { + /** Any tweenable property */ + [p: string]: any; + /** Amount of delay in seconds (or frames for frames-based tweens) before the animation should begin.*/ delay?: number; diff --git a/types/gsap/gsap-tests.ts b/types/gsap/gsap-tests.ts index 048a9d522e..36192141be 100644 --- a/types/gsap/gsap-tests.ts +++ b/types/gsap/gsap-tests.ts @@ -1,8 +1,19 @@ -import { TweenLite } from 'gsap'; +import { TweenLite, TweenMax } from 'gsap'; -const tween = TweenLite +const tweenLiteExample = TweenLite .to(document.getElementById('some-div'), 1, { width: '200px', - height: '200px' + height: '200px', + x: '100px', + y: '200px' }) .seek(0.5); + +const tweenMaxExample = TweenMax + .to(document.getElementById('some-div'), 1, { + width: '200px', + height: '200px', + x: '100px', + y: '200px' + }) + .seek(0.5); diff --git a/types/gsap/index.d.ts b/types/gsap/index.d.ts index cebefcf1c9..77d589603a 100644 --- a/types/gsap/index.d.ts +++ b/types/gsap/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for GSAP 1.19 // Project: http://greensock.com/ -// Definitions by: VILIC VANE , Robert S , Richard Fox +// Definitions by: VILIC VANE , Robert S , Richard Fox , Philip Bulley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/gsap/tsconfig.json b/types/gsap/tsconfig.json index 85301a0877..ee453d0872 100644 --- a/types/gsap/tsconfig.json +++ b/types/gsap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/guid/tsconfig.json b/types/guid/tsconfig.json index 17563577fd..20c94adc76 100644 --- a/types/guid/tsconfig.json +++ b/types/guid/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "guid-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gulp-angular-templatecache/gulp-angular-templatecache-tests.ts b/types/gulp-angular-templatecache/gulp-angular-templatecache-tests.ts index 559dd4f609..706b3acaff 100644 --- a/types/gulp-angular-templatecache/gulp-angular-templatecache-tests.ts +++ b/types/gulp-angular-templatecache/gulp-angular-templatecache-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as templateCache from 'gulp-angular-templatecache'; +import templateCache = require('gulp-angular-templatecache'); gulp.task('templatecache:no-arguments', function () { return gulp.src('templates/**/*.html') diff --git a/types/gulp-angular-templatecache/tsconfig.json b/types/gulp-angular-templatecache/tsconfig.json index 3971eae080..f5590d4937 100644 --- a/types/gulp-angular-templatecache/tsconfig.json +++ b/types/gulp-angular-templatecache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts b/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts index 386e1a882a..c2d87223b8 100644 --- a/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts +++ b/types/gulp-autoprefixer/gulp-autoprefixer-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as autoprefixer from "gulp-autoprefixer"; +import autoprefixer = require("gulp-autoprefixer"); gulp.src("test.css") .pipe(autoprefixer()) diff --git a/types/gulp-autoprefixer/tsconfig.json b/types/gulp-autoprefixer/tsconfig.json index 52fd74103c..de7d30ff47 100644 --- a/types/gulp-autoprefixer/tsconfig.json +++ b/types/gulp-autoprefixer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-babel/tsconfig.json b/types/gulp-babel/tsconfig.json index e177253e87..8a7d7b25a8 100644 --- a/types/gulp-babel/tsconfig.json +++ b/types/gulp-babel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-batch/gulp-batch-tests.ts b/types/gulp-batch/gulp-batch-tests.ts index c5936eb031..da0c67e84c 100644 --- a/types/gulp-batch/gulp-batch-tests.ts +++ b/types/gulp-batch/gulp-batch-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as batch from "gulp-batch"; +import batch = require("gulp-batch"); gulp.task('default', () => { gulp.watch([ 'lib/**', 'test/**' ], batch((events: any, cb: any) => { diff --git a/types/gulp-batch/tsconfig.json b/types/gulp-batch/tsconfig.json index 8b5bce2f98..00e877c977 100644 --- a/types/gulp-batch/tsconfig.json +++ b/types/gulp-batch/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/gulp-bump/gulp-bump-tests.ts b/types/gulp-bump/gulp-bump-tests.ts index b15e800a5e..caf5aecf6b 100644 --- a/types/gulp-bump/gulp-bump-tests.ts +++ b/types/gulp-bump/gulp-bump-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as GulpBump from 'gulp-bump'; +import GulpBump = require('gulp-bump'); gulp .src('package.json') diff --git a/types/gulp-bump/tsconfig.json b/types/gulp-bump/tsconfig.json index 003c952709..cb385de9a7 100644 --- a/types/gulp-bump/tsconfig.json +++ b/types/gulp-bump/tsconfig.json @@ -15,10 +15,11 @@ "strictNullChecks": true, "strictFunctionTypes": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ "index.d.ts", "gulp-bump-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gulp-cache/gulp-cache-tests.ts b/types/gulp-cache/gulp-cache-tests.ts index 31df7b0259..cc02e95119 100644 --- a/types/gulp-cache/gulp-cache-tests.ts +++ b/types/gulp-cache/gulp-cache-tests.ts @@ -1,6 +1,6 @@ import * as fs from "fs"; import * as gulp from "gulp"; -import * as cache from "gulp-cache"; +import cache = require("gulp-cache"); import File = require("vinyl"); // Some gulp plugin diff --git a/types/gulp-cache/tsconfig.json b/types/gulp-cache/tsconfig.json index e947f63db5..cee084a998 100644 --- a/types/gulp-cache/tsconfig.json +++ b/types/gulp-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-cached/tsconfig.json b/types/gulp-cached/tsconfig.json index cdec085a2b..f7b99d2469 100644 --- a/types/gulp-cached/tsconfig.json +++ b/types/gulp-cached/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-changed/tsconfig.json b/types/gulp-changed/tsconfig.json index d04c43b32e..80c8583bbf 100644 --- a/types/gulp-changed/tsconfig.json +++ b/types/gulp-changed/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-cheerio/tsconfig.json b/types/gulp-cheerio/tsconfig.json index be78d9969c..9d1f810c6c 100644 --- a/types/gulp-cheerio/tsconfig.json +++ b/types/gulp-cheerio/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-clean-dest/tsconfig.json b/types/gulp-clean-dest/tsconfig.json index 777c860568..518b39f91d 100644 --- a/types/gulp-clean-dest/tsconfig.json +++ b/types/gulp-clean-dest/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gulp-clean-dest-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gulp-coffeeify/tsconfig.json b/types/gulp-coffeeify/tsconfig.json index 241ff2e5f8..1b5f540107 100644 --- a/types/gulp-coffeeify/tsconfig.json +++ b/types/gulp-coffeeify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-coffeelint/gulp-coffeelint-tests.ts b/types/gulp-coffeelint/gulp-coffeelint-tests.ts index 5d18b98862..0acc0fb9e4 100644 --- a/types/gulp-coffeelint/gulp-coffeelint-tests.ts +++ b/types/gulp-coffeelint/gulp-coffeelint-tests.ts @@ -1,10 +1,6 @@ - - - import coffeelint = require('gulp-coffeelint'); import gulp = require('gulp'); - gulp.task('lint', function () { gulp.src('./src/*.coffee') .pipe(coffeelint()) @@ -52,6 +48,3 @@ gulp.task('lint', function() { .pipe(coffeelint()) .pipe(coffeelint.reporter(myReporter)); }); - - - diff --git a/types/gulp-coffeelint/tsconfig.json b/types/gulp-coffeelint/tsconfig.json index 94e2edb626..695aa2525d 100644 --- a/types/gulp-coffeelint/tsconfig.json +++ b/types/gulp-coffeelint/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-concat/gulp-concat-tests.ts b/types/gulp-concat/gulp-concat-tests.ts index 172aa61451..d1d0ebd1ad 100644 --- a/types/gulp-concat/gulp-concat-tests.ts +++ b/types/gulp-concat/gulp-concat-tests.ts @@ -1,8 +1,5 @@ - - - import gulp = require("gulp"); -import * as concat from "gulp-concat"; +import concat = require("gulp-concat"); gulp.task("concat:simple", () => { gulp.src(["file*.txt"]) diff --git a/types/gulp-concat/tsconfig.json b/types/gulp-concat/tsconfig.json index b28024194c..62d0e3f55f 100644 --- a/types/gulp-concat/tsconfig.json +++ b/types/gulp-concat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-connect/gulp-connect-tests.ts b/types/gulp-connect/gulp-connect-tests.ts index feafa1007b..ea29d2337d 100644 --- a/types/gulp-connect/gulp-connect-tests.ts +++ b/types/gulp-connect/gulp-connect-tests.ts @@ -89,7 +89,7 @@ gulp.task('connect', () => { // The following tests are custom tests to validate the more complicated APIs // Validate gulp-connect typings allow express apps to be passed in as middleware -import * as express from "express"; +import express = require("express"); gulp.task('connect', () => { const middleware = [ @@ -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). diff --git a/types/gulp-connect/tsconfig.json b/types/gulp-connect/tsconfig.json index fca451bd85..2ec8e07735 100644 --- a/types/gulp-connect/tsconfig.json +++ b/types/gulp-connect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-copy/gulp-copy-tests.ts b/types/gulp-copy/gulp-copy-tests.ts index f4bc3ac023..0b5d71f646 100644 --- a/types/gulp-copy/gulp-copy-tests.ts +++ b/types/gulp-copy/gulp-copy-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as gulpCopy from "gulp-copy"; +import gulpCopy = require("gulp-copy"); gulp.task("copy-files", () => { gulp.src("*.nonexistent") diff --git a/types/gulp-copy/tsconfig.json b/types/gulp-copy/tsconfig.json index 0c92078d28..69b46a3185 100644 --- a/types/gulp-copy/tsconfig.json +++ b/types/gulp-copy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-csso/gulp-csso-tests.ts b/types/gulp-csso/gulp-csso-tests.ts index 8595a92ce8..30f693d24d 100644 --- a/types/gulp-csso/gulp-csso-tests.ts +++ b/types/gulp-csso/gulp-csso-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as csso from 'gulp-csso'; +import csso = require('gulp-csso'); gulp.task('default', () => gulp.src('./main.css') diff --git a/types/gulp-csso/tsconfig.json b/types/gulp-csso/tsconfig.json index d0e22a2035..0f0b1e02fc 100644 --- a/types/gulp-csso/tsconfig.json +++ b/types/gulp-csso/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-debug/gulp-debug-tests.ts b/types/gulp-debug/gulp-debug-tests.ts index d5c8a6d52b..f9ffce748d 100644 --- a/types/gulp-debug/gulp-debug-tests.ts +++ b/types/gulp-debug/gulp-debug-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as debug from 'gulp-debug'; +import debug = require('gulp-debug'); gulp.task('default', () => gulp.src('foo.js') @@ -10,5 +7,4 @@ gulp.task('default', () => .pipe(gulp.dest('dist')) ); - debug(); diff --git a/types/gulp-debug/tsconfig.json b/types/gulp-debug/tsconfig.json index 3dbd5e8109..1a862e6e1e 100644 --- a/types/gulp-debug/tsconfig.json +++ b/types/gulp-debug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-diff/gulp-diff-tests.ts b/types/gulp-diff/gulp-diff-tests.ts index 23748d11e8..7c17e5235a 100644 --- a/types/gulp-diff/gulp-diff-tests.ts +++ b/types/gulp-diff/gulp-diff-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as diff from 'gulp-diff'; +import diff = require('gulp-diff'); gulp.task('task', () => { return gulp.src('src') diff --git a/types/gulp-diff/tsconfig.json b/types/gulp-diff/tsconfig.json index 9e4474532a..82c8e71fb3 100644 --- a/types/gulp-diff/tsconfig.json +++ b/types/gulp-diff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-dtsm/gulp-dtsm-tests.ts b/types/gulp-dtsm/gulp-dtsm-tests.ts index dafc6b3468..1262a57210 100644 --- a/types/gulp-dtsm/gulp-dtsm-tests.ts +++ b/types/gulp-dtsm/gulp-dtsm-tests.ts @@ -1,4 +1,4 @@ -import * as dtsm from 'gulp-dtsm'; +import dtsm = require('gulp-dtsm'); import * as gulp from 'gulp'; var stream: NodeJS.WritableStream = dtsm(); diff --git a/types/gulp-dtsm/tsconfig.json b/types/gulp-dtsm/tsconfig.json index dd1ca59de4..4e8ddf667c 100644 --- a/types/gulp-dtsm/tsconfig.json +++ b/types/gulp-dtsm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-espower/gulp-espower-tests.ts b/types/gulp-espower/gulp-espower-tests.ts index 9c04e1d3a0..e06cdda2e8 100644 --- a/types/gulp-espower/gulp-espower-tests.ts +++ b/types/gulp-espower/gulp-espower-tests.ts @@ -1,7 +1,3 @@ - - - - import espower = require('gulp-espower'); import * as gulp from 'gulp'; @@ -9,7 +5,6 @@ gulp.src('src/*.coffee') .pipe(espower()) .pipe(gulp.dest('out')); - gulp.src('src/*.coffee') .pipe(espower({ patterns: ['assert(value, [message])'] })) .pipe(gulp.dest('out')); diff --git a/types/gulp-espower/tsconfig.json b/types/gulp-espower/tsconfig.json index cf469c3b13..720f5897c2 100644 --- a/types/gulp-espower/tsconfig.json +++ b/types/gulp-espower/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-file-include/tsconfig.json b/types/gulp-file-include/tsconfig.json index ab226efcb3..4f8200bc86 100644 --- a/types/gulp-file-include/tsconfig.json +++ b/types/gulp-file-include/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-filter/gulp-filter-tests.ts b/types/gulp-filter/gulp-filter-tests.ts index 903f4083f7..730e6f0ae4 100644 --- a/types/gulp-filter/gulp-filter-tests.ts +++ b/types/gulp-filter/gulp-filter-tests.ts @@ -1,8 +1,8 @@ import * as gulp from 'gulp'; -import * as uglify from 'gulp-uglify'; -import * as less from 'gulp-less'; -import * as concat from 'gulp-concat'; -import * as filter from 'gulp-filter'; +import uglify = require('gulp-uglify'); +import less = require('gulp-less'); +import concat = require('gulp-concat'); +import filter = require('gulp-filter'); // Filter only gulp.task('default', () => { diff --git a/types/gulp-filter/tsconfig.json b/types/gulp-filter/tsconfig.json index f4f7d56d52..6120629011 100644 --- a/types/gulp-filter/tsconfig.json +++ b/types/gulp-filter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-flatten/gulp-flatten-tests.ts b/types/gulp-flatten/gulp-flatten-tests.ts index 8c89236d61..431b7819a9 100644 --- a/types/gulp-flatten/gulp-flatten-tests.ts +++ b/types/gulp-flatten/gulp-flatten-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from "gulp"; -import * as flatten from "gulp-flatten"; +import flatten = require("gulp-flatten"); gulp.task("flatten:simple", () => { gulp.src(["files/**/*.txt"]) diff --git a/types/gulp-flatten/tsconfig.json b/types/gulp-flatten/tsconfig.json index ab4f9a894a..2adbc5747c 100644 --- a/types/gulp-flatten/tsconfig.json +++ b/types/gulp-flatten/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-gh-pages/gulp-gh-pages-tests.ts b/types/gulp-gh-pages/gulp-gh-pages-tests.ts index df527b0023..e541f18508 100644 --- a/types/gulp-gh-pages/gulp-gh-pages-tests.ts +++ b/types/gulp-gh-pages/gulp-gh-pages-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as ghPages from "gulp-gh-pages"; +import ghPages = require("gulp-gh-pages"); gulp.src("test.css") .pipe(ghPages()); diff --git a/types/gulp-gh-pages/tsconfig.json b/types/gulp-gh-pages/tsconfig.json index 1ea7bf2217..3a8f402c8d 100644 --- a/types/gulp-gh-pages/tsconfig.json +++ b/types/gulp-gh-pages/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-gzip/gulp-gzip-tests.ts b/types/gulp-gzip/gulp-gzip-tests.ts index 0a4d125d43..20648e38e1 100644 --- a/types/gulp-gzip/gulp-gzip-tests.ts +++ b/types/gulp-gzip/gulp-gzip-tests.ts @@ -1,6 +1,3 @@ - - - import gulp = require('gulp'); import gzip = require('gulp-gzip'); diff --git a/types/gulp-gzip/tsconfig.json b/types/gulp-gzip/tsconfig.json index 4f3f5f8d77..0bdb09cd02 100644 --- a/types/gulp-gzip/tsconfig.json +++ b/types/gulp-gzip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-help-doc/tsconfig.json b/types/gulp-help-doc/tsconfig.json index b6f16b60a9..997b774603 100644 --- a/types/gulp-help-doc/tsconfig.json +++ b/types/gulp-help-doc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-help/tsconfig.json b/types/gulp-help/tsconfig.json index a174bbab6e..a525512784 100644 --- a/types/gulp-help/tsconfig.json +++ b/types/gulp-help/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-html-replace/gulp-html-replace-tests.ts b/types/gulp-html-replace/gulp-html-replace-tests.ts index 9a21a53b84..ca1e66c680 100644 --- a/types/gulp-html-replace/gulp-html-replace-tests.ts +++ b/types/gulp-html-replace/gulp-html-replace-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as htmlreplace from 'gulp-html-replace'; +import htmlreplace = require('gulp-html-replace'); // Examples taken from README.md of the gulp-html-replace project: // https://www.npmjs.com/package/gulp-html-replace diff --git a/types/gulp-html-replace/tsconfig.json b/types/gulp-html-replace/tsconfig.json index fcf17ed178..f21adbe57d 100644 --- a/types/gulp-html-replace/tsconfig.json +++ b/types/gulp-html-replace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-htmlmin/gulp-htmlmin-tests.ts b/types/gulp-htmlmin/gulp-htmlmin-tests.ts index 29c3bcd4fe..e0ca8be7cd 100644 --- a/types/gulp-htmlmin/gulp-htmlmin-tests.ts +++ b/types/gulp-htmlmin/gulp-htmlmin-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as htmlmin from 'gulp-htmlmin'; +import htmlmin = require('gulp-htmlmin'); gulp.task('minify', function() { return gulp.src('src/*.html') diff --git a/types/gulp-htmlmin/tsconfig.json b/types/gulp-htmlmin/tsconfig.json index 022acde96e..e426cd715f 100644 --- a/types/gulp-htmlmin/tsconfig.json +++ b/types/gulp-htmlmin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-if/tsconfig.json b/types/gulp-if/tsconfig.json index bb2544820b..777df7124c 100644 --- a/types/gulp-if/tsconfig.json +++ b/types/gulp-if/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-inject/gulp-inject-tests.ts b/types/gulp-inject/gulp-inject-tests.ts index ef29ebc343..d57756ccfa 100644 --- a/types/gulp-inject/gulp-inject-tests.ts +++ b/types/gulp-inject/gulp-inject-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from "gulp"; -import * as inject from "gulp-inject"; +import inject = require("gulp-inject"); gulp.task("inject:simple", () => { gulp.src("src/index.html") diff --git a/types/gulp-inject/tsconfig.json b/types/gulp-inject/tsconfig.json index aacadf6415..2af1ab9827 100644 --- a/types/gulp-inject/tsconfig.json +++ b/types/gulp-inject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-insert/tsconfig.json b/types/gulp-insert/tsconfig.json index 6feda660ed..89c69015ed 100644 --- a/types/gulp-insert/tsconfig.json +++ b/types/gulp-insert/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-install/gulp-install-tests.ts b/types/gulp-install/gulp-install-tests.ts index b822b42706..85b1f6ee1b 100644 --- a/types/gulp-install/gulp-install-tests.ts +++ b/types/gulp-install/gulp-install-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as install from 'gulp-install'; +import install = require('gulp-install'); // Examples taken from https://www.npmjs.com/package/gulp-install diff --git a/types/gulp-install/tsconfig.json b/types/gulp-install/tsconfig.json index e1b6063ac9..5576cb02ae 100644 --- a/types/gulp-install/tsconfig.json +++ b/types/gulp-install/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-istanbul/tsconfig.json b/types/gulp-istanbul/tsconfig.json index 133f0cd935..a73367da09 100644 --- a/types/gulp-istanbul/tsconfig.json +++ b/types/gulp-istanbul/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-jade/gulp-jade-tests.ts b/types/gulp-jade/gulp-jade-tests.ts index f184184573..e43917f597 100644 --- a/types/gulp-jade/gulp-jade-tests.ts +++ b/types/gulp-jade/gulp-jade-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as jade from 'gulp-jade'; +import jade = require('gulp-jade'); gulp.task('jade', () => { gulp.src('src/**/*.jade') diff --git a/types/gulp-jade/tsconfig.json b/types/gulp-jade/tsconfig.json index 7e924cb11b..aa9260a7c4 100644 --- a/types/gulp-jade/tsconfig.json +++ b/types/gulp-jade/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-jasmine-browser/gulp-jasmine-browser-tests.ts b/types/gulp-jasmine-browser/gulp-jasmine-browser-tests.ts index db219148d3..ba2584a2a0 100644 --- a/types/gulp-jasmine-browser/gulp-jasmine-browser-tests.ts +++ b/types/gulp-jasmine-browser/gulp-jasmine-browser-tests.ts @@ -1,6 +1,3 @@ - - - import gulp = require('gulp'); import jasmineBrowser = require('gulp-jasmine-browser'); @@ -10,21 +7,18 @@ gulp.task('jasmine', () => .pipe(jasmineBrowser.server({port: 8888})) ); - gulp.task('jasmine-phantom', () => gulp.src(['src/**/*.js', 'spec/**/*_spec.js']) .pipe(jasmineBrowser.specRunner({console: true})) .pipe(jasmineBrowser.headless()) ); - gulp.task('jasmine-slimerjs', () => gulp.src(['src/**/*.js', 'spec/**/*_spec.js']) .pipe(jasmineBrowser.specRunner({console: true})) .pipe(jasmineBrowser.headless({driver: 'slimerjs'})) ); - gulp.task('jasmine', () => gulp.src('spec/**/*_spec.js') .pipe(jasmineBrowser.specRunner()) diff --git a/types/gulp-jasmine-browser/tsconfig.json b/types/gulp-jasmine-browser/tsconfig.json index 55990f3261..3e09f9571f 100644 --- a/types/gulp-jasmine-browser/tsconfig.json +++ b/types/gulp-jasmine-browser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-jasmine/tsconfig.json b/types/gulp-jasmine/tsconfig.json index d44751f20b..4fc991e2ef 100644 --- a/types/gulp-jasmine/tsconfig.json +++ b/types/gulp-jasmine/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gulp-jasmine-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gulp-json-editor/gulp-json-editor-tests.ts b/types/gulp-json-editor/gulp-json-editor-tests.ts index 67176063de..c4fc082360 100644 --- a/types/gulp-json-editor/gulp-json-editor-tests.ts +++ b/types/gulp-json-editor/gulp-json-editor-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as jeditor from 'gulp-json-editor'; +import jeditor = require('gulp-json-editor'); // Samples taken from https://www.npmjs.com/package/gulp-json-editor diff --git a/types/gulp-json-editor/tsconfig.json b/types/gulp-json-editor/tsconfig.json index 4f224b2a01..612fbf802c 100644 --- a/types/gulp-json-editor/tsconfig.json +++ b/types/gulp-json-editor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-jsonminify/gulp-jsonminify-tests.ts b/types/gulp-jsonminify/gulp-jsonminify-tests.ts index 23008bad7e..c158f83627 100644 --- a/types/gulp-jsonminify/gulp-jsonminify-tests.ts +++ b/types/gulp-jsonminify/gulp-jsonminify-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as jsonminify from 'gulp-jsonminify'; +import jsonminify = require('gulp-jsonminify'); gulp.task('minify', () => { return gulp.src('src/*.json') diff --git a/types/gulp-jsonminify/tsconfig.json b/types/gulp-jsonminify/tsconfig.json index 0b6036c600..956c8eab43 100644 --- a/types/gulp-jsonminify/tsconfig.json +++ b/types/gulp-jsonminify/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gulp-jsonminify-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gulp-jspm/gulp-jspm-tests.ts b/types/gulp-jspm/gulp-jspm-tests.ts index 5f3e0812f1..f2c5c4d4e9 100644 --- a/types/gulp-jspm/gulp-jspm-tests.ts +++ b/types/gulp-jspm/gulp-jspm-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as gulpJspm from 'gulp-jspm'; +import gulpJspm = require('gulp-jspm'); // Examples taken from https://www.npmjs.com/package/gulp-jspm gulp.task('default', function(){ @@ -26,7 +23,7 @@ gulp.src('src/main.jsx') gulp.src('src/main.jsx') .pipe(gulpJspm({plugin: 'jsx'})) // `jspm bundle main.jsx!jsx` .pipe(gulp.dest('build/')); - + // all other options given to gulp-jspm are passed on to jspm, e.g. gulp.src('src/main.js') .pipe(gulpJspm({inject: true})) // `jspm bundle main --inject` diff --git a/types/gulp-jspm/tsconfig.json b/types/gulp-jspm/tsconfig.json index b612a0a146..c5e89286e7 100644 --- a/types/gulp-jspm/tsconfig.json +++ b/types/gulp-jspm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-less/gulp-less-tests.ts b/types/gulp-less/gulp-less-tests.ts index bd5335d80e..a5ac36c508 100644 --- a/types/gulp-less/gulp-less-tests.ts +++ b/types/gulp-less/gulp-less-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from "gulp"; -import * as less from "gulp-less"; +import less = require("gulp-less"); // Without options gulp.task("less", () => { diff --git a/types/gulp-less/tsconfig.json b/types/gulp-less/tsconfig.json index e4c00666f5..24266e4482 100644 --- a/types/gulp-less/tsconfig.json +++ b/types/gulp-less/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-load-plugins/gulp-load-plugins-tests.ts b/types/gulp-load-plugins/gulp-load-plugins-tests.ts index a0cff649ec..4f118a0688 100644 --- a/types/gulp-load-plugins/gulp-load-plugins-tests.ts +++ b/types/gulp-load-plugins/gulp-load-plugins-tests.ts @@ -1,6 +1,6 @@ import * as gulp from 'gulp'; -import * as gulpConcat from 'gulp-concat'; -import * as gulpLoadPlugins from 'gulp-load-plugins'; +import gulpConcat = require('gulp-concat'); +import gulpLoadPlugins = require('gulp-load-plugins'); interface GulpPlugins extends IGulpPlugins { concat: typeof gulpConcat; diff --git a/types/gulp-load-plugins/tsconfig.json b/types/gulp-load-plugins/tsconfig.json index 880ad1acd1..44c98dfb1d 100644 --- a/types/gulp-load-plugins/tsconfig.json +++ b/types/gulp-load-plugins/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-minify-css/gulp-minify-css-tests.ts b/types/gulp-minify-css/gulp-minify-css-tests.ts index 597111d30c..9de00a3ae8 100644 --- a/types/gulp-minify-css/gulp-minify-css-tests.ts +++ b/types/gulp-minify-css/gulp-minify-css-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from "gulp"; -import * as minifyCSS from "gulp-minify-css"; +import minifyCSS = require("gulp-minify-css"); gulp.task("minify-css", () => { gulp.src("css/**/*.css") diff --git a/types/gulp-minify-css/tsconfig.json b/types/gulp-minify-css/tsconfig.json index ccb2e4b319..08ddc4b6de 100644 --- a/types/gulp-minify-css/tsconfig.json +++ b/types/gulp-minify-css/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-minify-html/gulp-minify-html-tests.ts b/types/gulp-minify-html/gulp-minify-html-tests.ts index fd27474de2..5071348899 100644 --- a/types/gulp-minify-html/gulp-minify-html-tests.ts +++ b/types/gulp-minify-html/gulp-minify-html-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as minifyHtml from 'gulp-minify-html'; +import minifyHtml = require('gulp-minify-html'); // This package has been deprecated in favor of gulp-htmlmin, which should be faster and more comprehensive. diff --git a/types/gulp-minify-html/tsconfig.json b/types/gulp-minify-html/tsconfig.json index 80ef59bff4..5594b9006d 100644 --- a/types/gulp-minify-html/tsconfig.json +++ b/types/gulp-minify-html/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-mocha/gulp-mocha-tests.ts b/types/gulp-mocha/gulp-mocha-tests.ts index c84d710380..d007900825 100644 --- a/types/gulp-mocha/gulp-mocha-tests.ts +++ b/types/gulp-mocha/gulp-mocha-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as mocha from "gulp-mocha"; +import mocha = require("gulp-mocha"); gulp.task('default', function () { return gulp.src('test.js', {read: false}) diff --git a/types/gulp-mocha/tsconfig.json b/types/gulp-mocha/tsconfig.json index 52b200e921..0e919fbac5 100644 --- a/types/gulp-mocha/tsconfig.json +++ b/types/gulp-mocha/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-modernizr/gulp-modernizr-tests.ts b/types/gulp-modernizr/gulp-modernizr-tests.ts index a29f642d7f..8c5b4c0e31 100644 --- a/types/gulp-modernizr/gulp-modernizr-tests.ts +++ b/types/gulp-modernizr/gulp-modernizr-tests.ts @@ -1,5 +1,5 @@ import { src, dest } from 'gulp'; -import * as gulpModernizr from 'gulp-modernizr'; +import gulpModernizr = require('gulp-modernizr'); const s1 = gulpModernizr(); const s2 = gulpModernizr('filename.js', {}); diff --git a/types/gulp-modernizr/tsconfig.json b/types/gulp-modernizr/tsconfig.json index a2f50619a3..4c28752668 100644 --- a/types/gulp-modernizr/tsconfig.json +++ b/types/gulp-modernizr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-msbuild/gulp-msbuild-tests.ts b/types/gulp-msbuild/gulp-msbuild-tests.ts index f9e5ce053b..386746c0de 100644 --- a/types/gulp-msbuild/gulp-msbuild-tests.ts +++ b/types/gulp-msbuild/gulp-msbuild-tests.ts @@ -1,4 +1,4 @@ -import * as msbuild from "gulp-msbuild"; +import msbuild = require("gulp-msbuild"); const stream = msbuild({ stdout: false, diff --git a/types/gulp-msbuild/tsconfig.json b/types/gulp-msbuild/tsconfig.json index e999f3b231..560d597b85 100644 --- a/types/gulp-msbuild/tsconfig.json +++ b/types/gulp-msbuild/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-mustache/gulp-mustache-tests.ts b/types/gulp-mustache/gulp-mustache-tests.ts index c069a1dd02..d8285370e7 100644 --- a/types/gulp-mustache/gulp-mustache-tests.ts +++ b/types/gulp-mustache/gulp-mustache-tests.ts @@ -1,5 +1,4 @@ -import * as mustache from "gulp-mustache"; -// noinspection ES6UnusedImports +import mustache = require("gulp-mustache"); import { Transform } from "stream"; mustache({ // $ExpectType Transform diff --git a/types/gulp-mustache/tsconfig.json b/types/gulp-mustache/tsconfig.json index f461c5d525..4ebb11f698 100644 --- a/types/gulp-mustache/tsconfig.json +++ b/types/gulp-mustache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-newer/tsconfig.json b/types/gulp-newer/tsconfig.json index c139e12412..c5d2ed8894 100644 --- a/types/gulp-newer/tsconfig.json +++ b/types/gulp-newer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-ng-annotate/gulp-ng-annotate-tests.ts b/types/gulp-ng-annotate/gulp-ng-annotate-tests.ts index ea48672fb0..6116b87ad2 100644 --- a/types/gulp-ng-annotate/gulp-ng-annotate-tests.ts +++ b/types/gulp-ng-annotate/gulp-ng-annotate-tests.ts @@ -1,6 +1,3 @@ - - - import ngAnnotate = require('gulp-ng-annotate'); import gulp = require('gulp'); diff --git a/types/gulp-ng-annotate/tsconfig.json b/types/gulp-ng-annotate/tsconfig.json index 1b7db8f980..7a35fde2b9 100644 --- a/types/gulp-ng-annotate/tsconfig.json +++ b/types/gulp-ng-annotate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-nodemon/gulp-nodemon-tests.ts b/types/gulp-nodemon/gulp-nodemon-tests.ts index 364536f778..85e90a667b 100644 --- a/types/gulp-nodemon/gulp-nodemon-tests.ts +++ b/types/gulp-nodemon/gulp-nodemon-tests.ts @@ -1,6 +1,3 @@ - - - import gulp = require('gulp'); import path = require('path'); import nodemon = require('gulp-nodemon'); @@ -29,6 +26,8 @@ nodemon({ }); return tasks } + , nodeArgs: ['--trace-warnings'] + , args: ['-t'] }); diff --git a/types/gulp-nodemon/index.d.ts b/types/gulp-nodemon/index.d.ts index 7c5491f596..de08560463 100644 --- a/types/gulp-nodemon/index.d.ts +++ b/types/gulp-nodemon/index.d.ts @@ -69,6 +69,9 @@ declare namespace nodemon { execMap?: { [key: string]: string | boolean | number; }; events?: { [key: string]: string; }; restartable?: string; + args?: string[]; + nodeArgs?: string[]; + scriptPosition?: number; } interface EventEmitter extends NodeJS.EventEmitter { diff --git a/types/gulp-nodemon/tsconfig.json b/types/gulp-nodemon/tsconfig.json index af6e7a7991..5ff166eae3 100644 --- a/types/gulp-nodemon/tsconfig.json +++ b/types/gulp-nodemon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-nunit-runner/gulp-nunit-runner-tests.ts b/types/gulp-nunit-runner/gulp-nunit-runner-tests.ts index 0e55fef37a..ea571c3cf8 100644 --- a/types/gulp-nunit-runner/gulp-nunit-runner-tests.ts +++ b/types/gulp-nunit-runner/gulp-nunit-runner-tests.ts @@ -1,4 +1,4 @@ -import * as nunit from "gulp-nunit-runner"; +import nunit = require("gulp-nunit-runner"); const stream = nunit({ executable: 'c:/Program Files/NUnit/bin', diff --git a/types/gulp-nunit-runner/tsconfig.json b/types/gulp-nunit-runner/tsconfig.json index 97a0a7a8cb..e7daea0b13 100644 --- a/types/gulp-nunit-runner/tsconfig.json +++ b/types/gulp-nunit-runner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-plumber/tsconfig.json b/types/gulp-plumber/tsconfig.json index ad53d6fde5..a483c3197e 100644 --- a/types/gulp-plumber/tsconfig.json +++ b/types/gulp-plumber/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-protractor/gulp-protractor-tests.ts b/types/gulp-protractor/gulp-protractor-tests.ts index 77d31e2bea..c79ac9220c 100644 --- a/types/gulp-protractor/gulp-protractor-tests.ts +++ b/types/gulp-protractor/gulp-protractor-tests.ts @@ -1,6 +1,3 @@ - - - import gulp = require('gulp'); import protractor = require('gulp-protractor'); diff --git a/types/gulp-protractor/tsconfig.json b/types/gulp-protractor/tsconfig.json index bb39acdbdc..758e915a22 100644 --- a/types/gulp-protractor/tsconfig.json +++ b/types/gulp-protractor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-pug/gulp-pug-tests.ts b/types/gulp-pug/gulp-pug-tests.ts index 0ec83a248f..1ba56b91e4 100644 --- a/types/gulp-pug/gulp-pug-tests.ts +++ b/types/gulp-pug/gulp-pug-tests.ts @@ -1,5 +1,5 @@ import { src, dest } from 'gulp'; -import * as gulpPug from 'gulp-pug'; +import gulpPug = require('gulp-pug'); const s1 = gulpPug(); const s2 = gulpPug({}); diff --git a/types/gulp-pug/tsconfig.json b/types/gulp-pug/tsconfig.json index b3b2597c1e..c52e2c9cf0 100644 --- a/types/gulp-pug/tsconfig.json +++ b/types/gulp-pug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-remember/tsconfig.json b/types/gulp-remember/tsconfig.json index 02070e1b82..c3b4e15c77 100644 --- a/types/gulp-remember/tsconfig.json +++ b/types/gulp-remember/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-rename/tsconfig.json b/types/gulp-rename/tsconfig.json index b9b34366ee..3c33e8adf4 100644 --- a/types/gulp-rename/tsconfig.json +++ b/types/gulp-rename/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-replace/gulp-replace-tests.ts b/types/gulp-replace/gulp-replace-tests.ts index 6a17057495..79f77b93a9 100644 --- a/types/gulp-replace/gulp-replace-tests.ts +++ b/types/gulp-replace/gulp-replace-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as replace from "gulp-replace"; +import replace = require("gulp-replace"); gulp.task('templates', function(){ gulp.src(['file.txt']) diff --git a/types/gulp-replace/tsconfig.json b/types/gulp-replace/tsconfig.json index 5d188a1919..81dc6799cb 100644 --- a/types/gulp-replace/tsconfig.json +++ b/types/gulp-replace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-rev-replace/gulp-rev-replace-tests.ts b/types/gulp-rev-replace/gulp-rev-replace-tests.ts index 2d7e5a3580..3d191811bb 100644 --- a/types/gulp-rev-replace/gulp-rev-replace-tests.ts +++ b/types/gulp-rev-replace/gulp-rev-replace-tests.ts @@ -1,7 +1,7 @@ import * as gulp from 'gulp'; -import * as revReplace from 'gulp-rev-replace'; -import * as rev from 'gulp-rev'; -import * as useref from 'gulp-useref'; +import revReplace = require('gulp-rev-replace'); +import rev = require('gulp-rev'); +import useref = require('gulp-useref'); gulp.task("index", () => { return gulp.src("src/index.html") diff --git a/types/gulp-rev-replace/tsconfig.json b/types/gulp-rev-replace/tsconfig.json index c9a020605c..54babfcd8a 100644 --- a/types/gulp-rev-replace/tsconfig.json +++ b/types/gulp-rev-replace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-rev/gulp-rev-tests.ts b/types/gulp-rev/gulp-rev-tests.ts index c13b23fc71..c19616de11 100644 --- a/types/gulp-rev/gulp-rev-tests.ts +++ b/types/gulp-rev/gulp-rev-tests.ts @@ -1,6 +1,3 @@ - - - import gulp = require('gulp'); import rev = require('gulp-rev'); diff --git a/types/gulp-rev/tsconfig.json b/types/gulp-rev/tsconfig.json index fac8396ef8..c5ca988faa 100644 --- a/types/gulp-rev/tsconfig.json +++ b/types/gulp-rev/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-ruby-sass/gulp-ruby-sass-tests.ts b/types/gulp-ruby-sass/gulp-ruby-sass-tests.ts index 69346a16d8..70a034bd68 100644 --- a/types/gulp-ruby-sass/gulp-ruby-sass-tests.ts +++ b/types/gulp-ruby-sass/gulp-ruby-sass-tests.ts @@ -1,5 +1,5 @@ import * as gulp from "gulp"; -import * as sass from "gulp-ruby-sass"; +import sass = require("gulp-ruby-sass"); gulp.task('sass', function () { sass('./scss/*.scss') diff --git a/types/gulp-ruby-sass/tsconfig.json b/types/gulp-ruby-sass/tsconfig.json index 947482e45c..562b5e91b4 100644 --- a/types/gulp-ruby-sass/tsconfig.json +++ b/types/gulp-ruby-sass/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-sass/gulp-sass-tests.ts b/types/gulp-sass/gulp-sass-tests.ts index 72192512a7..5bed46d938 100644 --- a/types/gulp-sass/gulp-sass-tests.ts +++ b/types/gulp-sass/gulp-sass-tests.ts @@ -1,5 +1,5 @@ import gulp = require("gulp"); -import * as sass from "gulp-sass"; +import sass = require("gulp-sass"); gulp.task('sass', function () { gulp.src('./scss/*.scss') diff --git a/types/gulp-sass/tsconfig.json b/types/gulp-sass/tsconfig.json index 311d0e2615..62e7bfb40f 100644 --- a/types/gulp-sass/tsconfig.json +++ b/types/gulp-sass/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-shell/tsconfig.json b/types/gulp-shell/tsconfig.json index d9797a8f28..4d73d765dd 100644 --- a/types/gulp-shell/tsconfig.json +++ b/types/gulp-shell/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-size/gulp-size-tests.ts b/types/gulp-size/gulp-size-tests.ts index bd53018d6a..f978842201 100644 --- a/types/gulp-size/gulp-size-tests.ts +++ b/types/gulp-size/gulp-size-tests.ts @@ -1,6 +1,6 @@ import * as gulp from 'gulp'; -import * as size from 'gulp-size'; -import * as debug from 'gulp-debug'; +import size = require('gulp-size'); +import debug = require('gulp-debug'); gulp.task('default', () => gulp.src('fixture.js') diff --git a/types/gulp-size/tsconfig.json b/types/gulp-size/tsconfig.json index 2d84cb001c..ee2d5f0bc9 100644 --- a/types/gulp-size/tsconfig.json +++ b/types/gulp-size/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-sort/gulp-sort-tests.ts b/types/gulp-sort/gulp-sort-tests.ts index 62e17d27a2..e3cf64f429 100644 --- a/types/gulp-sort/gulp-sort-tests.ts +++ b/types/gulp-sort/gulp-sort-tests.ts @@ -1,7 +1,7 @@ /** Tests taken from https://github.com/pgilad/gulp-sort#usage */ import * as gulp from 'gulp'; -import * as sort from 'gulp-sort'; +import sort = require('gulp-sort'); import * as gulpUtil from 'gulp-util'; // default sort diff --git a/types/gulp-sort/tsconfig.json b/types/gulp-sort/tsconfig.json index df1ddc44e4..19cd0ffa81 100644 --- a/types/gulp-sort/tsconfig.json +++ b/types/gulp-sort/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-sourcemaps/tsconfig.json b/types/gulp-sourcemaps/tsconfig.json index 198b428937..fd79ffc3b1 100644 --- a/types/gulp-sourcemaps/tsconfig.json +++ b/types/gulp-sourcemaps/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-strip-debug/gulp-strip-debug-tests.ts b/types/gulp-strip-debug/gulp-strip-debug-tests.ts index 9a0b04e48a..0e8b6c1a8b 100644 --- a/types/gulp-strip-debug/gulp-strip-debug-tests.ts +++ b/types/gulp-strip-debug/gulp-strip-debug-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from 'gulp'; -import * as stripDebug from 'gulp-strip-debug'; +import stripDebug = require('gulp-strip-debug'); // Example taken from https://www.npmjs.com/package/gulp-strip-debug gulp.task('default', function () { diff --git a/types/gulp-strip-debug/tsconfig.json b/types/gulp-strip-debug/tsconfig.json index ad5d90ca69..6e8ef33fc2 100644 --- a/types/gulp-strip-debug/tsconfig.json +++ b/types/gulp-strip-debug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-svg-sprite/tsconfig.json b/types/gulp-svg-sprite/tsconfig.json index ed703e4c09..edfff724d1 100644 --- a/types/gulp-svg-sprite/tsconfig.json +++ b/types/gulp-svg-sprite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-task-listing/tsconfig.json b/types/gulp-task-listing/tsconfig.json index 6d99b2f3f2..2b580f1f5f 100644 --- a/types/gulp-task-listing/tsconfig.json +++ b/types/gulp-task-listing/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-tsd/gulp-tsd-tests.ts b/types/gulp-tsd/gulp-tsd-tests.ts index 0b7a1dadea..e593ec2634 100644 --- a/types/gulp-tsd/gulp-tsd-tests.ts +++ b/types/gulp-tsd/gulp-tsd-tests.ts @@ -1,8 +1,5 @@ - - - import * as gulp from "gulp"; -import * as tsd from "gulp-tsd"; +import tsd = require("gulp-tsd"); gulp.task("tsd", () => { gulp.src("gulp_tsd.json") diff --git a/types/gulp-tsd/tsconfig.json b/types/gulp-tsd/tsconfig.json index 692c21e642..3ede2690c5 100644 --- a/types/gulp-tsd/tsconfig.json +++ b/types/gulp-tsd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-uglify/composer.d.ts b/types/gulp-uglify/composer.d.ts index bb3f04f134..0584a72fc0 100644 --- a/types/gulp-uglify/composer.d.ts +++ b/types/gulp-uglify/composer.d.ts @@ -1,5 +1,5 @@ import * as UglifyJS from 'uglify-js'; -import * as GulpUglify from '.'; +import GulpUglify = require('.'); interface Composer { (uglify: Uglify, log: Logger): typeof GulpUglify; diff --git a/types/gulp-uglify/gulp-uglify-tests.ts b/types/gulp-uglify/gulp-uglify-tests.ts index 172d7cae0b..1a23580e8c 100644 --- a/types/gulp-uglify/gulp-uglify-tests.ts +++ b/types/gulp-uglify/gulp-uglify-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as uglify from 'gulp-uglify'; +import uglify = require('gulp-uglify'); import pump = require('pump'); import uglifyjs = require('uglify-js'); import composer = require('gulp-uglify/composer'); diff --git a/types/gulp-uglify/tsconfig.json b/types/gulp-uglify/tsconfig.json index 72fd35c65e..282b6c138b 100644 --- a/types/gulp-uglify/tsconfig.json +++ b/types/gulp-uglify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-useref/gulp-useref-tests.ts b/types/gulp-useref/gulp-useref-tests.ts index 5d777fd6e6..91cc7919e7 100644 --- a/types/gulp-useref/gulp-useref-tests.ts +++ b/types/gulp-useref/gulp-useref-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as useref from 'gulp-useref'; +import useref = require('gulp-useref'); // Usage gulp.task('default', function () { @@ -14,7 +14,7 @@ gulp.task('default', function () { .pipe(gulp.dest('dist')); }); -import * as gulpif from 'gulp-if'; +import gulpif = require('gulp-if'); import uglify = require('gulp-uglify'); import minifyCss = require('gulp-minify-css'); diff --git a/types/gulp-useref/tsconfig.json b/types/gulp-useref/tsconfig.json index cdb7922c57..b12ffbcda7 100644 --- a/types/gulp-useref/tsconfig.json +++ b/types/gulp-useref/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-util/tsconfig.json b/types/gulp-util/tsconfig.json index f383866019..d3286da30b 100644 --- a/types/gulp-util/tsconfig.json +++ b/types/gulp-util/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-watch/gulp-watch-tests.ts b/types/gulp-watch/gulp-watch-tests.ts index b273662824..360c53dd19 100644 --- a/types/gulp-watch/gulp-watch-tests.ts +++ b/types/gulp-watch/gulp-watch-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as watch from 'gulp-watch'; +import watch = require('gulp-watch'); gulp.task('stream', () => gulp.src('css/**/*.css') diff --git a/types/gulp-watch/tsconfig.json b/types/gulp-watch/tsconfig.json index 079cb9d569..b1937b173a 100644 --- a/types/gulp-watch/tsconfig.json +++ b/types/gulp-watch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp-zip/gulp-zip-tests.ts b/types/gulp-zip/gulp-zip-tests.ts index 983a4263ce..428ce81ebd 100644 --- a/types/gulp-zip/gulp-zip-tests.ts +++ b/types/gulp-zip/gulp-zip-tests.ts @@ -1,4 +1,4 @@ -import * as GulpZip from 'gulp-zip'; +import GulpZip = require('gulp-zip'); GulpZip('file.zip').on('end', () => {}); GulpZip('file.zip', {compress: false}).on('end', () => {}); diff --git a/types/gulp-zip/tsconfig.json b/types/gulp-zip/tsconfig.json index a5f75d75fa..8b43507914 100644 --- a/types/gulp-zip/tsconfig.json +++ b/types/gulp-zip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gulp/test/index.ts b/types/gulp/test/index.ts index 853799d8c4..f5ca436450 100644 --- a/types/gulp/test/index.ts +++ b/types/gulp/test/index.ts @@ -1,7 +1,7 @@ import * as gulp from 'gulp'; import * as undertaker from 'undertaker'; import * as registry from 'undertaker-registry'; -import * as del from "del"; +import del = require("del"); const minify: () => any = () => { }; const jade: () => any = () => { }; diff --git a/types/gulp/tsconfig.json b/types/gulp/tsconfig.json index b0ca843318..dfba44bd86 100644 --- a/types/gulp/tsconfig.json +++ b/types/gulp/tsconfig.json @@ -16,6 +16,7 @@ "strictNullChecks": true, "strictFunctionTypes": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true }, "files": [ diff --git a/types/gulp/v3/tsconfig.json b/types/gulp/v3/tsconfig.json index 2948f23682..d1a56e0a01 100644 --- a/types/gulp/v3/tsconfig.json +++ b/types/gulp/v3/tsconfig.json @@ -22,7 +22,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gzip-js/tsconfig.json b/types/gzip-js/tsconfig.json index a8138e1de9..978dc916bd 100644 --- a/types/gzip-js/tsconfig.json +++ b/types/gzip-js/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gzip-js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/gzip-size/tsconfig.json b/types/gzip-size/tsconfig.json index 6d244facf6..9779d93536 100644 --- a/types/gzip-size/tsconfig.json +++ b/types/gzip-size/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/gzip-size/v3/tsconfig.json b/types/gzip-size/v3/tsconfig.json index 88a695711b..1e806cb7bc 100644 --- a/types/gzip-size/v3/tsconfig.json +++ b/types/gzip-size/v3/tsconfig.json @@ -19,10 +19,11 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "gzip-size-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/h2o2/tsconfig.json b/types/h2o2/tsconfig.json index 30a156a786..b0d5bbf160 100644 --- a/types/h2o2/tsconfig.json +++ b/types/h2o2/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "h2o2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/halfred/tsconfig.json b/types/halfred/tsconfig.json index 7d75a822cb..2e09cffd82 100644 --- a/types/halfred/tsconfig.json +++ b/types/halfred/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/halogen/tsconfig.json b/types/halogen/tsconfig.json index f234a05b87..caaa6505d4 100644 --- a/types/halogen/tsconfig.json +++ b/types/halogen/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ diff --git a/types/hammerjs/tsconfig.json b/types/hammerjs/tsconfig.json index c0ba95885c..e159cc1fe0 100644 --- a/types/hammerjs/tsconfig.json +++ b/types/hammerjs/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/hammerjs/v1/tsconfig.json b/types/hammerjs/v1/tsconfig.json index aeabf7ff07..665a768e1d 100644 --- a/types/hammerjs/v1/tsconfig.json +++ b/types/hammerjs/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/handlebars/tsconfig.json b/types/handlebars/tsconfig.json index 5f874f3996..3fdef52d13 100644 --- a/types/handlebars/tsconfig.json +++ b/types/handlebars/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/handlebars/v1/tsconfig.json b/types/handlebars/v1/tsconfig.json index 96818b903b..7b246f2c3a 100644 --- a/types/handlebars/v1/tsconfig.json +++ b/types/handlebars/v1/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/hapi-auth-basic/tsconfig.json b/types/hapi-auth-basic/tsconfig.json index 56ac44dbdd..7448e829c4 100644 --- a/types/hapi-auth-basic/tsconfig.json +++ b/types/hapi-auth-basic/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "hapi-auth-basic-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/hapi-auth-jwt2/tsconfig.json b/types/hapi-auth-jwt2/tsconfig.json index 78a8423cc4..7d06e7c818 100644 --- a/types/hapi-auth-jwt2/tsconfig.json +++ b/types/hapi-auth-jwt2/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "hapi-auth-jwt2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/hapi-decorators/tsconfig.json b/types/hapi-decorators/tsconfig.json index 80aa56a21e..645122114e 100644 --- a/types/hapi-decorators/tsconfig.json +++ b/types/hapi-decorators/tsconfig.json @@ -16,13 +16,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "hapi-decorators-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/hapi/tsconfig.json b/types/hapi/tsconfig.json index 96790b3bff..53f8f2ece6 100644 --- a/types/hapi/tsconfig.json +++ b/types/hapi/tsconfig.json @@ -14,10 +14,13 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -97,4 +100,4 @@ "test/server/table.ts", "test/server/version.ts" ] -} +} \ No newline at end of file diff --git a/types/hapi/v12/tsconfig.json b/types/hapi/v12/tsconfig.json index c461c7d288..527a25a6be 100644 --- a/types/hapi/v12/tsconfig.json +++ b/types/hapi/v12/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hapi/v15/tsconfig.json b/types/hapi/v15/tsconfig.json index 154b6a8f0e..f3eea23e6b 100644 --- a/types/hapi/v15/tsconfig.json +++ b/types/hapi/v15/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hapi/v8/tsconfig.json b/types/hapi/v8/tsconfig.json index 7eb82005fd..e56e64ba1e 100644 --- a/types/hapi/v8/tsconfig.json +++ b/types/hapi/v8/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/har-format/tsconfig.json b/types/har-format/tsconfig.json index f5029a7c18..e30aa982b8 100644 --- a/types/har-format/tsconfig.json +++ b/types/har-format/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hard-rejection/tsconfig.json b/types/hard-rejection/tsconfig.json index 6c83946da7..1521f9e327 100644 --- a/types/hard-rejection/tsconfig.json +++ b/types/hard-rejection/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/harmony-proxy/tsconfig.json b/types/harmony-proxy/tsconfig.json index 2190dd8e23..5225c0854d 100644 --- a/types/harmony-proxy/tsconfig.json +++ b/types/harmony-proxy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/has-ansi/tsconfig.json b/types/has-ansi/tsconfig.json index d5b52a8974..e80018a785 100644 --- a/types/has-ansi/tsconfig.json +++ b/types/has-ansi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hash-file/tsconfig.json b/types/hash-file/tsconfig.json index 67f8cfcf8c..c300cccbda 100644 --- a/types/hash-file/tsconfig.json +++ b/types/hash-file/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hash-stream/tsconfig.json b/types/hash-stream/tsconfig.json index e1846bd608..61d4d3c12e 100644 --- a/types/hash-stream/tsconfig.json +++ b/types/hash-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hasha/tsconfig.json b/types/hasha/tsconfig.json index fe359d64a5..ebef98b818 100644 --- a/types/hasha/tsconfig.json +++ b/types/hasha/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hasher/tsconfig.json b/types/hasher/tsconfig.json index dae70f6dc4..b05767e01b 100644 --- a/types/hasher/tsconfig.json +++ b/types/hasher/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hashids/tsconfig.json b/types/hashids/tsconfig.json index 4d118acf1b..7d308003bb 100644 --- a/types/hashids/tsconfig.json +++ b/types/hashids/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hashmap/tsconfig.json b/types/hashmap/tsconfig.json index f2d00e0999..700a72e832 100644 --- a/types/hashmap/tsconfig.json +++ b/types/hashmap/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/hashmap/v1/tsconfig.json b/types/hashmap/v1/tsconfig.json index a085a1d89d..6537d23b5d 100644 --- a/types/hashmap/v1/tsconfig.json +++ b/types/hashmap/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hashset/tsconfig.json b/types/hashset/tsconfig.json index 7bf84fd5f1..9ac81f5b45 100644 --- a/types/hashset/tsconfig.json +++ b/types/hashset/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hashtable/tsconfig.json b/types/hashtable/tsconfig.json index 497a9448bf..eac4d4b6c8 100644 --- a/types/hashtable/tsconfig.json +++ b/types/hashtable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/haversine/tsconfig.json b/types/haversine/tsconfig.json index 6b8c2dfaf6..ed00b23d2c 100644 --- a/types/haversine/tsconfig.json +++ b/types/haversine/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hbs/hbs-tests.ts b/types/hbs/hbs-tests.ts new file mode 100644 index 0000000000..c1d355daea --- /dev/null +++ b/types/hbs/hbs-tests.ts @@ -0,0 +1,29 @@ +import express = require('express'); + +const app = express(); + +app.set('view engine', 'html'); + +import hbs = require('hbs'); + +// The idiom for this is +// app.engine('html', require('hbs').__express); +// However this undermines the test since the return type of require() is any +app.engine('html', hbs.__express); + +hbs.registerHelper('helper_name', (testParm: number) => testParm++); +hbs.registerPartial('partial_name', 'partial value'); + +hbs.registerPartials(__dirname + '/views/partials'); + +hbs.registerPartials(__dirname + '/views/partials', () => {}); + +hbs.localsAsTemplateData(app); + +const safeString = new hbs.handlebars.SafeString("string"); + +const instance1 = hbs.create(); +const instance2 = hbs.create(); + +app.engine('html', instance1.__express); +app.engine('hbs', instance2.__express); diff --git a/types/hbs/index.d.ts b/types/hbs/index.d.ts new file mode 100644 index 0000000000..1b3a36c4be --- /dev/null +++ b/types/hbs/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for hbs 4.0 +// Project: https://github.com/pillarjs/hbs +// Definitions by: David Muller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import handlebars = require('handlebars'); + +type handlebarsModule = typeof handlebars; + +interface hbsModule { + readonly handlebars: handlebarsModule; + localsAsTemplateData(app: any): void; + registerHelper(helperName: string, helperFunction: (...args: any[]) => any): void; + registerPartial(partialName: string, partialValue: string): void; + registerPartials(directoryName: string, callback?: () => void): void; + __express(filename: string, options: any, cb: (...args: any[]) => any): any; +} + +interface hbsModuleWithCreate extends hbsModule { + create(handlebars?: handlebarsModule): hbsModule; +} + +declare var baseModule: hbsModuleWithCreate; + +export = baseModule; diff --git a/types/hbs/tsconfig.json b/types/hbs/tsconfig.json new file mode 100644 index 0000000000..4ed61e005d --- /dev/null +++ b/types/hbs/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "hbs-tests.ts" + ] +} \ No newline at end of file diff --git a/types/hbs/tslint.json b/types/hbs/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/hbs/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/he/tsconfig.json b/types/he/tsconfig.json index 6e02234def..21526db543 100644 --- a/types/he/tsconfig.json +++ b/types/he/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/headroom/tsconfig.json b/types/headroom/tsconfig.json index eb03738511..5184b6b443 100644 --- a/types/headroom/tsconfig.json +++ b/types/headroom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/heap/tsconfig.json b/types/heap/tsconfig.json index ed8f269f6e..a5dc20174d 100644 --- a/types/heap/tsconfig.json +++ b/types/heap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/heapdump/tsconfig.json b/types/heapdump/tsconfig.json index a15a306b41..703a603ae1 100644 --- a/types/heapdump/tsconfig.json +++ b/types/heapdump/tsconfig.json @@ -16,10 +16,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "heapdump-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/heatmap.js/tsconfig.json b/types/heatmap.js/tsconfig.json index 2e22853a34..d1e87ffb3d 100644 --- a/types/heatmap.js/tsconfig.json +++ b/types/heatmap.js/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hedron/tsconfig.json b/types/hedron/tsconfig.json index bed62b30c6..647d1d6a30 100644 --- a/types/hedron/tsconfig.json +++ b/types/hedron/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "preserve" }, "files": [ diff --git a/types/hellojs/tsconfig.json b/types/hellojs/tsconfig.json index c3baa66581..755aefce72 100644 --- a/types/hellojs/tsconfig.json +++ b/types/hellojs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hellosign-embedded/tsconfig.json b/types/hellosign-embedded/tsconfig.json index 4712a41816..74d8ec66b4 100644 --- a/types/hellosign-embedded/tsconfig.json +++ b/types/hellosign-embedded/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/helmet/tsconfig.json b/types/helmet/tsconfig.json index 0a85e89659..f85a86b1c8 100644 --- a/types/helmet/tsconfig.json +++ b/types/helmet/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/heredatalens/tsconfig.json b/types/heredatalens/tsconfig.json index 5a2650b93f..4e2e0cd1a3 100644 --- a/types/heredatalens/tsconfig.json +++ b/types/heredatalens/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/heremaps/tsconfig.json b/types/heremaps/tsconfig.json index 7f83e9f79c..4ccebfba90 100644 --- a/types/heremaps/tsconfig.json +++ b/types/heremaps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/heroku-logger/tsconfig.json b/types/heroku-logger/tsconfig.json index 802ac41a2a..ebd7c0041c 100644 --- a/types/heroku-logger/tsconfig.json +++ b/types/heroku-logger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hex-rgba/tsconfig.json b/types/hex-rgba/tsconfig.json index 82f2e3808e..2f0ff73e60 100644 --- a/types/hex-rgba/tsconfig.json +++ b/types/hex-rgba/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "hex-rgba-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/hexo-bunyan/tsconfig.json b/types/hexo-bunyan/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/hexo-bunyan/tsconfig.json +++ b/types/hexo-bunyan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/hexo-fs/tsconfig.json b/types/hexo-fs/tsconfig.json index 4d8c00b74e..b3014c52df 100644 --- a/types/hexo-fs/tsconfig.json +++ b/types/hexo-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hexo-log/tsconfig.json b/types/hexo-log/tsconfig.json index b0af5da25b..906e609902 100644 --- a/types/hexo-log/tsconfig.json +++ b/types/hexo-log/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/highcharts-ng/tsconfig.json b/types/highcharts-ng/tsconfig.json index 6f313e502a..f1f180976f 100644 --- a/types/highcharts-ng/tsconfig.json +++ b/types/highcharts-ng/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index 917ab479ea..48c0c614c2 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -174,7 +174,7 @@ declare namespace Highcharts { * font size on bottom axis. * @default null */ - y?: number; + y?: number | null; /** * The Z index for the axis labels. * @default 7 @@ -256,7 +256,7 @@ declare namespace Highcharts { * Border color for the plot band. Also requires borderWidth to be set. * @default null */ - borderColor?: Color; + borderColor?: Color | null; /** * Border width for the plot band. Also requires borderColor to be set. * @default 0 @@ -289,7 +289,7 @@ declare namespace Highcharts { * @default null * @since 2.3 */ - innerRadius?: number | string; + innerRadius?: number | string | null; /** * Text labels for the plot bands */ @@ -485,7 +485,7 @@ declare namespace Highcharts { * @default 'middle' * @deprecated */ - enabled?: string; + enabled?: string | null; /** * The pixel distance between the axis labels or line and the title. * @default xAxis: 0 for horizontal axes, 10 for vertical axes, yAxis: 40 @@ -581,7 +581,7 @@ declare namespace Highcharts { * categories: ['Apples', 'Bananas', 'Oranges'] * @default null */ - categories?: any[]; + categories?: any[] | null; /** * The highest allowed value for automatically computed axis extremes. * @since 4.0 @@ -652,7 +652,7 @@ declare namespace Highcharts { * @default null * @since 4.0 */ - floor?: number; + floor?: number | null; /** * Color of the grid lines extending the ticks across the plot area. * @defaults to '#D8D8D8'. @@ -705,7 +705,7 @@ declare namespace Highcharts { * The maximum value of the axis. If null, the max value is automatically calculated. If the endOnTick option is * true, the max value might be rounded up. The actual maximum value is also influenced by chart.alignTicks. */ - max?: number; + max?: number | null; /** * Padding of the max value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. * This is useful when you don't want the highest data value to appear on the edge of the plot area. When the axis' @@ -723,7 +723,7 @@ declare namespace Highcharts { * The minimum value of the axis. If null the min value is automatically calculated. If the startOnTick option is * true, the min value might be rounded down. */ - min?: number; + min?: number | null; /** * Padding of the min value relative to the length of the axis. A padding of 0.05 will make a 100px axis 5px longer. * This is useful when you don't want the lowest data value to appear on the edge of the plot area. When the axis' @@ -787,7 +787,7 @@ declare namespace Highcharts { * * On axes using categories, minor ticks are not supported. */ - minorTickInterval?: number | string; + minorTickInterval?: number | string | null; /** * The pixel length of the minor tick marks. * @default 2 @@ -986,7 +986,7 @@ declare namespace Highcharts { * * If the tickInterval is too dense for labels to be drawn, Highcharts may remove ticks. */ - tickInterval?: number; + tickInterval?: number | null; /** * The pixel length of the main tick marks. * @default 10 @@ -998,7 +998,7 @@ declare namespace Highcharts { * * @default 72 for the Y axis, 100 for the X axis. */ - tickPixelInterval?: number; + tickPixelInterval?: number | null; /** * The position of the major tick marks relative to the axis line. Can be one of 'inside' and 'outside'. * @default 'outside' @@ -1025,7 +1025,7 @@ declare namespace Highcharts { * mark is placed between categories. The default is 'between' if the tickInterval is 1, else 'on'. * @default null */ - tickmarkPlacement?: string; + tickmarkPlacement?: string | null; /** * The axis title, showing next to the axis line. To disable the title, set the text to null. */ @@ -1161,12 +1161,12 @@ declare namespace Highcharts { * @default 'gray' */ color?: string | Gradient; - }; + } | null; /** * The maximum value of the axis in terms of map point values. If null, the max value is automatically calculated. * If the endOnTick option is true, the max value might be rounded up. */ - max?: number; + max?: number | null; /** * The color to represent the maximum of the color axis. Unless dataClasses or stops are set, the gradient ends at * this value. @@ -1185,7 +1185,7 @@ declare namespace Highcharts { * The minimum value of the axis in terms of map point values. If null, the min value is automatically calculated. * If the startOnTick option is true, the min value might be rounded down. */ - min?: number; + min?: number | null; /** * The color to represent the minimum of the color axis. Unless dataClasses or stops are set, the gradient starts at * this value. @@ -1232,7 +1232,7 @@ declare namespace Highcharts { * If user settings dictate minor ticks to become too dense, they don't make sense, and will be ignored to prevent * performance problems. */ - minorTickInterval?: string | number; + minorTickInterval?: string | number | null; /** * The pixel length of the minor tick marks. * @default 2 @@ -1284,7 +1284,7 @@ declare namespace Highcharts { * The interval of the tick marks in axis units. When null, the tick interval is computed to approximately follow * the tickPixelInterval. */ - tickInterval?: number; + tickInterval?: number | null; /** * The pixel length of the main tick marks. * @default 10 @@ -1294,7 +1294,7 @@ declare namespace Highcharts { * If tickInterval is null this option sets the approximate pixel interval of the tick marks. * @default 72 */ - tickPixelInterval?: number; + tickPixelInterval?: number | null; /** * The position of the major tick marks relative to the axis line. Can be one of 'inside' and 'outside'. * @default 'outside' @@ -1771,7 +1771,7 @@ declare namespace Highcharts { * @default null * @since 5.0.8 */ - height?: number | string; + height?: number | string | null; /** * If true, the axes will scale to the remaining visible series once one series is hidden. If false, hiding and * showing a series will not affect the axes or the other series. For stacks, once one series within the stack is @@ -1843,7 +1843,7 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - pinchType?: string; + pinchType?: string | null; /** * The background color or gradient for the plot area. */ @@ -2310,7 +2310,7 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - text?: string; + text?: string | null; /** * A configuration object for the button theme. The object accepts SVG properties like stroke-width, stroke and * fill. Tri-state button styles are supported by the states.hover and states.select objects. @@ -2390,7 +2390,7 @@ declare namespace Highcharts { * specific width and height, or a printer-friendly color scheme. * @default null */ - chartOptions?: Options; + chartOptions?: Options | null; /** * Whether to enable the exporting module. Disabling the module will hide the context button, but API methods will * still be available. @@ -2628,7 +2628,7 @@ declare namespace Highcharts { * @default ['k', 'M', 'G', 'T', 'P', 'E'] * @since 2.3.0 */ - numericSymbols?: string[]; + numericSymbols?: string[] | null; /** * Exporting module only. The text for the menu item to print the chart. * @default 'Print chart' @@ -2712,7 +2712,7 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - text?: string; + text?: string | null; } interface LegendOptions { @@ -3220,7 +3220,7 @@ declare namespace Highcharts { * The text color for the data labels. * @default null */ - color?: string | Gradient; + color?: string | Gradient | null; /** * Whether to hide data labels that are outside the plot area. By default, the data label is moved inside the plot * area according to the overflow option. @@ -3464,16 +3464,16 @@ declare namespace Highcharts { * widespread data points. * @default null, true for hover and select */ - enabled?: boolean; + enabled?: boolean | null; /** * The fill color of the point marker. When null, the series' or point's color is used. */ - fillColor?: string; + fillColor?: string | null; /** * The color of the point marker's outline. When null, the series' or point's color is used. * @default '#FFFFFF', '#000000' for select state */ - lineColor?: string | Gradient; + lineColor?: string | Gradient | null; /** * The width of the point marker's outline. * @default 0 @@ -3507,7 +3507,7 @@ declare namespace Highcharts { * @default null * @since 4.0.4 */ - height?: number; + height?: number | null; states?: { hover?: MarkerHoverState; /** @@ -3526,13 +3526,13 @@ declare namespace Highcharts { * Custom callbacks for symbol path generation can also be added to Highcharts.SVGRenderer.prototype.symbols. The * callback is then used by its method name. */ - symbol?: string; // null, 'circle', 'square', 'diamond', 'triangle' 'triangle-down' or 'url(graphic.png)' + symbol?: string | null; // null, 'circle', 'square', 'diamond', 'triangle' 'triangle-down' or 'url(graphic.png)' /** * Image markers only. Set the image width explicitly. When using this option, a height must also be set. * @default null. * @since 4.0.4 */ - width?: number; + width?: number | null; } interface PointEvents { @@ -3760,7 +3760,7 @@ declare namespace Highcharts { * The text color for the data labels. * @default null */ - color?: string | Gradient; + color?: string | Gradient | null; /** * Whether to hide data labels that are outside the plot area. By default, the data label is moved inside the plot * area according to the overflow option. @@ -4139,7 +4139,7 @@ declare namespace Highcharts { * @default null. * @since 3.0 */ - negativeColor?: string; + negativeColor?: string | null; point?: { events: PointEvents; }; @@ -4175,7 +4175,7 @@ declare namespace Highcharts { * Defaults to null in cartesian charts, 'between' in polar charts. * @since 2.3.0 */ - pointPlacement?: string | number; + pointPlacement?: string | number | null; /** * If no x values are given for the points in a series, pointStart defines on what value to start. For example, if a * series contains one yearly value starting from 1945, set pointStart to 1945. @@ -4221,7 +4221,7 @@ declare namespace Highcharts { * Whether to stack the values of each series on top of each other. Possible values are null to disable, 'normal' to * stack by value or 'percent'. */ - stacking?: string; + stacking?: string | null; /** * A wrapper object for all the series options in specific states. */ @@ -4247,7 +4247,7 @@ declare namespace Highcharts { * @default 0 * @since 2.0 */ - threshold?: number; + threshold?: number | null; /** * A configuration object for the tooltip rendering of each single series. Properties are inherited from tooltip, * but only the following properties can be defined on a series level. @@ -4285,7 +4285,7 @@ declare namespace Highcharts { /** * Fill color or gradient for the area. When null, the series' color is used with the series' fillOpacity. */ - fillColor?: string | Gradient; + fillColor?: string | Gradient | null; /** * Fill opacity for the area. Note that when you set an explicit fillColor, the fillOpacity is not applied. Instead, * you should define the opacity in the fillColor with an rgba color definition. @@ -4401,7 +4401,7 @@ declare namespace Highcharts { * @default null * @since 4.1.8 */ - maxPointWidth?: number; + maxPointWidth?: number | null; /** * The minimal height for a column or width for a bar. By default, 0 values are not shown. To visualize a 0 (or * close to zero) point, set the minimal point length to a pixel value like 3. In stacked column charts, @@ -4426,7 +4426,7 @@ declare namespace Highcharts { * pointPadding and groupPadding. * @since 1.2.5 */ - pointWidth?: number; + pointWidth?: number | null; /** * A wrapper object for all the series options in specific states. */ @@ -4474,13 +4474,13 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - medianColor?: string; + medianColor?: string | null; /** * The pixel width of the median line. If null, the lineWidth is used. * @default 2 * @since 3.0 */ - medianWidth?: number; + medianWidth?: number | null; } /** @@ -4517,7 +4517,7 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - negativeColor?: string; + negativeColor?: string | null; /** * Whether the bubble's value should be represented by the area or the width of the bubble. The default, area, * corresponds best to the human perception of the size of each bubble. @@ -4538,13 +4538,13 @@ declare namespace Highcharts { * @default null * @since 4.0.3 */ - zMax?: number; + zMax?: number | null; /** * The minimum for the Z value range. Defaults to the lowest Z value in the data. * @default null * @since 4.0.3 */ - zMin?: number; + zMin?: number | null; /** * When displayNegative is false, bubbles with lower Z values are skipped. When displayNegative is true and a * negativeColor is given, points with lower Z is colored. @@ -4617,7 +4617,7 @@ declare namespace Highcharts { * @default null * @since 4.1.8 */ - maxPointWidth?: number; + maxPointWidth?: number | null; /** * Padding between each column or bar, in x axis units. * @default 0.1 @@ -4635,7 +4635,7 @@ declare namespace Highcharts { * pointPadding and groupPadding. * @since 1.2.5 */ - pointWidth?: number; + pointWidth?: number | null; /** * A wrapper object for all the series options in specific states. */ @@ -4651,7 +4651,7 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - stemColor?: string; + stemColor?: string | null; /** * The dash style of the stem, the vertical line extending from the box to the whiskers. * @default 'Solid' @@ -4664,14 +4664,14 @@ declare namespace Highcharts { * @default null * @since 3.0 */ - stemWidth?: number; + stemWidth?: number | null; /** * The color of the whiskers, the horizontal lines marking low and high values. When null, the general series color * is used. * @default null * @since 3.0 */ - whiskerColor?: string; + whiskerColor?: string | null; /** * The length of the whiskers, the horizontal lines marking low and high values. It can be a numerical pixel value, * or a percentage value of the box width. Set 0 to disable whiskers. @@ -4685,7 +4685,7 @@ declare namespace Highcharts { * @default 2 * @since 3.0 */ - whiskerWidth?: number; + whiskerWidth?: number | null; } /** @@ -4863,7 +4863,7 @@ declare namespace Highcharts { * @default null * @since 4.1.8 */ - maxPointWidth?: number; + maxPointWidth?: number | null; /** * The row size - how many Y axis units each heatmap row should span. * @default 1 @@ -4901,7 +4901,7 @@ declare namespace Highcharts { * borderless pies. * @default '#FFFFFF' */ - borderColor?: string | Gradient; + borderColor?: string | Gradient | null; /** * The width of the border surrounding each column or bar. * @default 1 @@ -4914,7 +4914,7 @@ declare namespace Highcharts { * center should be explicitly set, for example to ['50%', '50%']. * @default [null, null] */ - center?: [string | number, string | number]; + center?: [string | number | null, string | number | null]; /** * A series specific or series type specific color set to apply instead of the global colors when colorByPoint is true. * @since 3.0 @@ -4932,7 +4932,7 @@ declare namespace Highcharts { * @default null * @since 1.3.6 */ - endAngle?: number; + endAngle?: number | null; /** * Equivalent to chart.ignoreHiddenSeries, this option tells whether the series shall be redrawn as if the hidden * point were null. @@ -5099,7 +5099,7 @@ declare namespace Highcharts { * @default null * @since 5.0.3 */ - threshold?: number; + threshold?: number | null; /** * When this option is true, the dial will wrap around the axes. For instance, in a full-range gauge going from 0 to * 360, a value of 400 will point to 40. When wrap is false, the dial stops at 360. @@ -5187,7 +5187,7 @@ declare namespace Highcharts { * @default null * @since 4.1.8 */ - maxPointWidth?: number; + maxPointWidth?: number | null; /** * The sort index of the point inside the treemap level. * @since 4.1.10 @@ -5362,7 +5362,7 @@ declare namespace Highcharts { * A pixel value specifying a fixed width for each column or bar. When null, the width is calculated from * the pointPadding and groupPadding. */ - pointWidth?: number; + pointWidth?: number | null; /** * This option allows grouping series in a stacked chart. The stack option can be a string or a number or anything * else, as long as the grouped series' stack options match each other. @@ -5584,7 +5584,7 @@ declare namespace Highcharts { * @default null * @since 2.0 */ - y?: number; + y?: number | null; } interface TitleOptions { @@ -5641,7 +5641,7 @@ declare namespace Highcharts { * @default null * @since 2.0 */ - y?: number; + y?: number | null; } interface CrosshairObject { @@ -5695,7 +5695,7 @@ declare namespace Highcharts { * The color of the tooltip border. When null, the border takes the color of the corresponding series or point. * @default null */ - borderColor?: string | Gradient; + borderColor?: string | Gradient | null; /** * The radius of the rounded border corners. * @default 3 @@ -5723,7 +5723,7 @@ declare namespace Highcharts { * * @default null */ - crosshairs?: boolean | [boolean, boolean] | CrosshairObject | [CrosshairObject, CrosshairObject]; + crosshairs?: boolean | [boolean, boolean] | CrosshairObject | [CrosshairObject, CrosshairObject] | null; /** * Enable or disable the tooltip. * @default true diff --git a/types/highcharts/tsconfig.json b/types/highcharts/tsconfig.json index ed1e69ef0c..18d37382e5 100644 --- a/types/highcharts/tsconfig.json +++ b/types/highcharts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/highland/tsconfig.json b/types/highland/tsconfig.json index 369326fd9f..43fea750ce 100644 --- a/types/highland/tsconfig.json +++ b/types/highland/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/highlight.js/tsconfig.json b/types/highlight.js/tsconfig.json index e3627e99ca..d13fff15ba 100644 --- a/types/highlight.js/tsconfig.json +++ b/types/highlight.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/highlight.js/v7/tsconfig.json b/types/highlight.js/v7/tsconfig.json index 10570c9f69..2c89b93acb 100644 --- a/types/highlight.js/v7/tsconfig.json +++ b/types/highlight.js/v7/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/hiredis/tsconfig.json b/types/hiredis/tsconfig.json index 927fdef018..8bc77b8339 100644 --- a/types/hiredis/tsconfig.json +++ b/types/hiredis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/history.js/tsconfig.json b/types/history.js/tsconfig.json index 4834d24b35..1972e4113e 100644 --- a/types/history.js/tsconfig.json +++ b/types/history.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/history/tsconfig.json b/types/history/tsconfig.json index f5638c9603..2be65a13ed 100644 --- a/types/history/tsconfig.json +++ b/types/history/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/history/v2/tsconfig.json b/types/history/v2/tsconfig.json index 4ee5476d05..94e2605881 100644 --- a/types/history/v2/tsconfig.json +++ b/types/history/v2/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/history/v3/tsconfig.json b/types/history/v3/tsconfig.json index 2075f25a15..17f7dc237f 100644 --- a/types/history/v3/tsconfig.json +++ b/types/history/v3/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hjson/tsconfig.json b/types/hjson/tsconfig.json index 5e6692a9bd..e2004c8716 100644 --- a/types/hjson/tsconfig.json +++ b/types/hjson/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hls.js/tsconfig.json b/types/hls.js/tsconfig.json index ed68ee32f3..f879abb0ef 100644 --- a/types/hls.js/tsconfig.json +++ b/types/hls.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hoek/tsconfig.json b/types/hoek/tsconfig.json index 06617f251f..9cc6965f8f 100644 --- a/types/hoek/tsconfig.json +++ b/types/hoek/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/holderjs/tsconfig.json b/types/holderjs/tsconfig.json index 6cf9415ee2..b33ee1cfdb 100644 --- a/types/holderjs/tsconfig.json +++ b/types/holderjs/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "holderjs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/hooker/tsconfig.json b/types/hooker/tsconfig.json index 446825fb97..38bc5b093c 100644 --- a/types/hooker/tsconfig.json +++ b/types/hooker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hopscotch/tsconfig.json b/types/hopscotch/tsconfig.json index d9fb810610..c192e75957 100644 --- a/types/hopscotch/tsconfig.json +++ b/types/hopscotch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/howler/tsconfig.json b/types/howler/tsconfig.json index 00ec7b93d7..d9f51622a8 100644 --- a/types/howler/tsconfig.json +++ b/types/howler/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hpp/hpp-tests.ts b/types/hpp/hpp-tests.ts index 21432f3d3f..8786ab702d 100644 --- a/types/hpp/hpp-tests.ts +++ b/types/hpp/hpp-tests.ts @@ -1,5 +1,5 @@ -import * as express from 'express'; -import * as hpp from 'hpp'; +import express = require('express'); +import hpp = require('hpp'); const app = express(); diff --git a/types/hpp/tsconfig.json b/types/hpp/tsconfig.json index 0193bd22d2..cbc4490a4e 100644 --- a/types/hpp/tsconfig.json +++ b/types/hpp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-entities/tsconfig.json b/types/html-entities/tsconfig.json index ad38016e35..57a35f13e7 100644 --- a/types/html-entities/tsconfig.json +++ b/types/html-entities/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-minifier/tsconfig.json b/types/html-minifier/tsconfig.json index 129a20c71f..c8f5ba70d1 100644 --- a/types/html-minifier/tsconfig.json +++ b/types/html-minifier/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-minifier/v1/tsconfig.json b/types/html-minifier/v1/tsconfig.json index 8def52b67d..df85608048 100644 --- a/types/html-minifier/v1/tsconfig.json +++ b/types/html-minifier/v1/tsconfig.json @@ -13,12 +13,17 @@ "../../" ], "paths": { - "html-minifier": ["html-minifier/v1"], - "html-minifier/*": ["html-minifier/v1/*"] + "html-minifier": [ + "html-minifier/v1" + ], + "html-minifier/*": [ + "html-minifier/v1/*" + ] }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-pdf/tsconfig.json b/types/html-pdf/tsconfig.json index e6936f2588..225bb52929 100644 --- a/types/html-pdf/tsconfig.json +++ b/types/html-pdf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-to-text/tsconfig.json b/types/html-to-text/tsconfig.json index 089a8e128e..fe209a615d 100644 --- a/types/html-to-text/tsconfig.json +++ b/types/html-to-text/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-webpack-plugin/html-webpack-plugin-tests.ts b/types/html-webpack-plugin/html-webpack-plugin-tests.ts index 7a1e5f20bc..b80ea9e6b0 100644 --- a/types/html-webpack-plugin/html-webpack-plugin-tests.ts +++ b/types/html-webpack-plugin/html-webpack-plugin-tests.ts @@ -1,4 +1,4 @@ -import * as HtmlWebpackPlugin from 'html-webpack-plugin'; +import HtmlWebpackPlugin = require('html-webpack-plugin'); new HtmlWebpackPlugin(); diff --git a/types/html-webpack-plugin/tsconfig.json b/types/html-webpack-plugin/tsconfig.json index 61d842ab9c..289455c231 100644 --- a/types/html-webpack-plugin/tsconfig.json +++ b/types/html-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html-webpack-template/html-webpack-template-tests.ts b/types/html-webpack-template/html-webpack-template-tests.ts index 4407af69eb..0108aa39d8 100644 --- a/types/html-webpack-template/html-webpack-template-tests.ts +++ b/types/html-webpack-template/html-webpack-template-tests.ts @@ -1,4 +1,4 @@ -import * as HtmlWebpackPlugin from 'html-webpack-plugin'; +import HtmlWebpackPlugin = require('html-webpack-plugin'); import * as template from 'html-webpack-template'; const optionsArray: template.Options[] = [ diff --git a/types/html-webpack-template/tsconfig.json b/types/html-webpack-template/tsconfig.json index 7b0b56e459..ddc0447c74 100644 --- a/types/html-webpack-template/tsconfig.json +++ b/types/html-webpack-template/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/html2canvas/tsconfig.json b/types/html2canvas/tsconfig.json index 0fcf24b6f8..9cf08eb266 100644 --- a/types/html2canvas/tsconfig.json +++ b/types/html2canvas/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/htmlbars-inline-precompile/tsconfig.json b/types/htmlbars-inline-precompile/tsconfig.json index fd03f6a476..c3eb8ef11f 100644 --- a/types/htmlbars-inline-precompile/tsconfig.json +++ b/types/htmlbars-inline-precompile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/htmlescape/tsconfig.json b/types/htmlescape/tsconfig.json index 581a713fff..abe0efa243 100644 --- a/types/htmlescape/tsconfig.json +++ b/types/htmlescape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/htmlhint/tsconfig.json b/types/htmlhint/tsconfig.json index b8472efbda..c2b3078f68 100644 --- a/types/htmlhint/tsconfig.json +++ b/types/htmlhint/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/htmlparser2/tsconfig.json b/types/htmlparser2/tsconfig.json index c6ccfee7cc..c19c42d22b 100644 --- a/types/htmlparser2/tsconfig.json +++ b/types/htmlparser2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/htmltojsx/tsconfig.json b/types/htmltojsx/tsconfig.json index 5b0fc81735..b505e65bd9 100644 --- a/types/htmltojsx/tsconfig.json +++ b/types/htmltojsx/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-assert/http-assert-tests.ts b/types/http-assert/http-assert-tests.ts index bfb12e650a..a0e159aeed 100644 --- a/types/http-assert/http-assert-tests.ts +++ b/types/http-assert/http-assert-tests.ts @@ -1,4 +1,4 @@ -import * as httpAssert from 'http-assert'; +import httpAssert = require('http-assert'); import { HttpError } from 'http-errors'; try { diff --git a/types/http-assert/tsconfig.json b/types/http-assert/tsconfig.json index 711327f38b..a1be51026d 100644 --- a/types/http-assert/tsconfig.json +++ b/types/http-assert/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-aws-es/tsconfig.json b/types/http-aws-es/tsconfig.json index 5d248f0375..44140847bb 100644 --- a/types/http-aws-es/tsconfig.json +++ b/types/http-aws-es/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-codes/tsconfig.json b/types/http-codes/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/http-codes/tsconfig.json +++ b/types/http-codes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/http-context/tsconfig.json b/types/http-context/tsconfig.json index 51422e3199..ade1021328 100644 --- a/types/http-context/tsconfig.json +++ b/types/http-context/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "http-context-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/http-errors/http-errors-tests.ts b/types/http-errors/http-errors-tests.ts index c3677fd5f9..583223d6a4 100644 --- a/types/http-errors/http-errors-tests.ts +++ b/types/http-errors/http-errors-tests.ts @@ -1,5 +1,5 @@ -import * as create from 'http-errors'; -import * as express from 'express'; +import create = require('http-errors'); +import express = require('express'); import * as util from 'util'; const app = express(); diff --git a/types/http-errors/tsconfig.json b/types/http-errors/tsconfig.json index 430bec9565..62465b68e8 100644 --- a/types/http-errors/tsconfig.json +++ b/types/http-errors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-link-header/tsconfig.json b/types/http-link-header/tsconfig.json index 3acfe11a33..3094403bb9 100644 --- a/types/http-link-header/tsconfig.json +++ b/types/http-link-header/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-proxy-agent/tsconfig.json b/types/http-proxy-agent/tsconfig.json index 626d4eaa4c..f0e1f42aee 100644 --- a/types/http-proxy-agent/tsconfig.json +++ b/types/http-proxy-agent/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "http-proxy-agent-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/http-proxy-middleware/tsconfig.json b/types/http-proxy-middleware/tsconfig.json index 459138e584..714fe3ca42 100644 --- a/types/http-proxy-middleware/tsconfig.json +++ b/types/http-proxy-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-proxy/http-proxy-tests.ts b/types/http-proxy/http-proxy-tests.ts index e691b48ed0..70ea803da6 100644 --- a/types/http-proxy/http-proxy-tests.ts +++ b/types/http-proxy/http-proxy-tests.ts @@ -1,5 +1,5 @@ import * as http from "http"; -import * as HttpProxy from "http-proxy"; +import HttpProxy = require("http-proxy"); const proxy = new HttpProxy({ changeOrigin: true diff --git a/types/http-proxy/index.d.ts b/types/http-proxy/index.d.ts index 962a9ecdb6..811789af33 100644 --- a/types/http-proxy/index.d.ts +++ b/types/http-proxy/index.d.ts @@ -197,6 +197,8 @@ declare namespace Server { autoRewrite?: boolean; /** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */ protocolRewrite?: string; + /** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */ + proxyTimeout?: number; } } diff --git a/types/http-proxy/tsconfig.json b/types/http-proxy/tsconfig.json index 24a9ed6c48..e8895667f5 100644 --- a/types/http-proxy/tsconfig.json +++ b/types/http-proxy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-server/tsconfig.json b/types/http-server/tsconfig.json index 98f006389c..1b90c09fa0 100644 --- a/types/http-server/tsconfig.json +++ b/types/http-server/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "http-server-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/http-status/tsconfig.json b/types/http-status/tsconfig.json index acb7f89cde..2a9f60f0c2 100644 --- a/types/http-status/tsconfig.json +++ b/types/http-status/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/http-string-parser/tsconfig.json b/types/http-string-parser/tsconfig.json index 80f7cd176a..82cb0405e7 100644 --- a/types/http-string-parser/tsconfig.json +++ b/types/http-string-parser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/httperr/tsconfig.json b/types/httperr/tsconfig.json index 85505edbc8..ef117164fb 100644 --- a/types/httperr/tsconfig.json +++ b/types/httperr/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hubot/tsconfig.json b/types/hubot/tsconfig.json index 9354cf926c..8dbed319d9 100644 --- a/types/hubot/tsconfig.json +++ b/types/hubot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hubspot-pace/tsconfig.json b/types/hubspot-pace/tsconfig.json index 1d2a2ec99e..f2c9f738e6 100644 --- a/types/hubspot-pace/tsconfig.json +++ b/types/hubspot-pace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/humane/tsconfig.json b/types/humane/tsconfig.json index 7b2fc3e81b..02cee5bec2 100644 --- a/types/humane/tsconfig.json +++ b/types/humane/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/humanize-plus/tsconfig.json b/types/humanize-plus/tsconfig.json index 37b195e2cd..674bdb64f5 100644 --- a/types/humanize-plus/tsconfig.json +++ b/types/humanize-plus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/humanize-string/humanize-string-tests.ts b/types/humanize-string/humanize-string-tests.ts new file mode 100644 index 0000000000..851746f088 --- /dev/null +++ b/types/humanize-string/humanize-string-tests.ts @@ -0,0 +1,4 @@ +import humanizeString = require('humanize-string'); + +humanizeString('UnicornsAndRainbows'); +humanizeString('unicorns_and-Rainbows_andPonies '); diff --git a/types/humanize-string/index.d.ts b/types/humanize-string/index.d.ts new file mode 100644 index 0000000000..ba8bc4e867 --- /dev/null +++ b/types/humanize-string/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for humanize-string 1.0 +// Project: https://github.com/sindresorhus/humanize-string/ +// Definitions by: Kevin Nacios +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function humanizeString(text: string): string; + +export = humanizeString; diff --git a/types/humanize-string/tsconfig.json b/types/humanize-string/tsconfig.json new file mode 100644 index 0000000000..2b97ea796b --- /dev/null +++ b/types/humanize-string/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "humanize-string-tests.ts" + ] +} \ No newline at end of file diff --git a/types/humanize-string/tslint.json b/types/humanize-string/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/humanize-string/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/humanparser/tsconfig.json b/types/humanparser/tsconfig.json index 1e12c171d0..3b7ed6be21 100644 --- a/types/humanparser/tsconfig.json +++ b/types/humanparser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/humps/tsconfig.json b/types/humps/tsconfig.json index ec1866d58c..79c40ebc87 100644 --- a/types/humps/tsconfig.json +++ b/types/humps/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hyco-ws/tsconfig.json b/types/hyco-ws/tsconfig.json index cc21647f01..468a3e9c69 100644 --- a/types/hyco-ws/tsconfig.json +++ b/types/hyco-ws/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hyperscript/tsconfig.json b/types/hyperscript/tsconfig.json index dcd78c9f85..733e14bcda 100644 --- a/types/hyperscript/tsconfig.json +++ b/types/hyperscript/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hypertext-application-language/tsconfig.json b/types/hypertext-application-language/tsconfig.json index 15621fa9c2..9c01e0594f 100644 --- a/types/hypertext-application-language/tsconfig.json +++ b/types/hypertext-application-language/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/hystrixjs/tsconfig.json b/types/hystrixjs/tsconfig.json index 480476e8d1..d534470204 100644 --- a/types/hystrixjs/tsconfig.json +++ b/types/hystrixjs/tsconfig.json @@ -16,10 +16,11 @@ "paths": {}, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "hystrixjs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/i18n-js/tsconfig.json b/types/i18n-js/tsconfig.json index 4a9e4d110b..128a7ad06d 100644 --- a/types/i18n-js/tsconfig.json +++ b/types/i18n-js/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "i18n-js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/i18n/tsconfig.json b/types/i18n/tsconfig.json index 4429a81fe6..4d7bacf4d0 100644 --- a/types/i18n/tsconfig.json +++ b/types/i18n/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-browser-languagedetector/tsconfig.json b/types/i18next-browser-languagedetector/tsconfig.json index 32755315aa..879c1d7ac7 100644 --- a/types/i18next-browser-languagedetector/tsconfig.json +++ b/types/i18next-browser-languagedetector/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-browser-languagedetector/v0/tsconfig.json b/types/i18next-browser-languagedetector/v0/tsconfig.json index 9873c74134..5396feadd6 100644 --- a/types/i18next-browser-languagedetector/v0/tsconfig.json +++ b/types/i18next-browser-languagedetector/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-express-middleware/i18next-express-middleware-tests.ts b/types/i18next-express-middleware/i18next-express-middleware-tests.ts index d56f7a9207..9959cf9dad 100644 --- a/types/i18next-express-middleware/i18next-express-middleware-tests.ts +++ b/types/i18next-express-middleware/i18next-express-middleware-tests.ts @@ -1,4 +1,4 @@ -import * as express from "express"; +import express = require("express"); import * as i18next from "i18next"; import middleware = require("i18next-express-middleware"); diff --git a/types/i18next-express-middleware/tsconfig.json b/types/i18next-express-middleware/tsconfig.json index 5a13f1733d..43460aefe2 100644 --- a/types/i18next-express-middleware/tsconfig.json +++ b/types/i18next-express-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-node-fs-backend/tsconfig.json b/types/i18next-node-fs-backend/tsconfig.json index 03b3347068..f0f6ba8147 100644 --- a/types/i18next-node-fs-backend/tsconfig.json +++ b/types/i18next-node-fs-backend/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-sprintf-postprocessor/tsconfig.json b/types/i18next-sprintf-postprocessor/tsconfig.json index 9a52882abe..af3f004099 100644 --- a/types/i18next-sprintf-postprocessor/tsconfig.json +++ b/types/i18next-sprintf-postprocessor/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next-xhr-backend/tsconfig.json b/types/i18next-xhr-backend/tsconfig.json index a7ca4c2adb..7c48abd709 100644 --- a/types/i18next-xhr-backend/tsconfig.json +++ b/types/i18next-xhr-backend/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/i18next/index.d.ts b/types/i18next/index.d.ts index c510d824eb..61b59b32e1 100644 --- a/types/i18next/index.d.ts +++ b/types/i18next/index.d.ts @@ -103,6 +103,11 @@ declare namespace i18next { * set it to fallback to let passed namespaces to translated hoc act as fallbacks */ nsMode?: string; + /** + * set it to the default parent element created by the Trans component. + * @default div + */ + defaultTransParent?: string; } interface InitOptions { diff --git a/types/i18next/tsconfig.json b/types/i18next/tsconfig.json index 9eadf37b0f..b37ad92b9d 100644 --- a/types/i18next/tsconfig.json +++ b/types/i18next/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/i18next/v2/tsconfig.json b/types/i18next/v2/tsconfig.json index 00464c1701..1533066fbb 100644 --- a/types/i18next/v2/tsconfig.json +++ b/types/i18next/v2/tsconfig.json @@ -24,6 +24,7 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/i2c-bus/tsconfig.json b/types/i2c-bus/tsconfig.json index 8407ea3efd..081ba2a5a6 100644 --- a/types/i2c-bus/tsconfig.json +++ b/types/i2c-bus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "../async/index.d.ts", diff --git a/types/iban/tsconfig.json b/types/iban/tsconfig.json index 352470aa0d..2e7f860867 100644 --- a/types/iban/tsconfig.json +++ b/types/iban/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ibm-mobilefirst/tsconfig.json b/types/ibm-mobilefirst/tsconfig.json index eabcd34447..83ab44c9d5 100644 --- a/types/ibm-mobilefirst/tsconfig.json +++ b/types/ibm-mobilefirst/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ibm_db/tsconfig.json b/types/ibm_db/tsconfig.json index f92b637034..4b69bc8c6b 100644 --- a/types/ibm_db/tsconfig.json +++ b/types/ibm_db/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/icepick/tsconfig.json b/types/icepick/tsconfig.json index 530031866b..93540a1c5f 100644 --- a/types/icepick/tsconfig.json +++ b/types/icepick/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/icheck/tsconfig.json b/types/icheck/tsconfig.json index b700077c47..0ec895d526 100644 --- a/types/icheck/tsconfig.json +++ b/types/icheck/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iconv/tsconfig.json b/types/iconv/tsconfig.json index b97ea1a7f3..78bd76e835 100644 --- a/types/iconv/tsconfig.json +++ b/types/iconv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ids/tsconfig.json b/types/ids/tsconfig.json index 1c739774db..c9e212f3ee 100644 --- a/types/ids/tsconfig.json +++ b/types/ids/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iframe-resizer/tsconfig.json b/types/iframe-resizer/tsconfig.json index e8a87f1302..7962a0d413 100644 --- a/types/iframe-resizer/tsconfig.json +++ b/types/iframe-resizer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "exclude": [ "node_modules" diff --git a/types/ignite-ui/tsconfig.json b/types/ignite-ui/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/ignite-ui/tsconfig.json +++ b/types/ignite-ui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/ignore-styles/tsconfig.json b/types/ignore-styles/tsconfig.json index aed3487cf4..36263af6ad 100644 --- a/types/ignore-styles/tsconfig.json +++ b/types/ignore-styles/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ignore-styles-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/iltorb/tsconfig.json b/types/iltorb/tsconfig.json index c12ff988ba..0c553243a8 100644 --- a/types/iltorb/tsconfig.json +++ b/types/iltorb/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "iltorb-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/image-size/image-size-tests.ts b/types/image-size/image-size-tests.ts index 983389091e..058ed7934f 100644 --- a/types/image-size/image-size-tests.ts +++ b/types/image-size/image-size-tests.ts @@ -1,7 +1,6 @@ - import * as url from "url"; import * as http from "http"; -import * as sizeOf from "image-size"; +import sizeOf = require("image-size"); // Synchronous const dimensions = sizeOf("images/funny-cats.png"); diff --git a/types/image-size/tsconfig.json b/types/image-size/tsconfig.json index 7a864603b7..009a4c9175 100644 --- a/types/image-size/tsconfig.json +++ b/types/image-size/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imagemagick-native/tsconfig.json b/types/imagemagick-native/tsconfig.json index bfd2f88451..c96e9d4a44 100644 --- a/types/imagemagick-native/tsconfig.json +++ b/types/imagemagick-native/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imagemagick/tsconfig.json b/types/imagemagick/tsconfig.json index 3a28cb5c59..cbbc1c0d83 100644 --- a/types/imagemagick/tsconfig.json +++ b/types/imagemagick/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imagemapster/tsconfig.json b/types/imagemapster/tsconfig.json index cb5e3bdff8..3198a00bc4 100644 --- a/types/imagemapster/tsconfig.json +++ b/types/imagemapster/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/images/images-tests.ts b/types/images/images-tests.ts index f7ba58d68d..9b6db2d1b2 100644 --- a/types/images/images-tests.ts +++ b/types/images/images-tests.ts @@ -1,4 +1,4 @@ -import * as images from "images"; +import images = require("images"); // from https://github.com/zhangyuanwei/node-images/blob/master/demo/uploadServer.js const tmp_path = "tmp_path"; diff --git a/types/images/tsconfig.json b/types/images/tsconfig.json index 75c7b85340..368e3b87b5 100644 --- a/types/images/tsconfig.json +++ b/types/images/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imagesloaded/tsconfig.json b/types/imagesloaded/tsconfig.json index 0673d1eaa2..a9ae36e077 100644 --- a/types/imagesloaded/tsconfig.json +++ b/types/imagesloaded/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imap-simple/tsconfig.json b/types/imap-simple/tsconfig.json index 859835549a..257a2ee006 100644 --- a/types/imap-simple/tsconfig.json +++ b/types/imap-simple/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imap/tsconfig.json b/types/imap/tsconfig.json index 987167daf3..655a1f4c54 100644 --- a/types/imap/tsconfig.json +++ b/types/imap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/imgur-rest-api/tsconfig.json b/types/imgur-rest-api/tsconfig.json index f2803640de..4835091ddb 100644 --- a/types/imgur-rest-api/tsconfig.json +++ b/types/imgur-rest-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/impress/tsconfig.json b/types/impress/tsconfig.json index a278db24c9..82aafbc612 100644 --- a/types/impress/tsconfig.json +++ b/types/impress/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/in-range/tsconfig.json b/types/in-range/tsconfig.json index 7d5182a929..0261e63a92 100644 --- a/types/in-range/tsconfig.json +++ b/types/in-range/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/incremental-dom/tsconfig.json b/types/incremental-dom/tsconfig.json index 8ba7d824d5..d5ffa268df 100644 --- a/types/incremental-dom/tsconfig.json +++ b/types/incremental-dom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/indent-string/tsconfig.json b/types/indent-string/tsconfig.json index 4f2e008801..d9d3db42a6 100644 --- a/types/indent-string/tsconfig.json +++ b/types/indent-string/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inert/tsconfig.json b/types/inert/tsconfig.json index da982b9122..feda976404 100644 --- a/types/inert/tsconfig.json +++ b/types/inert/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "inert-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/inflected/tsconfig.json b/types/inflected/tsconfig.json index b0a3a1d8b5..ce1b449bd6 100644 --- a/types/inflected/tsconfig.json +++ b/types/inflected/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inflection/tsconfig.json b/types/inflection/tsconfig.json index e77c4028fc..097bf72f01 100644 --- a/types/inflection/tsconfig.json +++ b/types/inflection/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inherits/tsconfig.json b/types/inherits/tsconfig.json index bdb4c4d873..f0bc28d26b 100644 --- a/types/inherits/tsconfig.json +++ b/types/inherits/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ini/tsconfig.json b/types/ini/tsconfig.json index ccc924b3fc..a2d9575bec 100644 --- a/types/ini/tsconfig.json +++ b/types/ini/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iniparser/tsconfig.json b/types/iniparser/tsconfig.json index 0d7970f93a..2dbbf3ac60 100644 --- a/types/iniparser/tsconfig.json +++ b/types/iniparser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inline-css/tsconfig.json b/types/inline-css/tsconfig.json index 4a13506061..83f7ce2a21 100644 --- a/types/inline-css/tsconfig.json +++ b/types/inline-css/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inline-style-prefixer/tsconfig.json b/types/inline-style-prefixer/tsconfig.json index 7d6d4209bc..7ed78cd882 100644 --- a/types/inline-style-prefixer/tsconfig.json +++ b/types/inline-style-prefixer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inquirer/tsconfig.json b/types/inquirer/tsconfig.json index 59793a86a1..132e52a694 100644 --- a/types/inquirer/tsconfig.json +++ b/types/inquirer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/insert-module-globals/tsconfig.json b/types/insert-module-globals/tsconfig.json index a9b4f218da..4f6dc79b6c 100644 --- a/types/insert-module-globals/tsconfig.json +++ b/types/insert-module-globals/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/insight/tsconfig.json b/types/insight/tsconfig.json index 7efb108eae..c90e8883c8 100644 --- a/types/insight/tsconfig.json +++ b/types/insight/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/integer/tsconfig.json b/types/integer/tsconfig.json index 60e0921a42..d8ff5490d1 100644 --- a/types/integer/tsconfig.json +++ b/types/integer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/interact.js/tsconfig.json b/types/interact.js/tsconfig.json index 6d4887d0f1..ec69c04168 100644 --- a/types/interact.js/tsconfig.json +++ b/types/interact.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intercom-web/tsconfig.json b/types/intercom-web/tsconfig.json index d77c89a53f..a6dafc828c 100755 --- a/types/intercom-web/tsconfig.json +++ b/types/intercom-web/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intercomjs/tsconfig.json b/types/intercomjs/tsconfig.json index a74351a03a..e04592b241 100644 --- a/types/intercomjs/tsconfig.json +++ b/types/intercomjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/internal-ip/tsconfig.json b/types/internal-ip/tsconfig.json index 746718e07c..68e01ce09d 100644 --- a/types/internal-ip/tsconfig.json +++ b/types/internal-ip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intl-messageformat/tsconfig.json b/types/intl-messageformat/tsconfig.json index 61f9873265..5fa45ea6b4 100644 --- a/types/intl-messageformat/tsconfig.json +++ b/types/intl-messageformat/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intl-tel-input/tsconfig.json b/types/intl-tel-input/tsconfig.json index 380d60229d..47bfb5d532 100644 --- a/types/intl-tel-input/tsconfig.json +++ b/types/intl-tel-input/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/intl/tsconfig.json b/types/intl/tsconfig.json index 30370fd405..e387d699b0 100644 --- a/types/intl/tsconfig.json +++ b/types/intl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/into-stream/tsconfig.json b/types/into-stream/tsconfig.json index cc8a2cfa00..78424ed386 100644 --- a/types/into-stream/tsconfig.json +++ b/types/into-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/intro.js/tsconfig.json b/types/intro.js/tsconfig.json index c86cbffec5..6f17df93d2 100644 --- a/types/intro.js/tsconfig.json +++ b/types/intro.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/invariant/tsconfig.json b/types/invariant/tsconfig.json index 1cd411b7f4..b9835c8ee2 100644 --- a/types/invariant/tsconfig.json +++ b/types/invariant/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/inversify-devtools/tsconfig.json b/types/inversify-devtools/tsconfig.json index 4883fdc99e..43d9c7f198 100644 --- a/types/inversify-devtools/tsconfig.json +++ b/types/inversify-devtools/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ion.rangeslider/tsconfig.json b/types/ion.rangeslider/tsconfig.json index 1affa9f527..8fa4b00b02 100644 --- a/types/ion.rangeslider/tsconfig.json +++ b/types/ion.rangeslider/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ion.rangeslider/v1/tsconfig.json b/types/ion.rangeslider/v1/tsconfig.json index c63da8c0e1..d567b18c5d 100644 --- a/types/ion.rangeslider/v1/tsconfig.json +++ b/types/ion.rangeslider/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ioredis/ioredis-tests.ts b/types/ioredis/ioredis-tests.ts index 2e80cd80e4..d8106ecdea 100644 --- a/types/ioredis/ioredis-tests.ts +++ b/types/ioredis/ioredis-tests.ts @@ -1,4 +1,4 @@ -import * as Redis from "ioredis"; +import Redis = require("ioredis"); const redis = new Redis(); redis.set('foo', 'bar'); diff --git a/types/ioredis/tsconfig.json b/types/ioredis/tsconfig.json index f073160729..7b17a6e338 100644 --- a/types/ioredis/tsconfig.json +++ b/types/ioredis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iota.lib.js/tsconfig.json b/types/iota.lib.js/tsconfig.json index b206b83455..5bb248e6c2 100644 --- a/types/iota.lib.js/tsconfig.json +++ b/types/iota.lib.js/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "iota.lib.js-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "iota.lib.js-tests.ts" + ] } \ No newline at end of file diff --git a/types/ip-regex/tsconfig.json b/types/ip-regex/tsconfig.json index e09382966a..e3c27d39a7 100644 --- a/types/ip-regex/tsconfig.json +++ b/types/ip-regex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ip/tsconfig.json b/types/ip/tsconfig.json index a445ebefe8..f6610d99f5 100644 --- a/types/ip/tsconfig.json +++ b/types/ip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/irc/tsconfig.json b/types/irc/tsconfig.json index ac224646a3..ba8bd73ab1 100644 --- a/types/irc/tsconfig.json +++ b/types/irc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iron/tsconfig.json b/types/iron/tsconfig.json index bddeeac5c0..e0ee70fb95 100644 --- a/types/iron/tsconfig.json +++ b/types/iron/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "iron-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/is-absolute-url/tsconfig.json b/types/is-absolute-url/tsconfig.json index 57c46bb32b..b53f33f8d0 100644 --- a/types/is-absolute-url/tsconfig.json +++ b/types/is-absolute-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-alphanumerical/tsconfig.json b/types/is-alphanumerical/tsconfig.json index 90b83f80fb..a0e28cd6c8 100644 --- a/types/is-alphanumerical/tsconfig.json +++ b/types/is-alphanumerical/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-archive/tsconfig.json b/types/is-archive/tsconfig.json index ce2b001789..992c7f96ab 100644 --- a/types/is-archive/tsconfig.json +++ b/types/is-archive/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-array/tsconfig.json b/types/is-array/tsconfig.json index 022fbc852e..32aaeff9f4 100644 --- a/types/is-array/tsconfig.json +++ b/types/is-array/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-binary-path/tsconfig.json b/types/is-binary-path/tsconfig.json index e0fd45ed1e..e497433304 100644 --- a/types/is-binary-path/tsconfig.json +++ b/types/is-binary-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-compressed/tsconfig.json b/types/is-compressed/tsconfig.json index b44edb3059..b90ecf1883 100644 --- a/types/is-compressed/tsconfig.json +++ b/types/is-compressed/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-finite/tsconfig.json b/types/is-finite/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/is-finite/tsconfig.json +++ b/types/is-finite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/is-glob/tsconfig.json b/types/is-glob/tsconfig.json index 1a408fe456..5fc85d6db2 100644 --- a/types/is-glob/tsconfig.json +++ b/types/is-glob/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "is-glob-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/is-ip/tsconfig.json b/types/is-ip/tsconfig.json index ea49885cbb..32c6d2baf7 100644 --- a/types/is-ip/tsconfig.json +++ b/types/is-ip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-my-json-valid/tsconfig.json b/types/is-my-json-valid/tsconfig.json index 687e2a6c57..13eedc22b1 100644 --- a/types/is-my-json-valid/tsconfig.json +++ b/types/is-my-json-valid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-negated-glob/tsconfig.json b/types/is-negated-glob/tsconfig.json index 9f8db73020..1083f6370c 100644 --- a/types/is-negated-glob/tsconfig.json +++ b/types/is-negated-glob/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "is-negated-glob-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/is-number/tsconfig.json b/types/is-number/tsconfig.json index 930df6698f..4eda636727 100644 --- a/types/is-number/tsconfig.json +++ b/types/is-number/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-object/tsconfig.json b/types/is-object/tsconfig.json index b3aae5340b..319385646a 100644 --- a/types/is-object/tsconfig.json +++ b/types/is-object/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "is-object-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/is-path-cwd/tsconfig.json b/types/is-path-cwd/tsconfig.json index 6f5a83c33d..0857fc254c 100644 --- a/types/is-path-cwd/tsconfig.json +++ b/types/is-path-cwd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-path-in-cwd/tsconfig.json b/types/is-path-in-cwd/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/is-path-in-cwd/tsconfig.json +++ b/types/is-path-in-cwd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/is-promise/tsconfig.json b/types/is-promise/tsconfig.json index fbc17a9140..62f75e7230 100644 --- a/types/is-promise/tsconfig.json +++ b/types/is-promise/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/is-relative-url/tsconfig.json b/types/is-relative-url/tsconfig.json index 1a85dcf51a..3304129cf5 100644 --- a/types/is-relative-url/tsconfig.json +++ b/types/is-relative-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-root-path/tsconfig.json b/types/is-root-path/tsconfig.json index 28d7f23893..32de5659e2 100644 --- a/types/is-root-path/tsconfig.json +++ b/types/is-root-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-root/tsconfig.json b/types/is-root/tsconfig.json index a92ff73369..2ec96b7950 100644 --- a/types/is-root/tsconfig.json +++ b/types/is-root/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-scoped/tsconfig.json b/types/is-scoped/tsconfig.json index e6ffa2ab86..e7cd6d168f 100644 --- a/types/is-scoped/tsconfig.json +++ b/types/is-scoped/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "is-scoped-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/is-stream/tsconfig.json b/types/is-stream/tsconfig.json index 061e555f72..711f3e885b 100644 --- a/types/is-stream/tsconfig.json +++ b/types/is-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-svg/tsconfig.json b/types/is-svg/tsconfig.json index 2621a88907..ee19bf61d4 100644 --- a/types/is-svg/tsconfig.json +++ b/types/is-svg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-text-path/tsconfig.json b/types/is-text-path/tsconfig.json index e6587abf96..f68781ca5a 100644 --- a/types/is-text-path/tsconfig.json +++ b/types/is-text-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-url-superb/tsconfig.json b/types/is-url-superb/tsconfig.json index 3450e58a06..5af295cadb 100644 --- a/types/is-url-superb/tsconfig.json +++ b/types/is-url-superb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-url/tsconfig.json b/types/is-url/tsconfig.json index 56f15b7e2f..a7c0ef487f 100644 --- a/types/is-url/tsconfig.json +++ b/types/is-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is-windows/tsconfig.json b/types/is-windows/tsconfig.json index 8696d92fe0..36ec2df909 100644 --- a/types/is-windows/tsconfig.json +++ b/types/is-windows/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/is/tsconfig.json b/types/is/tsconfig.json index 9abe3bbe43..90cdd21fd2 100644 --- a/types/is/tsconfig.json +++ b/types/is/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/isbn-utils/tsconfig.json b/types/isbn-utils/tsconfig.json index 9414c7c040..0077524e45 100644 --- a/types/isbn-utils/tsconfig.json +++ b/types/isbn-utils/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/iscroll/tsconfig.json b/types/iscroll/tsconfig.json index 7a1ec2a51b..b7dad3520e 100644 --- a/types/iscroll/tsconfig.json +++ b/types/iscroll/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iscroll/v4/tsconfig.json b/types/iscroll/v4/tsconfig.json index 2b09269531..4e6115127e 100644 --- a/types/iscroll/v4/tsconfig.json +++ b/types/iscroll/v4/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ismobilejs/tsconfig.json b/types/ismobilejs/tsconfig.json index ae9975d94e..748e1fff6f 100644 --- a/types/ismobilejs/tsconfig.json +++ b/types/ismobilejs/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ismobilejs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/iso-3166-2/tsconfig.json b/types/iso-3166-2/tsconfig.json index 0e374a83fc..2cdbb59c54 100644 --- a/types/iso-3166-2/tsconfig.json +++ b/types/iso-3166-2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/iso8601-localizer/tsconfig.json b/types/iso8601-localizer/tsconfig.json index e245ca21c0..01a65dcdc4 100644 --- a/types/iso8601-localizer/tsconfig.json +++ b/types/iso8601-localizer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/isomorphic-fetch/tsconfig.json b/types/isomorphic-fetch/tsconfig.json index f3cc715548..08c197c40f 100644 --- a/types/isomorphic-fetch/tsconfig.json +++ b/types/isomorphic-fetch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/isotope-layout/tsconfig.json b/types/isotope-layout/tsconfig.json index 8afefdbd01..50c41ebda1 100644 --- a/types/isotope-layout/tsconfig.json +++ b/types/isotope-layout/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/istanbul-lib-coverage/tsconfig.json b/types/istanbul-lib-coverage/tsconfig.json index 433ba89644..76754f3471 100644 --- a/types/istanbul-lib-coverage/tsconfig.json +++ b/types/istanbul-lib-coverage/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul-lib-hook/tsconfig.json b/types/istanbul-lib-hook/tsconfig.json index c010a0879b..45ad7e8ff7 100644 --- a/types/istanbul-lib-hook/tsconfig.json +++ b/types/istanbul-lib-hook/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul-lib-instrument/tsconfig.json b/types/istanbul-lib-instrument/tsconfig.json index 60629254a0..751abe74b0 100644 --- a/types/istanbul-lib-instrument/tsconfig.json +++ b/types/istanbul-lib-instrument/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul-lib-report/tsconfig.json b/types/istanbul-lib-report/tsconfig.json index 782aa1860c..644e91130d 100644 --- a/types/istanbul-lib-report/tsconfig.json +++ b/types/istanbul-lib-report/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul-lib-source-maps/tsconfig.json b/types/istanbul-lib-source-maps/tsconfig.json index ca94b106d7..9f1c37f7d7 100644 --- a/types/istanbul-lib-source-maps/tsconfig.json +++ b/types/istanbul-lib-source-maps/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul-middleware/tsconfig.json b/types/istanbul-middleware/tsconfig.json index 3bba961c04..153ab73a0e 100644 --- a/types/istanbul-middleware/tsconfig.json +++ b/types/istanbul-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/istanbul-reports/tsconfig.json b/types/istanbul-reports/tsconfig.json index 1f43d5038d..51c7eb3d46 100644 --- a/types/istanbul-reports/tsconfig.json +++ b/types/istanbul-reports/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/istanbul/tsconfig.json b/types/istanbul/tsconfig.json index 723eb394c5..ab009bb79a 100644 --- a/types/istanbul/tsconfig.json +++ b/types/istanbul/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ityped/tsconfig.json b/types/ityped/tsconfig.json index 2f2ceabe67..5530043548 100644 --- a/types/ityped/tsconfig.json +++ b/types/ityped/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ix.js/tsconfig.json b/types/ix.js/tsconfig.json index c840c77d73..3196f7e1c3 100644 --- a/types/ix.js/tsconfig.json +++ b/types/ix.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jade/tsconfig.json b/types/jade/tsconfig.json index f1c2b94f05..b7a356ca2f 100644 --- a/types/jade/tsconfig.json +++ b/types/jade/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jake/tsconfig.json b/types/jake/tsconfig.json index 5a5e5fcbd8..0f6b6131c4 100644 --- a/types/jake/tsconfig.json +++ b/types/jake/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jalaali-js/tsconfig.json b/types/jalaali-js/tsconfig.json index 995b501496..baf80ea66d 100644 --- a/types/jalaali-js/tsconfig.json +++ b/types/jalaali-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/japanese-holidays/tsconfig.json b/types/japanese-holidays/tsconfig.json index 1d8aeb27d0..44daea5b5c 100644 --- a/types/japanese-holidays/tsconfig.json +++ b/types/japanese-holidays/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-ajax/tsconfig.json b/types/jasmine-ajax/tsconfig.json index 01c73a745d..a0fc138c79 100644 --- a/types/jasmine-ajax/tsconfig.json +++ b/types/jasmine-ajax/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-data_driven_tests/tsconfig.json b/types/jasmine-data_driven_tests/tsconfig.json index 232e012191..1e82970117 100644 --- a/types/jasmine-data_driven_tests/tsconfig.json +++ b/types/jasmine-data_driven_tests/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-enzyme/tsconfig.json b/types/jasmine-enzyme/tsconfig.json index 6b63fe9694..bf83f1b6f4 100644 --- a/types/jasmine-enzyme/tsconfig.json +++ b/types/jasmine-enzyme/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-es6-promise-matchers/tsconfig.json b/types/jasmine-es6-promise-matchers/tsconfig.json index 98d8f03e42..876eee95ac 100644 --- a/types/jasmine-es6-promise-matchers/tsconfig.json +++ b/types/jasmine-es6-promise-matchers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-fixture/tsconfig.json b/types/jasmine-fixture/tsconfig.json index 149810b10a..ca506e5adb 100644 --- a/types/jasmine-fixture/tsconfig.json +++ b/types/jasmine-fixture/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-given/tsconfig.json b/types/jasmine-given/tsconfig.json index d1b9541f2c..57bd58c328 100644 --- a/types/jasmine-given/tsconfig.json +++ b/types/jasmine-given/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-jquery/tsconfig.json b/types/jasmine-jquery/tsconfig.json index ac43f3d18c..dc5f7f00d7 100644 --- a/types/jasmine-jquery/tsconfig.json +++ b/types/jasmine-jquery/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-matchers/tsconfig.json b/types/jasmine-matchers/tsconfig.json index 943271914e..fb7d43b96b 100644 --- a/types/jasmine-matchers/tsconfig.json +++ b/types/jasmine-matchers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-node/tsconfig.json b/types/jasmine-node/tsconfig.json index 2b68e61c60..2cc45d7d2a 100644 --- a/types/jasmine-node/tsconfig.json +++ b/types/jasmine-node/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine-promise-matchers/tsconfig.json b/types/jasmine-promise-matchers/tsconfig.json index 0b264e6527..66af9a8c08 100644 --- a/types/jasmine-promise-matchers/tsconfig.json +++ b/types/jasmine-promise-matchers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine/index.d.ts b/types/jasmine/index.d.ts index dd482c925f..f3e0407bab 100644 --- a/types/jasmine/index.d.ts +++ b/types/jasmine/index.d.ts @@ -259,11 +259,11 @@ declare namespace jasmine { execute(): void; describe(description: string, specDefinitions: () => void): Suite; // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these - beforeEach(beforeEachFunction: () => void): void; - beforeAll(beforeAllFunction: () => void): void; + beforeEach(beforeEachFunction: (done: DoneFn) => void, timeout?: number): void; + beforeAll(beforeAllFunction: (done: DoneFn) => void, timeout?: number): void; currentRunner(): Runner; - afterEach(afterEachFunction: () => void): void; - afterAll(afterAllFunction: () => void): void; + afterEach(afterEachFunction: (done: DoneFn) => void, timeout?: number): void; + afterAll(afterAllFunction: (done: DoneFn) => void, timeout?: number): void; xdescribe(desc: string, specDefinitions: () => void): XSuite; it(description: string, func: () => void): Spec; // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these diff --git a/types/jasmine/tsconfig.json b/types/jasmine/tsconfig.json index 55b83c6d3a..8cf9b9c42b 100644 --- a/types/jasmine/tsconfig.json +++ b/types/jasmine/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } -} +} \ No newline at end of file diff --git a/types/jasmine/v1/tsconfig.json b/types/jasmine/v1/tsconfig.json index 99a9fb48b4..35dd7f72b3 100644 --- a/types/jasmine/v1/tsconfig.json +++ b/types/jasmine/v1/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasmine_dom_matchers/tsconfig.json b/types/jasmine_dom_matchers/tsconfig.json index 4b09a5d93a..c806488fe6 100644 --- a/types/jasmine_dom_matchers/tsconfig.json +++ b/types/jasmine_dom_matchers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jasminewd2/tsconfig.json b/types/jasminewd2/tsconfig.json index 2267f75819..595a34e1b8 100644 --- a/types/jasminewd2/tsconfig.json +++ b/types/jasminewd2/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/java-applet/tsconfig.json b/types/java-applet/tsconfig.json index 776886e3f1..ae0ec396fd 100644 --- a/types/java-applet/tsconfig.json +++ b/types/java-applet/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/java/tsconfig.json b/types/java/tsconfig.json index 9f5ed2d241..6c47c1241c 100644 --- a/types/java/tsconfig.json +++ b/types/java/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/javascript-astar/tsconfig.json b/types/javascript-astar/tsconfig.json index 6ca80fa293..8c40ff7635 100644 --- a/types/javascript-astar/tsconfig.json +++ b/types/javascript-astar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/javascript-bignum/tsconfig.json b/types/javascript-bignum/tsconfig.json index d6a0961172..af86ab51b2 100644 --- a/types/javascript-bignum/tsconfig.json +++ b/types/javascript-bignum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/javascript-obfuscator/tsconfig.json b/types/javascript-obfuscator/tsconfig.json index 5b53fa94db..8c5281c864 100644 --- a/types/javascript-obfuscator/tsconfig.json +++ b/types/javascript-obfuscator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/javascript-state-machine/tsconfig.json b/types/javascript-state-machine/tsconfig.json index 75ccb2b212..44662c9100 100644 --- a/types/javascript-state-machine/tsconfig.json +++ b/types/javascript-state-machine/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jbinary/tsconfig.json b/types/jbinary/tsconfig.json index d272b54223..6c9f35a340 100644 --- a/types/jbinary/tsconfig.json +++ b/types/jbinary/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jcanvas/tsconfig.json b/types/jcanvas/tsconfig.json index 9c6aa5edbe..4bd7257d69 100644 --- a/types/jcanvas/tsconfig.json +++ b/types/jcanvas/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jdataview/tsconfig.json b/types/jdataview/tsconfig.json index 230f748dfe..67864c6551 100644 --- a/types/jdataview/tsconfig.json +++ b/types/jdataview/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jdenticon/tsconfig.json b/types/jdenticon/tsconfig.json index cb462ee4d6..1ae5237495 100644 --- a/types/jdenticon/tsconfig.json +++ b/types/jdenticon/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jee-jsf/tsconfig.json b/types/jee-jsf/tsconfig.json index 36364a83fa..3742e2c21b 100644 --- a/types/jee-jsf/tsconfig.json +++ b/types/jee-jsf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jenkins/jenkins-tests.ts b/types/jenkins/jenkins-tests.ts index 98b30d4b73..9f45c7053b 100644 --- a/types/jenkins/jenkins-tests.ts +++ b/types/jenkins/jenkins-tests.ts @@ -1,4 +1,4 @@ -import * as J from 'jenkins'; +import J = require('jenkins'); const jenkins = J({ baseUrl: 'http://user:pass@localhost:8080', crumbIssuer: true }); diff --git a/types/jenkins/tsconfig.json b/types/jenkins/tsconfig.json index 08dc07dbe9..44e042dc79 100644 --- a/types/jenkins/tsconfig.json +++ b/types/jenkins/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jest-diff/tsconfig.json b/types/jest-diff/tsconfig.json index 3624e1778b..8c945026ff 100644 --- a/types/jest-diff/tsconfig.json +++ b/types/jest-diff/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jest-diff-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jest-docblock/tsconfig.json b/types/jest-docblock/tsconfig.json index 4b1181bdad..e33cc9e573 100644 --- a/types/jest-docblock/tsconfig.json +++ b/types/jest-docblock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jest-get-type/tsconfig.json b/types/jest-get-type/tsconfig.json index d1e6fac5ee..9827885143 100644 --- a/types/jest-get-type/tsconfig.json +++ b/types/jest-get-type/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jest-get-type-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jest-in-case/tsconfig.json b/types/jest-in-case/tsconfig.json index a561ae813a..c84b4c71cd 100644 --- a/types/jest-in-case/tsconfig.json +++ b/types/jest-in-case/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jest-in-case-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jest-json-schema/tsconfig.json b/types/jest-json-schema/tsconfig.json index e8d55cbd89..72a4cfb23c 100644 --- a/types/jest-json-schema/tsconfig.json +++ b/types/jest-json-schema/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jest-json-schema-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jest-matcher-utils/tsconfig.json b/types/jest-matcher-utils/tsconfig.json index 115b762386..3a647a09a9 100644 --- a/types/jest-matcher-utils/tsconfig.json +++ b/types/jest-matcher-utils/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jest-matcher-utils-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jest-matchers/tsconfig.json b/types/jest-matchers/tsconfig.json index 123b605779..b3c1b8d9b8 100644 --- a/types/jest-matchers/tsconfig.json +++ b/types/jest-matchers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jest-validate/tsconfig.json b/types/jest-validate/tsconfig.json index 5b8abec385..0851710463 100644 --- a/types/jest-validate/tsconfig.json +++ b/types/jest-validate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index f58540fbe2..43768c629b 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Jest 22.0.5 +// Type definitions for Jest 22.1 // Project: http://facebook.github.io/jest/ // Definitions by: Asana // Ivo Stratev @@ -10,11 +10,10 @@ // Waseem Dahman // Jamie Mason // Douglas Duteil +// Ahn // Josh Goldberg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 -declare var beforeAll: jest.Lifecycle; declare var beforeEach: jest.Lifecycle; declare var afterAll: jest.Lifecycle; declare var afterEach: jest.Lifecycle; @@ -170,7 +169,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). @@ -553,16 +552,6 @@ declare namespace jest { // Relevant parts of Jasmine's API are below so they can be changed and removed over time. // This file can't reference jasmine.d.ts since the globals aren't compatible. -declare function spyOn(object: any, method: string): jasmine.Spy; -/** - * If you call the function pending anywhere in the spec body, - * no matter the expectations, the spec will be marked pending. - */ -declare function pending(reason?: string): void; -/** - * Fails a test when called within one. - */ -declare function fail(error?: any): void; declare namespace jasmine { let DEFAULT_TIMEOUT_INTERVAL: number; function clock(): Clock; diff --git a/types/jest/tsconfig.json b/types/jest/tsconfig.json index 8a02004840..fe92564343 100644 --- a/types/jest/tsconfig.json +++ b/types/jest/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jest/v16/tsconfig.json b/types/jest/v16/tsconfig.json index faf67cd73a..61038de4d6 100644 --- a/types/jest/v16/tsconfig.json +++ b/types/jest/v16/tsconfig.json @@ -23,7 +23,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jfp/tsconfig.json b/types/jfp/tsconfig.json index 81402f37d4..c75ebb5e7a 100644 --- a/types/jfp/tsconfig.json +++ b/types/jfp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jfs/tsconfig.json b/types/jfs/tsconfig.json index 2fd6c9f41b..8206817563 100644 --- a/types/jfs/tsconfig.json +++ b/types/jfs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jjv/tsconfig.json b/types/jjv/tsconfig.json index ce2a0343d8..0f6e9fe75f 100644 --- a/types/jjv/tsconfig.json +++ b/types/jjv/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jjve/tsconfig.json b/types/jjve/tsconfig.json index 12f97579f7..823b7b8df1 100644 --- a/types/jjve/tsconfig.json +++ b/types/jjve/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jmespath/tsconfig.json b/types/jmespath/tsconfig.json index 1b416d36d1..6b4bfc2810 100644 --- a/types/jmespath/tsconfig.json +++ b/types/jmespath/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/johnny-five/index.d.ts b/types/johnny-five/index.d.ts index 95a348429d..a1ff5d3f59 100644 --- a/types/johnny-five/index.d.ts +++ b/types/johnny-five/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/rwaldron/johnny-five // Definitions by: Toshiya Nakakura // Zoltan Ujvary +// Simon Colmer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -290,30 +291,6 @@ export declare class IMU { } export declare module IR { - export interface MotionOption { - pin: number | string; - } - - export class Motion { - constructor(option: number | MotionOption); - on(event: string, cb: () => void): this; - on(event: "data", cb: (data: any) => void): this; - on(event: "motionstart", cb: () => void): this; - on(event: "motionend", cb: () => void): this; - on(event: "calibrated", cb: () => void): this; - } - - export interface PloximityOption { - pin: number | string; - controller: string; - } - - export class Proximity { - constructor(option: number | PloximityOption); - on(event: string, cb: () => void): this; - on(event: "data", cb: (data: any) => void): this; - on(event: "change", cb: () => void): this; - } export interface ArrayOption { pins: Array | Array; @@ -521,6 +498,19 @@ export declare module Led { } } +export interface MotionOption { + pin: number | string; +} + +export class Motion { + constructor(option: number | MotionOption); + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: any) => void): this; + on(event: "motionstart", cb: () => void): this; + on(event: "motionend", cb: () => void): this; + on(event: "calibrated", cb: () => void): this; +} + export interface MotorOption { pins: any; current?: any; @@ -629,6 +619,23 @@ export declare class Ping { constructor(option: number | PingOption); } +export declare interface ProximityOption { + pin: number | string; + controller: string; +} + +export declare interface ProximityData { + cm: number; + in: number; +} + +export declare class Proximity { + constructor(option: number | ProximityOption); + on(event: string, cb: () => void): this; + on(event: "data", cb: (data: ProximityData) => void): this; + on(event: "change", cb: () => void): this; +} + export interface RelayOption { pin: number | string; type?: string; diff --git a/types/johnny-five/johnny-five-tests.ts b/types/johnny-five/johnny-five-tests.ts index 72e7d04b07..b2dd24904e 100644 --- a/types/johnny-five/johnny-five-tests.ts +++ b/types/johnny-five/johnny-five-tests.ts @@ -71,14 +71,14 @@ board.on('ready', function(){ freq: 100 // optional }); - var motion = new five.IR.Motion(7); + var motion = new five.Motion(7); // Options object with pin property - var motion = new five.IR.Motion({ + var motion = new five.Motion({ pin: 7 }); - var proximity = new five.IR.Proximity({ + var proximity = new five.Proximity({ controller: "GP2Y0A21YK", pin: "A0" }); diff --git a/types/johnny-five/tsconfig.json b/types/johnny-five/tsconfig.json index 5218cc5e2b..f58cec6814 100644 --- a/types/johnny-five/tsconfig.json +++ b/types/johnny-five/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/joi/tsconfig.json b/types/joi/tsconfig.json index 57e6c47881..1229f9503e 100644 --- a/types/joi/tsconfig.json +++ b/types/joi/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "joi-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/joi/v10/tsconfig.json b/types/joi/v10/tsconfig.json index 1bd530aff0..52855d5713 100644 --- a/types/joi/v10/tsconfig.json +++ b/types/joi/v10/tsconfig.json @@ -19,10 +19,11 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "joi-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/joi/v6/tsconfig.json b/types/joi/v6/tsconfig.json index 75aacbeeea..13d053b4d4 100644 --- a/types/joi/v6/tsconfig.json +++ b/types/joi/v6/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/joigoose/joigoose-tests.ts b/types/joigoose/joigoose-tests.ts index 91e36d827c..50cb29deef 100644 --- a/types/joigoose/joigoose-tests.ts +++ b/types/joigoose/joigoose-tests.ts @@ -1,4 +1,4 @@ -import * as Joigoose from "joigoose"; +import Joigoose = require("joigoose"); import * as Mongoose from "mongoose"; import * as Joi from "joi"; diff --git a/types/joigoose/tsconfig.json b/types/joigoose/tsconfig.json index 05aa2fd1c2..172e39fae9 100644 --- a/types/joigoose/tsconfig.json +++ b/types/joigoose/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/josa/index.d.ts b/types/josa/index.d.ts new file mode 100644 index 0000000000..3ce0d08ccc --- /dev/null +++ b/types/josa/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for josa 3.0 +// Project: https://github.com/kimdhoe/josa +// Definitions by: Vichyssoise +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type Topic = '은' | '는'; +export type Subject = '이' | '가'; +export type Objective = '을' | '를'; +export type Conjunction = '와' | '과'; +export type Means = '으로' | '로'; +export type Josa = Topic | Subject | Objective | Conjunction | Means; + +/** 조사 플레이스홀더(ex. #{은})가 포함된 문자열을 입력받아 완성된 문자열을 반환합니다. */ +export function josa(sentence: string): string; + +/** 명사에 맞는 조사를 찾아주는 함수를 반환합니다. 예를 들면, 임의의 명사에 대해 _을_과 를 중 하나를 선택하는 함수가 필요할 때 사용할 수 있습니다. */ +export function getJosaPicker(josa: Topic): (noun: string) => Topic; +export function getJosaPicker(josa: Subject): (noun: string) => Subject; +export function getJosaPicker(josa: Objective): (noun: string) => Objective; +export function getJosaPicker(josa: Conjunction): (noun: string) => Conjunction; +export function getJosaPicker(josa: Means): (noun: string) => Means; + +/** 명사에 조사를 붙이는 함수를 반환합니다. */ +export function makeJosaify(josa: Josa): (noun: string) => string; diff --git a/types/josa/josa-tests.ts b/types/josa/josa-tests.ts new file mode 100644 index 0000000000..6dd2ab771d --- /dev/null +++ b/types/josa/josa-tests.ts @@ -0,0 +1,22 @@ +import { josa, getJosaPicker, makeJosaify } from 'josa'; + +josa('비시스와즈'); // $ExpectType string +josa('사람들#{은} 작동만 되면 그 원리#{는} 신경#{을} 안쓰지'); // $ExpectType string + +getJosaPicker('은'); +getJosaPicker('은')('사람'); + +getJosaPicker('이'); +getJosaPicker('이')('사람'); + +getJosaPicker('을'); +getJosaPicker('을')('사람'); + +getJosaPicker('와'); +getJosaPicker('와')('사람'); + +getJosaPicker('로'); +getJosaPicker('로')('사람'); + +makeJosaify('은'); +makeJosaify('은')('사람'); // $ExpectType string diff --git a/types/josa/tsconfig.json b/types/josa/tsconfig.json new file mode 100644 index 0000000000..98786984f3 --- /dev/null +++ b/types/josa/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "josa-tests.ts" + ] +} \ No newline at end of file diff --git a/types/josa/tslint.json b/types/josa/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/josa/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jpeg-js/tsconfig.json b/types/jpeg-js/tsconfig.json index 20d7ba3d8d..09b8b89141 100644 --- a/types/jpeg-js/tsconfig.json +++ b/types/jpeg-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jpm/tsconfig.json b/types/jpm/tsconfig.json index 257f95eafa..7934ed544d 100644 --- a/types/jpm/tsconfig.json +++ b/types/jpm/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jqgrid/tsconfig.json b/types/jqgrid/tsconfig.json index fd6e8c36a2..4872ce6ec3 100644 --- a/types/jqgrid/tsconfig.json +++ b/types/jqgrid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jqrangeslider/tsconfig.json b/types/jqrangeslider/tsconfig.json index 9c8eabeb88..e7b62c7c06 100644 --- a/types/jqrangeslider/tsconfig.json +++ b/types/jqrangeslider/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-ajax-chain/tsconfig.json b/types/jquery-ajax-chain/tsconfig.json index 58a43cc65e..b7f9b3ac86 100644 --- a/types/jquery-ajax-chain/tsconfig.json +++ b/types/jquery-ajax-chain/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-alertable/tsconfig.json b/types/jquery-alertable/tsconfig.json index ca545d4a12..026ddd56c1 100644 --- a/types/jquery-alertable/tsconfig.json +++ b/types/jquery-alertable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-awesome-cursor/index.d.ts b/types/jquery-awesome-cursor/index.d.ts new file mode 100644 index 0000000000..1137b16b75 --- /dev/null +++ b/types/jquery-awesome-cursor/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for jquery-awesome-cursor 0.3 +// Project: https://jwarby.github.io/jquery-awesome-cursor +// Definitions by: Zsolt Kovács +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +declare namespace JQueryAwesomeCursor { + type flip = "horizontal" | "vertical" | "both"; + type cssHandler = (name: string) => void; + + interface Options { + color?: string; + size?: number; + hotspot?: number[] | string; + flip?: flip; + rotate?: number; + outline?: string; + font?: Font; + } + + interface Font { + family: string; + cssClass: string | cssHandler; + } +} + +interface JQueryStatic { + awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery; +} + +interface JQuery { + awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery; +} diff --git a/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts b/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts new file mode 100644 index 0000000000..cd47f56ff9 --- /dev/null +++ b/types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts @@ -0,0 +1,64 @@ +// Default +jQuery.awesomeCursor('pencil'); + +// Color +jQuery.awesomeCursor('pencil', { + color: '#ff0000' +}); + +// Size +jQuery.awesomeCursor('pencil', { + size: 32 +}); + +// Hotspot +jQuery.awesomeCursor('pencil', { + hotspot: [0, 17] +}); +jQuery.awesomeCursor('pencil', { + hotspot: 'bottom left' +}); + +// Flip +jQuery.awesomeCursor('pencil', { + flip: 'horizontal' +}); +jQuery.awesomeCursor('pencil', { + flip: 'vertical' +}); +jQuery.awesomeCursor('pencil', { + flip: 'both' +}); + +// Rotate +jQuery.awesomeCursor('pencil', { + rotate: 45 +}); + +// Outline +jQuery.awesomeCursor('pencil', { + outline: 'red' +}); + +// Different font +jQuery.awesomeCursor('brush', { + font: { + family: 'typicons', + cssClass: 'typcn typcn-%s' + } +}); +jQuery.awesomeCursor('brush', { + font: { + family: 'typicons', + cssClass: (name) => { + return 'typcn typcn-' + name; + } + } +}); + +// Mixed +jQuery.awesomeCursor('long-arrow-left', { + color: 'red', + hotspot: 'top left', + rotate: 45, +}); diff --git a/types/jquery-awesome-cursor/tsconfig.json b/types/jquery-awesome-cursor/tsconfig.json new file mode 100644 index 0000000000..b2e301a8b8 --- /dev/null +++ b/types/jquery-awesome-cursor/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-awesome-cursor-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-awesome-cursor/tslint.json b/types/jquery-awesome-cursor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jquery-awesome-cursor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jquery-backstretch/tsconfig.json b/types/jquery-backstretch/tsconfig.json index c2fb9bc82f..586b25464e 100644 --- a/types/jquery-backstretch/tsconfig.json +++ b/types/jquery-backstretch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-cropbox/tsconfig.json b/types/jquery-cropbox/tsconfig.json index 8ff494d309..3434909492 100644 --- a/types/jquery-cropbox/tsconfig.json +++ b/types/jquery-cropbox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-deparam/tsconfig.json b/types/jquery-deparam/tsconfig.json index b7d9a9d091..9f1b087687 100644 --- a/types/jquery-deparam/tsconfig.json +++ b/types/jquery-deparam/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-easy-loading/tsconfig.json b/types/jquery-easy-loading/tsconfig.json index c6c8a6a160..7e12f37ffe 100644 --- a/types/jquery-easy-loading/tsconfig.json +++ b/types/jquery-easy-loading/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-editable-select/tsconfig.json b/types/jquery-editable-select/tsconfig.json index a284c442fa..fc9904fdb8 100644 --- a/types/jquery-editable-select/tsconfig.json +++ b/types/jquery-editable-select/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-fullscreen/tsconfig.json b/types/jquery-fullscreen/tsconfig.json index 81b275bff5..dc4e20c177 100644 --- a/types/jquery-fullscreen/tsconfig.json +++ b/types/jquery-fullscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-galleria/tsconfig.json b/types/jquery-galleria/tsconfig.json index c082643a87..96c948f924 100644 --- a/types/jquery-galleria/tsconfig.json +++ b/types/jquery-galleria/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-handsontable/tsconfig.json b/types/jquery-handsontable/tsconfig.json index fac1311bb7..aa39ff119c 100644 --- a/types/jquery-handsontable/tsconfig.json +++ b/types/jquery-handsontable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-jcrop/tsconfig.json b/types/jquery-jcrop/tsconfig.json index add23691c0..895906f145 100644 --- a/types/jquery-jcrop/tsconfig.json +++ b/types/jquery-jcrop/tsconfig.json @@ -1,24 +1,25 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "jquery-jcrop-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-jcrop-tests.ts" + ] } \ No newline at end of file diff --git a/types/jquery-jsonrpcclient/tsconfig.json b/types/jquery-jsonrpcclient/tsconfig.json index 812781d6cc..b410a68acf 100644 --- a/types/jquery-jsonrpcclient/tsconfig.json +++ b/types/jquery-jsonrpcclient/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-knob/tsconfig.json b/types/jquery-knob/tsconfig.json index c177f5a019..d5913373b8 100644 --- a/types/jquery-knob/tsconfig.json +++ b/types/jquery-knob/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-mask-plugin/index.d.ts b/types/jquery-mask-plugin/index.d.ts index a142d0a97e..342045a204 100644 --- a/types/jquery-mask-plugin/index.d.ts +++ b/types/jquery-mask-plugin/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for jQuery Mask Plugin 1.14 // Project: https://igorescobar.github.io/jQuery-Mask-Plugin/ -// Definitions by: Anže Videnič , Igor Escobar +// Definitions by: Anže Videnič +// Igor Escobar +// Anderson Friaça // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -25,6 +27,7 @@ declare namespace jQueryMask { selectOnFocus?: boolean; reverse?: boolean; clearIfNotMatch?: boolean; + placeholder?: string; onComplete?(value: string, e: Event, $element: JQuery, options: Options): void; onKeyPress?(value: string, e: Event, $element: JQuery, options: Options): void; onChange?(value: string, e: Event, $element: JQuery, options: Options): void; diff --git a/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts b/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts index 310cec421b..90ac9f7a00 100644 --- a/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts +++ b/types/jquery-mask-plugin/jquery-mask-plugin-tests.ts @@ -27,6 +27,9 @@ $(document).ready(() => { placeholder: "__/__/____" } }); + $('.placeholder2').mask("00/00/0000", { + placeholder: "__/__/____" + }); $('.fallback').mask("00r00r0000", { translation: { r: { diff --git a/types/jquery-mask-plugin/tsconfig.json b/types/jquery-mask-plugin/tsconfig.json index 21be524f87..98c8d3d4e3 100644 --- a/types/jquery-mask-plugin/tsconfig.json +++ b/types/jquery-mask-plugin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-match-height/tsconfig.json b/types/jquery-match-height/tsconfig.json index 103ae84843..9c83d33574 100644 --- a/types/jquery-match-height/tsconfig.json +++ b/types/jquery-match-height/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-mockjax/tsconfig.json b/types/jquery-mockjax/tsconfig.json index 42505b57a0..3f3116e2e7 100644 --- a/types/jquery-mockjax/tsconfig.json +++ b/types/jquery-mockjax/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-mousewheel/tsconfig.json b/types/jquery-mousewheel/tsconfig.json index 7fe74c814f..bae05cac1a 100644 --- a/types/jquery-mousewheel/tsconfig.json +++ b/types/jquery-mousewheel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-notifier/tsconfig.json b/types/jquery-notifier/tsconfig.json index b2178bf718..40548bb50d 100644 --- a/types/jquery-notifier/tsconfig.json +++ b/types/jquery-notifier/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jquery-notifier-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jquery-param/tsconfig.json b/types/jquery-param/tsconfig.json index 65999b18ff..ab66910efe 100644 --- a/types/jquery-param/tsconfig.json +++ b/types/jquery-param/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-sortable/tsconfig.json b/types/jquery-sortable/tsconfig.json index 2a77692104..1e6c616f02 100644 --- a/types/jquery-sortable/tsconfig.json +++ b/types/jquery-sortable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-steps/tsconfig.json b/types/jquery-steps/tsconfig.json index 5af8c482b0..e1a0b04e2b 100644 --- a/types/jquery-steps/tsconfig.json +++ b/types/jquery-steps/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-sticky/index.d.ts b/types/jquery-sticky/index.d.ts new file mode 100644 index 0000000000..469ebde7a1 --- /dev/null +++ b/types/jquery-sticky/index.d.ts @@ -0,0 +1,82 @@ +// Type definitions for jquery-sticky 1.0 +// Project: https://github.com/garand/sticky +// Definitions by: Matthieu Tabuteau +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +interface JQueryStickyOptions { + /** + * Pixels between the page top and the element's top. + * @default 0 + */ + topSpacing?: number; + + /** + * Pixels between the page bottom and the element's bottom. + * @default 0 + */ + bottomSpacing?: number; + + /** + * CSS class added to the element's wrapper when "sticked". + * @default is-sticky + */ + className?: string; + + /** + * CSS class added to the wrapper. + * @default 'sticky-wrapper' + */ + wrapperClassName?: string; + + /** + * Boolean determining whether the sticky element should be horizontally centered in the page. + * @default false + */ + center?: boolean; + + /** + * Selector of element referenced to set fixed width of "sticky" element. + * @default '' + */ + getWidthFrom?: string; + + /** + * Boolean determining whether width of the "sticky" element should be updated to match the wrapper's width. + * Wrapper is a placeholder for "sticky" element while it is fixed (out of static elements flow), and its width depends on the context and CSS rules. + * Works only as long getWidthForm isn't set. + * @default true + */ + widthFromWrapper?: boolean; + + /** + * Boolean determining whether widths will be recalculated on window resize (using getWidthfrom). + * @default false + */ + responsiveWidth?: boolean; + + /** + * Controls z-index of the sticked element. + * @default inherit + */ + zIndex?: string; +} + +interface JQuery { + /** + * Initializer. options is optional. + */ + sticky(options?: JQueryStickyOptions): JQuery; + + /** + * Recalculates the element's position. + */ + sticky(method: 'update'): JQuery; + + /** + * To unstick an object. + */ + unstick(): JQuery; +} diff --git a/types/jquery-sticky/jquery-sticky-tests.ts b/types/jquery-sticky/jquery-sticky-tests.ts new file mode 100644 index 0000000000..e0e6e69d9c --- /dev/null +++ b/types/jquery-sticky/jquery-sticky-tests.ts @@ -0,0 +1,18 @@ +// initialization +$('#sticker').sticky({ + topSpacing: 12, + bottomSpacing: 12, + className: 'class-name', + wrapperClassName: 'wrapper-class-name', + center: true, + getWidthFrom: '#container', + widthFromWrapper: false, + responsiveWidth: true, + zIndex: '2' +}); + +// update element position +$('#sticker').sticky('update'); + +// unstick +$("#sticker").unstick(); diff --git a/types/jquery-sticky/tsconfig.json b/types/jquery-sticky/tsconfig.json new file mode 100644 index 0000000000..fd83e8263c --- /dev/null +++ b/types/jquery-sticky/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-sticky-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-sticky/tslint.json b/types/jquery-sticky/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jquery-sticky/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jquery-tags-input/index.d.ts b/types/jquery-tags-input/index.d.ts new file mode 100644 index 0000000000..612d57da52 --- /dev/null +++ b/types/jquery-tags-input/index.d.ts @@ -0,0 +1,112 @@ +// Type definitions for jQuery Tags Input Plugin 1.3 +// Project: https://github.com/xoxco/jQuery-Tags-Input +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +declare namespace jQueryTagsInput { + interface Options { + /** + * Url for autocomplete + */ + autocomplete_url?: string; + + /** + * Autocomplete options + */ + autocomplete?: object; + + /** + * Height of tag + */ + height?: string; + + /** + * Width of tag + */ + width?: string; + + /** + * Interactive tags + */ + interactive?: boolean; + + /** + * Placeholder of field when tags is empty + */ + defaultText?: string; + + /** + * Callback function on add tag + */ + onAddTag?: (addedValue: string) => void; + + /** + * Callback function on remove tag + */ + onRemoveTag?: (removedValue: string) => void; + + /** + * Callback function on change list of tags + */ + onChange?: (element: JQuery, changedValue: string) => void; + + /** + * Delimiters on tags creation + */ + delimiter?: string[]|string; + + /** + * Remove with tag backspace + */ + removeWithBackspace ?: boolean; + + /** + * Minimun char length for tag + */ + minChars?: number; + + /** + * Max char length for tag + */ + maxChars?: number; + + /** + * Placeholder color of tags + */ + placeholderColor?: string; + } + } + interface JQuery { + /** + * Transform input field to work with tags + * @param options for creation + */ + tagsInput(options?: jQueryTagsInput.Options): JQuery; + + /** + * Add a new tag to list + * @param tag value + */ + addTag(tag: string): boolean; + + /** + * Remove tag with value from list + * @param tag to be removed + */ + removeTag(tag: string): boolean; + + /** + * Add a new tags + * @param tags string separated by delimiter + */ + importTags(tags: string): void; + + /** + * Verify if tag exists + * @param tag value + */ + tagExist(tag: string): boolean; + } diff --git a/types/jquery-tags-input/jquery-tags-input-tests.ts b/types/jquery-tags-input/jquery-tags-input-tests.ts new file mode 100644 index 0000000000..559a47a698 --- /dev/null +++ b/types/jquery-tags-input/jquery-tags-input-tests.ts @@ -0,0 +1,20 @@ +// basic usage +$(document).ready(() => { + $('#inputTag').tagsInput(); + $('#inputTag').addTag('new tag'); + $('#inputTag').tagExist('new tag'); + $('inputTag').removeTag('new tag'); + $('#inputTag').importTags('tag1, tag2, tag3'); + + // with options + const options: jQueryTagsInput.Options = { + height: '100px', + width: '300px', + minChars: 3, + maxChars: 0, + onAddTag: (value: string) => { + alert('Tag added: ' + value); + } + }; + $('#inputTag').tagsInput(options); +}); diff --git a/types/jquery-tags-input/tsconfig.json b/types/jquery-tags-input/tsconfig.json new file mode 100644 index 0000000000..09fd291b0f --- /dev/null +++ b/types/jquery-tags-input/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-tags-input-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-tags-input/tslint.json b/types/jquery-tags-input/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery-tags-input/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file diff --git a/types/jquery-timeentry/tsconfig.json b/types/jquery-timeentry/tsconfig.json index 0869745caf..6993709bad 100644 --- a/types/jquery-timeentry/tsconfig.json +++ b/types/jquery-timeentry/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-toastmessage-plugin/tsconfig.json b/types/jquery-toastmessage-plugin/tsconfig.json index 79e81125ce..7073dd1b27 100644 --- a/types/jquery-toastmessage-plugin/tsconfig.json +++ b/types/jquery-toastmessage-plugin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-truncate-html/tsconfig.json b/types/jquery-truncate-html/tsconfig.json index c4ea956cac..cfe4235e9a 100644 --- a/types/jquery-truncate-html/tsconfig.json +++ b/types/jquery-truncate-html/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-urlparam/tsconfig.json b/types/jquery-urlparam/tsconfig.json index bdcb0ffebe..26820466ab 100644 --- a/types/jquery-urlparam/tsconfig.json +++ b/types/jquery-urlparam/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery-validation-unobtrusive/tsconfig.json b/types/jquery-validation-unobtrusive/tsconfig.json index 7cf39e48e0..9b3eee130c 100644 --- a/types/jquery-validation-unobtrusive/tsconfig.json +++ b/types/jquery-validation-unobtrusive/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.address/tsconfig.json b/types/jquery.address/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.address/tsconfig.json +++ b/types/jquery.address/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.are-you-sure/tsconfig.json b/types/jquery.are-you-sure/tsconfig.json index 165728a00e..1daf8cb533 100644 --- a/types/jquery.are-you-sure/tsconfig.json +++ b/types/jquery.are-you-sure/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.autosize/tsconfig.json b/types/jquery.autosize/tsconfig.json index 6cb415b04c..53f7cc67c8 100644 --- a/types/jquery.autosize/tsconfig.json +++ b/types/jquery.autosize/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.base64/tsconfig.json b/types/jquery.base64/tsconfig.json index 157bbd92d9..170b1338d6 100644 --- a/types/jquery.base64/tsconfig.json +++ b/types/jquery.base64/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.bbq/tsconfig.json b/types/jquery.bbq/tsconfig.json index 48e78a892d..24233f0897 100644 --- a/types/jquery.bbq/tsconfig.json +++ b/types/jquery.bbq/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.blockui/tsconfig.json b/types/jquery.blockui/tsconfig.json index e46b2e83ec..6a0de89f04 100644 --- a/types/jquery.blockui/tsconfig.json +++ b/types/jquery.blockui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.bootstrap.wizard/tsconfig.json b/types/jquery.bootstrap.wizard/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.bootstrap.wizard/tsconfig.json +++ b/types/jquery.bootstrap.wizard/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.cleditor/tsconfig.json b/types/jquery.cleditor/tsconfig.json index 70f33953ab..5fedcfc36e 100644 --- a/types/jquery.cleditor/tsconfig.json +++ b/types/jquery.cleditor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.clientsidelogging/tsconfig.json b/types/jquery.clientsidelogging/tsconfig.json index 80a2b6dbf4..fd8abca37d 100644 --- a/types/jquery.clientsidelogging/tsconfig.json +++ b/types/jquery.clientsidelogging/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.color/tsconfig.json b/types/jquery.color/tsconfig.json index 35da9bb381..16b6c64b5e 100644 --- a/types/jquery.color/tsconfig.json +++ b/types/jquery.color/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.colorbox/tsconfig.json b/types/jquery.colorbox/tsconfig.json index decbdf5578..ebd35bce20 100644 --- a/types/jquery.colorbox/tsconfig.json +++ b/types/jquery.colorbox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.colorpicker/index.d.ts b/types/jquery.colorpicker/index.d.ts index a2098e1ef9..1ece8a3c66 100644 --- a/types/jquery.colorpicker/index.d.ts +++ b/types/jquery.colorpicker/index.d.ts @@ -31,6 +31,7 @@ interface JQueryColorpickerOptions { closeOnOutside?: boolean; color?: string; colorFormat?: string; + disabled?: boolean; draggable?: boolean; duration?: string; format?: string; @@ -38,7 +39,7 @@ interface JQueryColorpickerOptions { hsv?: boolean; inline?: boolean; inlineFrame?: boolean; - layout?: {[part: string]: number[];}; + layout?: { [part: string]: number[]; }; limit?: string; modal?: boolean; mode?: string; @@ -67,7 +68,7 @@ interface JQueryColorpickerStatic { regional: { [key: string]: string; }; swatches: { [swatch: string]: { [name: string]: JQueryColorpickerStatic.RGB; }; }; writers: { [name: string]: (color: any, that: any) => any; }; - Color: { new (r?: number, g?: number, b?: number, a?: number): JQueryColorpickerStatic.Color; }; + Color: { new(r?: number, g?: number, b?: number, a?: number): JQueryColorpickerStatic.Color; }; } declare namespace JQueryColorpickerStatic { @@ -162,6 +163,6 @@ interface JQuery { colorpicker(method: "open"): JQuery; colorpicker(method: string): JQuery; colorpicker(method: "setColor", color: any): JQuery; - colorpicker(method: string, param: any): JQuery; + colorpicker(method: string, ...params: any[]): JQuery; colorpicker(options?: JQueryColorpickerOptions): JQuery; } diff --git a/types/jquery.colorpicker/jquery.colorpicker-tests.ts b/types/jquery.colorpicker/jquery.colorpicker-tests.ts index 707e2dd7f9..7d6e5c7ce3 100644 --- a/types/jquery.colorpicker/jquery.colorpicker-tests.ts +++ b/types/jquery.colorpicker/jquery.colorpicker-tests.ts @@ -17,6 +17,7 @@ var colorpicker = $("").colorpicker({ closeOnOutside: true, // Close the dialog when clicking outside the dialog (not for inline) color: '#00FF00', // Initial color (for inline only) colorFormat: 'HEX', // Format string for output color format + disabled: false, draggable: true, // Make popup dialog draggable if header is visible. duration: 'fast', hsv: true, // Show HSV controls and modes @@ -67,6 +68,10 @@ colorpicker.colorpicker("open"); colorpicker.colorpicker("close"); colorpicker.colorpicker("destroy"); colorpicker.colorpicker("setColor", "#deadbeef"); +colorpicker.colorpicker("option", "disabled", true); + +// check if all options are optional +let defaultColorpicker = $("").colorpicker({}); // example plugins provided @@ -94,23 +99,23 @@ $.colorpicker.parts["memory"] = function (inst) { break; } }).bind('contextmenu', function (e) { - e.preventDefault(); - }); + e.preventDefault(); + }); container.append($node); }, getMemory = function () { return ((document.cookie.match(/\bcolorpicker-memory=([^;]*)/) || [0, ''])[1]).split(','); }, - setMemory = function () { - var colors = []; - $('> *', container).each(function () { - colors.push(encodeURIComponent($(this).css('backgroundColor'))); - }); - var expdate = new Date(); - expdate.setDate(expdate.getDate() + (365 * 10)); - document.cookie = 'colorpicker-memory=' + colors.join() + ";expires=" + expdate.toUTCString(); - }; + setMemory = function () { + var colors = []; + $('> *', container).each(function () { + colors.push(encodeURIComponent($(this).css('backgroundColor'))); + }); + var expdate = new Date(); + expdate.setDate(expdate.getDate() + (365 * 10)); + document.cookie = 'colorpicker-memory=' + colors.join() + ";expires=" + expdate.toUTCString(); + }; this.init = function () { container = $('
') @@ -195,7 +200,7 @@ $.colorpicker.parsers['CMYK'] = function (color) { parseInt(m[2], 10) / 255, parseInt(m[3], 10) / 255, parseInt(m[4], 10) / 255 - ); + ); } }; @@ -206,7 +211,7 @@ $.colorpicker.parsers["#HEX8"] = function (color) { parseInt(m[2], 16) / 255, parseInt(m[3], 16) / 255, parseInt(m[4], 16) / 255 - ).setAlpha(parseInt(m[1], 16) / 255); + ).setAlpha(parseInt(m[1], 16) / 255); } }; diff --git a/types/jquery.colorpicker/tsconfig.json b/types/jquery.colorpicker/tsconfig.json index f0edccd4d6..5912d60570 100644 --- a/types/jquery.colorpicker/tsconfig.json +++ b/types/jquery.colorpicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.contextmenu/tsconfig.json b/types/jquery.contextmenu/tsconfig.json index 2de43ba64f..4ac31577f9 100644 --- a/types/jquery.contextmenu/tsconfig.json +++ b/types/jquery.contextmenu/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.cookie/tsconfig.json b/types/jquery.cookie/tsconfig.json index 0b4c16e92a..2b976c3bb2 100644 --- a/types/jquery.cookie/tsconfig.json +++ b/types/jquery.cookie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.customselect/tsconfig.json b/types/jquery.customselect/tsconfig.json index ce71c3244f..55a534bc45 100644 --- a/types/jquery.customselect/tsconfig.json +++ b/types/jquery.customselect/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.cycle/tsconfig.json b/types/jquery.cycle/tsconfig.json index b807c05700..3bb6527980 100644 --- a/types/jquery.cycle/tsconfig.json +++ b/types/jquery.cycle/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.cycle2/tsconfig.json b/types/jquery.cycle2/tsconfig.json index 8fe54da959..1c845b031f 100644 --- a/types/jquery.cycle2/tsconfig.json +++ b/types/jquery.cycle2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.dropotron/tsconfig.json b/types/jquery.dropotron/tsconfig.json index c811e857c6..3df7005b1a 100644 --- a/types/jquery.dropotron/tsconfig.json +++ b/types/jquery.dropotron/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.dynatree/tsconfig.json b/types/jquery.dynatree/tsconfig.json index 1963c75cb1..6373d266c0 100644 --- a/types/jquery.dynatree/tsconfig.json +++ b/types/jquery.dynatree/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.elang/tsconfig.json b/types/jquery.elang/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.elang/tsconfig.json +++ b/types/jquery.elang/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.fancytree/tsconfig.json b/types/jquery.fancytree/tsconfig.json index bd2d2932ca..5e301086b7 100644 --- a/types/jquery.fancytree/tsconfig.json +++ b/types/jquery.fancytree/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.fileupload/tsconfig.json b/types/jquery.fileupload/tsconfig.json index ddefea0e79..ac9c3306dd 100644 --- a/types/jquery.fileupload/tsconfig.json +++ b/types/jquery.fileupload/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.filtertable/tsconfig.json b/types/jquery.filtertable/tsconfig.json index a0166c7d6b..1208bc4f98 100644 --- a/types/jquery.filtertable/tsconfig.json +++ b/types/jquery.filtertable/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.finger/tsconfig.json b/types/jquery.finger/tsconfig.json index 55be70767e..b60410ab16 100644 --- a/types/jquery.finger/tsconfig.json +++ b/types/jquery.finger/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.flagstrap/tsconfig.json b/types/jquery.flagstrap/tsconfig.json index c4bf7e1a72..25bf48af93 100644 --- a/types/jquery.flagstrap/tsconfig.json +++ b/types/jquery.flagstrap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.form/tsconfig.json b/types/jquery.form/tsconfig.json index 02b4195224..9ea3a8c19e 100644 --- a/types/jquery.form/tsconfig.json +++ b/types/jquery.form/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.fullscreen/tsconfig.json b/types/jquery.fullscreen/tsconfig.json index bc666dcb90..46a640c552 100644 --- a/types/jquery.fullscreen/tsconfig.json +++ b/types/jquery.fullscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.gridster/tsconfig.json b/types/jquery.gridster/tsconfig.json index b1e75c13e7..72f940b715 100644 --- a/types/jquery.gridster/tsconfig.json +++ b/types/jquery.gridster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.growl/tsconfig.json b/types/jquery.growl/tsconfig.json index 8416f143a7..e28ff8e1cf 100644 --- a/types/jquery.growl/tsconfig.json +++ b/types/jquery.growl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.highlight-bartaz/tsconfig.json b/types/jquery.highlight-bartaz/tsconfig.json index 4cbe9ddf76..c8ae44427c 100644 --- a/types/jquery.highlight-bartaz/tsconfig.json +++ b/types/jquery.highlight-bartaz/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.jnotify/tsconfig.json b/types/jquery.jnotify/tsconfig.json index abfa7d2782..d73b2d21b9 100644 --- a/types/jquery.jnotify/tsconfig.json +++ b/types/jquery.jnotify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.joyride/tsconfig.json b/types/jquery.joyride/tsconfig.json index cf307a3611..c1e0a54e00 100644 --- a/types/jquery.joyride/tsconfig.json +++ b/types/jquery.joyride/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.jsignature/tsconfig.json b/types/jquery.jsignature/tsconfig.json index c802539b0a..e0a05e7e70 100644 --- a/types/jquery.jsignature/tsconfig.json +++ b/types/jquery.jsignature/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.leanmodal/tsconfig.json b/types/jquery.leanmodal/tsconfig.json index 3625769dde..91fbecca25 100644 --- a/types/jquery.leanmodal/tsconfig.json +++ b/types/jquery.leanmodal/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.livestampjs/tsconfig.json b/types/jquery.livestampjs/tsconfig.json index 4042cffe68..6f8e48e2c5 100644 --- a/types/jquery.livestampjs/tsconfig.json +++ b/types/jquery.livestampjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.menuaim/tsconfig.json b/types/jquery.menuaim/tsconfig.json index c63cface62..937edcefb8 100644 --- a/types/jquery.menuaim/tsconfig.json +++ b/types/jquery.menuaim/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.mmenu/tsconfig.json b/types/jquery.mmenu/tsconfig.json index f95d7a3e93..c7f027625c 100644 --- a/types/jquery.mmenu/tsconfig.json +++ b/types/jquery.mmenu/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.notify/tsconfig.json b/types/jquery.notify/tsconfig.json index e703d61e37..07f6bf60ae 100644 --- a/types/jquery.notify/tsconfig.json +++ b/types/jquery.notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.notifybar/tsconfig.json b/types/jquery.notifybar/tsconfig.json index 7541f17487..88ec6786be 100644 --- a/types/jquery.notifybar/tsconfig.json +++ b/types/jquery.notifybar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.noty/tsconfig.json b/types/jquery.noty/tsconfig.json index fa1c069762..b4076b50e2 100644 --- a/types/jquery.noty/tsconfig.json +++ b/types/jquery.noty/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.payment/tsconfig.json b/types/jquery.payment/tsconfig.json index 84e6f1c89a..e73add9f7c 100644 --- a/types/jquery.payment/tsconfig.json +++ b/types/jquery.payment/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.pjax/tsconfig.json b/types/jquery.pjax/tsconfig.json index 5d692dbfe4..7081f4c0fe 100644 --- a/types/jquery.pjax/tsconfig.json +++ b/types/jquery.pjax/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.placeholder/tsconfig.json b/types/jquery.placeholder/tsconfig.json index 40c034b33b..2f77fd3f6e 100644 --- a/types/jquery.placeholder/tsconfig.json +++ b/types/jquery.placeholder/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.pnotify/tsconfig.json b/types/jquery.pnotify/tsconfig.json index a7ad412326..be462cb2a5 100644 --- a/types/jquery.pnotify/tsconfig.json +++ b/types/jquery.pnotify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.postmessage/tsconfig.json b/types/jquery.postmessage/tsconfig.json index dffccae0cd..a3f5056acf 100644 --- a/types/jquery.postmessage/tsconfig.json +++ b/types/jquery.postmessage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.prettyphoto/tsconfig.json b/types/jquery.prettyphoto/tsconfig.json index c35b1d3718..5417cd1ec3 100644 --- a/types/jquery.prettyphoto/tsconfig.json +++ b/types/jquery.prettyphoto/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.qrcode/tsconfig.json b/types/jquery.qrcode/tsconfig.json index bfa114d23a..0b29ab63bc 100644 --- a/types/jquery.qrcode/tsconfig.json +++ b/types/jquery.qrcode/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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.rateit/tsconfig.json b/types/jquery.rateit/tsconfig.json index a2ab54ec3b..95c69f6aaa 100644 --- a/types/jquery.rateit/tsconfig.json +++ b/types/jquery.rateit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.rowgrid/tsconfig.json b/types/jquery.rowgrid/tsconfig.json index 452aaeee8b..5022e720a4 100644 --- a/types/jquery.rowgrid/tsconfig.json +++ b/types/jquery.rowgrid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.scrollto/tsconfig.json b/types/jquery.scrollto/tsconfig.json index 587136c6c3..e87036509d 100644 --- a/types/jquery.scrollto/tsconfig.json +++ b/types/jquery.scrollto/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.simplemodal/tsconfig.json b/types/jquery.simplemodal/tsconfig.json index 24b60b0f81..f494541240 100644 --- a/types/jquery.simplemodal/tsconfig.json +++ b/types/jquery.simplemodal/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.simplepagination/tsconfig.json b/types/jquery.simplepagination/tsconfig.json index fa188d40ae..424e397b5a 100644 --- a/types/jquery.simplepagination/tsconfig.json +++ b/types/jquery.simplepagination/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.simulate/tsconfig.json b/types/jquery.simulate/tsconfig.json index c1586267bc..09236d4a4d 100644 --- a/types/jquery.simulate/tsconfig.json +++ b/types/jquery.simulate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.slimscroll/tsconfig.json b/types/jquery.slimscroll/tsconfig.json index d6acf16f4e..2a510b3ab0 100644 --- a/types/jquery.slimscroll/tsconfig.json +++ b/types/jquery.slimscroll/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.soap/tsconfig.json b/types/jquery.soap/tsconfig.json index 30c25fedd2..bd14eab5f7 100644 --- a/types/jquery.soap/tsconfig.json +++ b/types/jquery.soap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.sortelements/tsconfig.json b/types/jquery.sortelements/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.sortelements/tsconfig.json +++ b/types/jquery.sortelements/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.superlink/tsconfig.json b/types/jquery.superlink/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.superlink/tsconfig.json +++ b/types/jquery.superlink/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.tagsmanager/tsconfig.json b/types/jquery.tagsmanager/tsconfig.json index 26ae59c2ef..f392a0fa22 100644 --- a/types/jquery.tagsmanager/tsconfig.json +++ b/types/jquery.tagsmanager/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.tile/tsconfig.json b/types/jquery.tile/tsconfig.json index 4dd9e0f2ed..00e7676d4a 100644 --- a/types/jquery.tile/tsconfig.json +++ b/types/jquery.tile/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.timeago/tsconfig.json b/types/jquery.timeago/tsconfig.json index 9d61fbd512..417dc84d46 100644 --- a/types/jquery.timeago/tsconfig.json +++ b/types/jquery.timeago/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.timepicker/tsconfig.json b/types/jquery.timepicker/tsconfig.json index 6536dcca3b..05a7466732 100644 --- a/types/jquery.timepicker/tsconfig.json +++ b/types/jquery.timepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.timer/tsconfig.json b/types/jquery.timer/tsconfig.json index 166eec6bc1..86bfbd69e7 100644 --- a/types/jquery.timer/tsconfig.json +++ b/types/jquery.timer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.tinycarousel/tsconfig.json b/types/jquery.tinycarousel/tsconfig.json index f8b4040854..fd0744014b 100644 --- a/types/jquery.tinycarousel/tsconfig.json +++ b/types/jquery.tinycarousel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.tinyscrollbar/tsconfig.json b/types/jquery.tinyscrollbar/tsconfig.json index f318eedaa4..782a29b264 100644 --- a/types/jquery.tinyscrollbar/tsconfig.json +++ b/types/jquery.tinyscrollbar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.tipsy/tsconfig.json b/types/jquery.tipsy/tsconfig.json index fc95477a54..5107f06d04 100644 --- a/types/jquery.tipsy/tsconfig.json +++ b/types/jquery.tipsy/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.tools/tsconfig.json b/types/jquery.tools/tsconfig.json index 3b99d33c86..ef601e0e3a 100644 --- a/types/jquery.tools/tsconfig.json +++ b/types/jquery.tools/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.total-storage/tsconfig.json b/types/jquery.total-storage/tsconfig.json index ab78e13671..3c62edadfa 100644 --- a/types/jquery.total-storage/tsconfig.json +++ b/types/jquery.total-storage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.transit/tsconfig.json b/types/jquery.transit/tsconfig.json index ba68e939c7..628d53a263 100644 --- a/types/jquery.transit/tsconfig.json +++ b/types/jquery.transit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.ui.datetimepicker/tsconfig.json b/types/jquery.ui.datetimepicker/tsconfig.json index 6d28673765..55a456ad6b 100644 --- a/types/jquery.ui.datetimepicker/tsconfig.json +++ b/types/jquery.ui.datetimepicker/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.ui.layout/tsconfig.json b/types/jquery.ui.layout/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jquery.ui.layout/tsconfig.json +++ b/types/jquery.ui.layout/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jquery.uniform/tsconfig.json b/types/jquery.uniform/tsconfig.json index 0cd374ab15..eae4f481cb 100644 --- a/types/jquery.uniform/tsconfig.json +++ b/types/jquery.uniform/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.validation/tsconfig.json b/types/jquery.validation/tsconfig.json index 83b1ac2d52..8f70b517be 100644 --- a/types/jquery.validation/tsconfig.json +++ b/types/jquery.validation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.watermark/tsconfig.json b/types/jquery.watermark/tsconfig.json index 9543996936..59413b5d3b 100644 --- a/types/jquery.watermark/tsconfig.json +++ b/types/jquery.watermark/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery.window/tsconfig.json b/types/jquery.window/tsconfig.json index d8608684d5..5ef472acc0 100644 --- a/types/jquery.window/tsconfig.json +++ b/types/jquery.window/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery/tsconfig.json b/types/jquery/tsconfig.json index e481dc63c6..4b70421330 100644 --- a/types/jquery/tsconfig.json +++ b/types/jquery/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/jquery/v1/tsconfig.json b/types/jquery/v1/tsconfig.json index 02855a9f8e..eb53f56f94 100644 --- a/types/jquery/v1/tsconfig.json +++ b/types/jquery/v1/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquery/v2/tsconfig.json b/types/jquery/v2/tsconfig.json index 03ea2df8de..35c2a9007d 100644 --- a/types/jquery/v2/tsconfig.json +++ b/types/jquery/v2/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jquerymobile/tsconfig.json b/types/jquerymobile/tsconfig.json index fbbd8cb739..47fb771e9e 100644 --- a/types/jquerymobile/tsconfig.json +++ b/types/jquerymobile/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jqueryui/tsconfig.json b/types/jqueryui/tsconfig.json index ea7c9385c3..2b018f0062 100644 --- a/types/jqueryui/tsconfig.json +++ b/types/jqueryui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-base64/tsconfig.json b/types/js-base64/tsconfig.json index 2e325222f7..3380190f21 100644 --- a/types/js-base64/tsconfig.json +++ b/types/js-base64/tsconfig.json @@ -1,20 +1,25 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "test/js-base64-module.test.ts", "test/js-base64-global.test.ts" ] -} +} \ No newline at end of file diff --git a/types/js-beautify/tsconfig.json b/types/js-beautify/tsconfig.json index 28b0a603af..cc2c018f82 100644 --- a/types/js-beautify/tsconfig.json +++ b/types/js-beautify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-clipper/tsconfig.json b/types/js-clipper/tsconfig.json index b4074f17c1..c9858c90d5 100644 --- a/types/js-clipper/tsconfig.json +++ b/types/js-clipper/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-combinatorics/tsconfig.json b/types/js-combinatorics/tsconfig.json index ff2a188dcb..fbba418acc 100644 --- a/types/js-combinatorics/tsconfig.json +++ b/types/js-combinatorics/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-cookie/tsconfig.json b/types/js-cookie/tsconfig.json index 63cd342137..a560d75efb 100644 --- a/types/js-cookie/tsconfig.json +++ b/types/js-cookie/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-data-angular/tsconfig.json b/types/js-data-angular/tsconfig.json index e5117ff27a..11abc585bf 100644 --- a/types/js-data-angular/tsconfig.json +++ b/types/js-data-angular/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-fixtures/tsconfig.json b/types/js-fixtures/tsconfig.json index 2f4cb02c4b..4a4c40a440 100644 --- a/types/js-fixtures/tsconfig.json +++ b/types/js-fixtures/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-git/tsconfig.json b/types/js-git/tsconfig.json index e53cf4f6d8..4c79ddd5b9 100644 --- a/types/js-git/tsconfig.json +++ b/types/js-git/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-md5/tsconfig.json b/types/js-md5/tsconfig.json index 6348210a6b..6a77ef18a2 100644 --- a/types/js-md5/tsconfig.json +++ b/types/js-md5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-priority-queue/tsconfig.json b/types/js-priority-queue/tsconfig.json index 12e9d7f000..c9efddc5ca 100644 --- a/types/js-priority-queue/tsconfig.json +++ b/types/js-priority-queue/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-quantities/tsconfig.json b/types/js-quantities/tsconfig.json index 1866fc5155..1d1f7f7a20 100644 --- a/types/js-quantities/tsconfig.json +++ b/types/js-quantities/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-schema/tsconfig.json b/types/js-schema/tsconfig.json index 1c26cda396..2fccac00c6 100644 --- a/types/js-schema/tsconfig.json +++ b/types/js-schema/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-search/tsconfig.json b/types/js-search/tsconfig.json index eb6253aec9..c940fa5db5 100644 --- a/types/js-search/tsconfig.json +++ b/types/js-search/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-to-java/tsconfig.json b/types/js-to-java/tsconfig.json index 6a927d9578..2aac508ed8 100644 --- a/types/js-to-java/tsconfig.json +++ b/types/js-to-java/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-url/tsconfig.json b/types/js-url/tsconfig.json index 117bf43420..a2cc751fb6 100644 --- a/types/js-url/tsconfig.json +++ b/types/js-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/js-yaml/tsconfig.json b/types/js-yaml/tsconfig.json index c36931fa61..8626455989 100644 --- a/types/js-yaml/tsconfig.json +++ b/types/js-yaml/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "js-yaml-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/js.spec/tsconfig.json b/types/js.spec/tsconfig.json index c7a1d13a57..063bbacc55 100644 --- a/types/js.spec/tsconfig.json +++ b/types/js.spec/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsbn/tsconfig.json b/types/jsbn/tsconfig.json index 68fb5fc2d5..a6c95282f7 100644 --- a/types/jsbn/tsconfig.json +++ b/types/jsbn/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jschannel/tsconfig.json b/types/jschannel/tsconfig.json index 83727a281c..4ba367418e 100644 --- a/types/jschannel/tsconfig.json +++ b/types/jschannel/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jschannel-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jscrollpane/tsconfig.json b/types/jscrollpane/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jscrollpane/tsconfig.json +++ b/types/jscrollpane/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jsdeferred/tsconfig.json b/types/jsdeferred/tsconfig.json index 7b6fbf8171..1cbd4c6293 100644 --- a/types/jsdeferred/tsconfig.json +++ b/types/jsdeferred/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsdom/tsconfig.json b/types/jsdom/tsconfig.json index fe7f9dd41f..ef95267a70 100644 --- a/types/jsdom/tsconfig.json +++ b/types/jsdom/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsdom/v2/tsconfig.json b/types/jsdom/v2/tsconfig.json index 3027a13385..32ce5274b0 100644 --- a/types/jsdom/v2/tsconfig.json +++ b/types/jsdom/v2/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsen/tsconfig.json b/types/jsen/tsconfig.json index cf32dd60a8..fb95888bdb 100644 --- a/types/jsen/tsconfig.json +++ b/types/jsen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsend/tsconfig.json b/types/jsend/tsconfig.json index 13a1b84a23..2aa1162a01 100644 --- a/types/jsend/tsconfig.json +++ b/types/jsend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsesc/tsconfig.json b/types/jsesc/tsconfig.json index d9f4194987..656652f612 100644 --- a/types/jsesc/tsconfig.json +++ b/types/jsesc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsfl/tsconfig.json b/types/jsfl/tsconfig.json index 581bbb4199..6c907b4e28 100644 --- a/types/jsfl/tsconfig.json +++ b/types/jsfl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsforce/tsconfig.json b/types/jsforce/tsconfig.json index 0d480d799f..73623d7e99 100644 --- a/types/jsforce/tsconfig.json +++ b/types/jsforce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jshamcrest/tsconfig.json b/types/jshamcrest/tsconfig.json index dd54b4d553..8972d0fa35 100644 --- a/types/jshamcrest/tsconfig.json +++ b/types/jshamcrest/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsmockito/tsconfig.json b/types/jsmockito/tsconfig.json index 3b81da0df0..85db6db99b 100644 --- a/types/jsmockito/tsconfig.json +++ b/types/jsmockito/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsnox/jsnox-tests.ts b/types/jsnox/jsnox-tests.ts index d545581591..f03c33e917 100644 --- a/types/jsnox/jsnox-tests.ts +++ b/types/jsnox/jsnox-tests.ts @@ -1,5 +1,5 @@ import * as React from "react"; -import * as jsnox from "jsnox"; +import jsnox = require("jsnox"); const $ = jsnox(React); interface PersonProps { diff --git a/types/jsnox/tsconfig.json b/types/jsnox/tsconfig.json index 03450f596c..2d6ef33c2f 100644 --- a/types/jsnox/tsconfig.json +++ b/types/jsnox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-editor/tsconfig.json b/types/json-editor/tsconfig.json index accf3485bf..9bdce0acb6 100644 --- a/types/json-editor/tsconfig.json +++ b/types/json-editor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-js/tsconfig.json b/types/json-js/tsconfig.json index 0bac144d32..1ca12a9cee 100644 --- a/types/json-js/tsconfig.json +++ b/types/json-js/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-merge-patch/tsconfig.json b/types/json-merge-patch/tsconfig.json index 2c3683dc41..f3a8a23907 100644 --- a/types/json-merge-patch/tsconfig.json +++ b/types/json-merge-patch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-patch/tsconfig.json b/types/json-patch/tsconfig.json index bcd1d84d36..ef71692ebc 100644 --- a/types/json-patch/tsconfig.json +++ b/types/json-patch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-pointer/tsconfig.json b/types/json-pointer/tsconfig.json index f5b746e548..1f38a08c46 100644 --- a/types/json-pointer/tsconfig.json +++ b/types/json-pointer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-query/tsconfig.json b/types/json-query/tsconfig.json index 9a317f4d83..85f1dfd7f7 100644 --- a/types/json-query/tsconfig.json +++ b/types/json-query/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-rpc-ws/tsconfig.json b/types/json-rpc-ws/tsconfig.json index d062401159..9ee376affa 100644 --- a/types/json-rpc-ws/tsconfig.json +++ b/types/json-rpc-ws/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-schema/tsconfig.json b/types/json-schema/tsconfig.json index 443caf8239..dabf0dd1ee 100644 --- a/types/json-schema/tsconfig.json +++ b/types/json-schema/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-socket/tsconfig.json b/types/json-socket/tsconfig.json index 5901e0b745..a173dc8fb8 100644 --- a/types/json-socket/tsconfig.json +++ b/types/json-socket/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-stable-stringify/tsconfig.json b/types/json-stable-stringify/tsconfig.json index bb605781c5..4b8cd49f28 100644 --- a/types/json-stable-stringify/tsconfig.json +++ b/types/json-stable-stringify/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json-stringify-safe/tsconfig.json b/types/json-stringify-safe/tsconfig.json index f4ca1b5e30..f86443faca 100644 --- a/types/json-stringify-safe/tsconfig.json +++ b/types/json-stringify-safe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json2md/tsconfig.json b/types/json2md/tsconfig.json index e0fd95f150..44162d1678 100644 --- a/types/json2md/tsconfig.json +++ b/types/json2md/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/json5/tsconfig.json b/types/json5/tsconfig.json index bf318f8b10..5bafbb80e7 100644 --- a/types/json5/tsconfig.json +++ b/types/json5/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonata/tsconfig.json b/types/jsonata/tsconfig.json index c047ca52bf..38ed068b63 100644 --- a/types/jsonata/tsconfig.json +++ b/types/jsonata/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsoneditor/tsconfig.json b/types/jsoneditor/tsconfig.json index 299abd4f68..7afee352a9 100644 --- a/types/jsoneditor/tsconfig.json +++ b/types/jsoneditor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsoneditoronline/tsconfig.json b/types/jsoneditoronline/tsconfig.json index 25ef8ae26a..134dd22ef9 100644 --- a/types/jsoneditoronline/tsconfig.json +++ b/types/jsoneditoronline/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonfile/tsconfig.json b/types/jsonfile/tsconfig.json index 287f9558c5..268bc6f4d0 100644 --- a/types/jsonfile/tsconfig.json +++ b/types/jsonfile/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "jsonfile-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jsonminify/tsconfig.json b/types/jsonminify/tsconfig.json index 0df74ef465..bc333f1dd1 100644 --- a/types/jsonminify/tsconfig.json +++ b/types/jsonminify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonnet/tsconfig.json b/types/jsonnet/tsconfig.json index c30a5a2ffb..e10b49c8ac 100644 --- a/types/jsonnet/tsconfig.json +++ b/types/jsonnet/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonp/tsconfig.json b/types/jsonp/tsconfig.json index 760822ff6b..988ca90c56 100644 --- a/types/jsonp/tsconfig.json +++ b/types/jsonp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonpath/tsconfig.json b/types/jsonpath/tsconfig.json index 04b06d5baf..853c26cb04 100644 --- a/types/jsonpath/tsconfig.json +++ b/types/jsonpath/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonrpc-serializer/tsconfig.json b/types/jsonrpc-serializer/tsconfig.json index f3a91d58c1..7558589d7b 100644 --- a/types/jsonrpc-serializer/tsconfig.json +++ b/types/jsonrpc-serializer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonstream/tsconfig.json b/types/jsonstream/tsconfig.json index 9fe19a4c05..5ebb03c9dc 100644 --- a/types/jsonstream/tsconfig.json +++ b/types/jsonstream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsonwebtoken/tsconfig.json b/types/jsonwebtoken/tsconfig.json index c16a931577..fcc3affcaf 100644 --- a/types/jsonwebtoken/tsconfig.json +++ b/types/jsonwebtoken/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jspdf/tsconfig.json b/types/jspdf/tsconfig.json index 697de6db64..6e5edabf45 100644 --- a/types/jspdf/tsconfig.json +++ b/types/jspdf/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsqrcode/tsconfig.json b/types/jsqrcode/tsconfig.json index dcc6bf63a2..487b814e24 100644 --- a/types/jsqrcode/tsconfig.json +++ b/types/jsqrcode/tsconfig.json @@ -11,6 +11,7 @@ "strictFunctionTypes": true, "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/jsrender/tsconfig.json b/types/jsrender/tsconfig.json index 71bcce3848..70dc2d65fe 100644 --- a/types/jsrender/tsconfig.json +++ b/types/jsrender/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsreport-core/index.d.ts b/types/jsreport-core/index.d.ts new file mode 100644 index 0000000000..23413889da --- /dev/null +++ b/types/jsreport-core/index.d.ts @@ -0,0 +1,96 @@ +// Type definitions for jsreport-core 1.5 +// Project: http://jsreport.net +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +import { Buffer } from 'buffer'; +import { Readable } from 'stream'; + +declare namespace JsReport { + type helpers = string | { [fun: string]: (...args: any[]) => any }; + + interface RenderOptions { + template: { + content: string; + engine: 'jsrender' | 'handlebars' | 'ejs' | 'jade' | string; + helpers?: helpers; + recipe: 'phantom-pdf' | 'electron-pdf' | 'text' | 'xlsx' | 'html-to-xlsx' | 'phantom-image' | 'html-to-text' | 'fop-pdf' | 'client-html' | 'wrapped-html' | 'wkhtmltopdf' | string; + }; + data?: any; + } + + interface Report { + content: Buffer; + stream: Readable; + headers: { + [header: string]: string | number | boolean; + }; + } + + interface Request { + template: { + content: string; + }; + } + + // interface Response { + // // todo + // } + + type Response = any; + + interface Listener { + add(type: string, callback: (req: Request, res: Response, err: any) => void): void; + } + + interface Logger { + add(logger: any, options?: { + level: 'debug' | 'info' | 'log' | 'warn' | 'error'; + }): void; + } + + interface Collection { + find(query: { + [field: string]: any; + }): Promise; + } + + interface DocumentStore { + collection(options: string): Collection; + } + + interface JsReporter { + afterRenderListeners: Listener; + afterTemplatingEnginesExecutedListeners: Listener; + beforeRenderListeners: Listener; + documentStore: DocumentStore; + initializeListeners: Listener; + logger: Logger; + validateRenderListeners: Listener; + init(): Promise; + render(options: RenderOptions): Promise; + use(extension: any): any; + } +} + +declare function JsReport(options?: Partial<{ + autoTempCleanup: boolean; + dataDirectory: string; + extensionsLocationCache: boolean; + loadConfig: boolean; + logger: { + silent: boolean; + }; + rootDirectory: string; + scripts: { + allowedModules: string[]; + }; + tasks: { + [task: string]: any; + }; + tempDirectory: string; +}>): JsReport.JsReporter; + +export = JsReport; diff --git a/types/jsreport-core/jsreport-core-tests.ts b/types/jsreport-core/jsreport-core-tests.ts new file mode 100644 index 0000000000..c7ded76f4d --- /dev/null +++ b/types/jsreport-core/jsreport-core-tests.ts @@ -0,0 +1,20 @@ +import JsReport = require('jsreport-core'); + +const jsreport = JsReport(); +jsreport.init().then(() => { + return jsreport.render({ + template: { + content: '

Hello {{:foo}}

', + engine: 'jsrender', + recipe: 'phantom-pdf' + }, + data: { + foo: "world" + } + }).then((resp) => { + // prints pdf with headline Hello world + console.log(resp.content.toString()); + }); +}).catch((e) => { + console.log(e); +}); diff --git a/types/jsreport-core/tsconfig.json b/types/jsreport-core/tsconfig.json new file mode 100644 index 0000000000..b10a124791 --- /dev/null +++ b/types/jsreport-core/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "esnext" + ], + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jsreport-core-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jsreport-core/tslint.json b/types/jsreport-core/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsreport-core/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jsrp/tsconfig.json b/types/jsrp/tsconfig.json index eee1ca1391..373b2161c7 100644 --- a/types/jsrp/tsconfig.json +++ b/types/jsrp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jss/tsconfig.json b/types/jss/tsconfig.json index f34791192c..c04079a405 100644 --- a/types/jss/tsconfig.json +++ b/types/jss/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jss-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jssha/tsconfig.json b/types/jssha/tsconfig.json index 9e54d3c27a..d510b70414 100644 --- a/types/jssha/tsconfig.json +++ b/types/jssha/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/jstimezonedetect/tsconfig.json b/types/jstimezonedetect/tsconfig.json index b774b2f27b..df242a4ba3 100644 --- a/types/jstimezonedetect/tsconfig.json +++ b/types/jstimezonedetect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jstorage/tsconfig.json b/types/jstorage/tsconfig.json index 7d03130196..80858e1d65 100644 --- a/types/jstorage/tsconfig.json +++ b/types/jstorage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jstree/tsconfig.json b/types/jstree/tsconfig.json index 235aef261c..6552fc878b 100644 --- a/types/jstree/tsconfig.json +++ b/types/jstree/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsts/tsconfig.json b/types/jsts/tsconfig.json index ac8ce72682..66fe8f3951 100644 --- a/types/jsts/tsconfig.json +++ b/types/jsts/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsuite/tsconfig.json b/types/jsuite/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/jsuite/tsconfig.json +++ b/types/jsuite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jsuri/tsconfig.json b/types/jsuri/tsconfig.json index aa5a702117..afbfd8a324 100644 --- a/types/jsuri/tsconfig.json +++ b/types/jsuri/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsurl/tsconfig.json b/types/jsurl/tsconfig.json index 3b795be015..2423c10630 100644 --- a/types/jsurl/tsconfig.json +++ b/types/jsurl/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jsx-chai/tsconfig.json b/types/jsx-chai/tsconfig.json index 5ff33d9bec..834397a636 100644 --- a/types/jsx-chai/tsconfig.json +++ b/types/jsx-chai/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jszip/jszip-tests.ts b/types/jszip/jszip-tests.ts index 81ccda09db..5d332a8070 100644 --- a/types/jszip/jszip-tests.ts +++ b/types/jszip/jszip-tests.ts @@ -1,4 +1,4 @@ -import * as JSZip from 'jszip'; +import JSZip = require('jszip'); const SEVERITY = { DEBUG: 0, diff --git a/types/jszip/tsconfig.json b/types/jszip/tsconfig.json index c5a1abf752..41412a6a91 100644 --- a/types/jszip/tsconfig.json +++ b/types/jszip/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jug/tsconfig.json b/types/jug/tsconfig.json index ceaf8a8e0a..22b58e92cd 100644 --- a/types/jug/tsconfig.json +++ b/types/jug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jui-core/tsconfig.json b/types/jui-core/tsconfig.json index 67f1eb8560..74b17d0023 100644 --- a/types/jui-core/tsconfig.json +++ b/types/jui-core/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jui-grid/tsconfig.json b/types/jui-grid/tsconfig.json index 44d9c93211..27e8059449 100644 --- a/types/jui-grid/tsconfig.json +++ b/types/jui-grid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jui/tsconfig.json b/types/jui/tsconfig.json index 6ea9a2ea6b..c3a1433f50 100644 --- a/types/jui/tsconfig.json +++ b/types/jui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jump.js/tsconfig.json b/types/jump.js/tsconfig.json index 58186807e9..3ee1305fa6 100644 --- a/types/jump.js/tsconfig.json +++ b/types/jump.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jweixin/tsconfig.json b/types/jweixin/tsconfig.json index d2740833c5..c4bb5b925b 100644 --- a/types/jweixin/tsconfig.json +++ b/types/jweixin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 32c3521f22..87a7526267 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -2,6 +2,7 @@ // Project: http://developer.longtailvideo.com/trac/ // Definitions by: Martin Duparc // Tomer Kruvi +// Philipp Gürtler // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // JW Player is the leading HTML5 & Flash video player, optimized for mobile and the desktop. Easy enough for beginners, advanced enough for pros. @@ -224,6 +225,13 @@ interface EventCallback { (param: T): void; } +interface Region { + x: 0; // x and y will always be 0 according to https://developer.jwplayer.com/jw-player/docs/javascript-api-reference/#jwplayergetsaferegion + y: 0; + width: number; + height: number; +} + interface JWPlayer { addButton(icon: string, label: string, handler: () => void, id: string): void; getAudioTracks(): any[]; @@ -243,7 +251,7 @@ interface JWPlayer { getPosition(): number; getQualityLevels(): any[]; getRenderingMode(): string; - getSafeRegion(): any[]; + getSafeRegion(): Region; getState(): string; getVolume(): number; getEnvironment(): Environment; diff --git a/types/jwplayer/tsconfig.json b/types/jwplayer/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/jwplayer/tsconfig.json +++ b/types/jwplayer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/jws/tsconfig.json b/types/jws/tsconfig.json index a8a2f625d3..e9dbaeac09 100644 --- a/types/jws/tsconfig.json +++ b/types/jws/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "jws-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/jwt-client/tsconfig.json b/types/jwt-client/tsconfig.json index 3611c59237..b8ddbc0257 100644 --- a/types/jwt-client/tsconfig.json +++ b/types/jwt-client/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jwt-decode/tsconfig.json b/types/jwt-decode/tsconfig.json index f53a16f5a6..3cc921989b 100644 --- a/types/jwt-decode/tsconfig.json +++ b/types/jwt-decode/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jwt-decode/v1/tsconfig.json b/types/jwt-decode/v1/tsconfig.json index 261fdece08..73afba4a58 100644 --- a/types/jwt-decode/v1/tsconfig.json +++ b/types/jwt-decode/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/jwt-simple/tsconfig.json b/types/jwt-simple/tsconfig.json index 52f84f6e77..9a3c56cf3e 100644 --- a/types/jwt-simple/tsconfig.json +++ b/types/jwt-simple/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kafka-node/index.d.ts b/types/kafka-node/index.d.ts index 4f566a8587..71d1fd6728 100644 --- a/types/kafka-node/index.d.ts +++ b/types/kafka-node/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Daniel Imrie-Situnayake , Bill , Michael Haan , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + // # Classes export class Client { constructor(connectionString: string, clientId?: string, options?: ZKOptions, noBatchOptions?: AckBatchOptions, sslOptions?: any); @@ -88,24 +90,24 @@ export class Offset { } export class KeyedMessage { - constructor(key: string, message: string); + constructor(key: string, value: string | Buffer); } // # Interfaces export interface Message { - topic: string; - value: string; - offset?: number; - partition?: number; - highWaterOffset?: number; - key?: number; -} + topic: string; + value: string | Buffer; + offset?: number; + partition?: number; + highWaterOffset?: number; + key?: string; + } export interface ProducerOptions { - requireAcks?: number; - ackTimeoutMs?: number; - partitionerType?: number; + requireAcks?: number; + ackTimeoutMs?: number; + partitionerType?: number; } export interface KafkaClientOptions { diff --git a/types/kafka-node/tsconfig.json b/types/kafka-node/tsconfig.json index 154c35e191..97ce936047 100644 --- a/types/kafka-node/tsconfig.json +++ b/types/kafka-node/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-chai-sinon/tsconfig.json b/types/karma-chai-sinon/tsconfig.json index 86c4fa3299..aa4d11fa60 100644 --- a/types/karma-chai-sinon/tsconfig.json +++ b/types/karma-chai-sinon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-chai/tsconfig.json b/types/karma-chai/tsconfig.json index 726bb90e80..775b764e40 100644 --- a/types/karma-chai/tsconfig.json +++ b/types/karma-chai/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-coverage/tsconfig.json b/types/karma-coverage/tsconfig.json index fe130be15a..492678b674 100644 --- a/types/karma-coverage/tsconfig.json +++ b/types/karma-coverage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-fixture/tsconfig.json b/types/karma-fixture/tsconfig.json index 0b39c302b4..9376aa9424 100644 --- a/types/karma-fixture/tsconfig.json +++ b/types/karma-fixture/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-jasmine/tsconfig.json b/types/karma-jasmine/tsconfig.json index 54f70b6c45..6de5629a75 100644 --- a/types/karma-jasmine/tsconfig.json +++ b/types/karma-jasmine/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma-webpack/tsconfig.json b/types/karma-webpack/tsconfig.json index 86996cdcfa..e019bd4bdf 100644 --- a/types/karma-webpack/tsconfig.json +++ b/types/karma-webpack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/karma/tsconfig.json b/types/karma/tsconfig.json index 23c81534d2..157092c790 100644 --- a/types/karma/tsconfig.json +++ b/types/karma/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/katex/tsconfig.json b/types/katex/tsconfig.json index 2cf3297aca..3bad4a0cd9 100644 --- a/types/katex/tsconfig.json +++ b/types/katex/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kcors/tsconfig.json b/types/kcors/tsconfig.json index 3322dc4921..4eb388863a 100644 --- a/types/kcors/tsconfig.json +++ b/types/kcors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kdbush/tsconfig.json b/types/kdbush/tsconfig.json index 11107837a0..79fe884afe 100644 --- a/types/kdbush/tsconfig.json +++ b/types/kdbush/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kefir/tsconfig.json b/types/kefir/tsconfig.json index e1d57fe2e3..7fc74e6713 100644 --- a/types/kefir/tsconfig.json +++ b/types/kefir/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index 7c81634f27..6ea7fea725 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; @@ -3754,7 +3814,7 @@ declare namespace kendo.ui { 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; diff --git a/types/kendo-ui/tsconfig.json b/types/kendo-ui/tsconfig.json index e6e296e3ee..285d942999 100644 --- a/types/kendo-ui/tsconfig.json +++ b/types/kendo-ui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keyboardjs/tsconfig.json b/types/keyboardjs/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/keyboardjs/tsconfig.json +++ b/types/keyboardjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/keygrip/tsconfig.json b/types/keygrip/tsconfig.json index 6a68ad8ba2..7c096ed3b4 100644 --- a/types/keygrip/tsconfig.json +++ b/types/keygrip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keymaster/tsconfig.json b/types/keymaster/tsconfig.json index c35aaa1b01..9fb59df1bc 100644 --- a/types/keymaster/tsconfig.json +++ b/types/keymaster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keymirror/tsconfig.json b/types/keymirror/tsconfig.json index 4d6365bc4c..a237e2396d 100644 --- a/types/keymirror/tsconfig.json +++ b/types/keymirror/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keypress.js/tsconfig.json b/types/keypress.js/tsconfig.json index 1643b0a002..00a88fbf72 100644 --- a/types/keypress.js/tsconfig.json +++ b/types/keypress.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keysym/tsconfig.json b/types/keysym/tsconfig.json index b2daaa6d31..0a853aa126 100644 --- a/types/keysym/tsconfig.json +++ b/types/keysym/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/keytar/tsconfig.json b/types/keytar/tsconfig.json index 5a2fe428ff..43efd1ec43 100644 --- a/types/keytar/tsconfig.json +++ b/types/keytar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kii-cloud-sdk/tsconfig.json b/types/kii-cloud-sdk/tsconfig.json index fd1b84aab9..69b251f247 100644 --- a/types/kii-cloud-sdk/tsconfig.json +++ b/types/kii-cloud-sdk/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kik-browser/tsconfig.json b/types/kik-browser/tsconfig.json index d832795617..0a59996f8c 100644 --- a/types/kik-browser/tsconfig.json +++ b/types/kik-browser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kineticjs/tsconfig.json b/types/kineticjs/tsconfig.json index cee48ec061..976f2dc3d3 100644 --- a/types/kineticjs/tsconfig.json +++ b/types/kineticjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/klaw-sync/tsconfig.json b/types/klaw-sync/tsconfig.json index f6fe9eb8bd..fbca4d319c 100644 --- a/types/klaw-sync/tsconfig.json +++ b/types/klaw-sync/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/klaw/klaw-tests.ts b/types/klaw/klaw-tests.ts index 2487aafd85..69406f73e8 100644 --- a/types/klaw/klaw-tests.ts +++ b/types/klaw/klaw-tests.ts @@ -1,4 +1,4 @@ -import * as klaw from "klaw"; +import klaw = require("klaw"); const path = require('path'); // README.md: Streams 1 (push) example: diff --git a/types/klaw/tsconfig.json b/types/klaw/tsconfig.json index 1d3db09e05..afa97d598d 100644 --- a/types/klaw/tsconfig.json +++ b/types/klaw/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/klaw/v1/klaw-tests.ts b/types/klaw/v1/klaw-tests.ts index 5e425a714a..7bfd79ee50 100644 --- a/types/klaw/v1/klaw-tests.ts +++ b/types/klaw/v1/klaw-tests.ts @@ -1,4 +1,4 @@ -import * as klaw from "klaw"; +import klaw = require("klaw"); import * as path from "path"; // README.md: Streams 1 (push) example: diff --git a/types/klaw/v1/tsconfig.json b/types/klaw/v1/tsconfig.json index 35caa3f9ea..8af7f84870 100644 --- a/types/klaw/v1/tsconfig.json +++ b/types/klaw/v1/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kms-json/tsconfig.json b/types/kms-json/tsconfig.json index f8ac8d1921..ed29ab5a4d 100644 --- a/types/kms-json/tsconfig.json +++ b/types/kms-json/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "kms-json-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/knex-postgis/knex-postgis-tests.ts b/types/knex-postgis/knex-postgis-tests.ts index 43a6c2f58b..99eb1382fc 100644 --- a/types/knex-postgis/knex-postgis-tests.ts +++ b/types/knex-postgis/knex-postgis-tests.ts @@ -1,6 +1,6 @@ import * as GeoJSON from 'geojson'; -import * as Knex from 'knex'; -import * as KPG from 'knex-postgis'; +import Knex = require('knex'); +import KPG = require('knex-postgis'); const knex: Knex = Knex({ dialect: 'pg' }); const st: KPG.KnexPostgis = KPG(knex); diff --git a/types/knex-postgis/tsconfig.json b/types/knex-postgis/tsconfig.json index 7d088da2f2..a3172fd1a1 100644 --- a/types/knex-postgis/tsconfig.json +++ b/types/knex-postgis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 6354773142..99b6a10476 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; @@ -116,7 +116,7 @@ declare namespace Knex { // Union union: Union; - unionAll(callback: Function): QueryBuilder; + unionAll(callback: QueryCallback): QueryBuilder; // Having having: Having; @@ -183,29 +183,29 @@ declare namespace Knex { interface Join { (raw: Raw): QueryBuilder; - (tableName: TableName, clause: (this: JoinClause, join: JoinClause) => void): QueryBuilder; - (tableName: TableName, columns: { [key: string]: string | number | Raw }): QueryBuilder; - (tableName: TableName, raw: Raw): QueryBuilder; - (tableName: TableName, column1: string, column2: string): QueryBuilder; - (tableName: TableName, column1: string, raw: Raw): QueryBuilder; - (tableName: TableName, column1: string, operator: string, column2: string): QueryBuilder; + (tableName: TableName | QueryCallback, clause: (this: JoinClause, join: JoinClause) => void): QueryBuilder; + (tableName: TableName | QueryCallback, columns: { [key: string]: string | number | Raw }): QueryBuilder; + (tableName: TableName | QueryCallback, raw: Raw): QueryBuilder; + (tableName: TableName | QueryCallback, column1: string, column2: string): QueryBuilder; + (tableName: TableName | QueryCallback, column1: string, raw: Raw): QueryBuilder; + (tableName: TableName | QueryCallback, column1: string, operator: string, column2: string): QueryBuilder; } interface JoinClause { on(raw: Raw): JoinClause; - on(callback: Function): JoinClause; + on(callback: QueryCallback): JoinClause; on(columns: { [key: string]: string | Raw }): JoinClause; on(column1: string, column2: string): JoinClause; on(column1: string, raw: Raw): JoinClause; on(column1: string, operator: string, column2: string | Raw): JoinClause; andOn(raw: Raw): JoinClause; - andOn(callback: Function): JoinClause; + andOn(callback: QueryCallback): JoinClause; andOn(columns: { [key: string]: string | Raw }): JoinClause; andOn(column1: string, column2: string): JoinClause; andOn(column1: string, raw: Raw): JoinClause; andOn(column1: string, operator: string, column2: string | Raw): JoinClause; orOn(raw: Raw): JoinClause; - orOn(callback: Function): JoinClause; + orOn(callback: QueryCallback): JoinClause; orOn(columns: { [key: string]: string | Raw }): JoinClause; orOn(column1: string, column2: string): JoinClause; orOn(column1: string, raw: Raw): JoinClause; @@ -222,12 +222,12 @@ declare namespace Knex { onNotNull(column1: string): JoinClause; andOnNotNull(column1: string): JoinClause; orOnNotNull(column1: string): JoinClause; - onExists(callback: () => void): JoinClause; - andOnExists(callback: () => void): JoinClause; - orOnExists(callback: () => void): JoinClause; - onNotExists(callback: () => void): JoinClause; - andOnNotExists(callback: () => void): JoinClause; - orOnNotExists(callback: () => void): JoinClause; + onExists(callback: QueryCallback): JoinClause; + andOnExists(callback: QueryCallback): JoinClause; + orOnExists(callback: QueryCallback): JoinClause; + onNotExists(callback: QueryCallback): JoinClause; + andOnNotExists(callback: QueryCallback): JoinClause; + orOnNotExists(callback: QueryCallback): JoinClause; onBetween(column1: string, range: [any, any]): JoinClause; andOnBetween(column1: string, range: [any, any]): JoinClause; orOnBetween(column1: string, range: [any, any]): JoinClause; @@ -260,7 +260,7 @@ declare namespace Knex { interface Where extends WhereRaw, WhereWrapped, WhereNull { (raw: Raw): QueryBuilder; - (callback: (queryBuilder: QueryBuilder) => any): QueryBuilder; + (callback: QueryCallback): QueryBuilder; (object: Object): QueryBuilder; (columnName: string, value: Value): QueryBuilder; (columnName: string, operator: string, value: Value): QueryBuilder; @@ -272,7 +272,7 @@ declare namespace Knex { } interface WhereWrapped { - (callback: Function): QueryBuilder; + (callback: QueryCallback): QueryBuilder; } interface WhereNull { @@ -281,7 +281,7 @@ declare namespace Knex { interface WhereIn { (columnName: string, values: Value[]): QueryBuilder; - (columnName: string, callback: Function): QueryBuilder; + (columnName: string, callback: QueryCallback): QueryBuilder; (columnName: string, query: QueryBuilder): QueryBuilder; } @@ -290,7 +290,7 @@ declare namespace Knex { } interface WhereExists { - (callback: Function): QueryBuilder; + (callback: QueryCallback): QueryBuilder; (query: QueryBuilder): QueryBuilder; } @@ -310,10 +310,10 @@ declare namespace Knex { } interface Union { - (callback: Function, wrap?: boolean): QueryBuilder; - (callbacks: Function[], wrap?: boolean): QueryBuilder; - (...callbacks: Function[]): QueryBuilder; - // (...callbacks: Function[], wrap?: boolean): QueryInterface; + (callback: QueryCallback, wrap?: boolean): QueryBuilder; + (callbacks: QueryCallback[], wrap?: boolean): QueryBuilder; + (...callbacks: QueryCallback[]): QueryBuilder; + // (...callbacks: QueryCallback[], wrap?: boolean): QueryInterface; } interface Having extends RawQueryBuilder, WhereWrapped { @@ -350,6 +350,7 @@ declare namespace Knex { // QueryBuilder // + type QueryCallback = (this: QueryBuilder, builder: QueryBuilder) => void; interface QueryBuilder extends QueryInterface, ChainableInterface { or: QueryBuilder; and: QueryBuilder; diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index 2aab8c30de..3aaefb6909 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -459,6 +459,44 @@ knex.select('*').from('accounts').joinRaw('natural full join table1').where('id' knex.select('*').from('accounts').join(knex.raw('natural full join table1')).where('id', 1); +knex.select('*').from('accounts') + .join(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .leftJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .leftOuterJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .rightJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .rightOuterJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .innerJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .crossJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .fullOuterJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); +knex.select('*').from('accounts') + .outerJoin(function() { + this.select('*').from('accounts').as('special_accounts'); + }, 'special_accounts.a', '=', 'accounts.b'); + + knex('customers') .distinct('first_name', 'last_name') .select(); @@ -487,6 +525,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'}); @@ -902,6 +941,72 @@ knex.select('*') knex.select('*').from('users').where(knex.raw('id = ?', [1])).toSQL(); +// +// Callback functions +// +knex('users') + .select('*') + .join('contacts', function(builder) { + this.on(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).andOn(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orOn(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).onExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orOnExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).andOnExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).onNotExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).andOnNotExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orOnNotExists(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }); + }).where(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orWhere(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).andWhere(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).whereIn('column', function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orWhereIn('column', function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).whereNotIn('column', function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).orWhereNotIn('column', function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).whereWrapped(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).union(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }).unionAll(function(builder) { + let self: Knex.QueryBuilder = this; + self = builder; + }); + // // Migrations // diff --git a/types/knex/tsconfig.json b/types/knex/tsconfig.json index 41e9ae905e..ceb9258104 100644 --- a/types/knex/tsconfig.json +++ b/types/knex/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "knex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/knockback/tsconfig.json b/types/knockback/tsconfig.json index fa1c069762..b4076b50e2 100644 --- a/types/knockback/tsconfig.json +++ b/types/knockback/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout-amd-helpers/tsconfig.json b/types/knockout-amd-helpers/tsconfig.json index b79c6d90d2..45078709f1 100644 --- a/types/knockout-amd-helpers/tsconfig.json +++ b/types/knockout-amd-helpers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout-secure-binding/tsconfig.json b/types/knockout-secure-binding/tsconfig.json index 111b6eeeee..379ad7d39b 100644 --- a/types/knockout-secure-binding/tsconfig.json +++ b/types/knockout-secure-binding/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout-transformations/tsconfig.json b/types/knockout-transformations/tsconfig.json index 4e5e456ef6..b15f7bf06b 100644 --- a/types/knockout-transformations/tsconfig.json +++ b/types/knockout-transformations/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.deferred.updates/tsconfig.json b/types/knockout.deferred.updates/tsconfig.json index e454e60d07..d01b404ad5 100644 --- a/types/knockout.deferred.updates/tsconfig.json +++ b/types/knockout.deferred.updates/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.editables/tsconfig.json b/types/knockout.editables/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/knockout.editables/tsconfig.json +++ b/types/knockout.editables/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout.es5/tsconfig.json b/types/knockout.es5/tsconfig.json index 794ea97505..5df65298d6 100644 --- a/types/knockout.es5/tsconfig.json +++ b/types/knockout.es5/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.kogrid/tsconfig.json b/types/knockout.kogrid/tsconfig.json index 005a8c6eb1..d410f0d355 100644 --- a/types/knockout.kogrid/tsconfig.json +++ b/types/knockout.kogrid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.mapper/tsconfig.json b/types/knockout.mapper/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/knockout.mapper/tsconfig.json +++ b/types/knockout.mapper/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout.mapping/tsconfig.json b/types/knockout.mapping/tsconfig.json index 1ae87d442f..abc93c70b5 100644 --- a/types/knockout.mapping/tsconfig.json +++ b/types/knockout.mapping/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.postbox/tsconfig.json b/types/knockout.postbox/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/knockout.postbox/tsconfig.json +++ b/types/knockout.postbox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout.projections/tsconfig.json b/types/knockout.projections/tsconfig.json index 97fa4bbc5e..963e6eed90 100644 --- a/types/knockout.projections/tsconfig.json +++ b/types/knockout.projections/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.punches/tsconfig.json b/types/knockout.punches/tsconfig.json index 6851149d09..e0388f01e2 100644 --- a/types/knockout.punches/tsconfig.json +++ b/types/knockout.punches/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.rx/tsconfig.json b/types/knockout.rx/tsconfig.json index 3a2a3fdb73..737007087d 100644 --- a/types/knockout.rx/tsconfig.json +++ b/types/knockout.rx/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockout.validation/tsconfig.json b/types/knockout.validation/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/knockout.validation/tsconfig.json +++ b/types/knockout.validation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout.viewmodel/tsconfig.json b/types/knockout.viewmodel/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/knockout.viewmodel/tsconfig.json +++ b/types/knockout.viewmodel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts index 570f61d80b..ade040f441 100644 --- a/types/knockout/index.d.ts +++ b/types/knockout/index.d.ts @@ -314,6 +314,7 @@ interface KnockoutUtils { triggerEvent(element: any, eventType: any): void; unwrapObservable(value: KnockoutObservable | T): T; + unwrapObservable(value: KnockoutObservableArray | T[]): T[]; // NOT PART OF THE MINIFIED API SURFACE (ONLY IN knockout-{version}.debug.js) https://github.com/SteveSanderson/knockout/issues/670 // forceRefresh(node: any): void; @@ -454,6 +455,7 @@ interface KnockoutStatic { renderTemplate(template: Function, viewModel: any, options?: any, target?: any, renderMode?: any): any; renderTemplate(template: string, viewModel: any, options?: any, target?: any, renderMode?: any): any; unwrap(value: KnockoutObservable | T): T; + unwrap(value: KnockoutObservableArray | T[]): T[]; computedContext: KnockoutComputedContext; diff --git a/types/knockout/tsconfig.json b/types/knockout/tsconfig.json index 1a314f7b0e..a37a6a6079 100644 --- a/types/knockout/tsconfig.json +++ b/types/knockout/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knockstrap/tsconfig.json b/types/knockstrap/tsconfig.json index 4d09924e6d..4572dcd8c4 100644 --- a/types/knockstrap/tsconfig.json +++ b/types/knockstrap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/knuddels-userapps-api/tsconfig.json b/types/knuddels-userapps-api/tsconfig.json index 96c3a04cc9..967fe5f571 100644 --- a/types/knuddels-userapps-api/tsconfig.json +++ b/types/knuddels-userapps-api/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ko.plus/tsconfig.json b/types/ko.plus/tsconfig.json index 7dbc42737f..6395dd819f 100644 --- a/types/ko.plus/tsconfig.json +++ b/types/ko.plus/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-basic-auth/koa-basic-auth-tests.ts b/types/koa-basic-auth/koa-basic-auth-tests.ts index 43cc5ab833..a1a8e8c3c2 100644 --- a/types/koa-basic-auth/koa-basic-auth-tests.ts +++ b/types/koa-basic-auth/koa-basic-auth-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import auth = require("koa-basic-auth"); const app = new Koa(); diff --git a/types/koa-basic-auth/tsconfig.json b/types/koa-basic-auth/tsconfig.json index 26e8260665..c6f340afe1 100644 --- a/types/koa-basic-auth/tsconfig.json +++ b/types/koa-basic-auth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-bodyparser/koa-bodyparser-tests.ts b/types/koa-bodyparser/koa-bodyparser-tests.ts index 7e972e12be..e38eb112dd 100644 --- a/types/koa-bodyparser/koa-bodyparser-tests.ts +++ b/types/koa-bodyparser/koa-bodyparser-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as bodyParser from "koa-bodyparser"; +import Koa = require("koa"); +import bodyParser = require("koa-bodyparser"); const app = new Koa(); diff --git a/types/koa-bodyparser/tsconfig.json b/types/koa-bodyparser/tsconfig.json index 1e7b5ee33e..e2af3dd2e0 100644 --- a/types/koa-bodyparser/tsconfig.json +++ b/types/koa-bodyparser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-cache-control/koa-cache-control-tests.ts b/types/koa-cache-control/koa-cache-control-tests.ts index c99f4fe862..9135551e7c 100644 --- a/types/koa-cache-control/koa-cache-control-tests.ts +++ b/types/koa-cache-control/koa-cache-control-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as cacheControl from "koa-cache-control"; +import Koa = require("koa"); +import cacheControl = require("koa-cache-control"); const app = new Koa(); diff --git a/types/koa-cache-control/tsconfig.json b/types/koa-cache-control/tsconfig.json index 3ecc5fd497..6c5cd8ce2b 100644 --- a/types/koa-cache-control/tsconfig.json +++ b/types/koa-cache-control/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-compose/tsconfig.json b/types/koa-compose/tsconfig.json index 59b13908a4..dcb5315c10 100644 --- a/types/koa-compose/tsconfig.json +++ b/types/koa-compose/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/koa-compress/koa-compress-tests.ts b/types/koa-compress/koa-compress-tests.ts index 30195cd30c..e24bc53b27 100644 --- a/types/koa-compress/koa-compress-tests.ts +++ b/types/koa-compress/koa-compress-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import compress = require("koa-compress"); const app = new Koa(); diff --git a/types/koa-compress/tsconfig.json b/types/koa-compress/tsconfig.json index 332dd960c4..f52f464f96 100644 --- a/types/koa-compress/tsconfig.json +++ b/types/koa-compress/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/koa-conditional-get/tsconfig.json b/types/koa-conditional-get/tsconfig.json index 111408f39b..36380b9cc4 100644 --- a/types/koa-conditional-get/tsconfig.json +++ b/types/koa-conditional-get/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "koa-conditional-get-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-csrf/koa-csrf-tests.ts b/types/koa-csrf/koa-csrf-tests.ts index d0bb211b01..8886e8b0cf 100644 --- a/types/koa-csrf/koa-csrf-tests.ts +++ b/types/koa-csrf/koa-csrf-tests.ts @@ -1,5 +1,5 @@ import koaCsrf = require("koa-csrf"); -import * as Koa from "koa"; +import Koa = require("koa"); const app = new Koa(); app.use(new koaCsrf({ diff --git a/types/koa-csrf/tsconfig.json b/types/koa-csrf/tsconfig.json index 56e1cf81a8..ff82d8c580 100644 --- a/types/koa-csrf/tsconfig.json +++ b/types/koa-csrf/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "koa-csrf-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-etag/koa-etag-tests.ts b/types/koa-etag/koa-etag-tests.ts index fa2d5515d6..a5cac4b870 100644 --- a/types/koa-etag/koa-etag-tests.ts +++ b/types/koa-etag/koa-etag-tests.ts @@ -1,5 +1,5 @@ import koaEtag = require('koa-etag'); -import * as Koa from 'koa'; +import Koa = require('koa'); new Koa().use(koaEtag()); diff --git a/types/koa-etag/tsconfig.json b/types/koa-etag/tsconfig.json index d6b1feb52c..511623a09e 100644 --- a/types/koa-etag/tsconfig.json +++ b/types/koa-etag/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "koa-etag-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-favicon/koa-favicon-tests.ts b/types/koa-favicon/koa-favicon-tests.ts index 72dfdb5aaa..755c38ff58 100644 --- a/types/koa-favicon/koa-favicon-tests.ts +++ b/types/koa-favicon/koa-favicon-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import favicon = require("koa-favicon"); const app = new Koa(); diff --git a/types/koa-favicon/tsconfig.json b/types/koa-favicon/tsconfig.json index 15566de398..bab1d261b3 100644 --- a/types/koa-favicon/tsconfig.json +++ b/types/koa-favicon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-generic-session/koa-generic-session-tests.ts b/types/koa-generic-session/koa-generic-session-tests.ts index e48d4dbef6..be10c1e04f 100644 --- a/types/koa-generic-session/koa-generic-session-tests.ts +++ b/types/koa-generic-session/koa-generic-session-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import { MemoryStore, Session } from "koa-generic-session"; import session = require("koa-generic-session"); diff --git a/types/koa-generic-session/tsconfig.json b/types/koa-generic-session/tsconfig.json index d16c12ef15..5b694a7245 100644 --- a/types/koa-generic-session/tsconfig.json +++ b/types/koa-generic-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-hbs/koa-hbs-tests.ts b/types/koa-hbs/koa-hbs-tests.ts index 14a113e816..0090f446c1 100644 --- a/types/koa-hbs/koa-hbs-tests.ts +++ b/types/koa-hbs/koa-hbs-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from 'koa'; +import Koa = require('koa'); import hbs = require("koa-hbs"); import * as Path from 'path'; diff --git a/types/koa-hbs/tsconfig.json b/types/koa-hbs/tsconfig.json index b286334455..e2651e411b 100644 --- a/types/koa-hbs/tsconfig.json +++ b/types/koa-hbs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-helmet/koa-helmet-tests.ts b/types/koa-helmet/koa-helmet-tests.ts index 1f50ea5c6b..2290ab07fa 100644 --- a/types/koa-helmet/koa-helmet-tests.ts +++ b/types/koa-helmet/koa-helmet-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from 'koa'; +import Koa = require('koa'); import helmet = require('koa-helmet'); const app = new Koa(); diff --git a/types/koa-helmet/tsconfig.json b/types/koa-helmet/tsconfig.json index 1024081843..8f895a44bf 100644 --- a/types/koa-helmet/tsconfig.json +++ b/types/koa-helmet/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-joi-router/tsconfig.json b/types/koa-joi-router/tsconfig.json index a872570270..d5d1b300ec 100644 --- a/types/koa-joi-router/tsconfig.json +++ b/types/koa-joi-router/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/koa-json-error/koa-json-error-tests.ts b/types/koa-json-error/koa-json-error-tests.ts index 9b2ab3c8de..be76a08cb3 100644 --- a/types/koa-json-error/koa-json-error-tests.ts +++ b/types/koa-json-error/koa-json-error-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as error from "koa-json-error"; +import Koa = require("koa"); +import error = require("koa-json-error"); const app = new Koa(); diff --git a/types/koa-json-error/tsconfig.json b/types/koa-json-error/tsconfig.json index 7aa60a506f..620700358d 100644 --- a/types/koa-json-error/tsconfig.json +++ b/types/koa-json-error/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-json/koa-json-tests.ts b/types/koa-json/koa-json-tests.ts index deb3aa8e0d..bce89d95eb 100644 --- a/types/koa-json/koa-json-tests.ts +++ b/types/koa-json/koa-json-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as json from 'koa-json'; +import Koa = require("koa"); +import json = require('koa-json'); const app = new Koa(); diff --git a/types/koa-json/tsconfig.json b/types/koa-json/tsconfig.json index 914c85a096..a9350d68de 100644 --- a/types/koa-json/tsconfig.json +++ b/types/koa-json/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-logger-winston/koa-logger-winston-tests.ts b/types/koa-logger-winston/koa-logger-winston-tests.ts index 44b9047b86..7bec5877f4 100644 --- a/types/koa-logger-winston/koa-logger-winston-tests.ts +++ b/types/koa-logger-winston/koa-logger-winston-tests.ts @@ -1,5 +1,5 @@ -import * as koa from 'koa'; -import * as logger from 'koa-logger-winston'; +import koa = require('koa'); +import logger = require('koa-logger-winston'); import * as winston from 'winston'; const app = new koa(); diff --git a/types/koa-logger-winston/tsconfig.json b/types/koa-logger-winston/tsconfig.json index 2f3ccb79ee..43a0fb6611 100644 --- a/types/koa-logger-winston/tsconfig.json +++ b/types/koa-logger-winston/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-logger/koa-logger-tests.ts b/types/koa-logger/koa-logger-tests.ts index 502c33255d..bd4a32213b 100644 --- a/types/koa-logger/koa-logger-tests.ts +++ b/types/koa-logger/koa-logger-tests.ts @@ -1,5 +1,5 @@ -import * as koa from 'koa'; -import * as logger from 'koa-logger'; +import koa = require('koa'); +import logger = require('koa-logger'); const app = new koa(); app.use(logger()); diff --git a/types/koa-logger/tsconfig.json b/types/koa-logger/tsconfig.json index 28110f20ac..a82734e6f3 100644 --- a/types/koa-logger/tsconfig.json +++ b/types/koa-logger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-morgan/koa-morgan-tests.ts b/types/koa-morgan/koa-morgan-tests.ts index 0a0e51cd95..8d4936a78a 100644 --- a/types/koa-morgan/koa-morgan-tests.ts +++ b/types/koa-morgan/koa-morgan-tests.ts @@ -1,6 +1,6 @@ import { IncomingMessage, ServerResponse } from 'http'; -import * as Koa from 'koa'; -import * as morgan from 'koa-morgan'; +import Koa = require('koa'); +import morgan = require('koa-morgan'); const app = new Koa(); diff --git a/types/koa-morgan/tsconfig.json b/types/koa-morgan/tsconfig.json index ecf170e923..a2b3ae7c8d 100644 --- a/types/koa-morgan/tsconfig.json +++ b/types/koa-morgan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-mount/index.d.ts b/types/koa-mount/index.d.ts index d05036d83b..138d4f6f36 100644 --- a/types/koa-mount/index.d.ts +++ b/types/koa-mount/index.d.ts @@ -5,7 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as Koa from "koa"; +import Koa = require("koa"); declare function mount(app: Koa.Middleware | Koa): Koa.Middleware; diff --git a/types/koa-mount/koa-mount-tests.ts b/types/koa-mount/koa-mount-tests.ts index 9a7702935f..139e08a3d8 100644 --- a/types/koa-mount/koa-mount-tests.ts +++ b/types/koa-mount/koa-mount-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as mount from "koa-mount"; +import Koa = require("koa"); +import mount = require("koa-mount"); const a = new Koa(); diff --git a/types/koa-mount/tsconfig.json b/types/koa-mount/tsconfig.json index d19516145b..ba31b0009f 100644 --- a/types/koa-mount/tsconfig.json +++ b/types/koa-mount/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-multer/index.d.ts b/types/koa-multer/index.d.ts new file mode 100644 index 0000000000..1c518bdd61 --- /dev/null +++ b/types/koa-multer/index.d.ts @@ -0,0 +1,134 @@ +// Type definitions for koa-multer 1.0 +// Project: https://github.com/koa-modules/multer +// Definitions by: benstevens48 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @file + * These definitions are based on the type definitions for multer - https://github.com/expressjs/multer - found on DefinitelyTyped. + * + * Note that it is necessary to explicitly cast the `Context.req` object to type `multer.MulterIncomingMessage` + * to get the correct type for the patched `Context.req` object, as in the following example. + * ```ts + * import * as Koa from 'koa'; + * import * as Router from 'koa-router'; + * import * as multer from 'koa-multer'; + * + * async function uploadFile(ctx: Koa.Context){ + * let multerReq = ctx.req; + * let files = multerReq.files; + * let baseFilePath: string = ctx.params.path || ''; + * //... + * } + * + * let router = new Router(); + * router.put('/uploads/:path?', upload.array('files'), uploadFile); + * ``` + * The type cast is necessary since the type definitions for Koa do not allow for the `Context.req` property to be extended. + */ + +import * as Koa from 'koa'; +import { IncomingMessage } from 'http'; + +declare namespace multer { + interface File { + /** Field name specified in the form */ + fieldname: string; + /** Name of the file on the user's computer */ + originalname: string; + /** Encoding type of the file */ + encoding: string; + /** Mime type of the file */ + mimetype: string; + /** Size of the file in bytes */ + size: number; + /** The folder to which the file has been saved (DiskStorage) */ + destination: string; + /** The name of the file within the destination (DiskStorage) */ + filename: string; + /** Location of the uploaded file (DiskStorage) */ + path: string; + /** A Buffer of the entire file (MemoryStorage) */ + buffer: Buffer; + } + + interface MulterIncomingMessage extends IncomingMessage { + body: any; + file: File; + files: { + [fieldname: string]: File[]; + } | File[]; + } + + interface Field { + /** The field name. */ + name: string; + /** Optional maximum number of files per field to accept. */ + maxCount?: number; + } + + interface Options { + /** The destination directory for the uploaded files. */ + dest?: string; + /** The storage engine to use for uploaded files. */ + storage?: StorageEngine; + /** + * An object specifying the size limits of the following optional properties. This object is passed to busboy + * directly, and the details of properties can be found on https://github.com/mscdex/busboy#busboy-methods + */ + limits?: { + /** Max field name size (Default: 100 bytes) */ + fieldNameSize?: number; + /** Max field value size (Default: 1MB) */ + fieldSize?: number; + /** Max number of non- file fields (Default: Infinity) */ + fields?: number; + /** For multipart forms, the max file size (in bytes)(Default: Infinity) */ + fileSize?: number; + /** For multipart forms, the max number of file fields (Default: Infinity) */ + files?: number; + /** For multipart forms, the max number of parts (fields + files)(Default: Infinity) */ + parts?: number; + /** For multipart forms, the max number of header key=> value pairs to parse Default: 2000(same as node's http). */ + headerPairs?: number; + /** Keep the full path of files instead of just the base name (Default: false) */ + preservePath?: boolean; + }; + /** A function to control which files to upload and which to skip. */ + fileFilter?(req: IncomingMessage, file: File, callback: (error: Error | null, acceptFile: boolean) => void): void; + } + + interface StorageEngine { + _handleFile(req: IncomingMessage, file: File, callback: (error?: any, info?: File) => void): void; + _removeFile(req: IncomingMessage, file: File, callback: (error: Error) => void): void; + } + + interface DiskStorageOptions { + /** A function used to determine within which folder the uploaded files should be stored. Defaults to the system's default temporary directory. */ + destination?: string | ((req: IncomingMessage, file: File, callback: (error: Error | null, destination: string) => void) => void); + /** A function used to determine what the file should be named inside the folder. Defaults to a random name with no file extension. */ + filename?(req: IncomingMessage, file: File, callback: (error: Error | null, filename: string) => void): void; + } + + interface Instance { + /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ + /** Accept a single file with the name fieldName. The single file will be stored in req.file. */ + single(fieldName?: string): Koa.Middleware; + /** Accept an array of files, all with the name fieldName. Optionally error out if more than maxCount files are uploaded. The array of files will be stored in req.files. */ + array(fieldName: string, maxCount?: number): Koa.Middleware; + /** Accept a mix of files, specified by fields. An object with arrays of files will be stored in req.files. */ + fields(fields: Field[]): Koa.Middleware; + /** Accepts all files that comes over the wire. An array of files will be stored in req.files. */ + any(): Koa.Middleware; + } + + /* The disk storage engine gives you full control on storing files to disk. */ + function diskStorage(options: DiskStorageOptions): StorageEngine; + /* The memory storage engine stores the files in memory as Buffer objects. */ + function memoryStorage(): StorageEngine; +} + +declare function multer(options?: multer.Options): multer.Instance; + +export = multer; diff --git a/types/koa-multer/koa-multer-tests.ts b/types/koa-multer/koa-multer-tests.ts new file mode 100644 index 0000000000..617e08c853 --- /dev/null +++ b/types/koa-multer/koa-multer-tests.ts @@ -0,0 +1,32 @@ +import Koa = require('koa'); +import multer = require('koa-multer'); + +const upload = multer({ + dest: 'uploads/', + fileFilter: (req, file, cb) => { + cb(null, true); + } +}); + +const app = new Koa(); + +app.use(upload.single('avatar')); + +app.use(upload.array('photos', 12)); + +const cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }]); +app.use(cpUpload); + +const diskStorage = multer.diskStorage({ + destination(req, file, cb) { + cb(null, '/tmp/my-uploads'); + }, + filename(req, file, cb) { + cb(null, `${file.fieldname}-${Date.now()}`); + } +}); + +const diskUpload = multer({ storage: diskStorage }); + +const memoryStorage = multer.memoryStorage(); +const memoryUpload = multer({ storage: memoryStorage }); diff --git a/types/koa-multer/tsconfig.json b/types/koa-multer/tsconfig.json new file mode 100644 index 0000000000..64394ca142 --- /dev/null +++ b/types/koa-multer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "koa-multer-tests.ts" + ] +} \ No newline at end of file diff --git a/types/koa-multer/tslint.json b/types/koa-multer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-multer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/koa-passport/koa-passport-tests.ts b/types/koa-passport/koa-passport-tests.ts index 42827a85ba..afc07b956e 100644 --- a/types/koa-passport/koa-passport-tests.ts +++ b/types/koa-passport/koa-passport-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from 'koa'; +import Koa = require('koa'); import * as passport from 'koa-passport'; const app = new Koa(); diff --git a/types/koa-passport/tsconfig.json b/types/koa-passport/tsconfig.json index fcd51d7953..0e27ba922a 100644 --- a/types/koa-passport/tsconfig.json +++ b/types/koa-passport/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-pino-logger/koa-pino-logger-tests.ts b/types/koa-pino-logger/koa-pino-logger-tests.ts index 68f5dd1331..bec6f887d2 100644 --- a/types/koa-pino-logger/koa-pino-logger-tests.ts +++ b/types/koa-pino-logger/koa-pino-logger-tests.ts @@ -1,5 +1,5 @@ -import * as koa from 'koa'; -import * as logger from 'koa-pino-logger'; +import koa = require('koa'); +import logger = require('koa-pino-logger'); const app = new koa(); app.use(logger()); diff --git a/types/koa-pino-logger/tsconfig.json b/types/koa-pino-logger/tsconfig.json index 13810e891e..beb0397ac8 100644 --- a/types/koa-pino-logger/tsconfig.json +++ b/types/koa-pino-logger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-pug/tsconfig.json b/types/koa-pug/tsconfig.json index ac317cd48f..c3faadb87c 100644 --- a/types/koa-pug/tsconfig.json +++ b/types/koa-pug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-range/koa-range-tests.ts b/types/koa-range/koa-range-tests.ts index c489bf4a6b..29982f9b04 100644 --- a/types/koa-range/koa-range-tests.ts +++ b/types/koa-range/koa-range-tests.ts @@ -1,5 +1,5 @@ -import * as range from "koa-range"; -import * as Koa from "koa"; +import range = require("koa-range"); +import Koa = require("koa"); const app = new Koa(); app.use(range); diff --git a/types/koa-range/tsconfig.json b/types/koa-range/tsconfig.json index 37c1c00f19..bbd6674449 100644 --- a/types/koa-range/tsconfig.json +++ b/types/koa-range/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-redis/koa-redis-tests.ts b/types/koa-redis/koa-redis-tests.ts index 21c8e010b0..2cf4ca2ddb 100644 --- a/types/koa-redis/koa-redis-tests.ts +++ b/types/koa-redis/koa-redis-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import { MemoryStore, Session } from "koa-generic-session"; import session = require("koa-generic-session"); import redisStore = require("koa-redis"); diff --git a/types/koa-redis/tsconfig.json b/types/koa-redis/tsconfig.json index a49a3a13c1..5aa71b8c46 100644 --- a/types/koa-redis/tsconfig.json +++ b/types/koa-redis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-route/koa-route-tests.ts b/types/koa-route/koa-route-tests.ts index 331c7d6b53..3b26266434 100644 --- a/types/koa-route/koa-route-tests.ts +++ b/types/koa-route/koa-route-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from 'koa'; +import Koa = require('koa'); import * as route from 'koa-route'; const app = new Koa(); diff --git a/types/koa-route/tsconfig.json b/types/koa-route/tsconfig.json index 97dff8158a..d9025db325 100644 --- a/types/koa-route/tsconfig.json +++ b/types/koa-route/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-router/koa-router-tests.ts b/types/koa-router/koa-router-tests.ts index 32f041bbc7..bbd525897c 100644 --- a/types/koa-router/koa-router-tests.ts +++ b/types/koa-router/koa-router-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as Router from "koa-router"; +import Koa = require("koa"); +import Router = require("koa-router"); const app = new Koa(); diff --git a/types/koa-router/tsconfig.json b/types/koa-router/tsconfig.json index 76f07fef64..22eb9a6790 100644 --- a/types/koa-router/tsconfig.json +++ b/types/koa-router/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-send/koa-send-tests.ts b/types/koa-send/koa-send-tests.ts index a3b136ea9a..33c8cdaa18 100644 --- a/types/koa-send/koa-send-tests.ts +++ b/types/koa-send/koa-send-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from 'koa'; -import * as send from 'koa-send'; +import Koa = require('koa'); +import send = require('koa-send'); const app = new Koa(); diff --git a/types/koa-send/tsconfig.json b/types/koa-send/tsconfig.json index 202d12546a..b43b7d491e 100644 --- a/types/koa-send/tsconfig.json +++ b/types/koa-send/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-session-minimal/koa-session-minimal-tests.ts b/types/koa-session-minimal/koa-session-minimal-tests.ts index b58f441d8e..6ea0ef7cf5 100644 --- a/types/koa-session-minimal/koa-session-minimal-tests.ts +++ b/types/koa-session-minimal/koa-session-minimal-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as session from "koa-session-minimal"; +import Koa = require("koa"); +import session = require("koa-session-minimal"); const app = new Koa(); diff --git a/types/koa-session-minimal/tsconfig.json b/types/koa-session-minimal/tsconfig.json index 42cafb4d4a..1ce6059819 100644 --- a/types/koa-session-minimal/tsconfig.json +++ b/types/koa-session-minimal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index d05ce7055e..8650a07d91 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -15,7 +15,7 @@ =============================================== */ -import * as Koa from "koa"; +import Koa = require("koa"); declare namespace session { /** diff --git a/types/koa-session/koa-session-tests.ts b/types/koa-session/koa-session-tests.ts index 02f944ae66..2844767240 100644 --- a/types/koa-session/koa-session-tests.ts +++ b/types/koa-session/koa-session-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from 'koa'; -import * as session from 'koa-session'; +import Koa = require('koa'); +import session = require('koa-session'); import * as ContextSession from "koa-session/lib/context"; import { diff --git a/types/koa-session/tsconfig.json b/types/koa-session/tsconfig.json index df47800012..21efde4293 100644 --- a/types/koa-session/tsconfig.json +++ b/types/koa-session/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -23,4 +24,4 @@ "lib/util.d.ts", "koa-session-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-sslify/tsconfig.json b/types/koa-sslify/tsconfig.json index 64615e2ab9..c41803dcde 100644 --- a/types/koa-sslify/tsconfig.json +++ b/types/koa-sslify/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "koa-sslify-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-static/koa-static-tests.ts b/types/koa-static/koa-static-tests.ts index 9b0d756f7d..c81b81483c 100644 --- a/types/koa-static/koa-static-tests.ts +++ b/types/koa-static/koa-static-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); import serve = require("koa-static"); const app = new Koa(); diff --git a/types/koa-static/tsconfig.json b/types/koa-static/tsconfig.json index ce89a3c21f..339209d9de 100644 --- a/types/koa-static/tsconfig.json +++ b/types/koa-static/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-views/koa-views-tests.ts b/types/koa-views/koa-views-tests.ts index 65d6be7e1f..3453b156de 100644 --- a/types/koa-views/koa-views-tests.ts +++ b/types/koa-views/koa-views-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from "koa"; -import * as views from "koa-views"; +import Koa = require("koa"); +import views = require("koa-views"); const app = new Koa(); diff --git a/types/koa-views/tsconfig.json b/types/koa-views/tsconfig.json index 95d7a74d53..31b4ec33f0 100644 --- a/types/koa-views/tsconfig.json +++ b/types/koa-views/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa-webpack/tsconfig.json b/types/koa-webpack/tsconfig.json index d3cef374db..7ff0f551fe 100644 --- a/types/koa-webpack/tsconfig.json +++ b/types/koa-webpack/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "koa-webpack-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/koa-websocket/index.d.ts b/types/koa-websocket/index.d.ts index 326f098ae5..e7a6c39a7d 100644 --- a/types/koa-websocket/index.d.ts +++ b/types/koa-websocket/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as Koa from 'koa'; +import Koa = require('koa'); import * as ws from 'ws'; import * as http from 'http'; import * as https from 'https'; @@ -30,7 +30,5 @@ interface KoaWebsocketApp extends Koa { ws: KoaWebsocketServer; } -type KoaWebsockets = (app: Koa) => KoaWebsocketApp; - -declare const websockets: KoaWebsockets; +declare function websockets(app: Koa): KoaWebsocketApp; export = websockets; diff --git a/types/koa-websocket/koa-websocket-tests.ts b/types/koa-websocket/koa-websocket-tests.ts index 66bd4bf4d2..bd99c3d17e 100644 --- a/types/koa-websocket/koa-websocket-tests.ts +++ b/types/koa-websocket/koa-websocket-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from 'koa'; -import * as websocket from 'koa-websocket'; +import Koa = require('koa'); +import websocket = require('koa-websocket'); const app = websocket(new Koa()); diff --git a/types/koa-websocket/tsconfig.json b/types/koa-websocket/tsconfig.json index 87c9225d08..4a0daa327f 100644 --- a/types/koa-websocket/tsconfig.json +++ b/types/koa-websocket/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa/index.d.ts b/types/koa/index.d.ts index 1203864c8c..2a5c49f110 100644 --- a/types/koa/index.d.ts +++ b/types/koa/index.d.ts @@ -21,7 +21,7 @@ import * as accepts from "accepts"; import * as Cookies from "cookies"; import { EventEmitter } from "events"; import { IncomingMessage, ServerResponse, Server } from "http"; -import * as httpAssert from "http-assert"; +import httpAssert = require("http-assert"); import * as Keygrip from "keygrip"; import * as compose from "koa-compose"; import { Socket, ListenOptions } from "net"; diff --git a/types/koa/koa-tests.ts b/types/koa/koa-tests.ts index 6dbc073bea..ea0a4a18b8 100644 --- a/types/koa/koa-tests.ts +++ b/types/koa/koa-tests.ts @@ -1,4 +1,4 @@ -import * as Koa from "koa"; +import Koa = require("koa"); const app = new Koa(); diff --git a/types/koa/tsconfig.json b/types/koa/tsconfig.json index 5c4ba0f656..730ff1452f 100644 --- a/types/koa/tsconfig.json +++ b/types/koa/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/koa2-cors/koa2-cors-tests.ts b/types/koa2-cors/koa2-cors-tests.ts index 820722d635..228fa4242e 100644 --- a/types/koa2-cors/koa2-cors-tests.ts +++ b/types/koa2-cors/koa2-cors-tests.ts @@ -1,5 +1,5 @@ -import * as Koa from 'koa'; -import * as cors from 'koa2-cors'; +import Koa = require('koa'); +import cors = require('koa2-cors'); const app = new Koa(); app.use(cors({ diff --git a/types/koa2-cors/tsconfig.json b/types/koa2-cors/tsconfig.json index 6c1a4b2374..9266fd9244 100644 --- a/types/koa2-cors/tsconfig.json +++ b/types/koa2-cors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/koa__cors/tsconfig.json b/types/koa__cors/tsconfig.json index 220bebc26a..38bf5b7cc1 100644 --- a/types/koa__cors/tsconfig.json +++ b/types/koa__cors/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "paths": { "@koa/cors": [ "koa__cors" diff --git a/types/kolite/tsconfig.json b/types/kolite/tsconfig.json index 1dc7da3187..b353af59cf 100644 --- a/types/kolite/tsconfig.json +++ b/types/kolite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/konami.js/tsconfig.json b/types/konami.js/tsconfig.json index b802a3109c..0d91607c95 100644 --- a/types/konami.js/tsconfig.json +++ b/types/konami.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kraken-js/tsconfig.json b/types/kraken-js/tsconfig.json index 2fce7a799d..15fd480c05 100644 --- a/types/kraken-js/tsconfig.json +++ b/types/kraken-js/tsconfig.json @@ -9,13 +9,16 @@ "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "kraken-js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/kramed/tsconfig.json b/types/kramed/tsconfig.json index b816669307..95206a5b55 100644 --- a/types/kramed/tsconfig.json +++ b/types/kramed/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kss/tsconfig.json b/types/kss/tsconfig.json index 987701f0bb..c5edb7df62 100644 --- a/types/kss/tsconfig.json +++ b/types/kss/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kue/tsconfig.json b/types/kue/tsconfig.json index dab7ca300b..1fb275fc79 100644 --- a/types/kue/tsconfig.json +++ b/types/kue/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kurento-utils/tsconfig.json b/types/kurento-utils/tsconfig.json index 8920df3604..023939e6a2 100644 --- a/types/kurento-utils/tsconfig.json +++ b/types/kurento-utils/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/kuromoji/tsconfig.json b/types/kuromoji/tsconfig.json index f74ea439af..442773f5e9 100644 --- a/types/kuromoji/tsconfig.json +++ b/types/kuromoji/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lab/tsconfig.json b/types/lab/tsconfig.json index 8e0ad06d10..7ddd8d3048 100644 --- a/types/lab/tsconfig.json +++ b/types/lab/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ladda/tsconfig.json b/types/ladda/tsconfig.json index 2d878b6f9d..e14f07795b 100644 --- a/types/ladda/tsconfig.json +++ b/types/ladda/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lasso/tsconfig.json b/types/lasso/tsconfig.json index 210de56a0d..197a5bede9 100644 --- a/types/lasso/tsconfig.json +++ b/types/lasso/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "lasso-tests.ts", @@ -29,4 +30,4 @@ "lib/writers/Writer.d.ts", "middleware/index.d.ts" ] -} +} \ No newline at end of file diff --git a/types/later/tsconfig.json b/types/later/tsconfig.json index 5b74d9d144..338433890b 100644 --- a/types/later/tsconfig.json +++ b/types/later/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/latinize/tsconfig.json b/types/latinize/tsconfig.json index 90b98478aa..2e3c34b548 100644 --- a/types/latinize/tsconfig.json +++ b/types/latinize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/latlon-geohash/tsconfig.json b/types/latlon-geohash/tsconfig.json index 10d9c00791..d34a297b36 100644 --- a/types/latlon-geohash/tsconfig.json +++ b/types/latlon-geohash/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "latlon-geohash-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/launchpad/tsconfig.json b/types/launchpad/tsconfig.json index 01333e0ca2..348675bca2 100644 --- a/types/launchpad/tsconfig.json +++ b/types/launchpad/tsconfig.json @@ -11,6 +11,7 @@ "strictFunctionTypes": true, "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "types": [], "baseUrl": "../", "typeRoots": [ diff --git a/types/lazy.js/tsconfig.json b/types/lazy.js/tsconfig.json index 0f2d64001d..4faba72fe2 100644 --- a/types/lazy.js/tsconfig.json +++ b/types/lazy.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lazypipe/tsconfig.json b/types/lazypipe/tsconfig.json index 7eb8c93b6a..f9a761bb01 100644 --- a/types/lazypipe/tsconfig.json +++ b/types/lazypipe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ldapjs/tsconfig.json b/types/ldapjs/tsconfig.json index a0df7615fd..860c7deb89 100644 --- a/types/ldapjs/tsconfig.json +++ b/types/ldapjs/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ldapjs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/leadfoot/tsconfig.json b/types/leadfoot/tsconfig.json index 5672c5bf4d..7390c30f18 100644 --- a/types/leadfoot/tsconfig.json +++ b/types/leadfoot/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/leaflet-areaselect/tsconfig.json b/types/leaflet-areaselect/tsconfig.json index 98aceb4b21..54aa992c34 100644 --- a/types/leaflet-areaselect/tsconfig.json +++ b/types/leaflet-areaselect/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-curve/tsconfig.json b/types/leaflet-curve/tsconfig.json index 6ca509b566..17abbb6dd6 100644 --- a/types/leaflet-curve/tsconfig.json +++ b/types/leaflet-curve/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-draw/index.d.ts b/types/leaflet-draw/index.d.ts index 35d014b699..7fd33f2152 100644 --- a/types/leaflet-draw/index.d.ts +++ b/types/leaflet-draw/index.d.ts @@ -387,7 +387,7 @@ declare module 'leaflet' { /** * Layer that was just created. */ - layer: Layer; + layer: Circle | CircleMarker | Marker | Polygon | Polyline | Rectangle; /** * The type of layer this is. One of: polyline, polygon, rectangle, circle, marker. diff --git a/types/leaflet-draw/leaflet-draw-tests.ts b/types/leaflet-draw/leaflet-draw-tests.ts index e63006edce..54015fa404 100644 --- a/types/leaflet-draw/leaflet-draw-tests.ts +++ b/types/leaflet-draw/leaflet-draw-tests.ts @@ -41,6 +41,7 @@ map.addControl(drawControl); map.on(L.Draw.Event.CREATED, (e: L.DrawEvents.Created) => { const type = e.layerType; const layer = e.layer; + const geojson = e.layer.toGeoJSON(); drawnItems.addLayer(layer); }); diff --git a/types/leaflet-draw/tsconfig.json b/types/leaflet-draw/tsconfig.json index 5db4feb624..d27f42eebf 100644 --- a/types/leaflet-draw/tsconfig.json +++ b/types/leaflet-draw/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-editable/tsconfig.json b/types/leaflet-editable/tsconfig.json index d03e43670e..9565df6304 100644 --- a/types/leaflet-editable/tsconfig.json +++ b/types/leaflet-editable/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-fullscreen/tsconfig.json b/types/leaflet-fullscreen/tsconfig.json index 102331a4af..4273a23910 100644 --- a/types/leaflet-fullscreen/tsconfig.json +++ b/types/leaflet-fullscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-geocoder-mapzen/tsconfig.json b/types/leaflet-geocoder-mapzen/tsconfig.json index 9bf4ee0bfb..197f88ad4f 100644 --- a/types/leaflet-geocoder-mapzen/tsconfig.json +++ b/types/leaflet-geocoder-mapzen/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-gpx/tsconfig.json b/types/leaflet-gpx/tsconfig.json index 08f5612820..475ac13cda 100644 --- a/types/leaflet-gpx/tsconfig.json +++ b/types/leaflet-gpx/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-imageoverlay-rotated/tsconfig.json b/types/leaflet-imageoverlay-rotated/tsconfig.json index 440971024d..4796b0511a 100644 --- a/types/leaflet-imageoverlay-rotated/tsconfig.json +++ b/types/leaflet-imageoverlay-rotated/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-label/tsconfig.json b/types/leaflet-label/tsconfig.json index bf2cfa0f43..ba2680e88c 100644 --- a/types/leaflet-label/tsconfig.json +++ b/types/leaflet-label/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-mouse-position/tsconfig.json b/types/leaflet-mouse-position/tsconfig.json index a853ad3c56..8322b38776 100644 --- a/types/leaflet-mouse-position/tsconfig.json +++ b/types/leaflet-mouse-position/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "leaflet-mouse-position-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/leaflet-polylinedecorator/tsconfig.json b/types/leaflet-polylinedecorator/tsconfig.json index f84b2a3913..7f81263acb 100644 --- a/types/leaflet-polylinedecorator/tsconfig.json +++ b/types/leaflet-polylinedecorator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-providers/tsconfig.json b/types/leaflet-providers/tsconfig.json index bb2349b7d5..b36bd5c2c4 100644 --- a/types/leaflet-providers/tsconfig.json +++ b/types/leaflet-providers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet-rotatedmarker/tsconfig.json b/types/leaflet-rotatedmarker/tsconfig.json index 18bf544889..195a3ec8ad 100644 --- a/types/leaflet-rotatedmarker/tsconfig.json +++ b/types/leaflet-rotatedmarker/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "leaflet-rotatedmarker-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/leaflet.awesome-markers/tsconfig.json b/types/leaflet.awesome-markers/tsconfig.json index 079cf577d2..6d25407162 100644 --- a/types/leaflet.awesome-markers/tsconfig.json +++ b/types/leaflet.awesome-markers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.awesome-markers/v0/tsconfig.json b/types/leaflet.awesome-markers/v0/tsconfig.json index 549076e43b..db5190d1ca 100644 --- a/types/leaflet.awesome-markers/v0/tsconfig.json +++ b/types/leaflet.awesome-markers/v0/tsconfig.json @@ -23,7 +23,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.fullscreen/tsconfig.json b/types/leaflet.fullscreen/tsconfig.json index bb2cf83e37..29a6ea1ec7 100644 --- a/types/leaflet.fullscreen/tsconfig.json +++ b/types/leaflet.fullscreen/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.gridlayer.googlemutant/tsconfig.json b/types/leaflet.gridlayer.googlemutant/tsconfig.json index d739a04322..73164f18ca 100644 --- a/types/leaflet.gridlayer.googlemutant/tsconfig.json +++ b/types/leaflet.gridlayer.googlemutant/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.heat/tsconfig.json b/types/leaflet.heat/tsconfig.json index 482c984b8c..cc206c4e7f 100644 --- a/types/leaflet.heat/tsconfig.json +++ b/types/leaflet.heat/tsconfig.json @@ -1,24 +1,25 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "leaflet.heat-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "leaflet.heat-tests.ts" + ] +} \ No newline at end of file diff --git a/types/leaflet.locatecontrol/index.d.ts b/types/leaflet.locatecontrol/index.d.ts index 35c88be5be..542461cec7 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; } } diff --git a/types/leaflet.locatecontrol/tsconfig.json b/types/leaflet.locatecontrol/tsconfig.json index 22ab0179b2..6da0fdda3b 100644 --- a/types/leaflet.locatecontrol/tsconfig.json +++ b/types/leaflet.locatecontrol/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.markercluster.layersupport/tsconfig.json b/types/leaflet.markercluster.layersupport/tsconfig.json index 13ba48e6f4..47502f355b 100644 --- a/types/leaflet.markercluster.layersupport/tsconfig.json +++ b/types/leaflet.markercluster.layersupport/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.markercluster/tsconfig.json b/types/leaflet.markercluster/tsconfig.json index b1f7f8c1af..67efe9169e 100644 --- a/types/leaflet.markercluster/tsconfig.json +++ b/types/leaflet.markercluster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.pancontrol/tsconfig.json b/types/leaflet.pancontrol/tsconfig.json index ec286c0305..8341a27f73 100644 --- a/types/leaflet.pancontrol/tsconfig.json +++ b/types/leaflet.pancontrol/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "leaflet.pancontrol-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/leaflet.pm/tsconfig.json b/types/leaflet.pm/tsconfig.json index b2313b93ee..ffe46ff393 100644 --- a/types/leaflet.pm/tsconfig.json +++ b/types/leaflet.pm/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet.polylinemeasure/tsconfig.json b/types/leaflet.polylinemeasure/tsconfig.json index b1db5e086d..2a4070495c 100644 --- a/types/leaflet.polylinemeasure/tsconfig.json +++ b/types/leaflet.polylinemeasure/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "leaflet.polylinemeasure-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/leaflet/tsconfig.json b/types/leaflet/tsconfig.json index 55862abef1..ab1f202443 100644 --- a/types/leaflet/tsconfig.json +++ b/types/leaflet/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leaflet/v0/tsconfig.json b/types/leaflet/v0/tsconfig.json index c8003b67d8..a2d29bb367 100644 --- a/types/leaflet/v0/tsconfig.json +++ b/types/leaflet/v0/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leapmotionts/tsconfig.json b/types/leapmotionts/tsconfig.json index 7ac842a053..b5fc5f85b4 100644 --- a/types/leapmotionts/tsconfig.json +++ b/types/leapmotionts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/legal-eagle/tsconfig.json b/types/legal-eagle/tsconfig.json index 380eaaed72..d41814f483 100644 --- a/types/legal-eagle/tsconfig.json +++ b/types/legal-eagle/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "legal-eagle-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/less-middleware/tsconfig.json b/types/less-middleware/tsconfig.json index 8a807955b0..fe169cfb2f 100644 --- a/types/less-middleware/tsconfig.json +++ b/types/less-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/less/tsconfig.json b/types/less/tsconfig.json index 635134c330..002ef68ece 100644 --- a/types/less/tsconfig.json +++ b/types/less/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/less2sass/tsconfig.json b/types/less2sass/tsconfig.json index e70848dca8..fef36e8edd 100644 --- a/types/less2sass/tsconfig.json +++ b/types/less2sass/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "less2sass-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/lestate/tsconfig.json b/types/lestate/tsconfig.json index 152bf946a6..8b6cfd98c1 100644 --- a/types/lestate/tsconfig.json +++ b/types/lestate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/level-sublevel/tsconfig.json b/types/level-sublevel/tsconfig.json index 4dad69a329..b9253b7772 100644 --- a/types/level-sublevel/tsconfig.json +++ b/types/level-sublevel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leveldown/leveldown-tests.ts b/types/leveldown/leveldown-tests.ts index 94d852d204..0aa9b3625e 100644 --- a/types/leveldown/leveldown-tests.ts +++ b/types/leveldown/leveldown-tests.ts @@ -1,4 +1,4 @@ -import * as leveldown from "leveldown"; +import leveldown = require("leveldown"); const db = leveldown("db1"); diff --git a/types/leveldown/tsconfig.json b/types/leveldown/tsconfig.json index 68b5638f5b..5c30c34f2f 100644 --- a/types/leveldown/tsconfig.json +++ b/types/leveldown/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/levelup/levelup-tests.ts b/types/levelup/levelup-tests.ts index 8827512437..2d3867cdd3 100644 --- a/types/levelup/levelup-tests.ts +++ b/types/levelup/levelup-tests.ts @@ -1,4 +1,4 @@ -import * as levelup from "levelup"; +import levelup = require("levelup"); interface BufferEncoding { encode(val: any): Buffer; @@ -68,7 +68,7 @@ db.batch() .write(function () { console.log('Done!') }) var open:boolean = db.isOpen(); -var closed:boolean = db.isClosed(); +var closed:boolean = db.isClosed(); db.createReadStream() .on('data', function (data: any) { console.log(data.key, '=', data.value) diff --git a/types/levelup/tsconfig.json b/types/levelup/tsconfig.json index 8825ba9b79..ac406bd9b2 100644 --- a/types/levelup/tsconfig.json +++ b/types/levelup/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/leven/tsconfig.json b/types/leven/tsconfig.json index 14d505d892..bcdc4add35 100644 --- a/types/leven/tsconfig.json +++ b/types/leven/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/levenshtein/tsconfig.json b/types/levenshtein/tsconfig.json index da44f54a3e..a02655c66d 100644 --- a/types/levenshtein/tsconfig.json +++ b/types/levenshtein/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/libpq/libpq-tests.ts b/types/libpq/libpq-tests.ts index fee968dabc..f1ae6cc1e3 100644 --- a/types/libpq/libpq-tests.ts +++ b/types/libpq/libpq-tests.ts @@ -1,9 +1,9 @@ /// import { Buffer } from 'buffer'; -import * as assert from 'assert'; +import assert = require('assert'); import * as async from 'async'; -import * as PQ from 'libpq'; +import PQ = require('libpq'); declare const _: { times(n: number, f: () => T): T[] }; diff --git a/types/libpq/tsconfig.json b/types/libpq/tsconfig.json index c2179c6020..859660d83b 100644 --- a/types/libpq/tsconfig.json +++ b/types/libpq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/libxmljs/tsconfig.json b/types/libxmljs/tsconfig.json index 7201fffe81..e44e2461e1 100644 --- a/types/libxmljs/tsconfig.json +++ b/types/libxmljs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/libxslt/tsconfig.json b/types/libxslt/tsconfig.json index a7f7f94ffc..85f9f9b81d 100644 --- a/types/libxslt/tsconfig.json +++ b/types/libxslt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/license-checker/tsconfig.json b/types/license-checker/tsconfig.json index 3cfded1e87..f5b303f669 100644 --- a/types/license-checker/tsconfig.json +++ b/types/license-checker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lil-uuid/tsconfig.json b/types/lil-uuid/tsconfig.json index 889bd07cca..a1a661c82a 100644 --- a/types/lil-uuid/tsconfig.json +++ b/types/lil-uuid/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "lil-uuid-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/lime-js/tsconfig.json b/types/lime-js/tsconfig.json index fb352deb87..4345d000d2 100644 --- a/types/lime-js/tsconfig.json +++ b/types/lime-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/line-by-line/line-by-line-tests.ts b/types/line-by-line/line-by-line-tests.ts index 9181e91a98..c97d02ca58 100644 --- a/types/line-by-line/line-by-line-tests.ts +++ b/types/line-by-line/line-by-line-tests.ts @@ -1,4 +1,4 @@ -import * as LineByLineReader from "line-by-line"; +import LineByLineReader = require("line-by-line"); const reader: LineByLineReader = new LineByLineReader("index.d.ts"); reader.on("line", (line: any) => { diff --git a/types/line-by-line/tsconfig.json b/types/line-by-line/tsconfig.json index c92dc43aac..43e95d3ed0 100644 --- a/types/line-by-line/tsconfig.json +++ b/types/line-by-line/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/line-reader/tsconfig.json b/types/line-reader/tsconfig.json index 0bf05161de..824b195e26 100644 --- a/types/line-reader/tsconfig.json +++ b/types/line-reader/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/linkify-it/tsconfig.json b/types/linkify-it/tsconfig.json index 53501188a6..bfc6f13f86 100644 --- a/types/linkify-it/tsconfig.json +++ b/types/linkify-it/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lls/tsconfig.json b/types/lls/tsconfig.json index 41aa184116..91a2928fd8 100644 --- a/types/lls/tsconfig.json +++ b/types/lls/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/load-json-file/tsconfig.json b/types/load-json-file/tsconfig.json index 9cbafc8746..0c3ea42200 100644 --- a/types/load-json-file/tsconfig.json +++ b/types/load-json-file/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loader-runner/tsconfig.json b/types/loader-runner/tsconfig.json index 9a8894c61b..72472c0eb3 100644 --- a/types/loader-runner/tsconfig.json +++ b/types/loader-runner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loader-utils/tsconfig.json b/types/loader-utils/tsconfig.json index 91aa5704c4..aed67fbc1b 100644 --- a/types/loader-utils/tsconfig.json +++ b/types/loader-utils/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loadware/tsconfig.json b/types/loadware/tsconfig.json index 5921615bf8..07bc5a8c23 100644 --- a/types/loadware/tsconfig.json +++ b/types/loadware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lobibox/tsconfig.json b/types/lobibox/tsconfig.json index ef1a1c2f64..ee14a0056b 100644 --- a/types/lobibox/tsconfig.json +++ b/types/lobibox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/local-dynamo/tsconfig.json b/types/local-dynamo/tsconfig.json index fe3803ac8c..d99efd9ac3 100644 --- a/types/local-dynamo/tsconfig.json +++ b/types/local-dynamo/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "local-dynamo-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/localized-countries/tsconfig.json b/types/localized-countries/tsconfig.json index 61ec539732..bea6b3f1e4 100644 --- a/types/localized-countries/tsconfig.json +++ b/types/localized-countries/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/localizejs-library/tsconfig.json b/types/localizejs-library/tsconfig.json index a297d28148..b0d9382afe 100644 --- a/types/localizejs-library/tsconfig.json +++ b/types/localizejs-library/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/locate-path/tsconfig.json b/types/locate-path/tsconfig.json index 355b51b851..06d40b6727 100644 --- a/types/locate-path/tsconfig.json +++ b/types/locate-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lockfile/tsconfig.json b/types/lockfile/tsconfig.json index 83b6126099..86b31141a7 100644 --- a/types/lockfile/tsconfig.json +++ b/types/lockfile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lockfile/v0/tsconfig.json b/types/lockfile/v0/tsconfig.json index a5f99334c4..2cfa991fab 100644 --- a/types/lockfile/v0/tsconfig.json +++ b/types/lockfile/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lockr/tsconfig.json b/types/lockr/tsconfig.json index 391de2fb03..c693013904 100644 --- a/types/lockr/tsconfig.json +++ b/types/lockr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/locutus/tsconfig.json b/types/locutus/tsconfig.json index 2a54cd1721..4a1db4fa50 100644 --- a/types/locutus/tsconfig.json +++ b/types/locutus/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lodash-es/tsconfig.json b/types/lodash-es/tsconfig.json index 7f69811c3c..192ee5b0af 100644 --- a/types/lodash-es/tsconfig.json +++ b/types/lodash-es/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -341,4 +342,4 @@ "zipObjectDeep.d.ts", "zipWith.d.ts" ] -} +} \ No newline at end of file diff --git a/types/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts b/types/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts index d6483e3d03..6d0163faf6 100644 --- a/types/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts +++ b/types/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts @@ -1,4 +1,4 @@ -import * as LodashModuleReplacementPlugin from 'lodash-webpack-plugin'; +import LodashModuleReplacementPlugin = require('lodash-webpack-plugin'); new LodashModuleReplacementPlugin(); diff --git a/types/lodash-webpack-plugin/tsconfig.json b/types/lodash-webpack-plugin/tsconfig.json index 5a4f35d31e..fd54c3b249 100644 --- a/types/lodash-webpack-plugin/tsconfig.json +++ b/types/lodash-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lodash.add/tsconfig.json b/types/lodash.add/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.add/tsconfig.json +++ b/types/lodash.add/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.after/tsconfig.json b/types/lodash.after/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.after/tsconfig.json +++ b/types/lodash.after/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ary/tsconfig.json b/types/lodash.ary/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ary/tsconfig.json +++ b/types/lodash.ary/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.assign/tsconfig.json b/types/lodash.assign/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.assign/tsconfig.json +++ b/types/lodash.assign/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.assignin/tsconfig.json b/types/lodash.assignin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.assignin/tsconfig.json +++ b/types/lodash.assignin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.assigninwith/tsconfig.json b/types/lodash.assigninwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.assigninwith/tsconfig.json +++ b/types/lodash.assigninwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.assignwith/tsconfig.json b/types/lodash.assignwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.assignwith/tsconfig.json +++ b/types/lodash.assignwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.at/tsconfig.json b/types/lodash.at/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.at/tsconfig.json +++ b/types/lodash.at/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.attempt/tsconfig.json b/types/lodash.attempt/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.attempt/tsconfig.json +++ b/types/lodash.attempt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.before/tsconfig.json b/types/lodash.before/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.before/tsconfig.json +++ b/types/lodash.before/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.bind/tsconfig.json b/types/lodash.bind/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.bind/tsconfig.json +++ b/types/lodash.bind/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.bindall/tsconfig.json b/types/lodash.bindall/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.bindall/tsconfig.json +++ b/types/lodash.bindall/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.bindkey/tsconfig.json b/types/lodash.bindkey/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.bindkey/tsconfig.json +++ b/types/lodash.bindkey/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.camelcase/tsconfig.json b/types/lodash.camelcase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.camelcase/tsconfig.json +++ b/types/lodash.camelcase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.capitalize/tsconfig.json b/types/lodash.capitalize/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.capitalize/tsconfig.json +++ b/types/lodash.capitalize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.castarray/tsconfig.json b/types/lodash.castarray/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.castarray/tsconfig.json +++ b/types/lodash.castarray/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ceil/tsconfig.json b/types/lodash.ceil/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ceil/tsconfig.json +++ b/types/lodash.ceil/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.chunk/tsconfig.json b/types/lodash.chunk/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.chunk/tsconfig.json +++ b/types/lodash.chunk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.clamp/tsconfig.json b/types/lodash.clamp/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.clamp/tsconfig.json +++ b/types/lodash.clamp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.clone/tsconfig.json b/types/lodash.clone/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.clone/tsconfig.json +++ b/types/lodash.clone/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.clonedeep/tsconfig.json b/types/lodash.clonedeep/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.clonedeep/tsconfig.json +++ b/types/lodash.clonedeep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.clonedeepwith/tsconfig.json b/types/lodash.clonedeepwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.clonedeepwith/tsconfig.json +++ b/types/lodash.clonedeepwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.clonewith/tsconfig.json b/types/lodash.clonewith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.clonewith/tsconfig.json +++ b/types/lodash.clonewith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.compact/tsconfig.json b/types/lodash.compact/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.compact/tsconfig.json +++ b/types/lodash.compact/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.concat/tsconfig.json b/types/lodash.concat/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.concat/tsconfig.json +++ b/types/lodash.concat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.cond/tsconfig.json b/types/lodash.cond/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.cond/tsconfig.json +++ b/types/lodash.cond/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.constant/tsconfig.json b/types/lodash.constant/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.constant/tsconfig.json +++ b/types/lodash.constant/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.countby/tsconfig.json b/types/lodash.countby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.countby/tsconfig.json +++ b/types/lodash.countby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.create/tsconfig.json b/types/lodash.create/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.create/tsconfig.json +++ b/types/lodash.create/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.curry/tsconfig.json b/types/lodash.curry/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.curry/tsconfig.json +++ b/types/lodash.curry/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.curryright/tsconfig.json b/types/lodash.curryright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.curryright/tsconfig.json +++ b/types/lodash.curryright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.debounce/tsconfig.json b/types/lodash.debounce/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.debounce/tsconfig.json +++ b/types/lodash.debounce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.deburr/tsconfig.json b/types/lodash.deburr/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.deburr/tsconfig.json +++ b/types/lodash.deburr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.defaults/tsconfig.json b/types/lodash.defaults/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.defaults/tsconfig.json +++ b/types/lodash.defaults/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.defaultsdeep/tsconfig.json b/types/lodash.defaultsdeep/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.defaultsdeep/tsconfig.json +++ b/types/lodash.defaultsdeep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.defer/tsconfig.json b/types/lodash.defer/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.defer/tsconfig.json +++ b/types/lodash.defer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.delay/tsconfig.json b/types/lodash.delay/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.delay/tsconfig.json +++ b/types/lodash.delay/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.difference/tsconfig.json b/types/lodash.difference/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.difference/tsconfig.json +++ b/types/lodash.difference/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.differenceby/tsconfig.json b/types/lodash.differenceby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.differenceby/tsconfig.json +++ b/types/lodash.differenceby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.differencewith/tsconfig.json b/types/lodash.differencewith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.differencewith/tsconfig.json +++ b/types/lodash.differencewith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.divide/tsconfig.json b/types/lodash.divide/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.divide/tsconfig.json +++ b/types/lodash.divide/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.drop/tsconfig.json b/types/lodash.drop/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.drop/tsconfig.json +++ b/types/lodash.drop/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.dropright/tsconfig.json b/types/lodash.dropright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.dropright/tsconfig.json +++ b/types/lodash.dropright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.droprightwhile/tsconfig.json b/types/lodash.droprightwhile/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.droprightwhile/tsconfig.json +++ b/types/lodash.droprightwhile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.dropwhile/tsconfig.json b/types/lodash.dropwhile/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.dropwhile/tsconfig.json +++ b/types/lodash.dropwhile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.endswith/tsconfig.json b/types/lodash.endswith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.endswith/tsconfig.json +++ b/types/lodash.endswith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.eq/tsconfig.json b/types/lodash.eq/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.eq/tsconfig.json +++ b/types/lodash.eq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.escape/tsconfig.json b/types/lodash.escape/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.escape/tsconfig.json +++ b/types/lodash.escape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.escaperegexp/tsconfig.json b/types/lodash.escaperegexp/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.escaperegexp/tsconfig.json +++ b/types/lodash.escaperegexp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.every/tsconfig.json b/types/lodash.every/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.every/tsconfig.json +++ b/types/lodash.every/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.fill/tsconfig.json b/types/lodash.fill/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.fill/tsconfig.json +++ b/types/lodash.fill/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.filter/tsconfig.json b/types/lodash.filter/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.filter/tsconfig.json +++ b/types/lodash.filter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.find/tsconfig.json b/types/lodash.find/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.find/tsconfig.json +++ b/types/lodash.find/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.findindex/tsconfig.json b/types/lodash.findindex/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.findindex/tsconfig.json +++ b/types/lodash.findindex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.findkey/tsconfig.json b/types/lodash.findkey/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.findkey/tsconfig.json +++ b/types/lodash.findkey/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.findlast/tsconfig.json b/types/lodash.findlast/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.findlast/tsconfig.json +++ b/types/lodash.findlast/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.findlastindex/tsconfig.json b/types/lodash.findlastindex/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.findlastindex/tsconfig.json +++ b/types/lodash.findlastindex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.findlastkey/tsconfig.json b/types/lodash.findlastkey/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.findlastkey/tsconfig.json +++ b/types/lodash.findlastkey/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.first/tsconfig.json b/types/lodash.first/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.first/tsconfig.json +++ b/types/lodash.first/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flatmap/tsconfig.json b/types/lodash.flatmap/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flatmap/tsconfig.json +++ b/types/lodash.flatmap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flatmapdeep/tsconfig.json b/types/lodash.flatmapdeep/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flatmapdeep/tsconfig.json +++ b/types/lodash.flatmapdeep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flatmapdepth/tsconfig.json b/types/lodash.flatmapdepth/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flatmapdepth/tsconfig.json +++ b/types/lodash.flatmapdepth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flatten/tsconfig.json b/types/lodash.flatten/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flatten/tsconfig.json +++ b/types/lodash.flatten/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flattendeep/tsconfig.json b/types/lodash.flattendeep/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flattendeep/tsconfig.json +++ b/types/lodash.flattendeep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flattendepth/tsconfig.json b/types/lodash.flattendepth/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flattendepth/tsconfig.json +++ b/types/lodash.flattendepth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flip/tsconfig.json b/types/lodash.flip/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flip/tsconfig.json +++ b/types/lodash.flip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.floor/tsconfig.json b/types/lodash.floor/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.floor/tsconfig.json +++ b/types/lodash.floor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flow/tsconfig.json b/types/lodash.flow/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flow/tsconfig.json +++ b/types/lodash.flow/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.flowright/tsconfig.json b/types/lodash.flowright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.flowright/tsconfig.json +++ b/types/lodash.flowright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.foreach/tsconfig.json b/types/lodash.foreach/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.foreach/tsconfig.json +++ b/types/lodash.foreach/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.foreachright/tsconfig.json b/types/lodash.foreachright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.foreachright/tsconfig.json +++ b/types/lodash.foreachright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.forin/tsconfig.json b/types/lodash.forin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.forin/tsconfig.json +++ b/types/lodash.forin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.forinright/tsconfig.json b/types/lodash.forinright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.forinright/tsconfig.json +++ b/types/lodash.forinright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.forown/tsconfig.json b/types/lodash.forown/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.forown/tsconfig.json +++ b/types/lodash.forown/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.forownright/tsconfig.json b/types/lodash.forownright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.forownright/tsconfig.json +++ b/types/lodash.forownright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.frompairs/tsconfig.json b/types/lodash.frompairs/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.frompairs/tsconfig.json +++ b/types/lodash.frompairs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.functions/tsconfig.json b/types/lodash.functions/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.functions/tsconfig.json +++ b/types/lodash.functions/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.functionsin/tsconfig.json b/types/lodash.functionsin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.functionsin/tsconfig.json +++ b/types/lodash.functionsin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.get/tsconfig.json b/types/lodash.get/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.get/tsconfig.json +++ b/types/lodash.get/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.groupby/tsconfig.json b/types/lodash.groupby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.groupby/tsconfig.json +++ b/types/lodash.groupby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.gt/tsconfig.json b/types/lodash.gt/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.gt/tsconfig.json +++ b/types/lodash.gt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.gte/tsconfig.json b/types/lodash.gte/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.gte/tsconfig.json +++ b/types/lodash.gte/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.has/tsconfig.json b/types/lodash.has/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.has/tsconfig.json +++ b/types/lodash.has/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.hasin/tsconfig.json b/types/lodash.hasin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.hasin/tsconfig.json +++ b/types/lodash.hasin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.head/tsconfig.json b/types/lodash.head/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.head/tsconfig.json +++ b/types/lodash.head/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.identity/tsconfig.json b/types/lodash.identity/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.identity/tsconfig.json +++ b/types/lodash.identity/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.includes/tsconfig.json b/types/lodash.includes/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.includes/tsconfig.json +++ b/types/lodash.includes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.indexof/tsconfig.json b/types/lodash.indexof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.indexof/tsconfig.json +++ b/types/lodash.indexof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.initial/tsconfig.json b/types/lodash.initial/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.initial/tsconfig.json +++ b/types/lodash.initial/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.inrange/tsconfig.json b/types/lodash.inrange/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.inrange/tsconfig.json +++ b/types/lodash.inrange/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.intersection/tsconfig.json b/types/lodash.intersection/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.intersection/tsconfig.json +++ b/types/lodash.intersection/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.intersectionby/tsconfig.json b/types/lodash.intersectionby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.intersectionby/tsconfig.json +++ b/types/lodash.intersectionby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.intersectionwith/tsconfig.json b/types/lodash.intersectionwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.intersectionwith/tsconfig.json +++ b/types/lodash.intersectionwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.invert/tsconfig.json b/types/lodash.invert/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.invert/tsconfig.json +++ b/types/lodash.invert/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.invertby/tsconfig.json b/types/lodash.invertby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.invertby/tsconfig.json +++ b/types/lodash.invertby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.invoke/tsconfig.json b/types/lodash.invoke/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.invoke/tsconfig.json +++ b/types/lodash.invoke/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.invokemap/tsconfig.json b/types/lodash.invokemap/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.invokemap/tsconfig.json +++ b/types/lodash.invokemap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isarguments/tsconfig.json b/types/lodash.isarguments/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isarguments/tsconfig.json +++ b/types/lodash.isarguments/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isarray/tsconfig.json b/types/lodash.isarray/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isarray/tsconfig.json +++ b/types/lodash.isarray/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isarraybuffer/tsconfig.json b/types/lodash.isarraybuffer/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isarraybuffer/tsconfig.json +++ b/types/lodash.isarraybuffer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isarraylike/tsconfig.json b/types/lodash.isarraylike/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isarraylike/tsconfig.json +++ b/types/lodash.isarraylike/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isarraylikeobject/tsconfig.json b/types/lodash.isarraylikeobject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isarraylikeobject/tsconfig.json +++ b/types/lodash.isarraylikeobject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isboolean/tsconfig.json b/types/lodash.isboolean/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isboolean/tsconfig.json +++ b/types/lodash.isboolean/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isbuffer/tsconfig.json b/types/lodash.isbuffer/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isbuffer/tsconfig.json +++ b/types/lodash.isbuffer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isdate/tsconfig.json b/types/lodash.isdate/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isdate/tsconfig.json +++ b/types/lodash.isdate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.iselement/tsconfig.json b/types/lodash.iselement/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.iselement/tsconfig.json +++ b/types/lodash.iselement/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isempty/tsconfig.json b/types/lodash.isempty/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isempty/tsconfig.json +++ b/types/lodash.isempty/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isequal/tsconfig.json b/types/lodash.isequal/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isequal/tsconfig.json +++ b/types/lodash.isequal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isequalwith/tsconfig.json b/types/lodash.isequalwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isequalwith/tsconfig.json +++ b/types/lodash.isequalwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.iserror/tsconfig.json b/types/lodash.iserror/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.iserror/tsconfig.json +++ b/types/lodash.iserror/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isfinite/tsconfig.json b/types/lodash.isfinite/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isfinite/tsconfig.json +++ b/types/lodash.isfinite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isfunction/tsconfig.json b/types/lodash.isfunction/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isfunction/tsconfig.json +++ b/types/lodash.isfunction/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isinteger/tsconfig.json b/types/lodash.isinteger/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isinteger/tsconfig.json +++ b/types/lodash.isinteger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.islength/tsconfig.json b/types/lodash.islength/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.islength/tsconfig.json +++ b/types/lodash.islength/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ismap/tsconfig.json b/types/lodash.ismap/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ismap/tsconfig.json +++ b/types/lodash.ismap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ismatch/tsconfig.json b/types/lodash.ismatch/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ismatch/tsconfig.json +++ b/types/lodash.ismatch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ismatchwith/tsconfig.json b/types/lodash.ismatchwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ismatchwith/tsconfig.json +++ b/types/lodash.ismatchwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isnan/tsconfig.json b/types/lodash.isnan/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isnan/tsconfig.json +++ b/types/lodash.isnan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isnative/tsconfig.json b/types/lodash.isnative/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isnative/tsconfig.json +++ b/types/lodash.isnative/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isnil/tsconfig.json b/types/lodash.isnil/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isnil/tsconfig.json +++ b/types/lodash.isnil/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isnull/tsconfig.json b/types/lodash.isnull/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isnull/tsconfig.json +++ b/types/lodash.isnull/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isnumber/tsconfig.json b/types/lodash.isnumber/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isnumber/tsconfig.json +++ b/types/lodash.isnumber/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isobject/tsconfig.json b/types/lodash.isobject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isobject/tsconfig.json +++ b/types/lodash.isobject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isobjectlike/tsconfig.json b/types/lodash.isobjectlike/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isobjectlike/tsconfig.json +++ b/types/lodash.isobjectlike/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isplainobject/tsconfig.json b/types/lodash.isplainobject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isplainobject/tsconfig.json +++ b/types/lodash.isplainobject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isregexp/tsconfig.json b/types/lodash.isregexp/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isregexp/tsconfig.json +++ b/types/lodash.isregexp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.issafeinteger/tsconfig.json b/types/lodash.issafeinteger/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.issafeinteger/tsconfig.json +++ b/types/lodash.issafeinteger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isset/tsconfig.json b/types/lodash.isset/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isset/tsconfig.json +++ b/types/lodash.isset/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isstring/tsconfig.json b/types/lodash.isstring/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isstring/tsconfig.json +++ b/types/lodash.isstring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.issymbol/tsconfig.json b/types/lodash.issymbol/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.issymbol/tsconfig.json +++ b/types/lodash.issymbol/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.istypedarray/tsconfig.json b/types/lodash.istypedarray/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.istypedarray/tsconfig.json +++ b/types/lodash.istypedarray/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isundefined/tsconfig.json b/types/lodash.isundefined/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isundefined/tsconfig.json +++ b/types/lodash.isundefined/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isweakmap/tsconfig.json b/types/lodash.isweakmap/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isweakmap/tsconfig.json +++ b/types/lodash.isweakmap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.isweakset/tsconfig.json b/types/lodash.isweakset/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.isweakset/tsconfig.json +++ b/types/lodash.isweakset/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.iteratee/tsconfig.json b/types/lodash.iteratee/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.iteratee/tsconfig.json +++ b/types/lodash.iteratee/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.join/tsconfig.json b/types/lodash.join/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.join/tsconfig.json +++ b/types/lodash.join/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.kebabcase/tsconfig.json b/types/lodash.kebabcase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.kebabcase/tsconfig.json +++ b/types/lodash.kebabcase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.keyby/tsconfig.json b/types/lodash.keyby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.keyby/tsconfig.json +++ b/types/lodash.keyby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.keys/tsconfig.json b/types/lodash.keys/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.keys/tsconfig.json +++ b/types/lodash.keys/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.keysin/tsconfig.json b/types/lodash.keysin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.keysin/tsconfig.json +++ b/types/lodash.keysin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.last/tsconfig.json b/types/lodash.last/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.last/tsconfig.json +++ b/types/lodash.last/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.lastindexof/tsconfig.json b/types/lodash.lastindexof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.lastindexof/tsconfig.json +++ b/types/lodash.lastindexof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.lowercase/tsconfig.json b/types/lodash.lowercase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.lowercase/tsconfig.json +++ b/types/lodash.lowercase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.lowerfirst/tsconfig.json b/types/lodash.lowerfirst/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.lowerfirst/tsconfig.json +++ b/types/lodash.lowerfirst/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.lt/tsconfig.json b/types/lodash.lt/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.lt/tsconfig.json +++ b/types/lodash.lt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.lte/tsconfig.json b/types/lodash.lte/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.lte/tsconfig.json +++ b/types/lodash.lte/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.mapkeys/tsconfig.json b/types/lodash.mapkeys/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.mapkeys/tsconfig.json +++ b/types/lodash.mapkeys/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.mapvalues/tsconfig.json b/types/lodash.mapvalues/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.mapvalues/tsconfig.json +++ b/types/lodash.mapvalues/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.matches/tsconfig.json b/types/lodash.matches/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.matches/tsconfig.json +++ b/types/lodash.matches/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.matchesproperty/tsconfig.json b/types/lodash.matchesproperty/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.matchesproperty/tsconfig.json +++ b/types/lodash.matchesproperty/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.max/tsconfig.json b/types/lodash.max/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.max/tsconfig.json +++ b/types/lodash.max/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.maxby/tsconfig.json b/types/lodash.maxby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.maxby/tsconfig.json +++ b/types/lodash.maxby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.mean/tsconfig.json b/types/lodash.mean/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.mean/tsconfig.json +++ b/types/lodash.mean/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.meanby/tsconfig.json b/types/lodash.meanby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.meanby/tsconfig.json +++ b/types/lodash.meanby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.memoize/tsconfig.json b/types/lodash.memoize/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.memoize/tsconfig.json +++ b/types/lodash.memoize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.merge/tsconfig.json b/types/lodash.merge/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.merge/tsconfig.json +++ b/types/lodash.merge/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.mergewith/tsconfig.json b/types/lodash.mergewith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.mergewith/tsconfig.json +++ b/types/lodash.mergewith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.method/tsconfig.json b/types/lodash.method/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.method/tsconfig.json +++ b/types/lodash.method/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.methodof/tsconfig.json b/types/lodash.methodof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.methodof/tsconfig.json +++ b/types/lodash.methodof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.min/tsconfig.json b/types/lodash.min/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.min/tsconfig.json +++ b/types/lodash.min/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.minby/tsconfig.json b/types/lodash.minby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.minby/tsconfig.json +++ b/types/lodash.minby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.mixin/tsconfig.json b/types/lodash.mixin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.mixin/tsconfig.json +++ b/types/lodash.mixin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.negate/tsconfig.json b/types/lodash.negate/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.negate/tsconfig.json +++ b/types/lodash.negate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.noop/tsconfig.json b/types/lodash.noop/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.noop/tsconfig.json +++ b/types/lodash.noop/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.now/tsconfig.json b/types/lodash.now/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.now/tsconfig.json +++ b/types/lodash.now/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.nth/tsconfig.json b/types/lodash.nth/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.nth/tsconfig.json +++ b/types/lodash.nth/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.ntharg/tsconfig.json b/types/lodash.ntharg/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.ntharg/tsconfig.json +++ b/types/lodash.ntharg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.omit/tsconfig.json b/types/lodash.omit/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.omit/tsconfig.json +++ b/types/lodash.omit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.omitby/tsconfig.json b/types/lodash.omitby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.omitby/tsconfig.json +++ b/types/lodash.omitby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.once/tsconfig.json b/types/lodash.once/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.once/tsconfig.json +++ b/types/lodash.once/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.orderby/tsconfig.json b/types/lodash.orderby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.orderby/tsconfig.json +++ b/types/lodash.orderby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.over/tsconfig.json b/types/lodash.over/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.over/tsconfig.json +++ b/types/lodash.over/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.overargs/tsconfig.json b/types/lodash.overargs/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.overargs/tsconfig.json +++ b/types/lodash.overargs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.overevery/tsconfig.json b/types/lodash.overevery/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.overevery/tsconfig.json +++ b/types/lodash.overevery/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.oversome/tsconfig.json b/types/lodash.oversome/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.oversome/tsconfig.json +++ b/types/lodash.oversome/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pad/tsconfig.json b/types/lodash.pad/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pad/tsconfig.json +++ b/types/lodash.pad/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.padend/tsconfig.json b/types/lodash.padend/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.padend/tsconfig.json +++ b/types/lodash.padend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.padstart/tsconfig.json b/types/lodash.padstart/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.padstart/tsconfig.json +++ b/types/lodash.padstart/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.parseint/tsconfig.json b/types/lodash.parseint/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.parseint/tsconfig.json +++ b/types/lodash.parseint/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.partial/tsconfig.json b/types/lodash.partial/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.partial/tsconfig.json +++ b/types/lodash.partial/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.partialright/tsconfig.json b/types/lodash.partialright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.partialright/tsconfig.json +++ b/types/lodash.partialright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.partition/tsconfig.json b/types/lodash.partition/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.partition/tsconfig.json +++ b/types/lodash.partition/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pick/tsconfig.json b/types/lodash.pick/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pick/tsconfig.json +++ b/types/lodash.pick/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pickby/tsconfig.json b/types/lodash.pickby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pickby/tsconfig.json +++ b/types/lodash.pickby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.property/tsconfig.json b/types/lodash.property/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.property/tsconfig.json +++ b/types/lodash.property/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.propertyof/tsconfig.json b/types/lodash.propertyof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.propertyof/tsconfig.json +++ b/types/lodash.propertyof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pull/tsconfig.json b/types/lodash.pull/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pull/tsconfig.json +++ b/types/lodash.pull/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pullall/tsconfig.json b/types/lodash.pullall/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pullall/tsconfig.json +++ b/types/lodash.pullall/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pullallby/tsconfig.json b/types/lodash.pullallby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pullallby/tsconfig.json +++ b/types/lodash.pullallby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pullallwith/tsconfig.json b/types/lodash.pullallwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pullallwith/tsconfig.json +++ b/types/lodash.pullallwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.pullat/tsconfig.json b/types/lodash.pullat/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.pullat/tsconfig.json +++ b/types/lodash.pullat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.random/tsconfig.json b/types/lodash.random/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.random/tsconfig.json +++ b/types/lodash.random/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.range/tsconfig.json b/types/lodash.range/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.range/tsconfig.json +++ b/types/lodash.range/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.rangeright/tsconfig.json b/types/lodash.rangeright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.rangeright/tsconfig.json +++ b/types/lodash.rangeright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.rearg/tsconfig.json b/types/lodash.rearg/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.rearg/tsconfig.json +++ b/types/lodash.rearg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.reduce/tsconfig.json b/types/lodash.reduce/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.reduce/tsconfig.json +++ b/types/lodash.reduce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.reduceright/tsconfig.json b/types/lodash.reduceright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.reduceright/tsconfig.json +++ b/types/lodash.reduceright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.reject/tsconfig.json b/types/lodash.reject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.reject/tsconfig.json +++ b/types/lodash.reject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.remove/tsconfig.json b/types/lodash.remove/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.remove/tsconfig.json +++ b/types/lodash.remove/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.repeat/tsconfig.json b/types/lodash.repeat/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.repeat/tsconfig.json +++ b/types/lodash.repeat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.replace/tsconfig.json b/types/lodash.replace/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.replace/tsconfig.json +++ b/types/lodash.replace/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.rest/tsconfig.json b/types/lodash.rest/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.rest/tsconfig.json +++ b/types/lodash.rest/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.result/tsconfig.json b/types/lodash.result/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.result/tsconfig.json +++ b/types/lodash.result/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.reverse/tsconfig.json b/types/lodash.reverse/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.reverse/tsconfig.json +++ b/types/lodash.reverse/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.round/tsconfig.json b/types/lodash.round/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.round/tsconfig.json +++ b/types/lodash.round/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sample/tsconfig.json b/types/lodash.sample/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sample/tsconfig.json +++ b/types/lodash.sample/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.samplesize/tsconfig.json b/types/lodash.samplesize/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.samplesize/tsconfig.json +++ b/types/lodash.samplesize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.set/tsconfig.json b/types/lodash.set/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.set/tsconfig.json +++ b/types/lodash.set/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.setwith/tsconfig.json b/types/lodash.setwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.setwith/tsconfig.json +++ b/types/lodash.setwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.shuffle/tsconfig.json b/types/lodash.shuffle/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.shuffle/tsconfig.json +++ b/types/lodash.shuffle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.size/tsconfig.json b/types/lodash.size/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.size/tsconfig.json +++ b/types/lodash.size/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.slice/tsconfig.json b/types/lodash.slice/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.slice/tsconfig.json +++ b/types/lodash.slice/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.snakecase/tsconfig.json b/types/lodash.snakecase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.snakecase/tsconfig.json +++ b/types/lodash.snakecase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.some/tsconfig.json b/types/lodash.some/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.some/tsconfig.json +++ b/types/lodash.some/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortby/tsconfig.json b/types/lodash.sortby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortby/tsconfig.json +++ b/types/lodash.sortby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedindex/tsconfig.json b/types/lodash.sortedindex/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedindex/tsconfig.json +++ b/types/lodash.sortedindex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedindexby/tsconfig.json b/types/lodash.sortedindexby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedindexby/tsconfig.json +++ b/types/lodash.sortedindexby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedindexof/tsconfig.json b/types/lodash.sortedindexof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedindexof/tsconfig.json +++ b/types/lodash.sortedindexof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedlastindex/tsconfig.json b/types/lodash.sortedlastindex/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedlastindex/tsconfig.json +++ b/types/lodash.sortedlastindex/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedlastindexby/tsconfig.json b/types/lodash.sortedlastindexby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedlastindexby/tsconfig.json +++ b/types/lodash.sortedlastindexby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sortedlastindexof/tsconfig.json b/types/lodash.sortedlastindexof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sortedlastindexof/tsconfig.json +++ b/types/lodash.sortedlastindexof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sorteduniq/tsconfig.json b/types/lodash.sorteduniq/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sorteduniq/tsconfig.json +++ b/types/lodash.sorteduniq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sorteduniqby/tsconfig.json b/types/lodash.sorteduniqby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sorteduniqby/tsconfig.json +++ b/types/lodash.sorteduniqby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.split/tsconfig.json b/types/lodash.split/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.split/tsconfig.json +++ b/types/lodash.split/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.spread/tsconfig.json b/types/lodash.spread/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.spread/tsconfig.json +++ b/types/lodash.spread/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.startcase/tsconfig.json b/types/lodash.startcase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.startcase/tsconfig.json +++ b/types/lodash.startcase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.startswith/tsconfig.json b/types/lodash.startswith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.startswith/tsconfig.json +++ b/types/lodash.startswith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.subtract/tsconfig.json b/types/lodash.subtract/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.subtract/tsconfig.json +++ b/types/lodash.subtract/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sum/tsconfig.json b/types/lodash.sum/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sum/tsconfig.json +++ b/types/lodash.sum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.sumby/tsconfig.json b/types/lodash.sumby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.sumby/tsconfig.json +++ b/types/lodash.sumby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tail/tsconfig.json b/types/lodash.tail/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tail/tsconfig.json +++ b/types/lodash.tail/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.take/tsconfig.json b/types/lodash.take/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.take/tsconfig.json +++ b/types/lodash.take/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.takeright/tsconfig.json b/types/lodash.takeright/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.takeright/tsconfig.json +++ b/types/lodash.takeright/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.takerightwhile/tsconfig.json b/types/lodash.takerightwhile/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.takerightwhile/tsconfig.json +++ b/types/lodash.takerightwhile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.takewhile/tsconfig.json b/types/lodash.takewhile/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.takewhile/tsconfig.json +++ b/types/lodash.takewhile/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.template/tsconfig.json b/types/lodash.template/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.template/tsconfig.json +++ b/types/lodash.template/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.throttle/tsconfig.json b/types/lodash.throttle/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.throttle/tsconfig.json +++ b/types/lodash.throttle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.times/tsconfig.json b/types/lodash.times/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.times/tsconfig.json +++ b/types/lodash.times/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.toarray/tsconfig.json b/types/lodash.toarray/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.toarray/tsconfig.json +++ b/types/lodash.toarray/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tofinite/tsconfig.json b/types/lodash.tofinite/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tofinite/tsconfig.json +++ b/types/lodash.tofinite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tointeger/tsconfig.json b/types/lodash.tointeger/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tointeger/tsconfig.json +++ b/types/lodash.tointeger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tolength/tsconfig.json b/types/lodash.tolength/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tolength/tsconfig.json +++ b/types/lodash.tolength/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tolower/tsconfig.json b/types/lodash.tolower/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tolower/tsconfig.json +++ b/types/lodash.tolower/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tonumber/tsconfig.json b/types/lodash.tonumber/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tonumber/tsconfig.json +++ b/types/lodash.tonumber/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.topairs/tsconfig.json b/types/lodash.topairs/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.topairs/tsconfig.json +++ b/types/lodash.topairs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.topairsin/tsconfig.json b/types/lodash.topairsin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.topairsin/tsconfig.json +++ b/types/lodash.topairsin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.topath/tsconfig.json b/types/lodash.topath/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.topath/tsconfig.json +++ b/types/lodash.topath/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.toplainobject/tsconfig.json b/types/lodash.toplainobject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.toplainobject/tsconfig.json +++ b/types/lodash.toplainobject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tosafeinteger/tsconfig.json b/types/lodash.tosafeinteger/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tosafeinteger/tsconfig.json +++ b/types/lodash.tosafeinteger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.tostring/tsconfig.json b/types/lodash.tostring/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.tostring/tsconfig.json +++ b/types/lodash.tostring/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.toupper/tsconfig.json b/types/lodash.toupper/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.toupper/tsconfig.json +++ b/types/lodash.toupper/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.transform/tsconfig.json b/types/lodash.transform/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.transform/tsconfig.json +++ b/types/lodash.transform/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.trim/tsconfig.json b/types/lodash.trim/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.trim/tsconfig.json +++ b/types/lodash.trim/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.trimend/tsconfig.json b/types/lodash.trimend/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.trimend/tsconfig.json +++ b/types/lodash.trimend/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.trimstart/tsconfig.json b/types/lodash.trimstart/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.trimstart/tsconfig.json +++ b/types/lodash.trimstart/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.truncate/tsconfig.json b/types/lodash.truncate/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.truncate/tsconfig.json +++ b/types/lodash.truncate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unary/tsconfig.json b/types/lodash.unary/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unary/tsconfig.json +++ b/types/lodash.unary/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unescape/tsconfig.json b/types/lodash.unescape/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unescape/tsconfig.json +++ b/types/lodash.unescape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.union/tsconfig.json b/types/lodash.union/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.union/tsconfig.json +++ b/types/lodash.union/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unionby/tsconfig.json b/types/lodash.unionby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unionby/tsconfig.json +++ b/types/lodash.unionby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unionwith/tsconfig.json b/types/lodash.unionwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unionwith/tsconfig.json +++ b/types/lodash.unionwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.uniq/tsconfig.json b/types/lodash.uniq/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.uniq/tsconfig.json +++ b/types/lodash.uniq/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.uniqby/tsconfig.json b/types/lodash.uniqby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.uniqby/tsconfig.json +++ b/types/lodash.uniqby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.uniqueid/tsconfig.json b/types/lodash.uniqueid/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.uniqueid/tsconfig.json +++ b/types/lodash.uniqueid/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.uniqwith/tsconfig.json b/types/lodash.uniqwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.uniqwith/tsconfig.json +++ b/types/lodash.uniqwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unset/tsconfig.json b/types/lodash.unset/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unset/tsconfig.json +++ b/types/lodash.unset/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unzip/tsconfig.json b/types/lodash.unzip/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unzip/tsconfig.json +++ b/types/lodash.unzip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.unzipwith/tsconfig.json b/types/lodash.unzipwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.unzipwith/tsconfig.json +++ b/types/lodash.unzipwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.update/tsconfig.json b/types/lodash.update/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.update/tsconfig.json +++ b/types/lodash.update/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.updatewith/tsconfig.json b/types/lodash.updatewith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.updatewith/tsconfig.json +++ b/types/lodash.updatewith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.uppercase/tsconfig.json b/types/lodash.uppercase/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.uppercase/tsconfig.json +++ b/types/lodash.uppercase/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.upperfirst/tsconfig.json b/types/lodash.upperfirst/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.upperfirst/tsconfig.json +++ b/types/lodash.upperfirst/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.values/tsconfig.json b/types/lodash.values/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.values/tsconfig.json +++ b/types/lodash.values/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.valuesin/tsconfig.json b/types/lodash.valuesin/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.valuesin/tsconfig.json +++ b/types/lodash.valuesin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.without/tsconfig.json b/types/lodash.without/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.without/tsconfig.json +++ b/types/lodash.without/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.words/tsconfig.json b/types/lodash.words/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.words/tsconfig.json +++ b/types/lodash.words/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.wrap/tsconfig.json b/types/lodash.wrap/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.wrap/tsconfig.json +++ b/types/lodash.wrap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.xor/tsconfig.json b/types/lodash.xor/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.xor/tsconfig.json +++ b/types/lodash.xor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.xorby/tsconfig.json b/types/lodash.xorby/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.xorby/tsconfig.json +++ b/types/lodash.xorby/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.xorwith/tsconfig.json b/types/lodash.xorwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.xorwith/tsconfig.json +++ b/types/lodash.xorwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.zip/tsconfig.json b/types/lodash.zip/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.zip/tsconfig.json +++ b/types/lodash.zip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.zipobject/tsconfig.json b/types/lodash.zipobject/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.zipobject/tsconfig.json +++ b/types/lodash.zipobject/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.zipobjectdeep/tsconfig.json b/types/lodash.zipobjectdeep/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.zipobjectdeep/tsconfig.json +++ b/types/lodash.zipobjectdeep/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash.zipwith/tsconfig.json b/types/lodash.zipwith/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/lodash.zipwith/tsconfig.json +++ b/types/lodash.zipwith/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/lodash/array/chunk.d.ts b/types/lodash/array/chunk.d.ts new file mode 100644 index 0000000000..16e4f8beb9 --- /dev/null +++ b/types/lodash/array/chunk.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + 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..7bf05df7e3 --- /dev/null +++ b/types/lodash/array/compact.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..3b1bac32aa --- /dev/null +++ b/types/lodash/array/concat.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + 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..5c237eccea --- /dev/null +++ b/types/lodash/array/difference.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + 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..da8e928097 --- /dev/null +++ b/types/lodash/array/differenceBy.d.ts @@ -0,0 +1,243 @@ +import _ = require("../index"); +declare module "../index" { + 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..39eca3314f --- /dev/null +++ b/types/lodash/array/differenceWith.d.ts @@ -0,0 +1,132 @@ +import _ = require("../index"); +declare module "../index" { + 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..6df72adcb6 --- /dev/null +++ b/types/lodash/array/drop.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..4e08a213b9 --- /dev/null +++ b/types/lodash/array/dropRight.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..efce8161d2 --- /dev/null +++ b/types/lodash/array/dropRightWhile.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + 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..f6f68fb191 --- /dev/null +++ b/types/lodash/array/dropWhile.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + 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..651a19a830 --- /dev/null +++ b/types/lodash/array/fill.d.ts @@ -0,0 +1,124 @@ +import _ = require("../index"); +declare module "../index" { + 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..13f314ee82 --- /dev/null +++ b/types/lodash/array/findIndex.d.ts @@ -0,0 +1,50 @@ +import _ = require("../index"); +declare module "../index" { + 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..db28988a4a --- /dev/null +++ b/types/lodash/array/findLastIndex.d.ts @@ -0,0 +1,49 @@ +import _ = require("../index"); +declare module "../index" { + 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..ec88a9b5b2 --- /dev/null +++ b/types/lodash/array/first.d.ts @@ -0,0 +1,23 @@ +import _ = require("../index"); +declare module "../index" { + 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..8453624756 --- /dev/null +++ b/types/lodash/array/flatten.d.ts @@ -0,0 +1,43 @@ +import _ = require("../index"); +declare module "../index" { + 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..0c604f2571 --- /dev/null +++ b/types/lodash/array/flattenDeep.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..0efd206f9e --- /dev/null +++ b/types/lodash/array/flattenDepth.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..92a8e4d168 --- /dev/null +++ b/types/lodash/array/fromPairs.d.ts @@ -0,0 +1,59 @@ +import _ = require("../index"); +declare module "../index" { + 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..476e5b2b07 --- /dev/null +++ b/types/lodash/array/head.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..f2f01c2e5c --- /dev/null +++ b/types/lodash/array/indexOf.d.ts @@ -0,0 +1,53 @@ +import _ = require("../index"); +declare module "../index" { + 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..fca86bcfa0 --- /dev/null +++ b/types/lodash/array/initial.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..444e0b23f1 --- /dev/null +++ b/types/lodash/array/intersection.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + 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..4148043afe --- /dev/null +++ b/types/lodash/array/intersectionBy.d.ts @@ -0,0 +1,134 @@ +import _ = require("../index"); +declare module "../index" { + 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..9fa2198c9b --- /dev/null +++ b/types/lodash/array/intersectionWith.d.ts @@ -0,0 +1,133 @@ +import _ = require("../index"); +declare module "../index" { + 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..2fd74dab4a --- /dev/null +++ b/types/lodash/array/join.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..4dcdb30423 --- /dev/null +++ b/types/lodash/array/last.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..4bcc38c947 --- /dev/null +++ b/types/lodash/array/lastIndexOf.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + 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..50e5b209a3 --- /dev/null +++ b/types/lodash/array/nth.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + 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..44ebc855c6 --- /dev/null +++ b/types/lodash/array/pull.d.ts @@ -0,0 +1,46 @@ +import _ = require("../index"); +declare module "../index" { + 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..ce926b9bb3 --- /dev/null +++ b/types/lodash/array/pullAll.d.ts @@ -0,0 +1,54 @@ +import _ = require("../index"); +declare module "../index" { + 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..3524aeae5e --- /dev/null +++ b/types/lodash/array/pullAllBy.d.ts @@ -0,0 +1,77 @@ +import _ = require("../index"); +declare module "../index" { + 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..345187daad --- /dev/null +++ b/types/lodash/array/pullAllWith.d.ts @@ -0,0 +1,77 @@ +import _ = require("../index"); +declare module "../index" { + 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..a9d56f23ef --- /dev/null +++ b/types/lodash/array/pullAt.d.ts @@ -0,0 +1,34 @@ +import _ = require("../index"); +declare module "../index" { + 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..3ec0636972 --- /dev/null +++ b/types/lodash/array/remove.d.ts @@ -0,0 +1,49 @@ +import _ = require("../index"); +declare module "../index" { + 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..0cf2112e24 --- /dev/null +++ b/types/lodash/array/reverse.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..7744c4b334 --- /dev/null +++ b/types/lodash/array/slice.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + 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..5f8df282e6 --- /dev/null +++ b/types/lodash/array/sortedIndex.d.ts @@ -0,0 +1,45 @@ +import _ = require("../index"); +declare module "../index" { + 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..c4184868ca --- /dev/null +++ b/types/lodash/array/sortedIndexBy.d.ts @@ -0,0 +1,97 @@ +import _ = require("../index"); +declare module "../index" { + 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..b391186178 --- /dev/null +++ b/types/lodash/array/sortedIndexOf.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + 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..33b466ea5f --- /dev/null +++ b/types/lodash/array/sortedLastIndex.d.ts @@ -0,0 +1,43 @@ +import _ = require("../index"); +declare module "../index" { + 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..c0f8344292 --- /dev/null +++ b/types/lodash/array/sortedLastIndexBy.d.ts @@ -0,0 +1,48 @@ +import _ = require("../index"); +declare module "../index" { + 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..09f8099d1f --- /dev/null +++ b/types/lodash/array/sortedLastIndexOf.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + 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..df0487d626 --- /dev/null +++ b/types/lodash/array/sortedUniq.d.ts @@ -0,0 +1,34 @@ +import _ = require("../index"); +declare module "../index" { + 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..054d4e38c9 --- /dev/null +++ b/types/lodash/array/sortedUniqBy.d.ts @@ -0,0 +1,66 @@ +import _ = require("../index"); +declare module "../index" { + 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..8716c9a2f8 --- /dev/null +++ b/types/lodash/array/tail.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..a97ff6b4ef --- /dev/null +++ b/types/lodash/array/take.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + 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..c786ab40c0 --- /dev/null +++ b/types/lodash/array/takeRight.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + 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..471c0a03f3 --- /dev/null +++ b/types/lodash/array/takeRightWhile.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + 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..05e6adc2a4 --- /dev/null +++ b/types/lodash/array/takeWhile.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + 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..f747a97da0 --- /dev/null +++ b/types/lodash/array/union.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + 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..5e5cd40647 --- /dev/null +++ b/types/lodash/array/unionBy.d.ts @@ -0,0 +1,164 @@ +import _ = require("../index"); +declare module "../index" { + 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..4778a4a6c7 --- /dev/null +++ b/types/lodash/array/unionWith.d.ts @@ -0,0 +1,103 @@ +import _ = require("../index"); +declare module "../index" { + 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..5dacb3b37b --- /dev/null +++ b/types/lodash/array/uniq.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + 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..13df8cb7db --- /dev/null +++ b/types/lodash/array/uniqBy.d.ts @@ -0,0 +1,71 @@ +import _ = require("../index"); +declare module "../index" { + 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..3d4d24334f --- /dev/null +++ b/types/lodash/array/uniqWith.d.ts @@ -0,0 +1,45 @@ +import _ = require("../index"); +declare module "../index" { + 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..ca96290da5 --- /dev/null +++ b/types/lodash/array/unzip.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..0608c97bd9 --- /dev/null +++ b/types/lodash/array/unzipWith.d.ts @@ -0,0 +1,60 @@ +import _ = require("../index"); +declare module "../index" { + 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..ced52397ee --- /dev/null +++ b/types/lodash/array/without.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + 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..5369888326 --- /dev/null +++ b/types/lodash/array/xor.d.ts @@ -0,0 +1,32 @@ +import _ = require("../index"); +declare module "../index" { + 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..1be5c1284b --- /dev/null +++ b/types/lodash/array/xorBy.d.ts @@ -0,0 +1,104 @@ +import _ = require("../index"); +declare module "../index" { + 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..0963a31da7 --- /dev/null +++ b/types/lodash/array/xorWith.d.ts @@ -0,0 +1,103 @@ +import _ = require("../index"); +declare module "../index" { + 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..bf4e436dbf --- /dev/null +++ b/types/lodash/array/zip.d.ts @@ -0,0 +1,129 @@ +import _ = require("../index"); +declare module "../index" { + 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(arrays1: List, arrays2: List): Array<[T1 | undefined, T2 | undefined]>; + + /** + * @see _.zip + */ + zip(arrays1: List, arrays2: List, arrays3: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined]>; + + /** + * @see _.zip + */ + zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined]>; + + /** + * @see _.zip + */ + zip(arrays1: List, arrays2: List, arrays3: List, arrays4: List, arrays5: List): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined, T5 | undefined]>; + + /** + * @see _.zip + */ + zip(...arrays: Array | null | undefined>): (T | undefined)[][]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper>, + arrays2: List, + ): LoDashImplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + ): LoDashImplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + ): LoDashImplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, + ): LoDashImplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashImplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashImplicitWrapper>>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper>, + arrays2: List, + ): LoDashExplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + ): LoDashExplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + ): LoDashExplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, + ): LoDashExplicitWrapper>; + + /** + * @see _.zip + */ + zip( + this: LoDashExplicitWrapper | null | undefined>, + ...arrays: Array | null | undefined> + ): LoDashExplicitWrapper>>; + } +} diff --git a/types/lodash/array/zipObject.d.ts b/types/lodash/array/zipObject.d.ts new file mode 100644 index 0000000000..cf7c35e96a --- /dev/null +++ b/types/lodash/array/zipObject.d.ts @@ -0,0 +1,58 @@ +import _ = require("../index"); +declare module "../index" { + 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..a91117e705 --- /dev/null +++ b/types/lodash/array/zipObjectDeep.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + 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..31e080b056 --- /dev/null +++ b/types/lodash/array/zipWith.d.ts @@ -0,0 +1,187 @@ +import _ = require("../index"); +declare module "../index" { + 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: List, + iteratee: (value1: T) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays1: List, + arrays2: List, + iteratee: (value1: T1, value2: T2) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays1: List, + arrays2: List, + arrays3: List, + iteratee: (value1: T1, value2: T2, value3: T3) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult + ): TResult[]; + + /** + * @see _.zipWith + */ + zipWith( + ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> + ): TResult[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper>, + iteratee: (value1: T) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper>, + arrays2: List, + iteratee: (value1: T1, value2: T2) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + iteratee: (value1: T1, value2: T2, value3: T3) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult + ): LoDashImplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashImplicitWrapper | null | undefined>, + ...iteratee: Array<((...group: T[]) => TResult) | List | null | undefined> + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper>, + iteratee: (value1: T) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper>, + arrays2: List, + iteratee: (value1: T1, value2: T2) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + iteratee: (value1: T1, value2: T2, value3: T3) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper>, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.zipWith + */ + zipWith( + this: LoDashExplicitWrapper | 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..7c7ca9e03a --- /dev/null +++ b/types/lodash/collection/countBy.d.ts @@ -0,0 +1,121 @@ +import _ = require("../index"); +declare module "../index" { + 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..9777780edc --- /dev/null +++ b/types/lodash/collection/each.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + 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..15e3007af5 --- /dev/null +++ b/types/lodash/collection/eachRight.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + 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..42062a74ad --- /dev/null +++ b/types/lodash/collection/every.d.ts @@ -0,0 +1,85 @@ +import _ = require("../index"); +declare module "../index" { + 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..0f60654127 --- /dev/null +++ b/types/lodash/collection/filter.d.ts @@ -0,0 +1,143 @@ +import _ = require("../index"); +declare module "../index" { + 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..25bfc77efc --- /dev/null +++ b/types/lodash/collection/find.d.ts @@ -0,0 +1,131 @@ +import _ = require("../index"); +declare module "../index" { + 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..edbcf971e4 --- /dev/null +++ b/types/lodash/collection/findLast.d.ts @@ -0,0 +1,121 @@ +import _ = require("../index"); +declare module "../index" { + 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..1917e691dc --- /dev/null +++ b/types/lodash/collection/flatMap.d.ts @@ -0,0 +1,164 @@ +import _ = require("../index"); +declare module "../index" { + 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..02a81ed5ab --- /dev/null +++ b/types/lodash/collection/flatMapDeep.d.ts @@ -0,0 +1,164 @@ +import _ = require("../index"); +declare module "../index" { + 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..6790a8e0f2 --- /dev/null +++ b/types/lodash/collection/flatMapDepth.d.ts @@ -0,0 +1,180 @@ +import _ = require("../index"); +declare module "../index" { + 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..74c0b38cde --- /dev/null +++ b/types/lodash/collection/forEach.d.ts @@ -0,0 +1,113 @@ +import _ = require("../index"); +declare module "../index" { + 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..dd01aa969a --- /dev/null +++ b/types/lodash/collection/forEachRight.d.ts @@ -0,0 +1,108 @@ +import _ = require("../index"); +declare module "../index" { + 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..714729181b --- /dev/null +++ b/types/lodash/collection/groupBy.d.ts @@ -0,0 +1,121 @@ +import _ = require("../index"); +declare module "../index" { + 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..87eda4e44a --- /dev/null +++ b/types/lodash/collection/includes.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + 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..99711b4e5f --- /dev/null +++ b/types/lodash/collection/invokeMap.d.ts @@ -0,0 +1,58 @@ +import _ = require("../index"); +declare module "../index" { + 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..f9ba2e24b5 --- /dev/null +++ b/types/lodash/collection/keyBy.d.ts @@ -0,0 +1,121 @@ +import _ = require("../index"); +declare module "../index" { + 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..4a90aaf95d --- /dev/null +++ b/types/lodash/collection/map.d.ts @@ -0,0 +1,180 @@ +import _ = require("../index"); +declare module "../index" { + 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..a8950959de --- /dev/null +++ b/types/lodash/collection/orderBy.d.ts @@ -0,0 +1,192 @@ +import _ = require("../index"); +declare module "../index" { + 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..f372f0708d --- /dev/null +++ b/types/lodash/collection/partition.d.ts @@ -0,0 +1,72 @@ +import _ = require("../index"); +declare module "../index" { + 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..2346225d60 --- /dev/null +++ b/types/lodash/collection/reduce.d.ts @@ -0,0 +1,220 @@ +import _ = require("../index"); +declare module "../index" { + 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..a183708d45 --- /dev/null +++ b/types/lodash/collection/reduceRight.d.ts @@ -0,0 +1,217 @@ +import _ = require("../index"); +declare module "../index" { + 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..d832f1ba14 --- /dev/null +++ b/types/lodash/collection/reject.d.ts @@ -0,0 +1,86 @@ +import _ = require("../index"); +declare module "../index" { + 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..ccaa4e118b --- /dev/null +++ b/types/lodash/collection/sample.d.ts @@ -0,0 +1,74 @@ +import _ = require("../index"); +declare module "../index" { + 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..bf620987d5 --- /dev/null +++ b/types/lodash/collection/sampleSize.d.ts @@ -0,0 +1,60 @@ +import _ = require("../index"); +declare module "../index" { + 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..8209ece654 --- /dev/null +++ b/types/lodash/collection/shuffle.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + 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..f1c393a7b7 --- /dev/null +++ b/types/lodash/collection/size.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..fff03751d1 --- /dev/null +++ b/types/lodash/collection/some.d.ts @@ -0,0 +1,85 @@ +import _ = require("../index"); +declare module "../index" { + 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..d20877f512 --- /dev/null +++ b/types/lodash/collection/sortBy.d.ts @@ -0,0 +1,84 @@ +import _ = require("../index"); +declare module "../index" { + 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..5af72d2440 --- /dev/null +++ b/types/lodash/common/common.d.ts @@ -0,0 +1,255 @@ +import _ = require("../index"); +type GlobalPartial = Partial; +declare module "../index" { + type PartialObject = GlobalPartial; + type Many = T | ReadonlyArray; + 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; +} diff --git a/types/lodash/date/now.d.ts b/types/lodash/date/now.d.ts new file mode 100644 index 0000000000..480326dd3d --- /dev/null +++ b/types/lodash/date/now.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + 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..94b60497e1 --- /dev/null +++ b/types/lodash/function/after.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..94bcc7f25e --- /dev/null +++ b/types/lodash/function/ary.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..2a3b840e8e --- /dev/null +++ b/types/lodash/function/before.d.ts @@ -0,0 +1,32 @@ +import _ = require("../index"); +declare module "../index" { + 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..28034aec12 --- /dev/null +++ b/types/lodash/function/bind.d.ts @@ -0,0 +1,50 @@ +import _ = require("../index"); +declare module "../index" { + 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..bab46527c9 --- /dev/null +++ b/types/lodash/function/bindKey.d.ts @@ -0,0 +1,51 @@ +import _ = require("../index"); +declare module "../index" { + 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..03ff949438 --- /dev/null +++ b/types/lodash/function/curry.d.ts @@ -0,0 +1,203 @@ +import _ = require("../index"); +declare module "../index" { + 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..044e98d5a2 --- /dev/null +++ b/types/lodash/function/curryRight.d.ts @@ -0,0 +1,132 @@ +import _ = require("../index"); +declare module "../index" { + 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..9ff85bd972 --- /dev/null +++ b/types/lodash/function/debounce.d.ts @@ -0,0 +1,67 @@ +import _ = require("../index"); +declare module "../index" { + 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..1968749ecd --- /dev/null +++ b/types/lodash/function/defer.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + 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..72e2b4151e --- /dev/null +++ b/types/lodash/function/delay.d.ts @@ -0,0 +1,38 @@ +import _ = require("../index"); +declare module "../index" { + 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; + } +} diff --git a/types/lodash/function/flip.d.ts b/types/lodash/function/flip.d.ts new file mode 100644 index 0000000000..e2699e3fd7 --- /dev/null +++ b/types/lodash/function/flip.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..c74cf2a32c --- /dev/null +++ b/types/lodash/function/memoize.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + 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..c4e3b7bea4 --- /dev/null +++ b/types/lodash/function/negate.d.ts @@ -0,0 +1,20 @@ +import _ = require("../index"); +declare module "../index" { + 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..b64562ac16 --- /dev/null +++ b/types/lodash/function/once.d.ts @@ -0,0 +1,20 @@ +import _ = require("../index"); +declare module "../index" { + 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..265f79981b --- /dev/null +++ b/types/lodash/function/overArgs.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + 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..6e729971a6 --- /dev/null +++ b/types/lodash/function/partial.d.ts @@ -0,0 +1,159 @@ +import _ = require("../index"); +declare module "../index" { + 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..24b4c47d20 --- /dev/null +++ b/types/lodash/function/partialRight.d.ts @@ -0,0 +1,150 @@ +import _ = require("../index"); +declare module "../index" { + 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..bff0a45b0c --- /dev/null +++ b/types/lodash/function/rearg.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..c05349f0f9 --- /dev/null +++ b/types/lodash/function/rest.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + 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..29c8b5e8cf --- /dev/null +++ b/types/lodash/function/spread.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + 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..0b0fc10039 --- /dev/null +++ b/types/lodash/function/throttle.d.ts @@ -0,0 +1,58 @@ +import _ = require("../index"); +declare module "../index" { + 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..8714529b10 --- /dev/null +++ b/types/lodash/function/unary.d.ts @@ -0,0 +1,32 @@ +import _ = require("../index"); +declare module "../index" { + 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..f0bb2693ff --- /dev/null +++ b/types/lodash/function/wrap.d.ts @@ -0,0 +1,61 @@ +import _ = require("../index"); +declare module "../index" { + 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..578bfacd21 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -3,17384 +3,361 @@ // Definitions by: Brian Zengel , // Ilya Mochalov , // Stepan Mikhaylyuk , -// Eric L Anderson , // AJ Richardson , // 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 - -added 2 number methods: -- [x] _.clamp -- [x] _.subtract - -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 -*/ +// util +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// export = _; export as namespace _; -declare let _: _.LoDashStatic; - -type PartialObject = Partial; - +declare const _: _.LoDashStatic; 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; + // tslint:disable-next-line no-empty-interface (This will be augmented) + interface LoDashStatic {} } // Backward compatibility with --target es5 diff --git a/types/lodash/lang/castArray.d.ts b/types/lodash/lang/castArray.d.ts new file mode 100644 index 0000000000..5f385c5ed5 --- /dev/null +++ b/types/lodash/lang/castArray.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..794e2383fb --- /dev/null +++ b/types/lodash/lang/clone.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + 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..0a49e67ea9 --- /dev/null +++ b/types/lodash/lang/cloneDeep.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..b46fc766ac --- /dev/null +++ b/types/lodash/lang/cloneDeepWith.d.ts @@ -0,0 +1,51 @@ +import _ = require("../index"); +declare module "../index" { + 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..22c00be038 --- /dev/null +++ b/types/lodash/lang/cloneWith.d.ts @@ -0,0 +1,74 @@ +import _ = require("../index"); +declare module "../index" { + 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..f069e15e73 --- /dev/null +++ b/types/lodash/lang/conformsTo.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + + 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..808ec0cf39 --- /dev/null +++ b/types/lodash/lang/eq.d.ts @@ -0,0 +1,55 @@ +import _ = require("../index"); +declare module "../index" { + 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..3ae27eaccf --- /dev/null +++ b/types/lodash/lang/gt.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..b68cc05c7d --- /dev/null +++ b/types/lodash/lang/gte.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..20c90752bf --- /dev/null +++ b/types/lodash/lang/isArguments.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..3d0676791c --- /dev/null +++ b/types/lodash/lang/isArray.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + 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..b22e954086 --- /dev/null +++ b/types/lodash/lang/isArrayBuffer.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..59c75a70b7 --- /dev/null +++ b/types/lodash/lang/isArrayLike.d.ts @@ -0,0 +1,52 @@ +import _ = require("../index"); +declare module "../index" { + 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..6613d7d410 --- /dev/null +++ b/types/lodash/lang/isArrayLikeObject.d.ts @@ -0,0 +1,53 @@ +import _ = require("../index"); +declare module "../index" { + 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..060d3eae5e --- /dev/null +++ b/types/lodash/lang/isBoolean.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..971cd4cc42 --- /dev/null +++ b/types/lodash/lang/isBuffer.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..ac6dc058f8 --- /dev/null +++ b/types/lodash/lang/isDate.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..9b818bc1cf --- /dev/null +++ b/types/lodash/lang/isElement.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..b84fd2e125 --- /dev/null +++ b/types/lodash/lang/isEmpty.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..ae7b0eedd8 --- /dev/null +++ b/types/lodash/lang/isEqual.d.ts @@ -0,0 +1,52 @@ +import _ = require("../index"); +declare module "../index" { + 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..44ab134546 --- /dev/null +++ b/types/lodash/lang/isEqualWith.d.ts @@ -0,0 +1,61 @@ +import _ = require("../index"); +declare module "../index" { + 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..a5bd5d378b --- /dev/null +++ b/types/lodash/lang/isError.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..e5015e8d49 --- /dev/null +++ b/types/lodash/lang/isFinite.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..7f6ae1feea --- /dev/null +++ b/types/lodash/lang/isFunction.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..a1919bf21d --- /dev/null +++ b/types/lodash/lang/isInteger.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + 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..b8c012460e --- /dev/null +++ b/types/lodash/lang/isLength.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + 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..b71a3d750f --- /dev/null +++ b/types/lodash/lang/isMap.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..dfb072c59b --- /dev/null +++ b/types/lodash/lang/isMatch.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + 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..fb47f327b4 --- /dev/null +++ b/types/lodash/lang/isMatchWith.d.ts @@ -0,0 +1,51 @@ +import _ = require("../index"); +declare module "../index" { + 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..b016c91c74 --- /dev/null +++ b/types/lodash/lang/isNaN.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..72f74e7148 --- /dev/null +++ b/types/lodash/lang/isNative.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..2b0cb04fbc --- /dev/null +++ b/types/lodash/lang/isNil.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + 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..04dfb18cea --- /dev/null +++ b/types/lodash/lang/isNull.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..81479cb4c9 --- /dev/null +++ b/types/lodash/lang/isNumber.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..e014fd9620 --- /dev/null +++ b/types/lodash/lang/isObject.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..1665ec8a69 --- /dev/null +++ b/types/lodash/lang/isObjectLike.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + 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..bb5070f535 --- /dev/null +++ b/types/lodash/lang/isPlainObject.d.ts @@ -0,0 +1,29 @@ +import _ = require("../index"); +declare module "../index" { + 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..4199940091 --- /dev/null +++ b/types/lodash/lang/isRegExp.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..0ca1b4809a --- /dev/null +++ b/types/lodash/lang/isSafeInteger.d.ts @@ -0,0 +1,43 @@ +import _ = require("../index"); +declare module "../index" { + 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..af7f4ad9e9 --- /dev/null +++ b/types/lodash/lang/isSet.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..d39917345e --- /dev/null +++ b/types/lodash/lang/isString.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..2f0a6aa4f5 --- /dev/null +++ b/types/lodash/lang/isSymbol.d.ts @@ -0,0 +1,34 @@ +import _ = require("../index"); +declare module "../index" { + 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..dffc9e43d0 --- /dev/null +++ b/types/lodash/lang/isTypedArray.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..dad9ed7cc3 --- /dev/null +++ b/types/lodash/lang/isUndefined.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..8dae9d20f5 --- /dev/null +++ b/types/lodash/lang/isWeakMap.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..2c08c521aa --- /dev/null +++ b/types/lodash/lang/isWeakSet.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..434b1476d0 --- /dev/null +++ b/types/lodash/lang/lt.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..84cc6b22fe --- /dev/null +++ b/types/lodash/lang/lte.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..d0fd0b93f2 --- /dev/null +++ b/types/lodash/lang/toArray.d.ts @@ -0,0 +1,46 @@ +import _ = require("../index"); +declare module "../index" { + 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..3007bf3674 --- /dev/null +++ b/types/lodash/lang/toFinite.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + 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..2f4c2f217c --- /dev/null +++ b/types/lodash/lang/toInteger.d.ts @@ -0,0 +1,42 @@ +import _ = require("../index"); +declare module "../index" { + 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..62e9b059fe --- /dev/null +++ b/types/lodash/lang/toLength.d.ts @@ -0,0 +1,43 @@ +import _ = require("../index"); +declare module "../index" { + 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..5099f7ad89 --- /dev/null +++ b/types/lodash/lang/toNumber.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + 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..60b9c1a7b1 --- /dev/null +++ b/types/lodash/lang/toPlainObject.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..a4e1729dbb --- /dev/null +++ b/types/lodash/lang/toSafeInteger.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + 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..559f05f66f --- /dev/null +++ b/types/lodash/lang/toString.d.ts @@ -0,0 +1,24 @@ +import _ = require("../index"); +declare module "../index" { + 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/lodash-tests.ts b/types/lodash/lodash-tests.ts index 77cc1984eb..ca33017323 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -20,9 +20,9 @@ const stoogesAges: StoogesAge[] = [ let result: any; -let any: any; +let anything: any; -interface TResult { +interface AbcObject { a: number; b: string; c: boolean; @@ -70,13 +70,13 @@ namespace TestWrapper { } { - let a: TResult[] = []; - _(a); // $ExpectType LoDashImplicitWrapper + let a: AbcObject[] = []; + _(a); // $ExpectType LoDashImplicitWrapper } { - let a: TResult[] | null | undefined = any; - _(a); // $ExpectType LoDashImplicitWrapper + let a: AbcObject[] | null | undefined = anything; + _(a); // $ExpectType LoDashImplicitWrapper } } @@ -103,81 +103,81 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[][]; + let result: AbcObject[][]; - result = _.chunk(array); - result = _.chunk(array, 42); + result = _.chunk(array); + result = _.chunk(array, 42); - result = _.chunk(list); - result = _.chunk(list, 42); + result = _.chunk(list); + result = _.chunk(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).chunk(); result = _(array).chunk(42); - result = _(list).chunk(); - result = _(list).chunk(42); + result = _(list).chunk(); + result = _(list).chunk(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _.chain(array).chunk(); result = _(array).chain().chunk(); result = _(array).chain().chunk(42); - result = _(list).chain().chunk(); - result = _(list).chain().chunk(42); + result = _(list).chain().chunk(); + result = _(list).chain().chunk(42); } } // _.compact namespace TestCompact { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let array2: Array | null | undefined = any; - let list2: _.List | null | undefined = any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let array2: Array | null | undefined = anything; + let list2: _.List | null | undefined = anything; { - let result: TResult[]; + let result: AbcObject[]; - result = _.compact(array); - result = _.compact(list); + result = _.compact(array); + result = _.compact(list); result = _.compact(array2); result = _.compact(list2); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).compact(); - result = _(list).compact(); + result = _(list).compact(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().compact(); - result = _(list).chain().compact(); + result = _(list).chain().compact(); } } // _.difference namespace TestDifference { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let arrayParam: TResult[] = []; - let listParam: _.List = []; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let arrayParam: AbcObject[] = []; + let listParam: _.List = []; { - let result: TResult[]; + let result: AbcObject[]; result = _.difference(array); result = _.difference(array, arrayParam); @@ -191,222 +191,222 @@ namespace TestDifference { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).difference(); result = _(array).difference(arrayParam); result = _(array).difference(listParam, arrayParam); result = _(array).difference(arrayParam, listParam, arrayParam); - result = _(list).difference(); - result = _(list).difference(listParam); - result = _(list).difference(arrayParam, listParam); - result = _(list).difference(listParam, arrayParam, listParam); + result = _(list).difference(); + result = _(list).difference(listParam); + result = _(list).difference(arrayParam, listParam); + result = _(list).difference(listParam, arrayParam, listParam); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().difference(); result = _(array).chain().difference(arrayParam); result = _(array).chain().difference(listParam, arrayParam); result = _(array).chain().difference(arrayParam, listParam, arrayParam); - result = _(list).chain().difference(); - result = _(list).chain().difference(listParam); - result = _(list).chain().difference(arrayParam, listParam); - result = _(list).chain().difference(listParam, arrayParam, listParam); + result = _(list).chain().difference(); + result = _(list).chain().difference(listParam); + result = _(list).chain().difference(arrayParam, listParam); + result = _(list).chain().difference(listParam, arrayParam, listParam); } } // _.differenceBy namespace TestDifferenceBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let arrayParam: TResult[] = []; - let listParam: _.List = []; - let iteratee: (value: TResult) => any = (value: TResult) => 1; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let arrayParam: AbcObject[] = []; + let listParam: _.List = []; + let iteratee: (value: AbcObject) => any = (value: AbcObject) => 1; { - let result: TResult[]; + let result: AbcObject[]; result = _.differenceBy(array); - result = _.differenceBy(array, arrayParam); - result = _.differenceBy(array, listParam, arrayParam); - result = _.differenceBy(array, arrayParam, listParam, arrayParam); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam); - result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, arrayParam); + result = _.differenceBy(array, listParam, arrayParam); + result = _.differenceBy(array, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); result = _.differenceBy(array, arrayParam, iteratee); result = _.differenceBy(array, listParam, arrayParam, iteratee); result = _.differenceBy(array, arrayParam, listParam, arrayParam, iteratee); result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, iteratee); result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); result = _.differenceBy(array, arrayParam, 'a'); result = _.differenceBy(array, listParam, arrayParam, 'a'); result = _.differenceBy(array, arrayParam, listParam, arrayParam, 'a'); result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, 'a'); result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); result = _.differenceBy(array, arrayParam, {a: 1}); result = _.differenceBy(array, listParam, arrayParam, {a: 1}); result = _.differenceBy(array, arrayParam, listParam, arrayParam, {a: 1}); result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _.differenceBy(array, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); + result = _.differenceBy(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _.differenceBy(list); - result = _.differenceBy(list, listParam); - result = _.differenceBy(list, arrayParam, listParam); - result = _.differenceBy(list, listParam, arrayParam, listParam); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam); - result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); + result = _.differenceBy(list, listParam); + result = _.differenceBy(list, arrayParam, listParam); + result = _.differenceBy(list, listParam, arrayParam, listParam); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam); + result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); result = _.differenceBy(list, listParam, iteratee); result = _.differenceBy(list, arrayParam, listParam, iteratee); result = _.differenceBy(list, listParam, arrayParam, listParam, iteratee); result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, iteratee); result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); result = _.differenceBy(list, listParam, 'a'); result = _.differenceBy(list, arrayParam, listParam, 'a'); result = _.differenceBy(list, listParam, arrayParam, listParam, 'a'); result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, 'a'); result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); result = _.differenceBy(list, listParam, {a: 1}); result = _.differenceBy(list, arrayParam, listParam, {a: 1}); result = _.differenceBy(list, listParam, arrayParam, listParam, {a: 1}); result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, {a: 1}); result = _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); - result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); + result = _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); } { - let result: _.LoDashImplicitWrapper; + let result: _.LoDashImplicitWrapper; - result = _(array).differenceBy(arrayParam); - result = _(array).differenceBy(listParam, arrayParam); - result = _(array).differenceBy(arrayParam, listParam, arrayParam); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam); - result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).differenceBy(arrayParam); + result = _(array).differenceBy(listParam, arrayParam); + result = _(array).differenceBy(arrayParam, listParam, arrayParam); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam); + result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); result = _(array).differenceBy(arrayParam, iteratee); result = _(array).differenceBy(listParam, arrayParam, iteratee); result = _(array).differenceBy(arrayParam, listParam, arrayParam, iteratee); result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).differenceBy(arrayParam, 'a'); result = _(array).differenceBy(listParam, arrayParam, 'a'); result = _(array).differenceBy(arrayParam, listParam, arrayParam, 'a'); result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).differenceBy(arrayParam, {a: 1}); result = _(array).differenceBy(listParam, arrayParam, {a: 1}); result = _(array).differenceBy(arrayParam, listParam, arrayParam, {a: 1}); result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _(array).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); + result = _(array).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(list).differenceBy(listParam); - result = _(list).differenceBy(arrayParam, listParam); - result = _(list).differenceBy(listParam, arrayParam, listParam); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam); - result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).differenceBy(listParam); + result = _(list).differenceBy(arrayParam, listParam); + result = _(list).differenceBy(listParam, arrayParam, listParam); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam); + result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); result = _(list).differenceBy(listParam, iteratee); result = _(list).differenceBy(arrayParam, listParam, iteratee); result = _(list).differenceBy(listParam, arrayParam, listParam, iteratee); result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, iteratee); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).differenceBy(listParam, 'a'); result = _(list).differenceBy(arrayParam, listParam, 'a'); result = _(list).differenceBy(listParam, arrayParam, listParam, 'a'); result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, 'a'); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).differenceBy(listParam, {a: 1}); result = _(list).differenceBy(arrayParam, listParam, {a: 1}); result = _(list).differenceBy(listParam, arrayParam, listParam, {a: 1}); result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, {a: 1}); result = _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); - result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); + result = _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; - result = _(array).chain().differenceBy(arrayParam); - result = _(array).chain().differenceBy(listParam, arrayParam); - result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam); - result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(arrayParam); + result = _(array).chain().differenceBy(listParam, arrayParam); + result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); result = _(array).chain().differenceBy(arrayParam, iteratee); result = _(array).chain().differenceBy(listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); result = _(array).chain().differenceBy(arrayParam, 'a'); result = _(array).chain().differenceBy(listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, 'a'); result = _(array).chain().differenceBy(arrayParam, {a: 1}); result = _(array).chain().differenceBy(listParam, arrayParam, {a: 1}); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, {a: 1}); result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, {a: 1}); result = _(array).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); + result = _(array).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - result = _(list).chain().differenceBy(listParam); - result = _(list).chain().differenceBy(arrayParam, listParam); - result = _(list).chain().differenceBy(listParam, arrayParam, listParam); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam); - result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(listParam); + result = _(list).chain().differenceBy(arrayParam, listParam); + result = _(list).chain().differenceBy(listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); result = _(list).chain().differenceBy(listParam, iteratee); result = _(list).chain().differenceBy(arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, iteratee); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); result = _(list).chain().differenceBy(listParam, 'a'); result = _(list).chain().differenceBy(arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, 'a'); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, 'a'); result = _(list).chain().differenceBy(listParam, {a: 1}); result = _(list).chain().differenceBy(arrayParam, listParam, {a: 1}); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, {a: 1}); result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, {a: 1}); result = _(list).chain().differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); - result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); + result = _(list).chain().differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, {a: 1}); } { @@ -550,63 +550,63 @@ namespace TestDifferenceBy { // _.differenceWith { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let arrayParam: TResult[] = []; - let listParam: _.List = []; - let comparator = (a: TResult, b: TResult) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let arrayParam: AbcObject[] = []; + let listParam: _.List = []; + let comparator = (a: AbcObject, b: AbcObject) => true; { - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, arrayParam); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, arrayParam, comparator); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam, comparator); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.differenceWith(array, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); } { - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(arrayParam, listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(arrayParam, comparator); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam, comparator); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); } { - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(arrayParam, listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(arrayParam, comparator); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam, comparator); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); } @@ -621,7 +621,7 @@ namespace TestDifferenceBy { } const t1: T1 = { a: 'a', b: 'b' }; - const t2: T2 | undefined = any; + const t2: T2 | undefined = anything; // $ExpectType T1[] _.differenceWith([t1], [t2], (a, b) => { @@ -648,169 +648,169 @@ namespace TestDifferenceBy { // _.drop { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; - result = _.drop(array); - result = _.drop(array, 42); + let result: AbcObject[]; + result = _.drop(array); + result = _.drop(array, 42); - result = _.drop(list); - result = _.drop(list, 42); + result = _.drop(list); + result = _.drop(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).drop(); result = _(array).drop(42); - result = _(list).drop(); - result = _(list).drop(42); + result = _(list).drop(); + result = _(list).drop(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().drop(); result = _(array).chain().drop(42); - result = _(list).chain().drop(); - result = _(list).chain().drop(42); + result = _(list).chain().drop(); + result = _(list).chain().drop(42); } } // _.dropRight namespace TestDropRight { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.dropRight(array); - result = _.dropRight(array, 42); + result = _.dropRight(array); + result = _.dropRight(array, 42); - result = _.dropRight(list); - result = _.dropRight(list, 42); + result = _.dropRight(list); + result = _.dropRight(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).dropRight(); result = _(array).dropRight(42); - result = _(list).dropRight(); - result = _(list).dropRight(42); + result = _(list).dropRight(); + result = _(list).dropRight(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropRight(); result = _(array).chain().dropRight(42); - result = _(list).chain().dropRight(); - result = _(list).chain().dropRight(42); + result = _(list).chain().dropRight(); + result = _(list).chain().dropRight(42); } } // _.dropRightWhile namespace TestDropRightWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.dropRightWhile(array); - result = _.dropRightWhile(array, predicateFn); - result = _.dropRightWhile(array, ''); + result = _.dropRightWhile(array); + result = _.dropRightWhile(array, predicateFn); + result = _.dropRightWhile(array, ''); result = _.dropRightWhile(array, {a: 42}); - result = _.dropRightWhile(list); - result = _.dropRightWhile(list, predicateFn); - result = _.dropRightWhile(list, ''); + result = _.dropRightWhile(list); + result = _.dropRightWhile(list, predicateFn); + result = _.dropRightWhile(list, ''); result = _.dropRightWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).dropRightWhile(); result = _(array).dropRightWhile(predicateFn); result = _(array).dropRightWhile(''); result = _(array).dropRightWhile({a: 42}); - result = _(list).dropRightWhile(); - result = _(list).dropRightWhile(predicateFn); - result = _(list).dropRightWhile(''); + result = _(list).dropRightWhile(); + result = _(list).dropRightWhile(predicateFn); + result = _(list).dropRightWhile(''); result = _(list).dropRightWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropRightWhile(); result = _(array).chain().dropRightWhile(predicateFn); result = _(array).chain().dropRightWhile(''); result = _(array).chain().dropRightWhile({a: 42}); - result = _(list).chain().dropRightWhile(); - result = _(list).chain().dropRightWhile(predicateFn); - result = _(list).chain().dropRightWhile(''); + result = _(list).chain().dropRightWhile(); + result = _(list).chain().dropRightWhile(predicateFn); + result = _(list).chain().dropRightWhile(''); result = _(list).chain().dropRightWhile({a: 42}); } } // _.dropWhile namespace TestDropWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.dropWhile(array); - result = _.dropWhile(array, predicateFn); - result = _.dropWhile(array, ''); + result = _.dropWhile(array); + result = _.dropWhile(array, predicateFn); + result = _.dropWhile(array, ''); result = _.dropWhile(array, {a: 42}); - result = _.dropWhile(list); - result = _.dropWhile(list, predicateFn); - result = _.dropWhile(list, ''); + result = _.dropWhile(list); + result = _.dropWhile(list, predicateFn); + result = _.dropWhile(list, ''); result = _.dropWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).dropWhile(); result = _(array).dropWhile(predicateFn); result = _(array).dropWhile(''); result = _(array).dropWhile({a: 42}); - result = _(list).dropWhile(); - result = _(list).dropWhile(predicateFn); - result = _(list).dropWhile(''); + result = _(list).dropWhile(); + result = _(list).dropWhile(predicateFn); + result = _(list).dropWhile(''); result = _(list).dropWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropWhile(); result = _(array).chain().dropWhile(predicateFn); result = _(array).chain().dropWhile(''); result = _(array).chain().dropWhile({a: 42}); - result = _(list).chain().dropWhile(); - result = _(list).chain().dropWhile(predicateFn); - result = _(list).chain().dropWhile(''); + result = _(list).chain().dropWhile(); + result = _(list).chain().dropWhile(predicateFn); + result = _(list).chain().dropWhile(''); result = _(list).chain().dropWhile({a: 42}); } } @@ -871,25 +871,25 @@ namespace TestFill { // _.findIndex namespace TestFindIndex { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; let fromIndex = 0; { let result: number; - result = _.findIndex(array); - result = _.findIndex(array, predicateFn); - result = _.findIndex(array, ''); + result = _.findIndex(array); + result = _.findIndex(array, predicateFn); + result = _.findIndex(array, ''); result = _.findIndex(array, {a: 42}); - result = _.findIndex(array, predicateFn, fromIndex); + result = _.findIndex(array, predicateFn, fromIndex); - result = _.findIndex(list); - result = _.findIndex(list, predicateFn); - result = _.findIndex(list, ''); + result = _.findIndex(list); + result = _.findIndex(list, predicateFn); + result = _.findIndex(list, ''); result = _.findIndex(list, {a: 42}); - result = _.findIndex(list, predicateFn, fromIndex); + result = _.findIndex(list, predicateFn, fromIndex); result = _.findIndex([{ b: 5 }], ['b', 5]); result = _(array).findIndex(); @@ -899,10 +899,10 @@ namespace TestFindIndex { result = _(array).findIndex(predicateFn, fromIndex); result = _(list).findIndex(); - result = _(list).findIndex(predicateFn); + result = _(list).findIndex(predicateFn); result = _(list).findIndex(''); result = _(list).findIndex<{a: number}>({a: 42}); - result = _(list).findIndex(predicateFn, fromIndex); + result = _(list).findIndex(predicateFn, fromIndex); } { @@ -915,35 +915,35 @@ namespace TestFindIndex { result = _(array).chain().findIndex(predicateFn, fromIndex); result = _(list).chain().findIndex(); - result = _(list).chain().findIndex(predicateFn); + result = _(list).chain().findIndex(predicateFn); result = _(list).chain().findIndex(''); result = _(list).chain().findIndex<{a: number}>({a: 42}); - result = _(list).chain().findIndex(predicateFn, fromIndex); + result = _(list).chain().findIndex(predicateFn, fromIndex); } } // _.findLastIndex namespace TestFindLastIndex { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; let fromIndex = 0; { let result: number; - result = _.findLastIndex(array); - result = _.findLastIndex(array, predicateFn); - result = _.findLastIndex(array, ''); + result = _.findLastIndex(array); + result = _.findLastIndex(array, predicateFn); + result = _.findLastIndex(array, ''); result = _.findLastIndex(array, {a: 42}); - result = _.findLastIndex(array, predicateFn, fromIndex); + result = _.findLastIndex(array, predicateFn, fromIndex); - result = _.findLastIndex(list); - result = _.findLastIndex(list, predicateFn); - result = _.findLastIndex(list, ''); + result = _.findLastIndex(list); + result = _.findLastIndex(list, predicateFn); + result = _.findLastIndex(list, ''); result = _.findLastIndex(list, {a: 42}); - result = _.findLastIndex(list, predicateFn, fromIndex); + result = _.findLastIndex(list, predicateFn, fromIndex); result = _.findLastIndex([{ b: 5 }], ['b', 5]); result = _(array).findLastIndex(); @@ -953,10 +953,10 @@ namespace TestFindLastIndex { result = _(array).findLastIndex(predicateFn, fromIndex); result = _(list).findLastIndex(); - result = _(list).findLastIndex(predicateFn); + result = _(list).findLastIndex(predicateFn); result = _(list).findLastIndex(''); result = _(list).findLastIndex<{a: number}>({a: 42}); - result = _(list).findLastIndex(predicateFn, fromIndex); + result = _(list).findLastIndex(predicateFn, fromIndex); } { @@ -969,17 +969,17 @@ namespace TestFindLastIndex { result = _(array).chain().findLastIndex(predicateFn, fromIndex); result = _(list).chain().findLastIndex(); - result = _(list).chain().findLastIndex(predicateFn); + result = _(list).chain().findLastIndex(predicateFn); result = _(list).chain().findLastIndex(''); result = _(list).chain().findLastIndex<{a: number}>({a: 42}); - result = _(list).chain().findLastIndex(predicateFn, fromIndex); + result = _(list).chain().findLastIndex(predicateFn, fromIndex); } } // _.first namespace TestFirst { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { let result: string | undefined; @@ -989,13 +989,13 @@ namespace TestFirst { } { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.first(array); - result = _.first(list); + result = _.first(array); + result = _.first(list); result = _(array).first(); - result = _(list).first(); + result = _(list).first(); } { @@ -1005,7 +1005,7 @@ namespace TestFirst { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().first(); result = _(list).chain().first(); @@ -1227,8 +1227,8 @@ namespace TestFromPairs { // _.head namespace TestHead { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { let result: string | undefined; @@ -1238,13 +1238,13 @@ namespace TestHead { } { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.head(array); - result = _.head(list); + result = _.head(array); + result = _.head(list); result = _(array).head(); - result = _(list).head(); + result = _(list).head(); } { @@ -1254,7 +1254,7 @@ namespace TestHead { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().head(); result = _(list).chain().head(); @@ -1263,28 +1263,28 @@ namespace TestHead { // _.indexOf namespace TestIndexOf { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let value: AbcObject = { a: 1, b: "", c: true }; { let result: number; - result = _.indexOf(array, value); - result = _.indexOf(array, value, true); - result = _.indexOf(array, value, 42); + result = _.indexOf(array, value); + result = _.indexOf(array, value, true); + result = _.indexOf(array, value, 42); - result = _.indexOf(list, value); - result = _.indexOf(list, value, true); - result = _.indexOf(list, value, 42); + result = _.indexOf(list, value); + result = _.indexOf(list, value, true); + result = _.indexOf(list, value, 42); result = _(array).indexOf(value); result = _(array).indexOf(value, true); result = _(array).indexOf(value, 42); - result = _(list).indexOf(value); - result = _(list).indexOf(value, true); - result = _(list).indexOf(value, 42); + result = _(list).indexOf(value); + result = _(list).indexOf(value, true); + result = _(list).indexOf(value, 42); } { @@ -1294,170 +1294,170 @@ namespace TestIndexOf { result = _(array).chain().indexOf(value, true); result = _(array).chain().indexOf(value, 42); - result = _(list).chain().indexOf(value); - result = _(list).chain().indexOf(value, true); - result = _(list).chain().indexOf(value, 42); + result = _(list).chain().indexOf(value); + result = _(list).chain().indexOf(value, true); + result = _(list).chain().indexOf(value, 42); } } // _.sortedIndexOf { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let value: AbcObject = { a: 1, b: "", c: true }; { let result: number; - result = _.sortedIndexOf(array, value); - result = _.sortedIndexOf(list, value); + result = _.sortedIndexOf(array, value); + result = _.sortedIndexOf(list, value); result = _(array).sortedIndexOf(value); - result = _(list).sortedIndexOf(value); + result = _(list).sortedIndexOf(value); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().sortedIndexOf(value); - result = _(list).chain().sortedIndexOf(value); + result = _(list).chain().sortedIndexOf(value); } } //_.initial namespace TestInitial { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.initial(array); - result = _.initial(list); + result = _.initial(array); + result = _.initial(list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).initial(); - result = _(list).initial(); + result = _(list).initial(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().initial(); - result = _(list).chain().initial(); + result = _(list).chain().initial(); } } // _.intersection namespace TestIntersection { - let array: TResult[] = [] as any; - let list: _.List = [] as any; - let arrayParam: TResult[] = [] as any; - let listParam: _.List = [] as any; + let array: AbcObject[] = [] as any; + let list: _.List = [] as any; + let arrayParam: AbcObject[] = [] as any; + let listParam: _.List = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.intersection(array, list); - result = _.intersection(list, array, list); + result = _.intersection(array, list); + result = _.intersection(list, array, list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(array).intersection(arrayParam); - result = _(array).intersection(listParam, arrayParam); + result = _(array).intersection(arrayParam); + result = _(array).intersection(listParam, arrayParam); - result = _(list).intersection(arrayParam); - result = _(list).intersection(listParam, arrayParam); + result = _(list).intersection(arrayParam); + result = _(list).intersection(listParam, arrayParam); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; - result = _(array).chain().intersection(arrayParam); - result = _(array).chain().intersection(listParam, arrayParam); + result = _(array).chain().intersection(arrayParam); + result = _(array).chain().intersection(listParam, arrayParam); - result = _(list).chain().intersection(arrayParam); - result = _(list).chain().intersection(listParam, arrayParam); + result = _(list).chain().intersection(arrayParam); + result = _(list).chain().intersection(listParam, arrayParam); } } // _.intersectionBy { - let array: TResult[] = [] as any; - let list: _.List = [] as any; - let arrayParam: TResult[] = [] as any; - let listParam: _.List = [] as any; + let array: AbcObject[] = [] as any; + let list: _.List = [] as any; + let arrayParam: AbcObject[] = [] as any; + let listParam: _.List = [] as any; - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(list, array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, 'a'); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, { a: 42 }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(list, array, list, { a: 42 }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, ['a', 42]); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionBy(list, array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, 'a'); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, { a: 42 }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(list).intersectionBy(array, list, { a: 42 }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, ['a', 42]); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionBy(list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return ""; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(list).intersectionBy(array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 1; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, 'a'); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, { a: 42 }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(list).intersectionBy(array, list, { a: 42 }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, ['a', 42]); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionBy(list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return false; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(list).intersectionBy(array, list, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return null; }); @@ -1490,59 +1490,59 @@ namespace TestIntersection { // _.intersectionWith { - let array: TResult[] = [] as any; - let list: _.List = [] as any; - let arrayParam: TResult[] = [] as any; - let listParam: _.List = [] as any; + let array: AbcObject[] = [] as any; + let list: _.List = [] as any; + let arrayParam: AbcObject[] = [] as any; + let listParam: _.List = [] as any; - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(list, array, list); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] result = _.intersectionWith(list, array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionWith(arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionWith(listParam, arrayParam); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(array).intersectionWith(list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper result = _(list).intersectionWith(array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionWith(arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionWith(listParam, arrayParam); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(array).intersectionWith(list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper result = _.chain(list).intersectionWith(array, list, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); @@ -1619,8 +1619,8 @@ namespace TestJoin { // _.last namespace TestLast { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { let result: string | undefined; @@ -1630,13 +1630,13 @@ namespace TestLast { } { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.last(array); - result = _.last(list); + result = _.last(array); + result = _.last(list); result = _(array).last(); - result = _(list).last(); + result = _(list).last(); } { @@ -1646,13 +1646,13 @@ namespace TestLast { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().last(); } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(list).chain().last(); } @@ -1660,28 +1660,28 @@ namespace TestLast { // _.lastIndexOf namespace TestLastIndexOf { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let value: AbcObject = { a: 1, b: "", c: true }; { let result: number; - result = _.lastIndexOf(array, value); - result = _.lastIndexOf(array, value, true); - result = _.lastIndexOf(array, value, 42); + result = _.lastIndexOf(array, value); + result = _.lastIndexOf(array, value, true); + result = _.lastIndexOf(array, value, 42); - result = _.lastIndexOf(list, value); - result = _.lastIndexOf(list, value, true); - result = _.lastIndexOf(list, value, 42); + result = _.lastIndexOf(list, value); + result = _.lastIndexOf(list, value, true); + result = _.lastIndexOf(list, value, 42); result = _(array).lastIndexOf(value); result = _(array).lastIndexOf(value, true); result = _(array).lastIndexOf(value, 42); - result = _(list).lastIndexOf(value); - result = _(list).lastIndexOf(value, true); - result = _(list).lastIndexOf(value, 42); + result = _(list).lastIndexOf(value); + result = _(list).lastIndexOf(value, true); + result = _(list).lastIndexOf(value, 42); } { @@ -1691,69 +1691,69 @@ namespace TestLastIndexOf { result = _(array).chain().lastIndexOf(value, true); result = _(array).chain().lastIndexOf(value, 42); - result = _(list).chain().lastIndexOf(value); - result = _(list).chain().lastIndexOf(value, true); - result = _(list).chain().lastIndexOf(value, 42); + result = _(list).chain().lastIndexOf(value); + result = _(list).chain().lastIndexOf(value, true); + result = _(list).chain().lastIndexOf(value, 42); } } // _.nth namespace TestNth { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let value = 0; { - let result: TResult | undefined; + let result: AbcObject | undefined; - result = _.nth(array); + result = _.nth(array); - result = _.nth(array, 42); + result = _.nth(array, 42); result = _(array).nth(); result = _(array).nth(42); - result = _(list).nth(); - result = _(list).nth(42); + result = _(list).nth(); + result = _(list).nth(42); } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(array).chain().nth(); result = _(array).chain().nth(42); - result = _(list).chain().nth(); - result = _(list).chain().nth(42); + result = _(list).chain().nth(); + result = _(list).chain().nth(42); } } // _.pull namespace TestPull { - let array: TResult[] = []; - let list: _.List = []; - let value: TResult = { a: 1, b: "", c: true }; + let array: AbcObject[] = []; + let list: _.List = []; + let value: AbcObject = { a: 1, b: "", c: true }; { - let result: TResult[]; + let result: AbcObject[]; - result = _.pull(array); - result = _.pull(array, value); - result = _.pull(array, value, value); - result = _.pull(array, value, value, value); + result = _.pull(array); + result = _.pull(array, value); + result = _.pull(array, value, value); + result = _.pull(array, value, value, value); } { - let result: _.List; + let result: _.List; - result = _.pull(list); - result = _.pull(list, value); - result = _.pull(list, value, value); - result = _.pull(list, value, value, value); + result = _.pull(list); + result = _.pull(list, value); + result = _.pull(list, value, value); + result = _.pull(list, value, value, value); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).pull(); result = _(array).pull(value); @@ -1762,16 +1762,16 @@ namespace TestPull { } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).pull(); - result = _(list).pull(value); - result = _(list).pull(value, value); - result = _(list).pull(value, value, value); + result = _(list).pull(); + result = _(list).pull(value); + result = _(list).pull(value, value); + result = _(list).pull(value, value, value); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().pull(); result = _(array).chain().pull(value); @@ -1780,40 +1780,40 @@ namespace TestPull { } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().pull(); - result = _(list).chain().pull(value); - result = _(list).chain().pull(value, value); - result = _(list).chain().pull(value, value, value); + result = _(list).chain().pull(); + result = _(list).chain().pull(value); + result = _(list).chain().pull(value, value); + result = _(list).chain().pull(value, value, value); } } // _.pullAt namespace TestPullAt { - let array: TResult[] = []; - let list: _.List = []; + let array: AbcObject[] = []; + let list: _.List = []; { - let result: TResult[]; + let result: AbcObject[]; - result = _.pullAt(array); - result = _.pullAt(array, 1); - result = _.pullAt(array, [2, 3], 1); - result = _.pullAt(array, 4, [2, 3], 1); + result = _.pullAt(array); + result = _.pullAt(array, 1); + result = _.pullAt(array, [2, 3], 1); + result = _.pullAt(array, 4, [2, 3], 1); } { - let result: ArrayLike; + let result: ArrayLike; - result = _.pullAt(list); - result = _.pullAt(list, 1); - result = _.pullAt(list, [2, 3], 1); - result = _.pullAt(list, 4, [2, 3], 1); + result = _.pullAt(list); + result = _.pullAt(list, 1); + result = _.pullAt(list, [2, 3], 1); + result = _.pullAt(list, 4, [2, 3], 1); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).pullAt(); result = _(array).pullAt(1); @@ -1822,7 +1822,7 @@ namespace TestPullAt { } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; result = _(list).pullAt(); result = _(list).pullAt(1); @@ -1831,7 +1831,7 @@ namespace TestPullAt { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().pullAt(); result = _(array).chain().pullAt(1); @@ -1840,7 +1840,7 @@ namespace TestPullAt { } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; result = _(list).chain().pullAt(); result = _(list).chain().pullAt(1); @@ -1851,134 +1851,134 @@ namespace TestPullAt { // _.pullAll { - let array: TResult[] = any; - let list: _.List = any; - let values: _.List = any; + let array: AbcObject[] = anything; + let list: _.List = anything; + let values: _.List = anything; - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAll(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAll(array, values); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAll(list); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAll(list, values); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAll(); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAll(values); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAll(); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAll(values); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAll(); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAll(values); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAll(); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAll(values); } // _.pullAllBy { - let array: TResult[] = any; - let list: _.List = any; - let values: _.List = any; + let array: AbcObject[] = anything; + let list: _.List = anything; + let values: _.List = anything; - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, 'a'); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, { a: 42 }); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, ['a', 42]); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllBy(array, values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return []; }); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, 'a'); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, { a: 42 }); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, ['a', 42]); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllBy(list, values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return () => {}; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, 'a'); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, 'a'); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, 'a'); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, 'a'); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, { a: 42 }); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, ['a', 42]); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllBy(values, (value) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject return 0; }); @@ -2011,70 +2011,70 @@ namespace TestPullAt { // _.pullAllWith { - let array: TResult[] = any; - let list: _.List = any; - let values: _.List = any; + let array: AbcObject[] = anything; + let list: _.List = anything; + let values: _.List = anything; - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllWith(array); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllWith(array, values); - // $ExpectType TResult[] + // $ExpectType AbcObject[] _.pullAllWith(array, values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllWith(list); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllWith(list, values); - // $ExpectType ArrayLike + // $ExpectType ArrayLike _.pullAllWith(list, values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllWith(); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllWith(values); - // $ExpectType LoDashImplicitWrapper + // $ExpectType LoDashImplicitWrapper _(array).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllWith(); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllWith(values); - // $ExpectType LoDashImplicitWrapper> + // $ExpectType LoDashImplicitWrapper> _(list).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllWith(); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllWith(values); - // $ExpectType LoDashExplicitWrapper + // $ExpectType LoDashExplicitWrapper _.chain(array).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllWith(); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllWith(values); - // $ExpectType LoDashExplicitWrapper> + // $ExpectType LoDashExplicitWrapper> _.chain(list).pullAllWith(values, (a, b) => { - a; // $ExpectType TResult - b; // $ExpectType TResult + a; // $ExpectType AbcObject + b; // $ExpectType AbcObject return true; }); @@ -2110,94 +2110,94 @@ namespace TestPullAt { // _.remove namespace TestRemove { - let array: TResult[] = []; - let list: _.List = []; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] = []; + let list: _.List = []; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.remove(array); - result = _.remove(array, predicateFn); - result = _.remove(array, ''); + result = _.remove(array); + result = _.remove(array, predicateFn); + result = _.remove(array, ''); result = _.remove(array, {a: 42}); - result = _.remove(list); - result = _.remove(list, predicateFn); - result = _.remove(list, ''); + result = _.remove(list); + result = _.remove(list, predicateFn); + result = _.remove(list, ''); result = _.remove(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).remove(); result = _(array).remove(predicateFn); result = _(array).remove(''); result = _(array).remove({a: 42}); - result = _(list).remove(); - result = _(list).remove(predicateFn); - result = _(list).remove(''); + result = _(list).remove(); + result = _(list).remove(predicateFn); + result = _(list).remove(''); result = _(list).remove({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().remove(); result = _(array).chain().remove(predicateFn); result = _(array).chain().remove(''); result = _(array).chain().remove({a: 42}); - result = _(list).chain().remove(); - result = _(list).chain().remove(predicateFn); - result = _(list).chain().remove(''); + result = _(list).chain().remove(); + result = _(list).chain().remove(predicateFn); + result = _(list).chain().remove(''); result = _(list).chain().remove({a: 42}); } } // _.tail namespace TestTail { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.tail(array); - result = _.tail(list); + result = _.tail(array); + result = _.tail(list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).tail(); - result = _(list).tail(); + result = _(list).tail(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().tail(); - result = _(list).chain().tail(); + result = _(list).chain().tail(); } } // _.slice namespace TestSlice { - let array: TResult[] | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.slice(array); + result = _.slice(array); result = _.slice(array, 42); result = _.slice(array, 42, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).slice(); result = _(array).slice(42); @@ -2205,7 +2205,7 @@ namespace TestSlice { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().slice(); result = _(array).chain().slice(42); @@ -2399,386 +2399,386 @@ namespace TestSortedLastIndexBy { // _.take namespace TestTake { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.take(array); - result = _.take(array, 42); + result = _.take(array); + result = _.take(array, 42); - result = _.take(list); - result = _.take(list, 42); + result = _.take(list); + result = _.take(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).take(); result = _(array).take(42); - result = _(list).take(); - result = _(list).take(42); + result = _(list).take(); + result = _(list).take(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().take(); result = _(array).chain().take(42); - result = _(list).chain().take(); - result = _(list).chain().take(42); + result = _(list).chain().take(); + result = _(list).chain().take(42); } } // _.takeRight namespace TestTakeRight { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.takeRight(array); - result = _.takeRight(array, 42); + result = _.takeRight(array); + result = _.takeRight(array, 42); - result = _.takeRight(list); - result = _.takeRight(list, 42); + result = _.takeRight(list); + result = _.takeRight(list, 42); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).takeRight(); result = _(array).takeRight(42); - result = _(list).takeRight(); - result = _(list).takeRight(42); + result = _(list).takeRight(); + result = _(list).takeRight(42); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeRight(); result = _(array).chain().takeRight(42); - result = _(list).chain().takeRight(); - result = _(list).chain().takeRight(42); + result = _(list).chain().takeRight(); + result = _(list).chain().takeRight(42); } } // _.takeRightWhile namespace TestTakeRightWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.takeRightWhile(array); - result = _.takeRightWhile(array, predicateFn); - result = _.takeRightWhile(array, ''); + result = _.takeRightWhile(array); + result = _.takeRightWhile(array, predicateFn); + result = _.takeRightWhile(array, ''); result = _.takeRightWhile(array, {a: 42}); - result = _.takeRightWhile(list); - result = _.takeRightWhile(list, predicateFn); - result = _.takeRightWhile(list, ''); + result = _.takeRightWhile(list); + result = _.takeRightWhile(list, predicateFn); + result = _.takeRightWhile(list, ''); result = _.takeRightWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).takeRightWhile(); result = _(array).takeRightWhile(predicateFn); result = _(array).takeRightWhile(''); result = _(array).takeRightWhile({a: 42}); - result = _(list).takeRightWhile(); - result = _(list).takeRightWhile(predicateFn); - result = _(list).takeRightWhile(''); + result = _(list).takeRightWhile(); + result = _(list).takeRightWhile(predicateFn); + result = _(list).takeRightWhile(''); result = _(list).takeRightWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeRightWhile(); result = _(array).chain().takeRightWhile(predicateFn); result = _(array).chain().takeRightWhile(''); result = _(array).chain().takeRightWhile({a: 42}); - result = _(list).chain().takeRightWhile(); - result = _(list).chain().takeRightWhile(predicateFn); - result = _(list).chain().takeRightWhile(''); + result = _(list).chain().takeRightWhile(); + result = _(list).chain().takeRightWhile(predicateFn); + result = _(list).chain().takeRightWhile(''); result = _(list).chain().takeRightWhile({a: 42}); } } // _.takeWhile namespace TestTakeWhile { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let predicateFn = (value: TResult, index: number, collection: _.List) => true; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let predicateFn = (value: AbcObject, index: number, collection: _.List) => true; { - let result: TResult[]; + let result: AbcObject[]; - result = _.takeWhile(array); - result = _.takeWhile(array, predicateFn); - result = _.takeWhile(array, ''); + result = _.takeWhile(array); + result = _.takeWhile(array, predicateFn); + result = _.takeWhile(array, ''); result = _.takeWhile(array, {a: 42}); - result = _.takeWhile(list); - result = _.takeWhile(list, predicateFn); - result = _.takeWhile(list, ''); + result = _.takeWhile(list); + result = _.takeWhile(list, predicateFn); + result = _.takeWhile(list, ''); result = _.takeWhile(list, {a: 42}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).takeWhile(); result = _(array).takeWhile(predicateFn); result = _(array).takeWhile(''); result = _(array).takeWhile({a: 42}); - result = _(list).takeWhile(); - result = _(list).takeWhile(predicateFn); - result = _(list).takeWhile(''); + result = _(list).takeWhile(); + result = _(list).takeWhile(predicateFn); + result = _(list).takeWhile(''); result = _(list).takeWhile({a: 42}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeWhile(); result = _(array).chain().takeWhile(predicateFn); result = _(array).chain().takeWhile(''); result = _(array).chain().takeWhile({a: 42}); - result = _(list).chain().takeWhile(); - result = _(list).chain().takeWhile(predicateFn); - result = _(list).chain().takeWhile(''); + result = _(list).chain().takeWhile(); + result = _(list).chain().takeWhile(predicateFn); + result = _(list).chain().takeWhile(''); result = _(list).chain().takeWhile({a: 42}); } } // _.union namespace TestUnion { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.union(); + result = _.union(); - result = _.union(array); - result = _.union(array, list); - result = _.union(array, list, array); + result = _.union(array); + result = _.union(array, list); + result = _.union(array, list, array); - result = _.union(list); - result = _.union(list, array); - result = _.union(list, array, list); + result = _.union(list); + result = _.union(list, array); + result = _.union(list, array, list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).union(); result = _(array).union(list); result = _(array).union(list, array); - result = _(array).union(); - result = _(array).union(list); - result = _(array).union(list, array); + result = _(array).union(); + result = _(array).union(list); + result = _(array).union(list, array); - result = _(list).union(); - result = _(list).union(array); - result = _(list).union(array, list); + result = _(list).union(); + result = _(list).union(array); + result = _(list).union(array, list); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().union(); result = _(array).chain().union(list); result = _(array).chain().union(list, array); - result = _(array).chain().union(); - result = _(array).chain().union(list); - result = _(array).chain().union(list, array); + result = _(array).chain().union(); + result = _(array).chain().union(list); + result = _(array).chain().union(list, array); - result = _(list).chain().union(); - result = _(list).chain().union(array); - result = _(list).chain().union(array, list); + result = _(list).chain().union(); + result = _(list).chain().union(array); + result = _(list).chain().union(array, list); } } // _.unionBy namespace TestUnionBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let iteratee: (value: TResult) => any = (value: TResult) => 1; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let iteratee: (value: AbcObject) => any = (value: AbcObject) => 1; { - let result: TResult[]; + let result: AbcObject[]; - result = _.unionBy(array, array); - result = _.unionBy(array, list, array); - result = _.unionBy(array, array, list, array); - result = _.unionBy(array, list, array, list, array); - result = _.unionBy(array, array, list, array, list, array); + result = _.unionBy(array, array); + result = _.unionBy(array, list, array); + result = _.unionBy(array, array, list, array); + result = _.unionBy(array, list, array, list, array); + result = _.unionBy(array, array, list, array, list, array); - result = _.unionBy(array, array, iteratee); - result = _.unionBy(array, list, array, iteratee); - result = _.unionBy(array, array, list, array, iteratee); - result = _.unionBy(array, list, array, list, array, iteratee); - result = _.unionBy(array, array, list, array, list, array, iteratee); + result = _.unionBy(array, array, iteratee); + result = _.unionBy(array, list, array, iteratee); + result = _.unionBy(array, array, list, array, iteratee); + result = _.unionBy(array, list, array, list, array, iteratee); + result = _.unionBy(array, array, list, array, list, array, iteratee); - result = _.unionBy(array, array, 'a'); - result = _.unionBy(array, list, array, 'a'); - result = _.unionBy(array, array, list, array, 'a'); - result = _.unionBy(array, list, array, list, array, 'a'); - result = _.unionBy(array, array, list, array, list, array, 'a'); + result = _.unionBy(array, array, 'a'); + result = _.unionBy(array, list, array, 'a'); + result = _.unionBy(array, array, list, array, 'a'); + result = _.unionBy(array, list, array, list, array, 'a'); + result = _.unionBy(array, array, list, array, list, array, 'a'); result = _.unionBy(array, array, {a: 1}); result = _.unionBy(array, list, array, {a: 1}); result = _.unionBy(array, array, list, array, {a: 1}); result = _.unionBy(array, list, array, list, array, {a: 1}); - result = _.unionBy(array, list, array, list, array, list, {a: 1}); + result = _.unionBy(array, list, array, list, array, list, {a: 1}); - result = _.unionBy(list, list); - result = _.unionBy(list, array, list); - result = _.unionBy(list, list, array, list); - result = _.unionBy(list, array, list, array, list); - result = _.unionBy(list, list, array, list, array, list); + result = _.unionBy(list, list); + result = _.unionBy(list, array, list); + result = _.unionBy(list, list, array, list); + result = _.unionBy(list, array, list, array, list); + result = _.unionBy(list, list, array, list, array, list); - result = _.unionBy(list, list, iteratee); - result = _.unionBy(list, array, list, iteratee); - result = _.unionBy(list, list, array, list, iteratee); - result = _.unionBy(list, array, list, array, list, iteratee); - result = _.unionBy(list, list, array, list, array, list, iteratee); + result = _.unionBy(list, list, iteratee); + result = _.unionBy(list, array, list, iteratee); + result = _.unionBy(list, list, array, list, iteratee); + result = _.unionBy(list, array, list, array, list, iteratee); + result = _.unionBy(list, list, array, list, array, list, iteratee); - result = _.unionBy(list, list, 'a'); - result = _.unionBy(list, array, list, 'a'); - result = _.unionBy(list, list, array, list, 'a'); - result = _.unionBy(list, array, list, array, list, 'a'); - result = _.unionBy(list, list, array, list, array, list, 'a'); + result = _.unionBy(list, list, 'a'); + result = _.unionBy(list, array, list, 'a'); + result = _.unionBy(list, list, array, list, 'a'); + result = _.unionBy(list, array, list, array, list, 'a'); + result = _.unionBy(list, list, array, list, array, list, 'a'); result = _.unionBy(list, list, {a: 1}); result = _.unionBy(list, array, list, {a: 1}); result = _.unionBy(list, list, array, list, {a: 1}); result = _.unionBy(list, array, list, array, list, {a: 1}); - result = _.unionBy(list, array, list, array, list, array, {a: 1}); + result = _.unionBy(list, array, list, array, list, array, {a: 1}); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(array).unionBy(array); - result = _(array).unionBy(list, array); - result = _(array).unionBy(array, list, array); - result = _(array).unionBy(list, array, list, array); - result = _(array).unionBy(array, list, array, list, array); + result = _(array).unionBy(array); + result = _(array).unionBy(list, array); + result = _(array).unionBy(array, list, array); + result = _(array).unionBy(list, array, list, array); + result = _(array).unionBy(array, list, array, list, array); - result = _(array).unionBy(array, iteratee); - result = _(array).unionBy(list, array, iteratee); - result = _(array).unionBy(array, list, array, iteratee); - result = _(array).unionBy(list, array, list, array, iteratee); - result = _(array).unionBy(array, list, array, list, array, iteratee); + result = _(array).unionBy(array, iteratee); + result = _(array).unionBy(list, array, iteratee); + result = _(array).unionBy(array, list, array, iteratee); + result = _(array).unionBy(list, array, list, array, iteratee); + result = _(array).unionBy(array, list, array, list, array, iteratee); - result = _(array).unionBy(array, 'a'); - result = _(array).unionBy(list, array, 'a'); - result = _(array).unionBy(array, list, array, 'a'); - result = _(array).unionBy(list, array, list, array, 'a'); - result = _(array).unionBy(array, list, array, list, array, 'a'); + result = _(array).unionBy(array, 'a'); + result = _(array).unionBy(list, array, 'a'); + result = _(array).unionBy(array, list, array, 'a'); + result = _(array).unionBy(list, array, list, array, 'a'); + result = _(array).unionBy(array, list, array, list, array, 'a'); result = _(array).unionBy(array, {a: 1}); result = _(array).unionBy(list, array, {a: 1}); result = _(array).unionBy(array, list, array, {a: 1}); result = _(array).unionBy(list, array, list, array, {a: 1}); - result = _(array).unionBy(list, array, list, array, list, {a: 1}); + result = _(array).unionBy(list, array, list, array, list, {a: 1}); - result = _(list).unionBy(list); - result = _(list).unionBy(array, list); - result = _(list).unionBy(list, array, list); - result = _(list).unionBy(array, list, array, list); - result = _(list).unionBy(list, array, list, array, list); + result = _(list).unionBy(list); + result = _(list).unionBy(array, list); + result = _(list).unionBy(list, array, list); + result = _(list).unionBy(array, list, array, list); + result = _(list).unionBy(list, array, list, array, list); - result = _(list).unionBy(list, iteratee); - result = _(list).unionBy(array, list, iteratee); - result = _(list).unionBy(list, array, list, iteratee); - result = _(list).unionBy(array, list, array, list, iteratee); - result = _(list).unionBy(list, array, list, array, list, iteratee); + result = _(list).unionBy(list, iteratee); + result = _(list).unionBy(array, list, iteratee); + result = _(list).unionBy(list, array, list, iteratee); + result = _(list).unionBy(array, list, array, list, iteratee); + result = _(list).unionBy(list, array, list, array, list, iteratee); - result = _(list).unionBy(list, 'a'); - result = _(list).unionBy(array, list, 'a'); - result = _(list).unionBy(list, array, list, 'a'); - result = _(list).unionBy(array, list, array, list, 'a'); - result = _(list).unionBy(list, array, list, array, list, 'a'); + result = _(list).unionBy(list, 'a'); + result = _(list).unionBy(array, list, 'a'); + result = _(list).unionBy(list, array, list, 'a'); + result = _(list).unionBy(array, list, array, list, 'a'); + result = _(list).unionBy(list, array, list, array, list, 'a'); result = _(list).unionBy(list, {a: 1}); result = _(list).unionBy(array, list, {a: 1}); result = _(list).unionBy(list, array, list, {a: 1}); result = _(list).unionBy(array, list, array, list, {a: 1}); - result = _(list).unionBy(array, list, array, list, array, {a: 1}); + result = _(list).unionBy(array, list, array, list, array, {a: 1}); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; - result = _(array).chain().unionBy(array); - result = _(array).chain().unionBy(list, array); - result = _(array).chain().unionBy(array, list, array); - result = _(array).chain().unionBy(list, array, list, array); - result = _(array).chain().unionBy(array, list, array, list, array); + result = _(array).chain().unionBy(array); + result = _(array).chain().unionBy(list, array); + result = _(array).chain().unionBy(array, list, array); + result = _(array).chain().unionBy(list, array, list, array); + result = _(array).chain().unionBy(array, list, array, list, array); - result = _(array).chain().unionBy(array, iteratee); - result = _(array).chain().unionBy(list, array, iteratee); - result = _(array).chain().unionBy(array, list, array, iteratee); - result = _(array).chain().unionBy(list, array, list, array, iteratee); - result = _(array).chain().unionBy(array, list, array, list, array, iteratee); + result = _(array).chain().unionBy(array, iteratee); + result = _(array).chain().unionBy(list, array, iteratee); + result = _(array).chain().unionBy(array, list, array, iteratee); + result = _(array).chain().unionBy(list, array, list, array, iteratee); + result = _(array).chain().unionBy(array, list, array, list, array, iteratee); - result = _(array).chain().unionBy(array, 'a'); - result = _(array).chain().unionBy(list, array, 'a'); - result = _(array).chain().unionBy(array, list, array, 'a'); - result = _(array).chain().unionBy(list, array, list, array, 'a'); - result = _(array).chain().unionBy(array, list, array, list, array, 'a'); + result = _(array).chain().unionBy(array, 'a'); + result = _(array).chain().unionBy(list, array, 'a'); + result = _(array).chain().unionBy(array, list, array, 'a'); + result = _(array).chain().unionBy(list, array, list, array, 'a'); + result = _(array).chain().unionBy(array, list, array, list, array, 'a'); result = _(array).chain().unionBy(array, {a: 1}); result = _(array).chain().unionBy(list, array, {a: 1}); result = _(array).chain().unionBy(array, list, array, {a: 1}); result = _(array).chain().unionBy(list, array, list, array, {a: 1}); - result = _(array).chain().unionBy(list, array, list, array, list, {a: 1}); + result = _(array).chain().unionBy(list, array, list, array, list, {a: 1}); - result = _(list).chain().unionBy(list); - result = _(list).chain().unionBy(array, list); - result = _(list).chain().unionBy(list, array, list); - result = _(list).chain().unionBy(array, list, array, list); - result = _(list).chain().unionBy(list, array, list, array, list); + result = _(list).chain().unionBy(list); + result = _(list).chain().unionBy(array, list); + result = _(list).chain().unionBy(list, array, list); + result = _(list).chain().unionBy(array, list, array, list); + result = _(list).chain().unionBy(list, array, list, array, list); - result = _(list).chain().unionBy(list, iteratee); - result = _(list).chain().unionBy(array, list, iteratee); - result = _(list).chain().unionBy(list, array, list, iteratee); - result = _(list).chain().unionBy(array, list, array, list, iteratee); - result = _(list).chain().unionBy(list, array, list, array, list, iteratee); + result = _(list).chain().unionBy(list, iteratee); + result = _(list).chain().unionBy(array, list, iteratee); + result = _(list).chain().unionBy(list, array, list, iteratee); + result = _(list).chain().unionBy(array, list, array, list, iteratee); + result = _(list).chain().unionBy(list, array, list, array, list, iteratee); - result = _(list).chain().unionBy(list, 'a'); - result = _(list).chain().unionBy(array, list, 'a'); - result = _(list).chain().unionBy(list, array, list, 'a'); - result = _(list).chain().unionBy(array, list, array, list, 'a'); - result = _(list).chain().unionBy(list, array, list, array, list, 'a'); + result = _(list).chain().unionBy(list, 'a'); + result = _(list).chain().unionBy(array, list, 'a'); + result = _(list).chain().unionBy(list, array, list, 'a'); + result = _(list).chain().unionBy(array, list, array, list, 'a'); + result = _(list).chain().unionBy(list, array, list, array, list, 'a'); result = _(list).chain().unionBy(list, {a: 1}); result = _(list).chain().unionBy(array, list, {a: 1}); result = _(list).chain().unionBy(list, array, list, {a: 1}); result = _(list).chain().unionBy(array, list, array, list, {a: 1}); - result = _(list).chain().unionBy(array, list, array, list, array, {a: 1}); + result = _(list).chain().unionBy(array, list, array, list, array, {a: 1}); } } @@ -3008,11 +3008,11 @@ namespace TestUnzip { 2: {0: true, 1: false, length: 2}, length: 3 }; - let nilArray: TResult[][] | null | undefined = [] as any; - let nilList: _.List<_.List> | null | undefined = [] as any; + let nilArray: AbcObject[][] | null | undefined = [] as any; + let nilList: _.List<_.List> | null | undefined = [] as any; { - let result: TResult[][]; + let result: AbcObject[][]; result = _.unzip(nilArray); result = _.unzip(nilList); @@ -3055,47 +3055,47 @@ namespace TestUnzip { } { - let result: TResult[]; + let result: AbcObject[]; result = _.unzipWith(testUnzipWithArray, (...group) => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }); result = _.unzipWith(testUnzipWithArray, (value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }); result = _.unzipWith(testUnzipWithList, (...group) => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }); result = _.unzipWith(testUnzipWithList, (value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }); - result = _(testUnzipWithArray).unzipWith((...group): TResult => { + result = _(testUnzipWithArray).unzipWith((...group): AbcObject => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }).value(); result = _(testUnzipWithArray).unzipWith((value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }).value(); - result = _(testUnzipWithList).unzipWith((...group): TResult => { + result = _(testUnzipWithList).unzipWith((...group): AbcObject => { group; // $ExpectType number[] - return any as TResult; + return anything as AbcObject; }).value(); result = _(testUnzipWithList).unzipWith((value1, value2, value3) => { value1; // $ExpectType number value2; // $ExpectType number value3; // $ExpectType number - return any as TResult; + return anything as AbcObject; }).value(); } } @@ -3149,83 +3149,100 @@ namespace TestWithout { // _.xor namespace TestXor { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[]; + let result: AbcObject[]; - result = _.xor(); + result = _.xor(); - result = _.xor(array); - result = _.xor(array, list); - result = _.xor(array, list, array); + result = _.xor(array); + result = _.xor(array, list); + result = _.xor(array, list, array); - result = _.xor(list); - result = _.xor(list, array); - result = _.xor(list, array, list); + result = _.xor(list); + result = _.xor(list, array); + result = _.xor(list, array, list); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).xor(); result = _(array).xor(list); result = _(array).xor(list, array); - result = _(list).xor(); - result = _(list).xor(array); - result = _(list).xor(array, list); + result = _(list).xor(); + result = _(list).xor(array); + result = _(list).xor(array, list); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().xor(); result = _(array).chain().xor(list); result = _(array).chain().xor(list, array); - result = _(list).chain().xor(); - result = _(list).chain().xor(array); - result = _(list).chain().xor(array, list); + result = _(list).chain().xor(); + result = _(list).chain().xor(array); + result = _(list).chain().xor(array, list); } } // _.zip -namespace TestZip { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; +{ + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; { - let result: TResult[][]; + // $ExpectType (AbcObject | undefined)[][] + _.zip(array); + // $ExpectType (AbcObject | undefined)[][] + _.zip(array, list); + // $ExpectType (AbcObject | undefined)[][] + _.zip(array, list, array); - result = _.zip(array); - result = _.zip(array, list); - result = _.zip(array, list, array); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list, array); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list, array, list); - result = _.zip(list); - result = _.zip(list, array); - result = _.zip(list, array, list); + // $ExpectType (AbcObject | undefined)[][] + _.zip(list, array, list, array, list, array); } { - let result: _.LoDashImplicitArrayWrapper; + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(array).zip(list); + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(array).zip(list, array); - result = _(array).zip(list); - result = _(array).zip(list, array); - - result = _(list).zip(array); - result = _(list).zip(array, list); + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(list).zip(array); + // $ExpectType LoDashImplicitWrapper<(AbcObject | undefined)[][]> + _(list).zip(array, list); } { - let result: _.LoDashExplicitArrayWrapper; + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(array).chain().zip(list); + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(array).chain().zip(list, array); - result = _(array).chain().zip(list); - result = _(array).chain().zip(list, array); + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(list).chain().zip(array); + // $ExpectType LoDashExplicitWrapper<(AbcObject | undefined)[][]> + _(list).chain().zip(array, list); + } - result = _(list).chain().zip(array); - result = _(list).chain().zip(array, list); + { + _.zip([1, 2], [3, 4]); // $ExpectType [number | undefined, number | undefined][] + _.zip([1, 2], ["a", "b"]); // $ExpectType [number | undefined, string | undefined][] + _.zip([1, 2], ["a", "b"], [true, false]); // $ExpectType [number | undefined, string | undefined, boolean | undefined][] } } @@ -3359,18 +3376,9 @@ namespace TestZipObject { } // _.zipWith -namespace TestZipWith { +{ type TestZipWithFn = (a1: number, a2: number) => number; - { - let result: number[][]; - result = _.zipWith([1, 2]); - result = _.zipWith([1, 2], [3, 4], [5, 6]); - result = _([1, 2]).zipWith().value(); - result = _([1, 2]).zipWith([3, 4], [5, 6]).value(); - result = _.chain([1, 2]).zipWith().value(); - result = _.chain([1, 2]).zipWith([3, 4], [5, 6]).value(); - } { let result: number[]; @@ -3511,6 +3519,19 @@ namespace TestZipWith { group; // $ExpectType number[] return 1; }).value(); + + result = _([1, 2]).zipWith(["a", "b"], (value1, value2) => { + value1; // $ExpectType number + value2; // $ExpectType string + return 1; + }).value(); + + result = _([1, 2]).zipWith(["a", "b"], [true, false], (value1, value2, value3) => { + value1; // $ExpectType number + value2; // $ExpectType string + value3; // $ExpectType boolean + return 1; + }).value(); } } @@ -3754,139 +3775,137 @@ namespace TestCommit { // _.prototype.concat namespace TestConcat { - { - let result: _.LoDashImplicitArrayWrapper; + const numberROA: ReadonlyArray = [0]; - result = _(1).concat(2); - result = _(1).concat(2, 3); - result = _(1).concat(2, 3, 4); + _.concat(1); // $ExpectType number[] + _.concat([1]); // $ExpectType number[] + _.concat(numberROA); // $ExpectType number[] + _.concat(1, 2); // $ExpectType number[] + _.concat(1, [1]); // $ExpectType number[] + _.concat(1, [1], numberROA); // $ExpectType number[] - result = _(1).concat(2); - result = _(1).concat(2, 3); - result = _(1).concat(2, 3, 4); - } + _(1).concat(2); // $ExpectType LoDashImplicitWrapper + _(1).concat([1]); // $ExpectType LoDashImplicitWrapper + _(1).concat([2], numberROA); // $ExpectType LoDashImplicitWrapper + _([1]).concat(2); // $ExpectType LoDashImplicitWrapper + _(numberROA).concat(numberROA); // $ExpectType LoDashImplicitWrapper + _(numberROA).concat(numberROA, numberROA); // $ExpectType LoDashImplicitWrapper - { - let result: _.LoDashImplicitArrayWrapper; + _.chain(1).concat(2); // $ExpectType LoDashExplicitWrapper + _.chain(1).concat([1]); // $ExpectType LoDashExplicitWrapper + _.chain(1).concat([2], numberROA); // $ExpectType LoDashExplicitWrapper + _.chain([1]).concat(2); // $ExpectType LoDashExplicitWrapper + _.chain(numberROA).concat(numberROA); // $ExpectType LoDashExplicitWrapper + _.chain(numberROA).concat(numberROA, numberROA); // $ExpectType LoDashExplicitWrapper - result = _(['']).concat(['']); - result = _(['']).concat([''], ['']); - result = _(['']).concat([''], [''], ['']); + const stringROA: ReadonlyArray = ['']; - result = _(['']).concat(['']); - result = _(['']).concat([''], ['']); - result = _(['']).concat([''], [''], ['']); - } + _.concat('a'); // $ExpectType string[] + _.concat(['a']); // $ExpectType string[] + _.concat(stringROA); // $ExpectType string[] + _.concat('a', 'b'); // $ExpectType string[] + _.concat('a', ['a']); // $ExpectType string[] + _.concat('a', ['a'], stringROA); // $ExpectType string[] - { - let result: _.LoDashImplicitArrayWrapper<{a: string}>; + _('a').concat('b'); // $ExpectType LoDashImplicitWrapper + _('a').concat(['a']); // $ExpectType LoDashImplicitWrapper + _('a').concat(['b'], stringROA); // $ExpectType LoDashImplicitWrapper + _(['a']).concat('b'); // $ExpectType LoDashImplicitWrapper + _(stringROA).concat(stringROA); // $ExpectType LoDashImplicitWrapper + _(stringROA).concat(stringROA, stringROA); // $ExpectType LoDashImplicitWrapper - result = _({a: ''}).concat<{a: string}>({a: ''}); - result = _({a: ''}).concat<{a: string}>({a: ''}, {a: ''}); - result = _({a: ''}).concat<{a: string}>({a: ''}, {a: ''}, {a: ''}); + _.chain('a').concat('b'); // $ExpectType LoDashExplicitWrapper + _.chain('a').concat(['a']); // $ExpectType LoDashExplicitWrapper + _.chain('a').concat(['b'], stringROA); // $ExpectType LoDashExplicitWrapper + _.chain(['a']).concat('b'); // $ExpectType LoDashExplicitWrapper + _.chain(stringROA).concat(stringROA); // $ExpectType LoDashExplicitWrapper + _.chain(stringROA).concat(stringROA, stringROA); // $ExpectType LoDashExplicitWrapper - result = _({a: ''}).concat({a: ''}); - result = _({a: ''}).concat({a: ''}, {a: ''}); - result = _({a: ''}).concat({a: ''}, {a: ''}, {a: ''}); - } + const abcObject: AbcObject = { a: 1, b: 'foo', c: true }; + const objectROA: ReadonlyArray = [{ a: 1, b: 'foo', c: true }]; - { - let result: _.LoDashExplicitArrayWrapper; + _.concat(abcObject); // $ExpectType AbcObject[] + _.concat([abcObject]); // $ExpectType AbcObject[] + _.concat(objectROA); // $ExpectType AbcObject[] + _.concat(abcObject, abcObject); // $ExpectType AbcObject[] + _.concat(abcObject, [abcObject]); // $ExpectType AbcObject[] + _.concat(abcObject, [abcObject], objectROA); // $ExpectType AbcObject[] - result = _(1).chain().concat(2); - result = _(1).chain().concat(2, 3); - result = _(1).chain().concat(2, 3, 4); + _(abcObject).concat(abcObject); // $ExpectType LoDashImplicitWrapper + _(abcObject).concat([abcObject]); // $ExpectType LoDashImplicitWrapper + _(abcObject).concat([abcObject], objectROA); // $ExpectType LoDashImplicitWrapper + _([abcObject]).concat(abcObject); // $ExpectType LoDashImplicitWrapper + _(objectROA).concat(objectROA); // $ExpectType LoDashImplicitWrapper + _(objectROA).concat(objectROA, objectROA); // $ExpectType LoDashImplicitWrapper - result = _(1).chain().concat(2); - result = _(1).chain().concat(2, 3); - result = _(1).chain().concat(2, 3, 4); - } - - { - let result: _.LoDashExplicitArrayWrapper; - - result = _(['']).chain().concat(['']); - result = _(['']).chain().concat([''], ['']); - result = _(['']).chain().concat([''], [''], ['']); - - result = _(['']).chain().concat(['']); - result = _(['']).chain().concat([''], ['']); - result = _(['']).chain().concat([''], [''], ['']); - } - - { - let result: _.LoDashExplicitArrayWrapper<{a: string}>; - - result = _({a: ''}).chain().concat<{a: string}>({a: ''}); - result = _({a: ''}).chain().concat<{a: string}>({a: ''}, {a: ''}); - result = _({a: ''}).chain().concat<{a: string}>({a: ''}, {a: ''}, {a: ''}); - - result = _({a: ''}).chain().concat({a: ''}); - result = _({a: ''}).chain().concat({a: ''}, {a: ''}); - result = _({a: ''}).chain().concat({a: ''}, {a: ''}, {a: ''}); - } + _.chain(abcObject).concat(abcObject); // $ExpectType LoDashExplicitWrapper + _.chain(abcObject).concat([abcObject]); // $ExpectType LoDashExplicitWrapper + _.chain(abcObject).concat([abcObject], objectROA); // $ExpectType LoDashExplicitWrapper + _.chain([abcObject]).concat(abcObject); // $ExpectType LoDashExplicitWrapper + _.chain(objectROA).concat(objectROA); // $ExpectType LoDashExplicitWrapper + _.chain(objectROA).concat(objectROA, objectROA); // $ExpectType LoDashExplicitWrapper } // _.prototype.plant namespace TestPlant { { let result: _.LoDashImplicitWrapper; - result = _(any).plant(42); + result = _(anything).plant(42); } { let result: _.LoDashImplicitStringWrapper; - result = _(any).plant(''); + result = _(anything).plant(''); } { let result: _.LoDashImplicitWrapper; - result = _(any).plant(true); + result = _(anything).plant(true); } { let result: _.LoDashImplicitNumberArrayWrapper; - result = _(any).plant([42]); + result = _(anything).plant([42]); } { let result: _.LoDashImplicitArrayWrapper; - result = _(any).plant([]); + result = _(anything).plant([]); } { let result: _.LoDashImplicitWrapper<{}>; - result = _(any).plant<{}>({}); + result = _(anything).plant<{}>({}); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().plant(42); + result = _(anything).chain().plant(42); } { let result: _.LoDashExplicitStringWrapper; - result = _(any).chain().plant(''); + result = _(anything).chain().plant(''); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().plant(true); + result = _(anything).chain().plant(true); } { let result: _.LoDashExplicitNumberArrayWrapper; - result = _(any).chain().plant([42]); + result = _(anything).chain().plant([42]); } { let result: _.LoDashExplicitArrayWrapper; - result = _(any).chain().plant([]); + result = _(anything).chain().plant([]); } { let result: _.LoDashExplicitWrapper<{}>; - result = _(any).chain().plant<{}>({}); + result = _(anything).chain().plant<{}>({}); } } @@ -4040,47 +4059,47 @@ namespace TestValueOf { // _.at namespace TestAt { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; - let dictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; + let dictionary: _.Dictionary | null | undefined = anything; { - let result: TResult[]; + let result: AbcObject[]; - result = _.at(array, 0, '1', [2], ['3'], [4, '5']); - result = _.at(list, 0, '1', [2], ['3'], [4, '5']); - result = _.at(dictionary, 0, '1', [2], ['3'], [4, '5']); + result = _.at(array, 0, '1', [2], ['3'], [4, '5']); + result = _.at(list, 0, '1', [2], ['3'], [4, '5']); + result = _.at(dictionary, 0, '1', [2], ['3'], [4, '5']); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).at(0, '1', [2], ['3'], [4, '5']); - result = _(list).at(0, '1', [2], ['3'], [4, '5']); - result = _(dictionary).at(0, '1', [2], ['3'], [4, '5']); + result = _(list).at(0, '1', [2], ['3'], [4, '5']); + result = _(dictionary).at(0, '1', [2], ['3'], [4, '5']); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().at(0, '1', [2], ['3'], [4, '5']); - result = _(list).chain().at(0, '1', [2], ['3'], [4, '5']); - result = _(dictionary).chain().at(0, '1', [2], ['3'], [4, '5']); + result = _(list).chain().at(0, '1', [2], ['3'], [4, '5']); + result = _(dictionary).chain().at(0, '1', [2], ['3'], [4, '5']); } } // _.countBy namespace TestCountBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; - let numericDictionary: _.NumericDictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; + let numericDictionary: _.NumericDictionary | null | undefined = obj; let stringIterator: (value: string, index: number, collection: string) => any = (value: string, index: number, collection: string) => 1; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; - let numericDictionaryIterator: (value: TResult, key: number, collection: _.NumericDictionary) => any = (value: TResult, key: number, collection: _.NumericDictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; + let numericDictionaryIterator: (value: AbcObject, key: number, collection: _.NumericDictionary) => any = (value: AbcObject, key: number, collection: _.NumericDictionary) => 1; { let result: _.Dictionary; @@ -4088,29 +4107,29 @@ namespace TestCountBy { result = _.countBy(''); result = _.countBy('', stringIterator); - result = _.countBy(array); - result = _.countBy(array, listIterator); - result = _.countBy(array, ''); + result = _.countBy(array); + result = _.countBy(array, listIterator); + result = _.countBy(array, ''); result = _.countBy(array, {a: 42}); - result = _.countBy(array, {a: 42}); + result = _.countBy(array, {a: 42}); - result = _.countBy(list); - result = _.countBy(list, listIterator); - result = _.countBy(list, ''); + result = _.countBy(list); + result = _.countBy(list, listIterator); + result = _.countBy(list, ''); result = _.countBy(list, {a: 42}); - result = _.countBy(list, {a: 42}); + result = _.countBy(list, {a: 42}); - result = _.countBy(dictionary); + result = _.countBy(dictionary); result = _.countBy(dictionary, dictionaryIterator); - result = _.countBy(dictionary, ''); + result = _.countBy(dictionary, ''); result = _.countBy(dictionary, {a: 42}); - result = _.countBy(dictionary, {a: 42}); + result = _.countBy(dictionary, {a: 42}); - result = _.countBy(numericDictionary); - result = _.countBy(numericDictionary, numericDictionaryIterator); - result = _.countBy(numericDictionary, ''); + result = _.countBy(numericDictionary); + result = _.countBy(numericDictionary, numericDictionaryIterator); + result = _.countBy(numericDictionary, ''); result = _.countBy(numericDictionary, {a: 42}); - result = _.countBy(numericDictionary, {a: 42}); + result = _.countBy(numericDictionary, {a: 42}); } { @@ -4126,7 +4145,7 @@ namespace TestCountBy { result = _(array).countBy({a: 42}); result = _(list).countBy(); - result = _(list).countBy(listIterator); + result = _(list).countBy(listIterator); result = _(list).countBy(''); result = _(list).countBy<{a: number}>({a: 42}); result = _(list).countBy({a: 42}); @@ -4138,7 +4157,7 @@ namespace TestCountBy { result = _(dictionary).countBy({a: 42}); result = _(numericDictionary).countBy(); - result = _(numericDictionary).countBy(numericDictionaryIterator); + result = _(numericDictionary).countBy(numericDictionaryIterator); result = _(numericDictionary).countBy(''); result = _(numericDictionary).countBy<{a: number}>({a: 42}); result = _(numericDictionary).countBy({a: 42}); @@ -4157,7 +4176,7 @@ namespace TestCountBy { result = _(array).chain().countBy({a: 42}); result = _(list).chain().countBy(); - result = _(list).chain().countBy(listIterator); + result = _(list).chain().countBy(listIterator); result = _(list).chain().countBy(''); result = _(list).chain().countBy<{a: number}>({a: 42}); result = _(list).chain().countBy({a: 42}); @@ -4169,7 +4188,7 @@ namespace TestCountBy { result = _(dictionary).chain().countBy({a: 42}); result = _(numericDictionary).chain().countBy(); - result = _(numericDictionary).chain().countBy(numericDictionaryIterator); + result = _(numericDictionary).chain().countBy(numericDictionaryIterator); result = _(numericDictionary).chain().countBy(''); result = _(numericDictionary).chain().countBy<{a: number}>({a: 42}); result = _(numericDictionary).chain().countBy({a: 42}); @@ -4178,16 +4197,16 @@ namespace TestCountBy { // _.each namespace TestEach { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; let stringIterator: (char: string, index: number, string: string) => any = (char: string, index: number, string: string) => 1; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; { let result: string; @@ -4202,37 +4221,37 @@ namespace TestEach { } { - let result: TResult[]; + let result: AbcObject[]; result = _.each(array, listIterator); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; result = _.each(nilArray, listIterator); } { - let result: _.List; + let result: _.List; result = _.each(list, listIterator); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.each(nilList, listIterator); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.each(dictionary, dictionaryIterator); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.each(nilDictionary, dictionaryIterator); } @@ -4244,19 +4263,19 @@ namespace TestEach { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).each(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).each(listIterator); + result = _(list).each(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).each(dictionaryIterator); } @@ -4268,19 +4287,19 @@ namespace TestEach { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().each(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().each(listIterator); + result = _(list).chain().each(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().each(dictionaryIterator); } @@ -4288,16 +4307,16 @@ namespace TestEach { // _.eachRight namespace TestEachRight { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; let stringIterator: (char: string, index: number, string: string) => any = (char: string, index: number, string: string) => 1; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; { let result: string; @@ -4312,37 +4331,37 @@ namespace TestEachRight { } { - let result: TResult[]; + let result: AbcObject[]; result = _.eachRight(array, listIterator); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; result = _.eachRight(nilArray, listIterator); } { - let result: _.List; + let result: _.List; result = _.eachRight(list, listIterator); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.eachRight(nilList, listIterator); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.eachRight(dictionary, dictionaryIterator); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.eachRight(nilDictionary, dictionaryIterator); } @@ -4354,19 +4373,19 @@ namespace TestEachRight { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).eachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).eachRight(listIterator); + result = _(list).eachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).eachRight(dictionaryIterator); } @@ -4378,19 +4397,19 @@ namespace TestEachRight { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().eachRight(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().eachRight(listIterator); + result = _(list).chain().eachRight(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().eachRight(dictionaryIterator); } @@ -4493,14 +4512,14 @@ namespace TestEvery { // _.filter namespace TestFilter { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; let stringIterator = (char: string, index: number, string: string) => true; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; { let result: string[]; @@ -4509,17 +4528,17 @@ namespace TestFilter { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.filter(array, listIterator); - result = _.filter(array, ''); - result = _.filter(array, {a: 42}); - result = _.filter(array, ["a", 42]); + result = _.filter(array, listIterator); + result = _.filter(array, ''); + result = _.filter(array, {a: 42}); + result = _.filter(array, ["a", 42]); - result = _.filter(list, listIterator); - result = _.filter(list, ''); - result = _.filter(list, {a: 42}); - result = _.filter(list, ["a", 42]); + result = _.filter(list, listIterator); + result = _.filter(list, ''); + result = _.filter(list, {a: 42}); + result = _.filter(list, ["a", 42]); result = _.filter(dictionary, dictionaryIterator); result = _.filter(dictionary, ''); @@ -4534,17 +4553,17 @@ namespace TestFilter { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).filter(listIterator); result = _(array).filter(''); result = _(array).filter({a: 42}); result = _(array).filter(["a", 42]); - result = _(list).filter(listIterator); - result = _(list).filter(''); - result = _(list).filter({a: 42}); - result = _(list).filter(["a", 42]); + result = _(list).filter(listIterator); + result = _(list).filter(''); + result = _(list).filter({a: 42}); + result = _(list).filter(["a", 42]); result = _(dictionary).filter(dictionaryIterator); result = _(dictionary).filter(''); @@ -4559,17 +4578,17 @@ namespace TestFilter { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().filter(listIterator); result = _(array).chain().filter(''); result = _(array).chain().filter({a: 42}); result = _(array).chain().filter(["a", 42]); - result = _(list).chain().filter(listIterator); - result = _(list).chain().filter(''); - result = _(list).chain().filter({a: 42}); - result = _(list).chain().filter(["a", 42]); + result = _(list).chain().filter(listIterator); + result = _(list).chain().filter(''); + result = _(list).chain().filter({a: 42}); + result = _(list).chain().filter(["a", 42]); result = _(dictionary).chain().filter(dictionaryIterator); result = _(dictionary).chain().filter(''); @@ -4579,8 +4598,8 @@ namespace TestFilter { { // Test filtering with type guard - let a2: Array | null | undefined = any; - let d2: _.Dictionary | null | undefined = any; + let a2: Array | null | undefined = anything; + let d2: _.Dictionary | null | undefined = anything; _.filter(a2, (item: string | number): item is number => typeof item === "number"); // $ExpectType number[] _.filter(d2, (item: string | number): item is number => typeof item === "number"); // $ExpectType number[] @@ -4593,35 +4612,35 @@ namespace TestFilter { // _.find namespace TestFind { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - let result: TResult | undefined; + let result: AbcObject | undefined; result = _.find(array); - result = _.find(array); - result = _.find(array, listIterator); - result = _.find(array, listIterator, 1); - result = _.find(array, ''); - result = _.find(array, '', 1); - result = _.find(array, {a: 42}); - result = _.find(array, {a: 42}, 1); + result = _.find(array); + result = _.find(array, listIterator); + result = _.find(array, listIterator, 1); + result = _.find(array, ''); + result = _.find(array, '', 1); + result = _.find(array, {a: 42}); + result = _.find(array, {a: 42}, 1); result = _.find(array, ['a', 5]); result = _.find(array, ['a', 5], 1); result = _.find(list); - result = _.find(list); - result = _.find(list, listIterator); - result = _.find(list, listIterator, 1); - result = _.find(list, ''); - result = _.find(list, '', 1); - result = _.find(list, {a: 42}); - result = _.find(list, {a: 42}, 1); + result = _.find(list); + result = _.find(list, listIterator); + result = _.find(list, listIterator, 1); + result = _.find(list, ''); + result = _.find(list, '', 1); + result = _.find(list, {a: 42}); + result = _.find(list, {a: 42}, 1); result = _.find(list, ['a', 5]); result = _.find(list, ['a', 5], 1); @@ -4646,15 +4665,15 @@ namespace TestFind { result = _(array).find(['a', 5]); result = _(array).find(['a', 5], 1); - result = _(list).find(); - result = _(list).find(listIterator); - result = _(list).find(listIterator, 1); - result = _(list).find(''); - result = _(list).find('', 1); - result = _(list).find({a: 42}); - result = _(list).find({a: 42}, 1); - result = _(list).find(['a', 5]); - result = _(list).find(['a', 5], 1); + result = _(list).find(); + result = _(list).find(listIterator); + result = _(list).find(listIterator, 1); + result = _(list).find(''); + result = _(list).find('', 1); + result = _(list).find({a: 42}); + result = _(list).find({a: 42}, 1); + result = _(list).find(['a', 5]); + result = _(list).find(['a', 5], 1); result = _(dictionary).find(); result = _(dictionary).find(dictionaryIterator); @@ -4666,41 +4685,41 @@ namespace TestFind { result = _(dictionary).find(['a', 5]); result = _(dictionary).find(['a', 5], 1); - result = _.find([any as TResult, null, undefined], (value: TResult | null | undefined): value is TResult | undefined => value !== null); - result = _([any as TResult, null, undefined]).find((value: TResult | null | undefined): value is TResult | undefined => value !== null); + result = _.find([anything as AbcObject, null, undefined], (value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); + result = _([anything as AbcObject, null, undefined]).find((value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); } // _.findLast namespace TestFindLast { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - let result: TResult | undefined; + let result: AbcObject | undefined; result = _.findLast(array); - result = _.findLast(array); - result = _.findLast(array, listIterator); - result = _.findLast(array, listIterator, 1); - result = _.findLast(array, ''); - result = _.findLast(array, '', 1); - result = _.findLast(array, {a: 42}); - result = _.findLast(array, {a: 42}, 1); + result = _.findLast(array); + result = _.findLast(array, listIterator); + result = _.findLast(array, listIterator, 1); + result = _.findLast(array, ''); + result = _.findLast(array, '', 1); + result = _.findLast(array, {a: 42}); + result = _.findLast(array, {a: 42}, 1); result = _.findLast(array, ['a', 5]); result = _.findLast(array, ['a', 5], 1); result = _.findLast(list); - result = _.findLast(list); - result = _.findLast(list, listIterator); - result = _.findLast(list, listIterator, 1); - result = _.findLast(list, ''); - result = _.findLast(list, '', 1); - result = _.findLast(list, {a: 42}); - result = _.findLast(list, {a: 42}, 1); + result = _.findLast(list); + result = _.findLast(list, listIterator); + result = _.findLast(list, listIterator, 1); + result = _.findLast(list, ''); + result = _.findLast(list, '', 1); + result = _.findLast(list, {a: 42}); + result = _.findLast(list, {a: 42}, 1); result = _.findLast(list, ['a', 5]); result = _.findLast(list, ['a', 5], 1); @@ -4725,15 +4744,15 @@ namespace TestFindLast { result = _(array).findLast(['a', 5]); result = _(array).findLast(['a', 5], 1); - result = _(list).findLast(); - result = _(list).findLast(listIterator); - result = _(list).findLast(listIterator, 1); - result = _(list).findLast(''); - result = _(list).findLast('', 1); - result = _(list).findLast({a: 42}); - result = _(list).findLast({a: 42}, 1); - result = _(list).findLast(['a', 5]); - result = _(list).findLast(['a', 5], 1); + result = _(list).findLast(); + result = _(list).findLast(listIterator); + result = _(list).findLast(listIterator, 1); + result = _(list).findLast(''); + result = _(list).findLast('', 1); + result = _(list).findLast({a: 42}); + result = _(list).findLast({a: 42}, 1); + result = _(list).findLast(['a', 5]); + result = _(list).findLast(['a', 5], 1); result = _(dictionary).findLast(); result = _(dictionary).findLast(dictionaryIterator); @@ -4745,8 +4764,8 @@ namespace TestFindLast { result = _(dictionary).findLast(['a', 5]); result = _(dictionary).findLast(['a', 5], 1); - result = _.findLast([any as TResult, null, undefined], (value: TResult | null | undefined): value is TResult | undefined => value !== null); - result = _([any as TResult, null, undefined]).findLast((value: TResult | null | undefined): value is TResult | undefined => value !== null); + result = _.findLast([anything as AbcObject, null, undefined], (value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); + result = _([anything as AbcObject, null, undefined]).findLast((value: AbcObject | null | undefined): value is AbcObject | undefined => value !== null); } // _.flatMap @@ -4938,14 +4957,14 @@ namespace TestFlatMapDeep { let numArray: Array | null | undefined = [1, [2, 3]] as any; let objArray: Array<{a: number}|Array<{a: number}>> | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; - let numList: _.List | null | undefined = any; - let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = any; + let numList: _.List | null | undefined = anything; + let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numDictionary: _.Dictionary | null | undefined = any; - let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = any; + let numDictionary: _.Dictionary | null | undefined = anything; + let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numNumericDictionary: _.NumericDictionary | null | undefined = any; - let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = any; + let numNumericDictionary: _.NumericDictionary | null | undefined = anything; + let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; let stringIterator: (value: string, index: number, collection: _.List) => _.ListOfRecursiveArraysOrValues = (a, b, c) => ['a', 'b', 'c']; @@ -5099,14 +5118,14 @@ namespace TestFlatMapDepth { let numArray: Array | null | undefined = [1, [2, 3]] as any; let objArray: Array<{a: number}|Array<{a: number}>> | null | undefined = [{a: 1}, [{a: 2}, {a: 3}]] as any; - let numList: _.List | null | undefined = any; - let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = any; + let numList: _.List | null | undefined = anything; + let objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numDictionary: _.Dictionary | null | undefined = any; - let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = any; + let numDictionary: _.Dictionary | null | undefined = anything; + let objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; - let numNumericDictionary: _.NumericDictionary | null | undefined = any; - let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = any; + let numNumericDictionary: _.NumericDictionary | null | undefined = anything; + let objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; let stringIterator: (value: string, index: number, collection: _.List) => _.ListOfRecursiveArraysOrValues = (a, b, c) => ""; @@ -5257,16 +5276,16 @@ namespace TestFlatMapDepth { // _.forEach namespace TestForEach { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value, index, collection) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value, key, collection) => 1; - let objectIterator: (value: number | string | boolean, key: string, collection: TResult) => any = (value, key, collection) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value, index, collection) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value, key, collection) => 1; + let objectIterator: (value: number | string | boolean, key: string, collection: AbcObject) => any = (value, key, collection) => 1; { let result: string; @@ -5289,77 +5308,77 @@ namespace TestForEach { } { - let result: TResult[]; - result = _.forEach(array, (value, index, collection: ArrayLike) => { - value; // $ExpectType TResult + let result: AbcObject[]; + result = _.forEach(array, (value, index, collection: ArrayLike) => { + value; // $ExpectType AbcObject index; // $ExpectType number }); result = _.forEach(array, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; - result = _.forEach(array, (value, index, collection: ArrayLike) => { - value; // $ExpectType TResult + result = _.forEach(array, (value, index, collection: ArrayLike) => { + value; // $ExpectType AbcObject index; // $ExpectType number }); result = _.forEach(nilArray, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.List; + let result: _.List; result = _.forEach(list, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.forEach(nilList, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.forEach(dictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.forEach(nilDictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } { - let sample1: TResult = any; + let sample1: AbcObject = anything; sample1 = _.forEach(sample1, objectIterator); - let sample2: TResult | null | undefined = any; + let sample2: AbcObject | null | undefined = anything; sample2 = _.forEach(sample2, objectIterator); } @@ -5374,45 +5393,45 @@ namespace TestForEach { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashImplicitNillableArrayWrapper; + let result: _.LoDashImplicitNillableArrayWrapper; result = _(nilArray).forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).forEach(listIterator); + result = _(list).forEach(listIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.List>; + let result: _.LoDashImplicitNillableObjectWrapper<_.List>; - result = _(nilList).forEach(listIterator); + result = _(nilList).forEach(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).forEach(dictionaryIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).forEach(dictionaryIterator); } @@ -5428,45 +5447,45 @@ namespace TestForEach { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitNillableArrayWrapper; + let result: _.LoDashExplicitNillableArrayWrapper; result = _(nilArray).chain().forEach((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; - result = _(list).chain().forEach(listIterator); + result = _(list).chain().forEach(listIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.List>; + let result: _.LoDashExplicitNillableObjectWrapper<_.List>; - result = _(nilList).chain().forEach(listIterator); + result = _(nilList).chain().forEach(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().forEach(dictionaryIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).chain().forEach(dictionaryIterator); } @@ -5474,15 +5493,15 @@ namespace TestForEach { // _.forEachRight namespace TestForEachRight { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let nilArray: TResult[] | null | undefined = [] as any; - let nilList: _.List | null | undefined = [] as any; - let nilDictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let nilArray: AbcObject[] | null | undefined = [] as any; + let nilList: _.List | null | undefined = [] as any; + let nilDictionary: _.Dictionary | null | undefined = anything; - let listIterator: (value: TResult, index: number, collection: _.List) => any = (value: TResult, index: number, collection: _.List) => 1; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any = (value: TResult, key: string, collection: _.Dictionary) => 1; + let listIterator: (value: AbcObject, index: number, collection: _.List) => any = (value: AbcObject, index: number, collection: _.List) => 1; + let dictionaryIterator: (value: AbcObject, key: string, collection: _.Dictionary) => any = (value: AbcObject, key: string, collection: _.Dictionary) => 1; { let result: string; @@ -5505,62 +5524,62 @@ namespace TestForEachRight { } { - let result: TResult[]; + let result: AbcObject[]; result = _.forEachRight(array, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: TResult[] | null | undefined; + let result: AbcObject[] | null | undefined; result = _.forEachRight(nilArray, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.List; + let result: _.List; result = _.forEachRight(list, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.List | null | undefined; + let result: _.List | null | undefined; result = _.forEachRight(nilList, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType ArrayLike + collection; // $ExpectType ArrayLike }); } { - let result: _.Dictionary; + let result: _.Dictionary; result = _.forEachRight(dictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } { - let result: _.Dictionary | null | undefined; + let result: _.Dictionary | null | undefined; result = _.forEachRight(nilDictionary, (value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType string - collection; // $ExpectType Dictionary + collection; // $ExpectType Dictionary }); } @@ -5575,37 +5594,37 @@ namespace TestForEachRight { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).forEachRight(listIterator); } { - let result: _.LoDashImplicitNillableArrayWrapper; + let result: _.LoDashImplicitNillableArrayWrapper; result = _(nilArray).forEachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.List>; + let result: _.LoDashImplicitObjectWrapper<_.List>; - result = _(list).forEachRight(listIterator); + result = _(list).forEachRight(listIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.List>; + let result: _.LoDashImplicitNillableObjectWrapper<_.List>; - result = _(nilList).forEachRight(listIterator); + result = _(nilList).forEachRight(listIterator); } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).forEachRight(dictionaryIterator); } { - let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).forEachRight(dictionaryIterator); } @@ -5621,45 +5640,45 @@ namespace TestForEachRight { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().forEachRight((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitNillableArrayWrapper; + let result: _.LoDashExplicitNillableArrayWrapper; result = _(nilArray).chain().forEachRight((value, index, collection) => { - value; // $ExpectType TResult + value; // $ExpectType AbcObject index; // $ExpectType number - collection; // $ExpectType TResult[] + collection; // $ExpectType AbcObject[] }); } { - let result: _.LoDashExplicitObjectWrapper<_.List>; + let result: _.LoDashExplicitObjectWrapper<_.List>; result = _(list).chain().forEachRight(listIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.List>; + let result: _.LoDashExplicitNillableObjectWrapper<_.List>; - result = _(nilList).chain().forEachRight(listIterator); + result = _(nilList).chain().forEachRight(listIterator); } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().forEachRight(dictionaryIterator); } { - let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitNillableObjectWrapper<_.Dictionary>; result = _(nilDictionary).chain().forEachRight(dictionaryIterator); } @@ -6051,18 +6070,18 @@ namespace TestMap { let obj: any = {}; let dictionary: _.Dictionary | null | undefined = obj; - let listIterator: (value: number, index: number, collection: _.List) => TResult = (value: number, index: number, collection: _.List) => ({ a: 1, b: "", c: true }); - let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => TResult = (value: number, key: string, collection: _.Dictionary) => ({ a: 1, b: "", c: true }); + let listIterator: (value: number, index: number, collection: _.List) => AbcObject = (value: number, index: number, collection: _.List) => ({ a: 1, b: "", c: true }); + let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => AbcObject = (value: number, key: string, collection: _.Dictionary) => ({ a: 1, b: "", c: true }); { _.map(array); // $ExpectType number[] - _.map(array, listIterator); // $ExpectType TResult[] + _.map(array, listIterator); // $ExpectType AbcObject[] _.map(list); // $ExpectType number[] - _.map(list, listIterator); // $ExpectType TResult[] + _.map(list, listIterator); // $ExpectType AbcObject[] _.map(dictionary); // $ExpectType number[] - _.map(dictionary, dictionaryIterator); // $ExpectType TResult[] + _.map(dictionary, dictionaryIterator); // $ExpectType AbcObject[] } { @@ -6074,13 +6093,13 @@ namespace TestMap { { _(array).map().value(); // $ExpectType number[] - _(array).map(listIterator).value(); // $ExpectType TResult[] + _(array).map(listIterator).value(); // $ExpectType AbcObject[] _(list).map().value(); // $ExpectType number[] - _(list).map(listIterator).value(); // $ExpectType TResult[] + _(list).map(listIterator).value(); // $ExpectType AbcObject[] _(dictionary).map().value(); // $ExpectType number[] - _(dictionary).map(dictionaryIterator).value(); // $ExpectType TResult[] + _(dictionary).map(dictionaryIterator).value(); // $ExpectType AbcObject[] } { @@ -6091,13 +6110,13 @@ namespace TestMap { { _(array).chain().map().value(); // $ExpectType number[] - _(array).chain().map(listIterator).value(); // $ExpectType TResult[] + _(array).chain().map(listIterator).value(); // $ExpectType AbcObject[] _(list).chain().map().value(); // $ExpectType number[] - _(list).chain().map(listIterator).value(); // $ExpectType TResult[] + _(list).chain().map(listIterator).value(); // $ExpectType AbcObject[] _(dictionary).chain().map().value(); // $ExpectType number[] - _(dictionary).chain().map(dictionaryIterator).value(); // $ExpectType TResult[] + _(dictionary).chain().map(dictionaryIterator).value(); // $ExpectType AbcObject[] } { @@ -6132,7 +6151,7 @@ namespace TestPartition { { let result: any[][]; - result = _.partition(any, (n) => { + result = _.partition(anything, (n) => { n; // $ExpectType any return n < 'c'; }); @@ -6183,7 +6202,7 @@ namespace TestPartition { { let result: _.LoDashImplicitWrapper; - result = _(any).partition((n) => { + result = _(anything).partition((n) => { n; // $ExpectType any return n < 'c'; }); @@ -6228,7 +6247,7 @@ namespace TestPartition { { let result: _.LoDashExplicitWrapper; - result = _.chain(any).partition((n) => { + result = _.chain(anything).partition((n) => { n; // $ExpectType any return n < 'c'; }); @@ -6275,7 +6294,7 @@ namespace TestPartition { // _.map with iteratee shorthand // module TestMapInsteadOfPluck { // interface SampleObject { -// d: {b: TResult}[]; +// d: {b: AbcObject}[]; // } // // let array: SampleObject[] = []; @@ -6296,42 +6315,42 @@ namespace TestPartition { // } // // { -// let result: TResult[]; +// let result: AbcObject[]; // -// result = _.map(array, 'd.0.b'); -// result = _.map(array, ['d', 0, 'b']); +// result = _.map(array, 'd.0.b'); +// result = _.map(array, ['d', 0, 'b']); // -// result = _.map(list, 'd.0.b'); -// result = _.map(list, ['d', 0, 'b']); +// result = _.map(list, 'd.0.b'); +// result = _.map(list, ['d', 0, 'b']); // -// result = _.map(dictionary, 'd.0.b'); -// result = _.map(dictionary, ['d', 0, 'b']); +// result = _.map(dictionary, 'd.0.b'); +// result = _.map(dictionary, ['d', 0, 'b']); // } // // { -// let result: _.LoDashImplicitArrayWrapper; +// let result: _.LoDashImplicitArrayWrapper; // -// result = _(array).map('d.0.b'); -// result = _(array).map(['d', 0, 'b']); +// result = _(array).map('d.0.b'); +// result = _(array).map(['d', 0, 'b']); // -// result = _(list).map('d.0.b'); -// result = _(list).map(['d', 0, 'b']); +// result = _(list).map('d.0.b'); +// result = _(list).map(['d', 0, 'b']); // -// result = _(dictionary).map('d.0.b'); -// result = _(dictionary).map(['d', 0, 'b']); +// result = _(dictionary).map('d.0.b'); +// result = _(dictionary).map(['d', 0, 'b']); // } // // { -// let result: _.LoDashExplicitArrayWrapper; +// let result: _.LoDashExplicitArrayWrapper; // -// result = _(array).chain().map('d.0.b'); -// result = _(array).chain().map(['d', 0, 'b']); +// result = _(array).chain().map('d.0.b'); +// result = _(array).chain().map(['d', 0, 'b']); // -// result = _(list).chain().map('d.0.b'); -// result = _(list).chain().map(['d', 0, 'b']); +// result = _(list).chain().map('d.0.b'); +// result = _(list).chain().map(['d', 0, 'b']); // -// result = _(dictionary).chain().map('d.0.b'); -// result = _(dictionary).chain().map(['d', 0, 'b']); +// result = _(dictionary).chain().map('d.0.b'); +// result = _(dictionary).chain().map(['d', 0, 'b']); // } // } namespace TestReduce { @@ -6375,14 +6394,14 @@ namespace TestReduce { // _.reject namespace TestReject { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; let stringIterator = (char: string, index: number, string: string) => true; - let listIterator = (value: TResult, index: number, collection: _.List) => true; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => true; + let listIterator = (value: AbcObject, index: number, collection: _.List) => true; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; { let result: string[]; @@ -6391,14 +6410,14 @@ namespace TestReject { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.reject(array, listIterator); - result = _.reject(array, ''); + result = _.reject(array, listIterator); + result = _.reject(array, ''); result = _.reject(array, {a: 42}); - result = _.reject(list, listIterator); - result = _.reject(list, ''); + result = _.reject(list, listIterator); + result = _.reject(list, ''); result = _.reject(list, {a: 42}); result = _.reject(dictionary, dictionaryIterator); @@ -6413,14 +6432,14 @@ namespace TestReject { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).reject(listIterator); result = _(array).reject(''); result = _(array).reject({a: 42}); - result = _(list).reject(listIterator); - result = _(list).reject(''); + result = _(list).reject(listIterator); + result = _(list).reject(''); result = _(list).reject({a: 42}); result = _(dictionary).reject(dictionaryIterator); @@ -6435,14 +6454,14 @@ namespace TestReject { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().reject(listIterator); result = _(array).chain().reject(''); result = _(array).chain().reject({a: 42}); - result = _(list).chain().reject(listIterator); - result = _(list).chain().reject(''); + result = _(list).chain().reject(listIterator); + result = _(list).chain().reject(''); result = _(list).chain().reject({a: 42}); result = _(dictionary).chain().reject(dictionaryIterator); @@ -6554,10 +6573,10 @@ namespace TestSampleSize { // _.shuffle namespace TestShuffle { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; { let result: string[]; @@ -6566,10 +6585,10 @@ namespace TestShuffle { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.shuffle(array); - result = _.shuffle(list); + result = _.shuffle(array); + result = _.shuffle(list); result = _.shuffle(dictionary); } @@ -6580,10 +6599,10 @@ namespace TestShuffle { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).shuffle(); - result = _(list).shuffle(); + result = _(list).shuffle(); result = _(dictionary).shuffle(); } @@ -6594,10 +6613,10 @@ namespace TestShuffle { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().shuffle(); - result = _(list).chain().shuffle(); + result = _(list).chain().shuffle(); result = _(dictionary).chain().shuffle(); } } @@ -6752,22 +6771,22 @@ namespace TestSome { result = _(sampleObject).chain().some(objectIterator); result = _(sampleObject).chain().some('a'); result = _(sampleObject).chain().some(['a', 42]); - result = _(sampleObject).chain().some({a: 42}); + result = _(sampleObject).chain().some({a: 42}); } } // _.sortBy namespace TestSortBy { - let array: TResult[] | null | undefined = [] as any; - let list: _.List | null | undefined = [] as any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List | null | undefined = [] as any; let obj: any = {}; - let dictionary: _.Dictionary | null | undefined = obj; + let dictionary: _.Dictionary | null | undefined = obj; - let listIterator = (value: TResult, index: number, collection: _.List) => 0; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => 0; + let listIterator = (value: AbcObject, index: number, collection: _.List) => 0; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => 0; { - let result: TResult[]; + let result: AbcObject[]; result = _.sortBy(array); result = _.sortBy(array, listIterator); @@ -6786,7 +6805,7 @@ namespace TestSortBy { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).sortBy(); result = _(array).sortBy(listIterator); @@ -6805,7 +6824,7 @@ namespace TestSortBy { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().sortBy(); result = _(array).chain().sortBy(listIterator); @@ -6834,14 +6853,14 @@ _(foodsOrganic).sortBy('organic', (food) => food.name, { organic: true }).value( namespace TestorderBy { type SampleObject = {a: number; b: string; c: boolean}; - const array: SampleObject[] | null | undefined = any; - const list: _.List | null | undefined = any; - const numericDictionary: _.NumericDictionary | null | undefined = any; - const dictionary: _.Dictionary | null | undefined = any; - const orders: boolean|string|Array = any; + const array: SampleObject[] | null | undefined = anything; + const list: _.List | null | undefined = anything; + const numericDictionary: _.NumericDictionary | null | undefined = anything; + const dictionary: _.Dictionary | null | undefined = anything; + const orders: boolean|string|Array = anything; { - let iteratees: ((value: string) => any)|Array<(value: string) => any> = any; + let iteratees: ((value: string) => any)|Array<(value: string) => any> = anything; let result: string[]; result = _.orderBy('acbd', iteratees); @@ -6849,7 +6868,7 @@ namespace TestorderBy { } { - const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = any; + const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = anything; let result: SampleObject[]; result = _.orderBy(array, iteratees); @@ -6874,7 +6893,7 @@ namespace TestorderBy { } { - const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = any; + const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = anything; let result: _.LoDashImplicitArrayWrapper; result = _(array).orderBy(iteratees); @@ -6897,7 +6916,7 @@ namespace TestorderBy { } { - const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = any; + const iteratees: ((value: SampleObject) => _.NotVoid)|string|_.PartialDeep|Array<((value: SampleObject) => _.NotVoid)|string|_.PartialDeep> = anything; let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().orderBy(iteratees); @@ -7037,8 +7056,8 @@ namespace TestBind { let result: SampleResult; - result = _.bind(func, any); - result = _.bind(func, any); + result = _.bind(func, anything); + result = _.bind(func, anything); } { @@ -7046,8 +7065,8 @@ namespace TestBind { let result: SampleResult; - result = _.bind(func, any, 42); - result = _.bind(func, any, 42); + result = _.bind(func, anything, 42); + result = _.bind(func, anything, 42); } { @@ -7055,8 +7074,8 @@ namespace TestBind { let result: SampleResult; - result = _.bind(func, any, 42, ''); - result = _.bind(func, any, 42, ''); + result = _.bind(func, anything, 42, ''); + result = _.bind(func, anything, 42, ''); } { @@ -7064,7 +7083,7 @@ namespace TestBind { let result: _.LoDashImplicitObjectWrapper; - result = _(func).bind(any); + result = _(func).bind(anything); } { @@ -7072,7 +7091,7 @@ namespace TestBind { let result: _.LoDashImplicitObjectWrapper; - result = _(func).bind(any, 42); + result = _(func).bind(anything, 42); } { @@ -7080,7 +7099,7 @@ namespace TestBind { let result: _.LoDashImplicitObjectWrapper; - result = _(func).bind(any, 42, ''); + result = _(func).bind(anything, 42, ''); } { @@ -7088,7 +7107,7 @@ namespace TestBind { let result: _.LoDashExplicitObjectWrapper; - result = _(func).chain().bind(any); + result = _(func).chain().bind(anything); } { @@ -7096,7 +7115,7 @@ namespace TestBind { let result: _.LoDashExplicitWrapper; - result = _(func).chain().bind(any, 42); + result = _(func).chain().bind(anything, 42); } { @@ -7104,7 +7123,7 @@ namespace TestBind { let result: _.LoDashExplicitWrapper; - result = _(func).chain().bind(any, 42, ''); + result = _(func).chain().bind(anything, 42, ''); } } @@ -7328,27 +7347,27 @@ namespace TestDefer { let result: number; result = _.defer(func); - result = _.defer(func, any); - result = _.defer(func, any, any); - result = _.defer(func, any, any, any); + result = _.defer(func, anything); + result = _.defer(func, anything, anything); + result = _.defer(func, anything, anything, anything); } { let result: _.LoDashImplicitWrapper; result = _(func).defer(); - result = _(func).defer(any); - result = _(func).defer(any, any); - result = _(func).defer(any, any, any); + result = _(func).defer(anything); + result = _(func).defer(anything, anything); + result = _(func).defer(anything, anything, anything); } { let result: _.LoDashExplicitWrapper; result = _(func).chain().defer(); - result = _(func).chain().defer(any); - result = _(func).chain().defer(any, any); - result = _(func).chain().defer(any, any, any); + result = _(func).chain().defer(anything); + result = _(func).chain().defer(anything, anything); + result = _(func).chain().defer(anything, anything, anything); } } @@ -8115,15 +8134,15 @@ namespace TestEq { { let result: boolean; - result = _.eq(any, any); + result = _.eq(anything, anything); - result = _(any).eq(any); + result = _(anything).eq(anything); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().eq(any); + result = _(anything).chain().eq(anything); } } @@ -8132,18 +8151,18 @@ namespace TestGt { { let result: boolean; - result = _.gt(any, any); - result = _(1).gt(any); - result = _([]).gt(any); - result = _({}).gt(any); + result = _.gt(anything, anything); + result = _(1).gt(anything); + result = _([]).gt(anything); + result = _({}).gt(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().gt(any); - result = _([]).chain().gt(any); - result = _({}).chain().gt(any); + result = _(1).chain().gt(anything); + result = _([]).chain().gt(anything); + result = _({}).chain().gt(anything); } } @@ -8152,18 +8171,18 @@ namespace TestGte { { let result: boolean; - result = _.gte(any, any); - result = _(1).gte(any); - result = _([]).gte(any); - result = _({}).gte(any); + result = _.gte(anything, anything); + result = _(1).gte(anything); + result = _([]).gte(anything); + result = _({}).gte(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().gte(any); - result = _([]).chain().gte(any); - result = _({}).chain().gte(any); + result = _(1).chain().gte(anything); + result = _([]).chain().gte(anything); + result = _({}).chain().gte(anything); } } @@ -8183,7 +8202,7 @@ namespace TestisArguments { { let result: boolean; - result = _.isArguments(any); + result = _.isArguments(anything); result = _(1).isArguments(); result = _([]).isArguments(); result = _({}).isArguments(); @@ -8201,7 +8220,7 @@ namespace TestisArguments { // _.isArray namespace TestIsArray { { - let value: number|string[]|boolean[] = any; + let value: number|string[]|boolean[] = anything; if (_.isArray(value)) { value; // $ExpectType string[] | boolean[] @@ -8214,7 +8233,7 @@ namespace TestIsArray { { let result: boolean; - result = _.isArray(any); + result = _.isArray(anything); result = _(1).isArray(); result = _([]).isArray(); result = _({}).isArray(); @@ -8232,7 +8251,7 @@ namespace TestIsArray { // _.isArrayBuffer namespace TestIsArrayBuffer { { - let value: ArrayBuffer|number = any; + let value: ArrayBuffer|number = anything; if (_.isArrayBuffer(value)) { value; // $ExpectType ArrayBuffer @@ -8245,7 +8264,7 @@ namespace TestIsArrayBuffer { { let result: boolean; - result = _.isArrayBuffer(any); + result = _.isArrayBuffer(anything); result = _(1).isArrayBuffer(); result = _([]).isArrayBuffer(); result = _({}).isArrayBuffer(); @@ -8265,7 +8284,7 @@ namespace TestIsArrayLike { { let value: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | { length: string } | { a: string } | null | undefined - = any; + = anything; if (_.isArrayLike(value)) { let result: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] = value; @@ -8275,7 +8294,7 @@ namespace TestIsArrayLike { } { - let value: boolean[] = any; + let value: boolean[] = anything; if (_.isArrayLike(value)) { let result: boolean[] = value; @@ -8286,7 +8305,7 @@ namespace TestIsArrayLike { } { - let value: () => number = any; + let value: () => number = anything; if (_.isArrayLike(value)) { value; // $ExpectType never @@ -8296,7 +8315,7 @@ namespace TestIsArrayLike { } { - let value: { a: string } = any; + let value: { a: string } = anything; if (_.isArrayLike(value)) { let result: { a: string, length: number } = value; @@ -8307,7 +8326,7 @@ namespace TestIsArrayLike { } { - let value: any = any; + let value: any = anything; if (_.isArrayLike(value)) { value; // $ExpectType any @@ -8320,7 +8339,7 @@ namespace TestIsArrayLike { { let result: boolean; - result = _.isArrayLike(any); + result = _.isArrayLike(anything); result = _(1).isArrayLike(); result = _([]).isArrayLike(); result = _({}).isArrayLike(); @@ -8340,7 +8359,7 @@ namespace TestIsArrayLikeObject { { let value: string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | string | { length: string } | { a: string } | null | undefined - = any; + = anything; if (_.isArrayLikeObject(value)) { let result: string[] | { [index: number]: boolean, length: number } | [number, boolean] = value; @@ -8350,7 +8369,7 @@ namespace TestIsArrayLikeObject { } { - let value: boolean[] = any; + let value: boolean[] = anything; if (_.isArrayLikeObject(value)) { let result: boolean[] = value; @@ -8361,7 +8380,7 @@ namespace TestIsArrayLikeObject { } { - let value: (a: string) => boolean = any; + let value: (a: string) => boolean = anything; if (_.isArrayLikeObject(value)) { value; // $ExpectType never @@ -8371,7 +8390,7 @@ namespace TestIsArrayLikeObject { } { - let value: { a: string } = any; + let value: { a: string } = anything; if (_.isArrayLikeObject(value)) { let result: { a: string, length: number } = value; @@ -8382,7 +8401,7 @@ namespace TestIsArrayLikeObject { } { - let value: any = any; + let value: any = anything; if (_.isArrayLikeObject(value)) { value; // $ExpectType any @@ -8395,7 +8414,7 @@ namespace TestIsArrayLikeObject { { let result: boolean; - result = _.isArrayLikeObject(any); + result = _.isArrayLikeObject(anything); result = _(1).isArrayLikeObject(); result = _([]).isArrayLikeObject(); result = _({}).isArrayLikeObject(); @@ -8426,7 +8445,7 @@ namespace TestIsBoolean { { let result: boolean; - result = _.isBoolean(any); + result = _.isBoolean(anything); result = _(1).isBoolean(); result = _([]).isBoolean(); result = _({}).isBoolean(); @@ -8446,7 +8465,7 @@ namespace TestIsBuffer { { let result: boolean; - result = _.isBuffer(any); + result = _.isBuffer(anything); result = _(1).isBuffer(); result = _([]).isBuffer(); result = _({}).isBuffer(); @@ -8477,7 +8496,7 @@ namespace TestIsBuffer { { let result: boolean; - result = _.isDate(any); + result = _.isDate(anything); result = _(42).isDate(); result = _([]).isDate(); result = _({}).isDate(); @@ -8497,7 +8516,7 @@ namespace TestIsElement { { let result: boolean; - result = _.isElement(any); + result = _.isElement(anything); result = _(42).isElement(); result = _([]).isElement(); @@ -8518,7 +8537,7 @@ namespace TestIsEmpty { { let result: boolean; - result = _.isEmpty(any); + result = _.isEmpty(anything); result = _(1).isEmpty(); result = _('').isEmpty(); result = _([]).isEmpty(); @@ -8542,15 +8561,15 @@ namespace TestIsEqual { { let result: boolean; - result = _.isEqual(any, any); + result = _.isEqual(anything, anything); - result = _(any).isEqual(any); + result = _(anything).isEqual(anything); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().isEqual(any); + result = _(anything).chain().isEqual(anything); } } @@ -8561,15 +8580,15 @@ namespace TestIsEqualWith { { let result: boolean; - result = _.isEqualWith(any, any, customizer); + result = _.isEqualWith(anything, anything, customizer); - result = _(any).isEqualWith(any, customizer); + result = _(anything).isEqualWith(anything, customizer); } { let result: _.LoDashExplicitWrapper; - result = _(any).chain().isEqualWith(any, customizer); + result = _(anything).chain().isEqualWith(anything, customizer); } } @@ -8605,7 +8624,7 @@ namespace TestIsError { { let result: boolean; - result = _.isError(any); + result = _.isError(anything); result = _(1).isError(); result = _([]).isError(); result = _({}).isError(); @@ -8625,7 +8644,7 @@ namespace TestIsFinite { { let result: boolean; - result = _.isFinite(any); + result = _.isFinite(anything); result = _(1).isFinite(); result = _([]).isFinite(); result = _({}).isFinite(); @@ -8643,7 +8662,7 @@ namespace TestIsFinite { // _.isFunction namespace TestIsFunction { { - let value: number|(() => void) = any; + let value: number|(() => void) = anything; if (_.isFunction(value)) { value; // $ExpectType () => void @@ -8652,15 +8671,15 @@ namespace TestIsFunction { value; // $ExpectType number } - if (_.isFunction(any)) { - any(); + if (_.isFunction(anything)) { + anything(); } } { let result: boolean; - result = _.isFunction(any); + result = _.isFunction(anything); result = _(1).isFunction(); result = _([]).isFunction(); result = _({}).isFunction(); @@ -8680,7 +8699,7 @@ namespace TestIsInteger { { let result: boolean; - result = _.isInteger(any); + result = _.isInteger(anything); result = _(1).isInteger(); result = _([]).isInteger(); @@ -8701,7 +8720,7 @@ namespace TestIsLength { { let result: boolean; - result = _.isLength(any); + result = _.isLength(anything); result = _(1).isLength(); result = _([]).isLength(); @@ -8733,7 +8752,7 @@ namespace TestIsMap { { let result: boolean; - result = _.isMap(any); + result = _.isMap(anything); result = _(1).isMap(); result = _([]).isMap(); result = _({}).isMap(); @@ -8769,7 +8788,7 @@ namespace TestIsNaN { { let result: boolean; - result = _.isNaN(any); + result = _.isNaN(anything); result = _(1).isNaN(); result = _([]).isNaN(); @@ -8788,7 +8807,7 @@ namespace TestIsNaN { // _.isNative namespace TestIsNative { { - let value: number|(() => void) = any; + let value: number|(() => void) = anything; if (_.isNative(value)) { value; // $ExpectType () => void @@ -8801,7 +8820,7 @@ namespace TestIsNative { { let result: boolean; - result = _.isNative(any); + result = _.isNative(anything); result = _(1).isNative(); result = _([]).isNative(); @@ -8822,7 +8841,7 @@ namespace TestIsNil { { let result: boolean; - result = _.isNil(any); + result = _.isNil(anything); result = _(1).isNil(); result = _([]).isNil(); @@ -8843,7 +8862,7 @@ namespace TestIsNull { { let result: boolean; - result = _.isNull(any); + result = _.isNull(anything); result = _(1).isNull(); result = _([]).isNull(); @@ -8875,7 +8894,7 @@ namespace TestIsNumber { { let result: boolean; - result = _.isNumber(any); + result = _.isNumber(anything); result = _(1).isNumber(); result = _([]).isNumber(); @@ -8896,7 +8915,7 @@ namespace TestIsObject { { let result: boolean; - result = _.isObject(any); + result = _.isObject(anything); result = _(1).isObject(); result = _([]).isObject(); result = _({}).isObject(); @@ -8916,7 +8935,7 @@ namespace TestIsObjectLike { { let result: boolean; - result = _.isObjectLike(any); + result = _.isObjectLike(anything); result = _(1).isObjectLike(); result = _([]).isObjectLike(); result = _({}).isObjectLike(); @@ -8936,7 +8955,7 @@ namespace TestIsPlainObject { { let result: boolean; - result = _.isPlainObject(any); + result = _.isPlainObject(anything); result = _(1).isPlainObject(); result = _([]).isPlainObject(); result = _({}).isPlainObject(); @@ -8967,7 +8986,7 @@ namespace TestIsRegExp { { let result: boolean; - result = _.isRegExp(any); + result = _.isRegExp(anything); result = _(1).isRegExp(); result = _([]).isRegExp(); result = _({}).isRegExp(); @@ -8987,7 +9006,7 @@ namespace TestIsSafeInteger { { let result: boolean; - result = _.isSafeInteger(any); + result = _.isSafeInteger(anything); result = _(1).isSafeInteger(); result = _([]).isSafeInteger(); @@ -9019,7 +9038,7 @@ namespace TestIsSet { { let result: boolean; - result = _.isSet(any); + result = _.isSet(anything); result = _(1).isSet(); result = _([]).isSet(); result = _({}).isSet(); @@ -9050,7 +9069,7 @@ namespace TestIsString { { let result: boolean; - result = _.isString(any); + result = _.isString(anything); result = _(1).isString(); result = _([]).isString(); result = _({}).isString(); @@ -9070,7 +9089,7 @@ namespace TestIsSymbol { { let result: boolean; - result = _.isSymbol(any); + result = _.isSymbol(anything); result = _(1).isSymbol(); result = _([]).isSymbol(); @@ -9107,7 +9126,7 @@ namespace TestIsUndefined { { let result: boolean; - result = _.isUndefined(any); + result = _.isUndefined(anything); result = _(1).isUndefined(); result = _([]).isUndefined(); @@ -9139,7 +9158,7 @@ namespace TestIsWeakMap { { let result: boolean; - result = _.isWeakMap(any); + result = _.isWeakMap(anything); result = _(1).isWeakMap(); result = _([]).isWeakMap(); result = _({}).isWeakMap(); @@ -9170,7 +9189,7 @@ namespace TestIsWeakSet { { let result: boolean; - result = _.isWeakSet(any); + result = _.isWeakSet(anything); result = _(1).isWeakSet(); result = _([]).isWeakSet(); result = _({}).isWeakSet(); @@ -9190,18 +9209,18 @@ namespace TestLt { { let result: boolean; - result = _.lt(any, any); - result = _(1).lt(any); - result = _([]).lt(any); - result = _({}).lt(any); + result = _.lt(anything, anything); + result = _(1).lt(anything); + result = _([]).lt(anything); + result = _({}).lt(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().lt(any); - result = _([]).chain().lt(any); - result = _({}).chain().lt(any); + result = _(1).chain().lt(anything); + result = _([]).chain().lt(anything); + result = _({}).chain().lt(anything); } } @@ -9210,27 +9229,27 @@ namespace TestLte { { let result: boolean; - result = _.lte(any, any); - result = _(1).lte(any); - result = _([]).lte(any); - result = _({}).lte(any); + result = _.lte(anything, anything); + result = _(1).lte(anything); + result = _([]).lte(anything); + result = _({}).lte(anything); } { let result: _.LoDashExplicitWrapper; - result = _(1).chain().lte(any); - result = _([]).chain().lte(any); - result = _({}).chain().lte(any); + result = _(1).chain().lte(anything); + result = _([]).chain().lte(anything); + result = _({}).chain().lte(anything); } } // _.toArray namespace TestToArray { - let array: TResult[] = []; - let list: _.List = []; - let dictionary: _.Dictionary = {}; - let numericDictionary: _.NumericDictionary = {}; + let array: AbcObject[] = []; + let list: _.List = []; + let dictionary: _.Dictionary = {}; + let numericDictionary: _.NumericDictionary = {}; { let result: string[]; @@ -9240,12 +9259,12 @@ namespace TestToArray { } { - let result: TResult[]; + let result: AbcObject[]; - result = _.toArray(array); - result = _.toArray(list); - result = _.toArray(dictionary); - result = _.toArray(numericDictionary); + result = _.toArray(array); + result = _.toArray(list); + result = _.toArray(dictionary); + result = _.toArray(numericDictionary); result = _.toArray(array); result = _.toArray(list); @@ -9262,28 +9281,28 @@ namespace TestToArray { } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; result = _(array).toArray(); - result = _(list).toArray(); - result = _(dictionary).toArray(); - result = _(numericDictionary).toArray(); + result = _(list).toArray(); + result = _(dictionary).toArray(); + result = _(numericDictionary).toArray(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().toArray(); - result = _(list).chain().toArray(); - result = _(dictionary).chain().toArray(); - result = _(numericDictionary).chain().toArray(); + result = _(list).chain().toArray(); + result = _(dictionary).chain().toArray(); + result = _(numericDictionary).chain().toArray(); } } // _.toPlainObject namespace TestToPlainObject { { - let result: TResult; + let result: AbcObject; result = _.toPlainObject(); result = _.toPlainObject(true); result = _.toPlainObject(1); @@ -9293,7 +9312,7 @@ namespace TestToPlainObject { } { - let result: _.LoDashImplicitObjectWrapper; + let result: _.LoDashImplicitObjectWrapper; result = _(true).toPlainObject(); result = _(1).toPlainObject(); @@ -9517,13 +9536,13 @@ namespace TestMax { namespace TestMaxBy { let array: number[] = []; let list: _.List = []; - let array2: TResult[] = []; - let list2: _.List = []; + let array2: AbcObject[] = []; + let list2: _.List = []; let listIterator = (value: number, index: number, collection: _.List) => 0; let result: number | undefined; - let result2: TResult | undefined; + let result2: AbcObject | undefined; result = _.maxBy(array); result = _.maxBy(array, listIterator); @@ -9559,7 +9578,7 @@ namespace TestMean { // _.meanBy { - let array: TResult[] = []; + let array: AbcObject[] = []; let result: number; @@ -9587,13 +9606,13 @@ namespace TestMin { namespace TestMinBy { let array: number[] = []; let list: _.List = []; - let array2: TResult[] = []; - let list2: _.List = []; + let array2: AbcObject[] = []; + let list2: _.List = []; let listIterator = (value: number, index: number, collection: _.List) => 0; let result: number | undefined; - let result2: TResult | undefined; + let result2: AbcObject | undefined; result = _.minBy(array); result = _.minBy(array, listIterator); @@ -10889,11 +10908,11 @@ namespace TestForIn { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -10958,11 +10977,11 @@ namespace TestForInRight { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -11027,11 +11046,11 @@ namespace TestForOwn { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -11096,11 +11115,11 @@ namespace TestForOwnRight { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary = {}; - let nilDictionary: _.Dictionary | null | undefined = any; + let nilDictionary: _.Dictionary | null | undefined = anything; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any = (value: number, key: string, collection: _.Dictionary) => 1; let object: SampleObject = { a: 1, b: "", c: true }; - let nilObject: SampleObject | null | undefined = any; + let nilObject: SampleObject | null | undefined = anything; let objectIterator: (element: any, key?: string, collection?: any) => any = (element: any, key?: string, collection?: any) => 1; { @@ -11488,7 +11507,7 @@ namespace TestInvertBy { // _.keys namespace TestKeys { - let object: _.Dictionary | null | undefined = any; + let object: _.Dictionary | null | undefined = anything; { let result: string[]; @@ -11511,7 +11530,7 @@ namespace TestKeys { // _.keysIn namespace TestKeysIn { - let object: _.Dictionary | null | undefined = any; + let object: _.Dictionary | null | undefined = anything; { let result: string[]; @@ -11534,15 +11553,15 @@ namespace TestKeysIn { // _.mapKeys namespace TestMapKeys { - let array: TResult[] | null | undefined = [] as any; - let list: _.List| null | undefined = [] as any; - let dictionary: _.Dictionary | null | undefined = any; + let array: AbcObject[] | null | undefined = [] as any; + let list: _.List| null | undefined = [] as any; + let dictionary: _.Dictionary | null | undefined = anything; - let listIterator = (value: TResult, index: number, collection: _.List) => ""; - let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary) => ""; + let listIterator = (value: AbcObject, index: number, collection: _.List) => ""; + let dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => ""; { - let result: _.Dictionary; + let result: _.Dictionary; result = _.mapKeys(array); result = _.mapKeys(array, listIterator); @@ -11561,7 +11580,7 @@ namespace TestMapKeys { } { - let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(array).mapKeys(); result = _(array).mapKeys(listIterator); @@ -11580,7 +11599,7 @@ namespace TestMapKeys { } { - let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; + let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(array).chain().mapKeys(); result = _(array).chain().mapKeys(listIterator); @@ -11721,11 +11740,11 @@ namespace TestMergeWith { // _.omit namespace TestOmit { - let obj: TResult | null | undefined = any; - let dict: { [key: string]: TResult } = { }; + let obj: AbcObject | null | undefined = anything; + let dict: { [key: string]: AbcObject } = { }; { - let result: Partial; + let result: Partial; result = _.omit(obj, 'a'); result = _.omit(obj, 0, 'a'); @@ -11735,7 +11754,7 @@ namespace TestOmit { } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; result = _(obj).omit('a'); result = _(obj).omit(0, 'a'); @@ -11745,7 +11764,7 @@ namespace TestOmit { } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; result = _(obj).chain().omit('a'); result = _(obj).chain().omit(0, 'a'); @@ -11757,99 +11776,82 @@ namespace TestOmit { // _.omitBy namespace TestOmitBy { - let obj: TResult | null | undefined = any; + let obj: AbcObject | null | undefined = anything; let predicate = (element: any, key: string) => true; { - let result: Partial; + let result: Partial; result = _.omitBy(obj, predicate); } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; - result = _(obj).omitBy(predicate); + result = _(obj).omitBy(predicate); } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; - result = _(obj).chain().omitBy(predicate); + result = _(obj).chain().omitBy(predicate); } } // _.pick namespace TestPick { - let obj1: TResult | null | undefined = any; - let obj2: TResult = any; + const obj1: AbcObject | null | undefined = anything; + const obj2: AbcObject = anything; + const readonlyArray: ReadonlyArray = ['a', 'b']; + const literalsArray = ['a' as 'a', 'b' as 'b']; + const roLiteralsArray: ReadonlyArray<'a' | 'b'> = literalsArray; - { - let result: Partial; + _.pick(obj1, 'a'); // $ExpectType PartialDeep + _.pick(obj1, 0, 'a'); // $ExpectType PartialDeep + _.pick(obj1, ['b', 1], 0, 'a'); // $ExpectType PartialDeep + _.pick(obj1, readonlyArray); // $ExpectType PartialDeep + _.pick(obj2, 'a', 'b'); // $ExpectType Pick + _.pick(obj2, literalsArray); // $ExpectType Pick + _.pick(obj2, roLiteralsArray); // $ExpectType Pick - result = _.pick(obj1, 'a'); - result = _.pick(obj1, 0, 'a'); - result = _.pick(obj1, ['b', 1], 0, 'a'); - } + _(obj1).pick('a'); // $ExpectType LoDashImplicitWrapper> + _(obj1).pick(0, 'a'); // $ExpectType LoDashImplicitWrapper> + _(obj1).pick(['b', 1], 0, 'a'); // $ExpectType LoDashImplicitWrapper> + _(obj1).pick(readonlyArray); // $ExpectType LoDashImplicitWrapper> + _(obj2).pick('a', 'b'); // $ExpectType LoDashImplicitWrapper> + _(obj2).pick(literalsArray); // $ExpectType LoDashImplicitWrapper> + _(obj2).pick(roLiteralsArray); // $ExpectType LoDashImplicitWrapper> - { - let result: Pick; - result = _.pick(obj2, 'a', 'b'); - result = _.pick(obj2, ['a' as 'a', 'b' as 'b']); - } - - { - let result: _.LoDashImplicitWrapper>; - - result = _(obj1).pick('a'); - result = _(obj1).pick(0, 'a'); - result = _(obj1).pick(['b', 1], 0, 'a'); - } - - { - let result: _.LoDashImplicitWrapper>; - - result = _(obj2).pick('a', 'b'); - result = _(obj2).pick(['a' as 'a', 'b' as 'b']); - } - - { - let result: _.LoDashExplicitWrapper>; - - result = _(obj1).chain().pick('a'); - result = _(obj1).chain().pick(0, 'a'); - result = _(obj1).chain().pick(['b', 1], 0, 'a'); - } - - { - let result: _.LoDashExplicitWrapper>; - - result = _(obj2).chain().pick('a', 'b'); - result = _(obj2).chain().pick(['a' as 'a', 'b' as 'b']); - } + _.chain(obj1).pick('a'); // $ExpectType LoDashExplicitWrapper> + _.chain(obj1).pick(0, 'a'); // $ExpectType LoDashExplicitWrapper> + _.chain(obj1).pick(['b', 1], 0, 'a'); // $ExpectType LoDashExplicitWrapper> + _.chain(obj1).pick(readonlyArray); // $ExpectType LoDashExplicitWrapper> + _.chain(obj2).pick('a', 'b'); // $ExpectType LoDashExplicitWrapper> + _.chain(obj2).pick(literalsArray); // $ExpectType LoDashExplicitWrapper> + _.chain(obj2).pick(roLiteralsArray); // $ExpectType LoDashExplicitWrapper> } // _.pickBy namespace TestPickBy { - let obj: TResult | null | undefined = any; + let obj: AbcObject | null | undefined = anything; let predicate = (element: any, key: string) => true; { - let result: Partial; + let result: Partial; result = _.pickBy(obj, predicate); } { - let result: _.LoDashImplicitWrapper>; + let result: _.LoDashImplicitWrapper>; - result = _(obj).pickBy(predicate); + result = _(obj).pickBy(predicate); } { - let result: _.LoDashExplicitWrapper>; + let result: _.LoDashExplicitWrapper>; - result = _(obj).chain().pickBy(predicate); + result = _(obj).chain().pickBy(predicate); } } @@ -12067,13 +12069,13 @@ namespace TestTransform { let dictionary: _.Dictionary = {}; { - let iterator = (acc: TResult[], curr: number, index?: number, arr?: number[]) => {}; - let accumulator: TResult[] = []; - let result: TResult[]; + let iterator = (acc: AbcObject[], curr: number, index?: number, arr?: number[]) => {}; + let accumulator: AbcObject[] = []; + let result: AbcObject[]; result = _.transform(array); - result = _.transform(array, iterator); - result = _.transform(array, iterator, accumulator); + result = _.transform(array, iterator); + result = _.transform(array, iterator, accumulator); result = _(array).transform().value(); result = _(array).transform(iterator).value(); @@ -12081,37 +12083,37 @@ namespace TestTransform { } { - let iterator = (acc: _.Dictionary, curr: number, index?: number, arr?: number[]) => {}; - let accumulator: _.Dictionary = {}; - let result: _.Dictionary; + let iterator = (acc: _.Dictionary, curr: number, index?: number, arr?: number[]) => {}; + let accumulator: _.Dictionary = {}; + let result: _.Dictionary; - result = _.transform(array, iterator, accumulator); + result = _.transform(array, iterator, accumulator); result = _(array).transform(iterator, accumulator).value(); } { - let iterator = (acc: _.Dictionary, curr: number, key?: string, dict?: _.Dictionary) => {}; - let accumulator: _.Dictionary = {}; - let result: _.Dictionary; + let iterator = (acc: _.Dictionary, curr: number, key?: string, dict?: _.Dictionary) => {}; + let accumulator: _.Dictionary = {}; + let result: _.Dictionary; result = _.transform(dictionary); - result = _.transform(dictionary, iterator); - result = _.transform(dictionary, iterator, accumulator); + result = _.transform(dictionary, iterator); + result = _.transform(dictionary, iterator, accumulator); result = _(dictionary).transform().value(); - result = _(dictionary).transform(iterator).value(); - result = _(dictionary).transform(iterator, accumulator).value(); + result = _(dictionary).transform(iterator).value(); + result = _(dictionary).transform(iterator, accumulator).value(); } { - let iterator = (acc: TResult[], curr: number, key?: string, dict?: _.Dictionary) => {}; - let accumulator: TResult[] = []; - let result: TResult[]; + let iterator = (acc: AbcObject[], curr: number, key?: string, dict?: _.Dictionary) => {}; + let accumulator: AbcObject[] = []; + let result: AbcObject[]; - result = _.transform(dictionary, iterator, accumulator); + result = _.transform(dictionary, iterator, accumulator); - result = _(dictionary).transform(iterator, accumulator).value(); + result = _(dictionary).transform(iterator, accumulator).value(); } } @@ -12344,37 +12346,37 @@ namespace TestValues { // _.valuesIn namespace TestValuesIn { - let object: _.Dictionary = {}; + let object: _.Dictionary = {}; { - let result: TResult[]; + let result: AbcObject[]; result = _.valuesIn(object); } { - let result: TResult[]; + let result: AbcObject[]; // Without this type hint, this will fail to compile, as expected. - result = _.valuesIn({}); + result = _.valuesIn({}); } { - let result: TResult[]; + let result: AbcObject[]; result = _.values(object); } { - let result: _.LoDashImplicitArrayWrapper; + let result: _.LoDashImplicitArrayWrapper; - result = _(object).valuesIn(); + result = _(object).valuesIn(); } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; - result = _(object).chain().valuesIn(); + result = _(object).chain().valuesIn(); } } @@ -13267,7 +13269,7 @@ namespace TestIdentity { } { - let input: { a: number; } | null | undefined = any; + let input: { a: number; } | null | undefined = anything; _.identity(input); // $ExpectType { a: number; } | null | undefined _.identity(); // $ExpectType undefined } @@ -13276,13 +13278,13 @@ namespace TestIdentity { // _.iteratee namespace TestIteratee { { - _.iteratee((...args: any[]): TResult => any); // $ExpectType (...args: any[]) => TResult - _.iteratee((a: TResult): boolean => any); // $ExpectType (a: TResult) => boolean - _.iteratee((a: TResult | undefined): a is undefined => any); // $ExpectType (a: TResult | undefined) => a is undefined + _.iteratee((...args: any[]): AbcObject => anything); // $ExpectType (...args: any[]) => AbcObject + _.iteratee((a: AbcObject): boolean => anything); // $ExpectType (a: AbcObject) => boolean + _.iteratee((a: AbcObject | undefined): a is undefined => anything); // $ExpectType (a: AbcObject | undefined) => a is undefined } { - let result: (object: any) => TResult; + let result: (object: any) => AbcObject; result = _.iteratee(''); } @@ -13294,14 +13296,14 @@ namespace TestIteratee { } { - let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; + let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => AbcObject>; - let func: (...args: any[]) => TResult = any; + let func: (...args: any[]) => AbcObject = anything; result = _(func).iteratee(); } { - let result: _.LoDashImplicitObjectWrapper<(object: any) => TResult>; + let result: _.LoDashImplicitObjectWrapper<(object: any) => AbcObject>; result = _('').iteratee(); } @@ -13313,14 +13315,14 @@ namespace TestIteratee { } { - let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => AbcObject>; - let func: (...args: any[]) => TResult = any; + let func: (...args: any[]) => AbcObject = anything; result = _(func).chain().iteratee(); } { - let result: _.LoDashExplicitObjectWrapper<(object: any) => TResult>; + let result: _.LoDashExplicitObjectWrapper<(object: any) => AbcObject>; result = _('').chain().iteratee(); } @@ -13334,68 +13336,68 @@ namespace TestIteratee { // _.matches namespace TestMatches { - let source: TResult = { a: 1, b: "", c: true }; + let source: AbcObject = { a: 1, b: "", c: true }; { let result: (value: any) => boolean; - result = _.matches(source); + result = _.matches(source); } { - let result: (value: TResult) => boolean; - result = _.matches(source); + let result: (value: AbcObject) => boolean; + result = _.matches(source); } { - let result: _.LoDashImplicitObjectWrapper<(value: TResult) => boolean>; - result = _(source).matches(); + let result: _.LoDashImplicitObjectWrapper<(value: AbcObject) => boolean>; + result = _(source).matches(); } { - let result: _.LoDashExplicitObjectWrapper<(value: TResult) => boolean>; - result = _(source).chain().matches(); + let result: _.LoDashExplicitObjectWrapper<(value: AbcObject) => boolean>; + result = _(source).chain().matches(); } } // _.matchesProperty { let path: string | string[] = []; - let source: TResult = { a: 1, b: "", c: true }; + let source: AbcObject = { a: 1, b: "", c: true }; { let result: (value: any) => boolean; - result = _.matchesProperty(path, source); + result = _.matchesProperty(path, source); } { - let result: (value: TResult) => boolean; + let result: (value: AbcObject) => boolean; - result = _.matchesProperty(path, source); + result = _.matchesProperty(path, source); } { let result: _.LoDashImplicitObjectWrapper<(value: any) => boolean>; - result = _(path).matchesProperty(source); + result = _(path).matchesProperty(source); } { - let result: _.LoDashImplicitObjectWrapper<(value: TResult) => boolean>; + let result: _.LoDashImplicitObjectWrapper<(value: AbcObject) => boolean>; - result = _(path).matchesProperty(source); + result = _(path).matchesProperty(source); } { let result: _.LoDashExplicitObjectWrapper<(value: any) => boolean>; - result = _(path).chain().matchesProperty(source); + result = _(path).chain().matchesProperty(source); } { - let result: _.LoDashExplicitObjectWrapper<(value: TResult) => boolean>; + let result: _.LoDashExplicitObjectWrapper<(value: AbcObject) => boolean>; - result = _(path).chain().matchesProperty(source); + result = _(path).chain().matchesProperty(source); } } @@ -13405,89 +13407,89 @@ namespace TestMethod { let result: (object: any) => {a: string}; result = _.method('a.0'); - result = _.method('a.0', any, any); - result = _.method('a.0', any, any, any); + result = _.method('a.0', anything, anything); + result = _.method('a.0', anything, anything, anything); result = _.method(['a', 0]); - result = _.method(['a', 0], any); - result = _.method(['a', 0], any, any); - result = _.method(['a', 0], any, any, any); + result = _.method(['a', 0], anything); + result = _.method(['a', 0], anything, anything); + result = _.method(['a', 0], anything, anything, anything); } { let result: (object: {a: string}) => {b: string}; result = _.method('a.0'); - result = _.method('a.0', any, any); - result = _.method('a.0', any, any, any); + result = _.method('a.0', anything, anything); + result = _.method('a.0', anything, anything, anything); result = _.method(['a', 0]); - result = _.method(['a', 0], any); - result = _.method(['a', 0], any, any); - result = _.method(['a', 0], any, any, any); + result = _.method(['a', 0], anything); + result = _.method(['a', 0], anything, anything); + result = _.method(['a', 0], anything, anything, anything); } { let result: _.LoDashImplicitObjectWrapper<(object: any) => {a: string}>; result = _('a.0').method(); - result = _('a.0').method(any); - result = _('a.0').method(any, any); - result = _('a.0').method(any, any, any); + result = _('a.0').method(anything); + result = _('a.0').method(anything, anything); + result = _('a.0').method(anything, anything, anything); result = _(['a', 0]).method(); - result = _(['a', 0]).method(any); - result = _(['a', 0]).method(any, any); - result = _(['a', 0]).method(any, any, any); + result = _(['a', 0]).method(anything); + result = _(['a', 0]).method(anything, anything); + result = _(['a', 0]).method(anything, anything, anything); } { let result: _.LoDashImplicitObjectWrapper<(object: {a: string}) => {b: string}>; result = _('a.0').method(); - result = _('a.0').method(any); - result = _('a.0').method(any, any); - result = _('a.0').method(any, any, any); + result = _('a.0').method(anything); + result = _('a.0').method(anything, anything); + result = _('a.0').method(anything, anything, anything); result = _(['a', 0]).method(); - result = _(['a', 0]).method(any); - result = _(['a', 0]).method(any, any); - result = _(['a', 0]).method(any, any, any); + result = _(['a', 0]).method(anything); + result = _(['a', 0]).method(anything, anything); + result = _(['a', 0]).method(anything, anything, anything); } { let result: _.LoDashExplicitObjectWrapper<(object: any) => {a: string}>; result = _('a.0').chain().method(); - result = _('a.0').chain().method(any); - result = _('a.0').chain().method(any, any); - result = _('a.0').chain().method(any, any, any); + result = _('a.0').chain().method(anything); + result = _('a.0').chain().method(anything, anything); + result = _('a.0').chain().method(anything, anything, anything); result = _(['a', 0]).chain().method(); - result = _(['a', 0]).chain().method(any); - result = _(['a', 0]).chain().method(any, any); - result = _(['a', 0]).chain().method(any, any, any); + result = _(['a', 0]).chain().method(anything); + result = _(['a', 0]).chain().method(anything, anything); + result = _(['a', 0]).chain().method(anything, anything, anything); } { let result: _.LoDashExplicitObjectWrapper<(object: {a: string}) => {b: string}>; result = _('a.0').chain().method(); - result = _('a.0').chain().method(any); - result = _('a.0').chain().method(any, any); - result = _('a.0').chain().method(any, any, any); + result = _('a.0').chain().method(anything); + result = _('a.0').chain().method(anything, anything); + result = _('a.0').chain().method(anything, anything, anything); result = _(['a', 0]).chain().method(); - result = _(['a', 0]).chain().method(any); - result = _(['a', 0]).chain().method(any, any); - result = _(['a', 0]).chain().method(any, any, any); + result = _(['a', 0]).chain().method(anything); + result = _(['a', 0]).chain().method(anything, anything); + result = _(['a', 0]).chain().method(anything, anything, anything); } } // _.methodOf namespace TestMethodOf { - type SampleObject = { a: Array<{ b(): TResult }> }; - type ResultFn = (path: string | string[]) => TResult; + type SampleObject = { a: Array<{ b(): AbcObject }> }; + type ResultFn = (path: string | string[]) => AbcObject; let object: SampleObject = { a: [] }; @@ -13495,34 +13497,34 @@ namespace TestMethodOf { let result: ResultFn; result = _.methodOf(object); - result = _.methodOf(object, any); - result = _.methodOf(object, any, any); - result = _.methodOf(object, any, any, any); + result = _.methodOf(object, anything); + result = _.methodOf(object, anything, anything); + result = _.methodOf(object, anything, anything, anything); } { let result: _.LoDashImplicitObjectWrapper; result = _(object).methodOf(); - result = _(object).methodOf(any); - result = _(object).methodOf(any, any); - result = _(object).methodOf(any, any, any); + result = _(object).methodOf(anything); + result = _(object).methodOf(anything, anything); + result = _(object).methodOf(anything, anything, anything); } { let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().methodOf(); - result = _(object).chain().methodOf(any); - result = _(object).chain().methodOf(any, any); - result = _(object).chain().methodOf(any, any, any); + result = _(object).chain().methodOf(anything); + result = _(object).chain().methodOf(anything, anything); + result = _(object).chain().methodOf(anything, anything, anything); } } // _.mixin namespace TestMixin { let source: _.Dictionary<(...args: any[]) => any> = {}; - let dest: TResult = any; + let dest: AbcObject = anything; let options: {chain?: boolean} = {}; { @@ -13533,7 +13535,7 @@ namespace TestMixin { } { - let result: TResult; + let result: AbcObject; result = _.mixin(dest, source); result = _.mixin(dest, source, options); @@ -13547,7 +13549,7 @@ namespace TestMixin { } { - let result: _.LoDashImplicitWrapper; + let result: _.LoDashImplicitWrapper; result = _(dest).mixin(source); result = _(dest).mixin(source, options); @@ -13561,7 +13563,7 @@ namespace TestMixin { } { - let result: _.LoDashExplicitWrapper; + let result: _.LoDashExplicitWrapper; result = _(dest).chain().mixin(source); result = _(dest).chain().mixin(source, options); @@ -13602,7 +13604,7 @@ namespace TestNoop { result = _([1]).noop(true, 'a', 1); result = _(['']).noop(true, 'a', 1); result = _({}).noop(true, 'a', 1); - result = _(any).noop(true, 'a', 1); + result = _(anything).noop(true, 'a', 1); } { @@ -13612,7 +13614,7 @@ namespace TestNoop { result = _([1]).chain().noop(true, 'a', 1); result = _(['']).chain().noop(true, 'a', 1); result = _({}).chain().noop(true, 'a', 1); - result = _(any).chain().noop(true, 'a', 1); + result = _(anything).chain().noop(true, 'a', 1); } } @@ -13863,7 +13865,7 @@ namespace TestRangeRight { let result: any[]; result = _.stubArray(); - result = _(any).stubArray(); + result = _(anything).stubArray(); } { @@ -13873,7 +13875,7 @@ namespace TestRangeRight { result = _([1]).chain().stubArray(); result = _(['']).chain().stubArray(); result = _({}).chain().stubArray(); - result = _(any).chain().stubArray(); + result = _(anything).chain().stubArray(); } } @@ -13883,7 +13885,7 @@ namespace TestRangeRight { let result: boolean; result = _.stubFalse(); - result = _(any).stubFalse(); + result = _(anything).stubFalse(); } { @@ -13893,7 +13895,7 @@ namespace TestRangeRight { result = _([1]).chain().stubFalse(); result = _(['']).chain().stubFalse(); result = _({}).chain().stubFalse(); - result = _(any).chain().stubFalse(); + result = _(anything).chain().stubFalse(); } } @@ -13903,7 +13905,7 @@ namespace TestRangeRight { let result: object; result = _.stubObject(); - result = _(any).stubObject(); + result = _(anything).stubObject(); } { @@ -13913,7 +13915,7 @@ namespace TestRangeRight { result = _([1]).chain().stubObject(); result = _(['']).chain().stubObject(); result = _({}).chain().stubObject(); - result = _(any).chain().stubObject(); + result = _(anything).chain().stubObject(); } } @@ -13923,7 +13925,7 @@ namespace TestRangeRight { let result: string; result = _.stubString(); - result = _(any).stubString(); + result = _(anything).stubString(); } { @@ -13933,7 +13935,7 @@ namespace TestRangeRight { result = _([1]).chain().stubString(); result = _(['']).chain().stubString(); result = _({}).chain().stubString(); - result = _(any).chain().stubString(); + result = _(anything).chain().stubString(); } } @@ -13943,7 +13945,7 @@ namespace TestRangeRight { let result: boolean; result = _.stubTrue(); - result = _(any).stubTrue(); + result = _(anything).stubTrue(); } { @@ -13953,13 +13955,13 @@ namespace TestRangeRight { result = _([1]).chain().stubTrue(); result = _(['']).chain().stubTrue(); result = _({}).chain().stubTrue(); - result = _(any).chain().stubTrue(); + result = _(anything).chain().stubTrue(); } } // _.times namespace TestTimes { - let iteratee: (num: number) => TResult = (num: number) => ({ a: 1, b: "", c: true }); + let iteratee: (num: number) => AbcObject = (num: number) => ({ a: 1, b: "", c: true }); { let result: number[]; @@ -13969,7 +13971,7 @@ namespace TestTimes { } { - let result: TResult[]; + let result: AbcObject[]; result = _.times(42, iteratee); result = _(42).times(iteratee); @@ -13982,7 +13984,7 @@ namespace TestTimes { } { - let result: _.LoDashExplicitArrayWrapper; + let result: _.LoDashExplicitArrayWrapper; result = _(42).chain().times(iteratee); } diff --git a/types/lodash/math/add.d.ts b/types/lodash/math/add.d.ts new file mode 100644 index 0000000000..573178e0f4 --- /dev/null +++ b/types/lodash/math/add.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..a51048c2f2 --- /dev/null +++ b/types/lodash/math/ceil.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..be6bc0abbd --- /dev/null +++ b/types/lodash/math/divide.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..81b490af1d --- /dev/null +++ b/types/lodash/math/floor.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..20efcebef6 --- /dev/null +++ b/types/lodash/math/max.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..adc787a911 --- /dev/null +++ b/types/lodash/math/maxBy.d.ts @@ -0,0 +1,49 @@ +import _ = require("../index"); +declare module "../index" { + 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..ebaa42ce32 --- /dev/null +++ b/types/lodash/math/mean.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + 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..a6bf558754 --- /dev/null +++ b/types/lodash/math/meanBy.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + 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..ac441afa83 --- /dev/null +++ b/types/lodash/math/min.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..fad6e5a284 --- /dev/null +++ b/types/lodash/math/minBy.d.ts @@ -0,0 +1,49 @@ +import _ = require("../index"); +declare module "../index" { + 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..0767ee1154 --- /dev/null +++ b/types/lodash/math/multiply.d.ts @@ -0,0 +1,29 @@ +import _ = require("../index"); +declare module "../index" { + 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..59f97c3144 --- /dev/null +++ b/types/lodash/math/round.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..5b627db982 --- /dev/null +++ b/types/lodash/math/subtract.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + 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..ab9222900d --- /dev/null +++ b/types/lodash/math/sum.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + 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..240dca6919 --- /dev/null +++ b/types/lodash/math/sumBy.d.ts @@ -0,0 +1,53 @@ +import _ = require("../index"); +declare module "../index" { + 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/number/clamp.d.ts b/types/lodash/number/clamp.d.ts new file mode 100644 index 0000000000..af2b47c995 --- /dev/null +++ b/types/lodash/number/clamp.d.ts @@ -0,0 +1,56 @@ +import _ = require("../index"); +declare module "../index" { + 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..c3215a1c0f --- /dev/null +++ b/types/lodash/number/inRange.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + 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..a6522326f6 --- /dev/null +++ b/types/lodash/number/random.d.ts @@ -0,0 +1,85 @@ +import _ = require("../index"); +declare module "../index" { + 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..17d282a8ec --- /dev/null +++ b/types/lodash/object/assign.d.ts @@ -0,0 +1,172 @@ +import _ = require("../index"); +declare module "../index" { + 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..01b38f7efa --- /dev/null +++ b/types/lodash/object/assignIn.d.ts @@ -0,0 +1,171 @@ +import _ = require("../index"); +declare module "../index" { + 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..776a81b580 --- /dev/null +++ b/types/lodash/object/assignInWith.d.ts @@ -0,0 +1,183 @@ +import _ = require("../index"); +declare module "../index" { + 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..4b98ad5e53 --- /dev/null +++ b/types/lodash/object/assignWith.d.ts @@ -0,0 +1,180 @@ +import _ = require("../index"); +declare module "../index" { + 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..c95f8c9600 --- /dev/null +++ b/types/lodash/object/at.d.ts @@ -0,0 +1,61 @@ +import _ = require("../index"); +declare module "../index" { + 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..836cc05425 --- /dev/null +++ b/types/lodash/object/create.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + 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..956d5b4022 --- /dev/null +++ b/types/lodash/object/defaults.d.ts @@ -0,0 +1,155 @@ +import _ = require("../index"); +declare module "../index" { + 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..a9aa5d6b53 --- /dev/null +++ b/types/lodash/object/defaultsDeep.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..786b2a7abd --- /dev/null +++ b/types/lodash/object/entries.d.ts @@ -0,0 +1,38 @@ +import _ = require("../index"); +declare module "../index" { + 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..fcd378032e --- /dev/null +++ b/types/lodash/object/entriesIn.d.ts @@ -0,0 +1,38 @@ +import _ = require("../index"); +declare module "../index" { + 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..3bdace2de1 --- /dev/null +++ b/types/lodash/object/extend.d.ts @@ -0,0 +1,147 @@ +import _ = require("../index"); +declare module "../index" { + 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..191c69dd8b --- /dev/null +++ b/types/lodash/object/extendWith.d.ts @@ -0,0 +1,159 @@ +import _ = require("../index"); +declare module "../index" { + 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..2e35165e24 --- /dev/null +++ b/types/lodash/object/findKey.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + 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..6a43330138 --- /dev/null +++ b/types/lodash/object/findLastKey.d.ts @@ -0,0 +1,46 @@ +import _ = require("../index"); +declare module "../index" { + 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..7fa7e14a33 --- /dev/null +++ b/types/lodash/object/forIn.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + 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..0364db0403 --- /dev/null +++ b/types/lodash/object/forInRight.d.ts @@ -0,0 +1,35 @@ +import _ = require("../index"); +declare module "../index" { + 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..eeeb4adef6 --- /dev/null +++ b/types/lodash/object/forOwn.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + 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..e760dfa78f --- /dev/null +++ b/types/lodash/object/forOwnRight.d.ts @@ -0,0 +1,35 @@ +import _ = require("../index"); +declare module "../index" { + 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..bcc15d01e8 --- /dev/null +++ b/types/lodash/object/functions.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + 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..84b8e88959 --- /dev/null +++ b/types/lodash/object/functionsIn.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + 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..ff793192fb --- /dev/null +++ b/types/lodash/object/get.d.ts @@ -0,0 +1,238 @@ +import _ = require("../index"); +declare module "../index" { + 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..53026153d1 --- /dev/null +++ b/types/lodash/object/has.d.ts @@ -0,0 +1,47 @@ +import _ = require("../index"); +declare module "../index" { + 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..5da20394b2 --- /dev/null +++ b/types/lodash/object/hasIn.d.ts @@ -0,0 +1,46 @@ +import _ = require("../index"); +declare module "../index" { + 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..d5c62aa9af --- /dev/null +++ b/types/lodash/object/invert.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..12b90969e1 --- /dev/null +++ b/types/lodash/object/invertBy.d.ts @@ -0,0 +1,62 @@ +import _ = require("../index"); +declare module "../index" { + 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..9405c4fa6c --- /dev/null +++ b/types/lodash/object/invoke.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + 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..374e64ad2c --- /dev/null +++ b/types/lodash/object/keys.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..fe05763414 --- /dev/null +++ b/types/lodash/object/keysIn.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..620977cdb1 --- /dev/null +++ b/types/lodash/object/mapKeys.d.ts @@ -0,0 +1,86 @@ +import _ = require("../index"); +declare module "../index" { + 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..e71e1c7f3e --- /dev/null +++ b/types/lodash/object/mapValues.d.ts @@ -0,0 +1,189 @@ +import _ = require("../index"); +declare module "../index" { + 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..0c18e6cfe5 --- /dev/null +++ b/types/lodash/object/merge.d.ts @@ -0,0 +1,156 @@ +import _ = require("../index"); +declare module "../index" { + 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..01fb9264e6 --- /dev/null +++ b/types/lodash/object/mergeWith.d.ts @@ -0,0 +1,133 @@ +import _ = require("../index"); +declare module "../index" { + 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..8684b37b61 --- /dev/null +++ b/types/lodash/object/omit.d.ts @@ -0,0 +1,69 @@ +import _ = require("../index"); +declare module "../index" { + 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..d6c762e496 --- /dev/null +++ b/types/lodash/object/omitBy.d.ts @@ -0,0 +1,45 @@ +import _ = require("../index"); +declare module "../index" { + 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..0561c58630 --- /dev/null +++ b/types/lodash/object/pick.d.ts @@ -0,0 +1,68 @@ +import _ = require("../index"); +declare module "../index" { + 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..98b3c717dc --- /dev/null +++ b/types/lodash/object/pickBy.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + 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..ea06014ae5 --- /dev/null +++ b/types/lodash/object/result.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + 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..fe406347e7 --- /dev/null +++ b/types/lodash/object/set.d.ts @@ -0,0 +1,65 @@ +import _ = require("../index"); +declare module "../index" { + 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..63f470180b --- /dev/null +++ b/types/lodash/object/setWith.d.ts @@ -0,0 +1,71 @@ +import _ = require("../index"); +declare module "../index" { + 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..42c4edab2f --- /dev/null +++ b/types/lodash/object/toPairs.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + 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..ee6818c212 --- /dev/null +++ b/types/lodash/object/toPairsIn.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + 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..817f51a4b2 --- /dev/null +++ b/types/lodash/object/transform.d.ts @@ -0,0 +1,163 @@ +import _ = require("../index"); +declare module "../index" { + 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..0cf4b56f92 --- /dev/null +++ b/types/lodash/object/unset.d.ts @@ -0,0 +1,32 @@ +import _ = require("../index"); +declare module "../index" { + 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..4289efca72 --- /dev/null +++ b/types/lodash/object/update.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + 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..4da0be8ce5 --- /dev/null +++ b/types/lodash/object/updateWith.d.ts @@ -0,0 +1,83 @@ +import _ = require("../index"); +declare module "../index" { + 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..d1dfa1177b --- /dev/null +++ b/types/lodash/object/values.d.ts @@ -0,0 +1,56 @@ +import _ = require("../index"); +declare module "../index" { + 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..22730438f5 --- /dev/null +++ b/types/lodash/object/valuesIn.d.ts @@ -0,0 +1,41 @@ +import _ = require("../index"); +declare module "../index" { + 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/seq/chain.d.ts b/types/lodash/seq/chain.d.ts new file mode 100644 index 0000000000..9edc42f881 --- /dev/null +++ b/types/lodash/seq/chain.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..3a6a35d69b --- /dev/null +++ b/types/lodash/seq/prototype.at.d.ts @@ -0,0 +1,12 @@ +// import _ = require("../index"); +// declare module "../index" { +// 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..9edc42f881 --- /dev/null +++ b/types/lodash/seq/prototype.chain.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..f22477f2f9 --- /dev/null +++ b/types/lodash/seq/prototype.commit.d.ts @@ -0,0 +1,11 @@ +import _ = require("../index"); +declare module "../index" { + 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.plant.d.ts b/types/lodash/seq/prototype.plant.d.ts new file mode 100644 index 0000000000..6025b09381 --- /dev/null +++ b/types/lodash/seq/prototype.plant.d.ts @@ -0,0 +1,18 @@ +import _ = require("../index"); +declare module "../index" { + 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..66526e729b --- /dev/null +++ b/types/lodash/seq/prototype.reverse.d.ts @@ -0,0 +1,14 @@ +import _ = require("../index"); +declare module "../index" { + 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..22da767aec --- /dev/null +++ b/types/lodash/seq/prototype.toJSON.d.ts @@ -0,0 +1,9 @@ +import _ = require("../index"); +declare module "../index" { + 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..4deef48ec0 --- /dev/null +++ b/types/lodash/seq/prototype.toString.d.ts @@ -0,0 +1,11 @@ +import _ = require("../index"); +declare module "../index" { + 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..9ba88a8250 --- /dev/null +++ b/types/lodash/seq/prototype.value.d.ts @@ -0,0 +1,13 @@ +import _ = require("../index"); +declare module "../index" { + 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..6a69f1f202 --- /dev/null +++ b/types/lodash/seq/prototype.valueOf.d.ts @@ -0,0 +1,9 @@ +import _ = require("../index"); +declare module "../index" { + interface LoDashWrapper { + /** + * @see _.value + */ + valueOf(): TValue; + } +} \ No newline at end of file diff --git a/types/lodash/seq/tap.d.ts b/types/lodash/seq/tap.d.ts new file mode 100644 index 0000000000..dd4fc8d754 --- /dev/null +++ b/types/lodash/seq/tap.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..295011945a --- /dev/null +++ b/types/lodash/seq/thru.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + 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..8362137353 --- /dev/null +++ b/types/lodash/string/camelCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..678f1c1de6 --- /dev/null +++ b/types/lodash/string/capitalize.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..85d3476be1 --- /dev/null +++ b/types/lodash/string/deburr.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..383c0acc41 --- /dev/null +++ b/types/lodash/string/endsWith.d.ts @@ -0,0 +1,38 @@ +import _ = require("../index"); +declare module "../index" { + 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..21131ee05f --- /dev/null +++ b/types/lodash/string/escape.d.ts @@ -0,0 +1,37 @@ +import _ = require("../index"); +declare module "../index" { + 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..a05b2b80ab --- /dev/null +++ b/types/lodash/string/escapeRegExp.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..eac11176a7 --- /dev/null +++ b/types/lodash/string/kebabCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..5349f3af18 --- /dev/null +++ b/types/lodash/string/lowerCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..54cacab3e6 --- /dev/null +++ b/types/lodash/string/lowerFirst.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..d47f48afad --- /dev/null +++ b/types/lodash/string/pad.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + 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..ed4c552705 --- /dev/null +++ b/types/lodash/string/padEnd.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + 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..02f2ce2752 --- /dev/null +++ b/types/lodash/string/padStart.d.ts @@ -0,0 +1,39 @@ +import _ = require("../index"); +declare module "../index" { + 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..082b45617d --- /dev/null +++ b/types/lodash/string/parseInt.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + 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..a72cda78b1 --- /dev/null +++ b/types/lodash/string/repeat.d.ts @@ -0,0 +1,32 @@ +import _ = require("../index"); +declare module "../index" { + 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..9245e2d712 --- /dev/null +++ b/types/lodash/string/replace.d.ts @@ -0,0 +1,59 @@ +import _ = require("../index"); +declare module "../index" { + 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..efdaac05d0 --- /dev/null +++ b/types/lodash/string/snakeCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..e964d851ce --- /dev/null +++ b/types/lodash/string/split.d.ts @@ -0,0 +1,56 @@ +import _ = require("../index"); +declare module "../index" { + 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..19e0551bf6 --- /dev/null +++ b/types/lodash/string/startCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..6090c2ed69 --- /dev/null +++ b/types/lodash/string/startsWith.d.ts @@ -0,0 +1,38 @@ +import _ = require("../index"); +declare module "../index" { + 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..a876c72fd8 --- /dev/null +++ b/types/lodash/string/template.d.ts @@ -0,0 +1,61 @@ +import _ = require("../index"); +declare module "../index" { + 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..522014d583 --- /dev/null +++ b/types/lodash/string/toLower.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..5b2215685b --- /dev/null +++ b/types/lodash/string/toUpper.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..47e2a81d36 --- /dev/null +++ b/types/lodash/string/trim.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + 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..1af345dd74 --- /dev/null +++ b/types/lodash/string/trimEnd.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + 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..1055f6b1d3 --- /dev/null +++ b/types/lodash/string/trimStart.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + 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..23d4039356 --- /dev/null +++ b/types/lodash/string/truncate.d.ts @@ -0,0 +1,40 @@ +import _ = require("../index"); +declare module "../index" { + 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..3e2be90abb --- /dev/null +++ b/types/lodash/string/unescape.d.ts @@ -0,0 +1,30 @@ +import _ = require("../index"); +declare module "../index" { + 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..d33b6885b9 --- /dev/null +++ b/types/lodash/string/upperCase.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..692aa702cd --- /dev/null +++ b/types/lodash/string/upperFirst.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..4ca4530513 --- /dev/null +++ b/types/lodash/string/words.d.ts @@ -0,0 +1,44 @@ +import _ = require("../index"); +declare module "../index" { + 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/tsconfig.json b/types/lodash/tsconfig.json index af6ba5e2e9..7bd90cb77f 100644 --- a/types/lodash/tsconfig.json +++ b/types/lodash/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -318,4 +319,4 @@ "zipObjectDeep.d.ts", "zipWith.d.ts" ] -} +} \ 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..b539421d13 --- /dev/null +++ b/types/lodash/util/attempt.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..1ebe05fe60 --- /dev/null +++ b/types/lodash/util/bindAll.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..036f518184 --- /dev/null +++ b/types/lodash/util/cond.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + 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..9da61cedd1 --- /dev/null +++ b/types/lodash/util/conforms.d.ts @@ -0,0 +1,28 @@ +import _ = require("../index"); +declare module "../index" { + 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..9255171af1 --- /dev/null +++ b/types/lodash/util/constant.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..ced0e976c5 --- /dev/null +++ b/types/lodash/util/defaultTo.d.ts @@ -0,0 +1,53 @@ +import _ = require("../index"); +declare module "../index" { + 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..90736c5da4 --- /dev/null +++ b/types/lodash/util/flow.d.ts @@ -0,0 +1,171 @@ +import _ = require("../index"); +declare module "../index" { + 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..e61f162ce3 --- /dev/null +++ b/types/lodash/util/flowRight.d.ts @@ -0,0 +1,156 @@ +import _ = require("../index"); +declare module "../index" { + 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..6fff4525ad --- /dev/null +++ b/types/lodash/util/identity.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + 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..b41c6d3cf2 --- /dev/null +++ b/types/lodash/util/iteratee.d.ts @@ -0,0 +1,58 @@ +import _ = require("../index"); +declare module "../index" { + 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..b919ffbbcc --- /dev/null +++ b/types/lodash/util/matches.d.ts @@ -0,0 +1,36 @@ +import _ = require("../index"); +declare module "../index" { + 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..fc574be4f9 --- /dev/null +++ b/types/lodash/util/matchesProperty.d.ts @@ -0,0 +1,59 @@ +import _ = require("../index"); +declare module "../index" { + 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..09c508caef --- /dev/null +++ b/types/lodash/util/method.d.ts @@ -0,0 +1,31 @@ +import _ = require("../index"); +declare module "../index" { + 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..4ec4d15515 --- /dev/null +++ b/types/lodash/util/methodOf.d.ts @@ -0,0 +1,35 @@ +import _ = require("../index"); +declare module "../index" { + 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..02237ae751 --- /dev/null +++ b/types/lodash/util/mixin.d.ts @@ -0,0 +1,69 @@ +import _ = require("../index"); +declare module "../index" { + 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..80ecca9f10 --- /dev/null +++ b/types/lodash/util/noConflict.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + 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..ca66677e57 --- /dev/null +++ b/types/lodash/util/noop.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + 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..c5b6b0d5db --- /dev/null +++ b/types/lodash/util/nthArg.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..2b4b49f573 --- /dev/null +++ b/types/lodash/util/over.d.ts @@ -0,0 +1,33 @@ +import _ = require("../index"); +declare module "../index" { + 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..d061d3ec72 --- /dev/null +++ b/types/lodash/util/overEvery.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..1ff92f8d42 --- /dev/null +++ b/types/lodash/util/overSome.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..8edab90248 --- /dev/null +++ b/types/lodash/util/property.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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..cc272ec7bf --- /dev/null +++ b/types/lodash/util/propertyOf.d.ts @@ -0,0 +1,27 @@ +import _ = require("../index"); +declare module "../index" { + 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..35bf7e3d2e --- /dev/null +++ b/types/lodash/util/range.d.ts @@ -0,0 +1,56 @@ +import _ = require("../index"); +declare module "../index" { + 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..ced80d5968 --- /dev/null +++ b/types/lodash/util/rangeRight.d.ts @@ -0,0 +1,77 @@ +import _ = require("../index"); +declare module "../index" { + 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..38fb1ff6b1 --- /dev/null +++ b/types/lodash/util/runInContext.d.ts @@ -0,0 +1,19 @@ +import _ = require("../index"); +declare module "../index" { + 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..b8440b7f25 --- /dev/null +++ b/types/lodash/util/stubArray.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + 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..394bdc5cce --- /dev/null +++ b/types/lodash/util/stubFalse.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + 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..877decfcf0 --- /dev/null +++ b/types/lodash/util/stubObject.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + 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..6967aafc14 --- /dev/null +++ b/types/lodash/util/stubString.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + 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..2a18d82e88 --- /dev/null +++ b/types/lodash/util/stubTrue.d.ts @@ -0,0 +1,25 @@ +import _ = require("../index"); +declare module "../index" { + 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..1056080ebf --- /dev/null +++ b/types/lodash/util/times.d.ts @@ -0,0 +1,50 @@ +import _ = require("../index"); +declare module "../index" { + 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..e98a9eb30f --- /dev/null +++ b/types/lodash/util/toPath.d.ts @@ -0,0 +1,43 @@ +import _ = require("../index"); +declare module "../index" { + 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..75bedcaa94 --- /dev/null +++ b/types/lodash/util/uniqueId.d.ts @@ -0,0 +1,26 @@ +import _ = require("../index"); +declare module "../index" { + 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 diff --git a/types/lodash/v3/tsconfig.json b/types/lodash/v3/tsconfig.json index 5c5613d3f6..1040ab2909 100644 --- a/types/lodash/v3/tsconfig.json +++ b/types/lodash/v3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/log-symbols/tsconfig.json b/types/log-symbols/tsconfig.json index 8677d194b0..ea0c26df1f 100644 --- a/types/log-symbols/tsconfig.json +++ b/types/log-symbols/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/log-update/tsconfig.json b/types/log-update/tsconfig.json index 888455297b..adf2bc1f11 100644 --- a/types/log-update/tsconfig.json +++ b/types/log-update/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/logat/tsconfig.json b/types/logat/tsconfig.json index 75453c3721..9d7c306b17 100644 --- a/types/logat/tsconfig.json +++ b/types/logat/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/logform/tsconfig.json b/types/logform/tsconfig.json index 5b68ac3c28..c8f0b78465 100644 --- a/types/logform/tsconfig.json +++ b/types/logform/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "logform-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/logg/tsconfig.json b/types/logg/tsconfig.json index 9dd1a361e7..3aa48bf94a 100644 --- a/types/logg/tsconfig.json +++ b/types/logg/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loggly/tsconfig.json b/types/loggly/tsconfig.json index 76b8a59ac2..7f58c0566a 100644 --- a/types/loggly/tsconfig.json +++ b/types/loggly/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loglevel/tsconfig.json b/types/loglevel/tsconfig.json index 4d370f7a24..24356220d6 100644 --- a/types/loglevel/tsconfig.json +++ b/types/loglevel/tsconfig.json @@ -14,11 +14,12 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "test/loglevel-tests.ts", "test/loglevel-umd-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/logrotate-stream/tsconfig.json b/types/logrotate-stream/tsconfig.json index 2f82ad189f..71cfc9061a 100644 --- a/types/logrotate-stream/tsconfig.json +++ b/types/logrotate-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lokijs/tsconfig.json b/types/lokijs/tsconfig.json index 96175c28a4..39e3841c03 100644 --- a/types/lokijs/tsconfig.json +++ b/types/lokijs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lolex/tsconfig.json b/types/lolex/tsconfig.json index e9ab242410..6a181ec052 100644 --- a/types/lolex/tsconfig.json +++ b/types/lolex/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/long/tsconfig.json b/types/long/tsconfig.json index 2d90b2337f..6a07cb3a61 100644 --- a/types/long/tsconfig.json +++ b/types/long/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loopback-boot/loopback-boot-tests.ts b/types/loopback-boot/loopback-boot-tests.ts index 5de95d00c6..8fa409c768 100644 --- a/types/loopback-boot/loopback-boot-tests.ts +++ b/types/loopback-boot/loopback-boot-tests.ts @@ -1,6 +1,6 @@ -import * as loopback from 'loopback'; -import * as boot from 'loopback-boot'; -import * as cookieParser from 'cookie-parser'; +import loopback = require('loopback'); +import boot = require('loopback-boot'); +import cookieParser = require('cookie-parser'); class Server { app: loopback.LoopBackApplication; diff --git a/types/loopback-boot/tsconfig.json b/types/loopback-boot/tsconfig.json index 2a7cbe1ca5..6f4a061162 100644 --- a/types/loopback-boot/tsconfig.json +++ b/types/loopback-boot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loopback/index.d.ts b/types/loopback/index.d.ts index 99fc4d4ccb..087ce2aadd 100644 --- a/types/loopback/index.d.ts +++ b/types/loopback/index.d.ts @@ -2653,7 +2653,7 @@ declare namespace l { * if a principal is in the specified role. * Should provide a callback or return a promise. */ - static registerResolver(role: string, resolver: () => void): void; + static registerResolver(role: string, resolver: (role: string, ctx: Context, callback?: (err: Error, resolved: boolean) => void) => Promise | void): void; } /** diff --git a/types/loopback/loopback-tests.ts b/types/loopback/loopback-tests.ts index ed37bf5804..359e6977b6 100644 --- a/types/loopback/loopback-tests.ts +++ b/types/loopback/loopback-tests.ts @@ -1,5 +1,5 @@ -import * as loopback from 'loopback'; -import * as cookieParser from 'cookie-parser'; +import loopback = require('loopback'); +import cookieParser = require('cookie-parser'); class TestModel { id: number; diff --git a/types/loopback/tsconfig.json b/types/loopback/tsconfig.json index b967450fde..c823167232 100644 --- a/types/loopback/tsconfig.json +++ b/types/loopback/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lorem-ipsum/tsconfig.json b/types/lorem-ipsum/tsconfig.json index c1f3e00374..5575163410 100644 --- a/types/lorem-ipsum/tsconfig.json +++ b/types/lorem-ipsum/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lory.js/tsconfig.json b/types/lory.js/tsconfig.json index 94d47b69ea..6421fd1c74 100644 --- a/types/lory.js/tsconfig.json +++ b/types/lory.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/loud-rejection/tsconfig.json b/types/loud-rejection/tsconfig.json index 56909e692c..10ea4f7604 100644 --- a/types/loud-rejection/tsconfig.json +++ b/types/loud-rejection/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lovefield/tsconfig.json b/types/lovefield/tsconfig.json index fa9ed6e11d..08338eadd1 100644 --- a/types/lovefield/tsconfig.json +++ b/types/lovefield/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lowdb/tsconfig.json b/types/lowdb/tsconfig.json index 7897564789..1de72964d4 100644 --- a/types/lowdb/tsconfig.json +++ b/types/lowdb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -28,4 +29,4 @@ "lib/main.d.ts", "lowdb-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/lowlight/tsconfig.json b/types/lowlight/tsconfig.json index 31ecea4b06..0a49e6766b 100644 --- a/types/lowlight/tsconfig.json +++ b/types/lowlight/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lozad/tsconfig.json b/types/lozad/tsconfig.json index 9243f7f7d4..d61aba4331 100644 --- a/types/lozad/tsconfig.json +++ b/types/lozad/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lru-cache/tsconfig.json b/types/lru-cache/tsconfig.json index de5c387339..f43250b4df 100644 --- a/types/lru-cache/tsconfig.json +++ b/types/lru-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lscache/tsconfig.json b/types/lscache/tsconfig.json index 50876365a3..2d2820887b 100644 --- a/types/lscache/tsconfig.json +++ b/types/lscache/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ltx/tsconfig.json b/types/ltx/tsconfig.json index d4af416e4b..6dc4e36d43 100644 --- a/types/ltx/tsconfig.json +++ b/types/ltx/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/luaparse/tsconfig.json b/types/luaparse/tsconfig.json index 8e932f496e..20bb41fd6f 100644 --- a/types/luaparse/tsconfig.json +++ b/types/luaparse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lunr/tsconfig.json b/types/lunr/tsconfig.json index 87faffb76d..703cfe59e2 100644 --- a/types/lunr/tsconfig.json +++ b/types/lunr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lunr/v0/tsconfig.json b/types/lunr/v0/tsconfig.json index a98126157c..e5e4452efe 100644 --- a/types/lunr/v0/tsconfig.json +++ b/types/lunr/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lusca/tsconfig.json b/types/lusca/tsconfig.json index ede7926c1c..121ac13cb6 100644 --- a/types/lusca/tsconfig.json +++ b/types/lusca/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "lusca-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index 327fe15ade..7229e45dc4 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -294,6 +294,7 @@ declare module 'luxon' { function eras(length?: EraLength, options?: InfoOptions): string[]; function features(): Features; function hasDST(zone: string | Zone): boolean; + function isValidIANAZone(zone: string): boolean; function meridiems(options?: InfoOptions): string[]; function months(length?: UnitLength, options?: UnitOptions): string[]; function monthsFormat(length?: UnitLength, options?: UnitOptions): string[]; diff --git a/types/luxon/tsconfig.json b/types/luxon/tsconfig.json index e1b0e7864c..5cc88630a1 100644 --- a/types/luxon/tsconfig.json +++ b/types/luxon/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "luxon-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/lwip/tsconfig.json b/types/lwip/tsconfig.json index 769d843dfa..9ee6b81563 100644 --- a/types/lwip/tsconfig.json +++ b/types/lwip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/lz-string/tsconfig.json b/types/lz-string/tsconfig.json index 40ca2ffb09..dde67f8095 100644 --- a/types/lz-string/tsconfig.json +++ b/types/lz-string/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/magic-number/tsconfig.json b/types/magic-number/tsconfig.json index 8dedeff2ce..b1f79faabc 100644 --- a/types/magic-number/tsconfig.json +++ b/types/magic-number/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/magicsuggest/tsconfig.json b/types/magicsuggest/tsconfig.json index 19b82ea9cd..c653b426c2 100644 --- a/types/magicsuggest/tsconfig.json +++ b/types/magicsuggest/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/magnet-uri/tsconfig.json b/types/magnet-uri/tsconfig.json index e47bf7de89..6e9dde38d8 100644 --- a/types/magnet-uri/tsconfig.json +++ b/types/magnet-uri/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mailcheck/tsconfig.json b/types/mailcheck/tsconfig.json index 9f3bada102..29af1c15d0 100644 --- a/types/mailcheck/tsconfig.json +++ b/types/mailcheck/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/maildev/tsconfig.json b/types/maildev/tsconfig.json index e7d5d8aa90..dff916fbd2 100644 --- a/types/maildev/tsconfig.json +++ b/types/maildev/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mailgen/tsconfig.json b/types/mailgen/tsconfig.json index be58901e20..54d65b6c43 100644 --- a/types/mailgen/tsconfig.json +++ b/types/mailgen/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mailparser/tsconfig.json b/types/mailparser/tsconfig.json index 0e85dee795..3570cc37d0 100644 --- a/types/mailparser/tsconfig.json +++ b/types/mailparser/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/main-bower-files/tsconfig.json b/types/main-bower-files/tsconfig.json index bde61fa6db..03d4c7ad1f 100644 --- a/types/main-bower-files/tsconfig.json +++ b/types/main-bower-files/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mainloop.js/tsconfig.json b/types/mainloop.js/tsconfig.json index b8e7bf9fd5..784abcc46e 100644 --- a/types/mainloop.js/tsconfig.json +++ b/types/mainloop.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/make-dir/tsconfig.json b/types/make-dir/tsconfig.json index f1770d52af..90fb4e1cdc 100644 --- a/types/make-dir/tsconfig.json +++ b/types/make-dir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/maker.js/tsconfig.json b/types/maker.js/tsconfig.json index 3f15fa99e1..62757799a0 100644 --- a/types/maker.js/tsconfig.json +++ b/types/maker.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mandrill-api/tsconfig.json b/types/mandrill-api/tsconfig.json index 9855b826de..26cc6e44e4 100644 --- a/types/mandrill-api/tsconfig.json +++ b/types/mandrill-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/map-obj/tsconfig.json b/types/map-obj/tsconfig.json index 70c0243a5b..c640073717 100644 --- a/types/map-obj/tsconfig.json +++ b/types/map-obj/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index f334304224..47f62556c3 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -26,8 +26,12 @@ declare namespace mapboxgl { constructor(options?: MapboxOptions); addControl(control: Control, position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'): this; + + addControl(control: IControl, position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'): this; removeControl(control: Control): this; + + removeControl(control: IControl): this; addClass(klass: string, options?: mapboxgl.StyleOptions): this; @@ -161,7 +165,7 @@ declare namespace mapboxgl { setPitch(pitch: number, eventData?: EventData): this; - fitBounds(bounds: LngLatBoundsLike, options?: { linear?: boolean, easing?: Function, padding?: number | mapboxgl.PaddingOptions, offset?: PointLike, maxZoom?: number }, eventData?: mapboxgl.EventData): this; + fitBounds(bounds: LngLatBoundsLike, options?: mapboxgl.FitBoundsOptions, eventData?: mapboxgl.EventData): this; jumpTo(options: mapboxgl.CameraOptions, eventData?: mapboxgl.EventData): this; @@ -404,10 +408,6 @@ declare namespace mapboxgl { maximumAge?: number; } - export class FitBoundsOptions { - maxZoom?: number; - } - /** * Geolocate */ @@ -872,6 +872,15 @@ declare namespace mapboxgl { easing?: Function; } + export interface FitBoundsOptions extends mapboxgl.FlyToOptions { + linear?: boolean; + easing?: Function; + padding?: number | mapboxgl.PaddingOptions; + offset?: mapboxgl.PointLike; + maxZoom?: number; + maxDuration?: number; + } + /** * MapEvent */ diff --git a/types/mapbox-gl/tsconfig.json b/types/mapbox-gl/tsconfig.json index 4c4228132e..347f097155 100644 --- a/types/mapbox-gl/tsconfig.json +++ b/types/mapbox-gl/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mapbox-gl-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mapbox/tsconfig.json b/types/mapbox/tsconfig.json index 9aec764a7c..97c6c610a8 100644 --- a/types/mapbox/tsconfig.json +++ b/types/mapbox/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mapbox__shelf-pack/tsconfig.json b/types/mapbox__shelf-pack/tsconfig.json index 49afd3f46e..6dd2d6f58f 100644 --- a/types/mapbox__shelf-pack/tsconfig.json +++ b/types/mapbox__shelf-pack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mapnik/tsconfig.json b/types/mapnik/tsconfig.json index 81f111a37e..4112c1aab4 100644 --- a/types/mapnik/tsconfig.json +++ b/types/mapnik/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "mapnik-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "mapnik-tests.ts" + ] } \ No newline at end of file diff --git a/types/mapsjs/tsconfig.json b/types/mapsjs/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/mapsjs/tsconfig.json +++ b/types/mapsjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/mariasql/tsconfig.json b/types/mariasql/tsconfig.json index bab62b5218..353dfdd4b9 100644 --- a/types/mariasql/tsconfig.json +++ b/types/mariasql/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mark.js/tsconfig.json b/types/mark.js/tsconfig.json index 381f150954..9a75e5b93b 100644 --- a/types/mark.js/tsconfig.json +++ b/types/mark.js/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mark.js-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/markdown-it-anchor/tsconfig.json b/types/markdown-it-anchor/tsconfig.json index df3de49f4a..8b1b51c3c4 100644 --- a/types/markdown-it-anchor/tsconfig.json +++ b/types/markdown-it-anchor/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/markdown-it-container/tsconfig.json b/types/markdown-it-container/tsconfig.json index 9dd6ec9ad2..9d32044fcb 100644 --- a/types/markdown-it-container/tsconfig.json +++ b/types/markdown-it-container/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/markdown-it/tsconfig.json b/types/markdown-it/tsconfig.json index fc493d2d9b..2cddb5aefd 100644 --- a/types/markdown-it/tsconfig.json +++ b/types/markdown-it/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/markdownlint/tsconfig.json b/types/markdownlint/tsconfig.json index 53b9ae46aa..193076542b 100644 --- a/types/markdownlint/tsconfig.json +++ b/types/markdownlint/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "markdownlint-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/marked/tsconfig.json b/types/marked/tsconfig.json index 222ab4e4f1..8380a3964f 100644 --- a/types/marked/tsconfig.json +++ b/types/marked/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/marker-animate-unobtrusive/tsconfig.json b/types/marker-animate-unobtrusive/tsconfig.json index 68e2526510..1b1c994cb4 100644 --- a/types/marker-animate-unobtrusive/tsconfig.json +++ b/types/marker-animate-unobtrusive/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/markerclustererplus/tsconfig.json b/types/markerclustererplus/tsconfig.json index 0aca5b9a0a..f4c0adbebc 100644 --- a/types/markerclustererplus/tsconfig.json +++ b/types/markerclustererplus/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/markitup/tsconfig.json b/types/markitup/tsconfig.json index daa2c18b72..384fb13be7 100644 --- a/types/markitup/tsconfig.json +++ b/types/markitup/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/maskedinput/tsconfig.json b/types/maskedinput/tsconfig.json index 0884b77742..90ead5dea0 100644 --- a/types/maskedinput/tsconfig.json +++ b/types/maskedinput/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/masonry-layout/index.d.ts b/types/masonry-layout/index.d.ts index a771b423e5..2e62989ca8 100644 --- a/types/masonry-layout/index.d.ts +++ b/types/masonry-layout/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Masonry 4.0 +// Type definitions for Masonry 4.2 // Project: https://github.com/desandro/masonry // Definitions by: Mark Wilson , Travis Brown // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -50,6 +50,7 @@ declare namespace Masonry { fitWidth?: boolean; originLeft?: boolean; originTop?: boolean; + horizontalOrder?: boolean; // setup containerStyle?: {}; diff --git a/types/masonry-layout/masonry-layout-tests.ts b/types/masonry-layout/masonry-layout-tests.ts index d21813a791..3a75894f5c 100644 --- a/types/masonry-layout/masonry-layout-tests.ts +++ b/types/masonry-layout/masonry-layout-tests.ts @@ -42,6 +42,7 @@ function testExtendedOptions() { }, transitionDuration: '0.4s', resize: true, - initLayout: true + initLayout: true, + horizontalOrder: true }); } diff --git a/types/masonry-layout/tsconfig.json b/types/masonry-layout/tsconfig.json index a2133122a5..e0ebcb530e 100644 --- a/types/masonry-layout/tsconfig.json +++ b/types/masonry-layout/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/massive/tsconfig.json b/types/massive/tsconfig.json index 916b3e2b47..da316ae1a5 100644 --- a/types/massive/tsconfig.json +++ b/types/massive/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/massive/v3/tsconfig.json b/types/massive/v3/tsconfig.json index ddfdc175d3..334d74eea1 100644 --- a/types/massive/v3/tsconfig.json +++ b/types/massive/v3/tsconfig.json @@ -12,15 +12,18 @@ "../../" ], "paths": { - "massive": [ "massive/v3" ] + "massive": [ + "massive/v3" + ] }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "massive-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/match-media-mock/tsconfig.json b/types/match-media-mock/tsconfig.json index adcb526b65..9187747e27 100644 --- a/types/match-media-mock/tsconfig.json +++ b/types/match-media-mock/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/material-components-web/index.d.ts b/types/material-components-web/index.d.ts new file mode 100644 index 0000000000..c5d1434942 --- /dev/null +++ b/types/material-components-web/index.d.ts @@ -0,0 +1,64 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import autoInit from 'material__auto-init'; +import * as base from 'material__base'; +import * as checkbox from 'material__checkbox'; +import * as dialog from 'material__dialog'; +import * as drawer from 'material__drawer'; +import * as formField from 'material__form-field'; +import * as gridList from 'material__grid-list'; +import * as iconToggle from 'material__icon-toggle'; +import * as linearProgress from 'material__linear-progress'; +import * as menu from 'material__menu'; +import * as radio from 'material__radio'; +import * as ripple from 'material__ripple'; +import * as select from 'material__select'; +import * as selectionControl from 'material__selection-control'; +import * as slider from 'material__slider'; +import * as snackbar from 'material__snackbar'; +import * as tabs from 'material__tabs'; +import * as textField from 'material__textfield'; +import * as toolbar from 'material__toolbar'; + +// Export all components. +export { + autoInit, + base, + checkbox, + dialog, + drawer, + formField, + gridList, + iconToggle, + linearProgress, + menu, + radio, + ripple, + select, + selectionControl, + slider, + snackbar, + tabs, + textField, + toolbar, +}; diff --git a/types/material-components-web/tsconfig.json b/types/material-components-web/tsconfig.json new file mode 100644 index 0000000000..8b1b69457e --- /dev/null +++ b/types/material-components-web/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material-components-web/tslint.json b/types/material-components-web/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material-components-web/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material-design-lite/tsconfig.json b/types/material-design-lite/tsconfig.json index 96da690ed9..0672184541 100644 --- a/types/material-design-lite/tsconfig.json +++ b/types/material-design-lite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/material-ui-datatables/tsconfig.json b/types/material-ui-datatables/tsconfig.json index 805afdbb17..1b91dcedd6 100644 --- a/types/material-ui-datatables/tsconfig.json +++ b/types/material-ui-datatables/tsconfig.json @@ -15,7 +15,8 @@ "jsx": "react", "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/material-ui-pagination/material-ui-pagination-tests.tsx b/types/material-ui-pagination/material-ui-pagination-tests.tsx index a7f85d8184..d680f95e1f 100644 --- a/types/material-ui-pagination/material-ui-pagination-tests.tsx +++ b/types/material-ui-pagination/material-ui-pagination-tests.tsx @@ -5,7 +5,7 @@ import * as ReactDOM from 'react-dom'; import Pagination from 'material-ui-pagination'; import * as ui from 'material-ui'; import { MuiThemeProvider } from 'material-ui/styles'; -import * as injectTapEventPlugin from 'react-tap-event-plugin'; +import injectTapEventPlugin = require('react-tap-event-plugin'); // Needed for onTouchTap // Check this repo: diff --git a/types/material-ui-pagination/tsconfig.json b/types/material-ui-pagination/tsconfig.json index c98526003d..eef315d2c9 100644 --- a/types/material-ui-pagination/tsconfig.json +++ b/types/material-ui-pagination/tsconfig.json @@ -21,6 +21,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 32410592ab..9624e6d4a2 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -1262,7 +1262,7 @@ declare namespace __MaterialUI { // Other properties from autoWidth?: boolean; - children?: Array>; + children?: React.ReactElement | Array>; desktop?: boolean; disableAutoFocus?: boolean; initiallyKeyboardFocused?: boolean; diff --git a/types/material-ui/material-ui-tests.tsx b/types/material-ui/material-ui-tests.tsx index b01613cd8c..51b22c936c 100644 --- a/types/material-ui/material-ui-tests.tsx +++ b/types/material-ui/material-ui-tests.tsx @@ -4498,6 +4498,11 @@ const IconMenuExampleSimple = () => ( + } + > + + ); diff --git a/types/material-ui/tsconfig.json b/types/material-ui/tsconfig.json index 7d478ab185..0d3a5e6d32 100644 --- a/types/material-ui/tsconfig.json +++ b/types/material-ui/tsconfig.json @@ -21,6 +21,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/material__animation/index.d.ts b/types/material__animation/index.d.ts new file mode 100644 index 0000000000..8baf562003 --- /dev/null +++ b/types/material__animation/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const transformStyleProperties: string[]; + +export function getCorrectEventName(windowObj: Window, eventType: string): string; + +export function getCorrectPropertyName(windowObj: Window, eventType: string): string; diff --git a/types/material__animation/tsconfig.json b/types/material__animation/tsconfig.json new file mode 100644 index 0000000000..0cbce49fc7 --- /dev/null +++ b/types/material__animation/tsconfig.json @@ -0,0 +1,25 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__animation/tslint.json b/types/material__animation/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__animation/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__auto-init/index.d.ts b/types/material__auto-init/index.d.ts new file mode 100644 index 0000000000..026b692b99 --- /dev/null +++ b/types/material__auto-init/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type MDCLogger = (message?: any, ...optionalParams: any[]) => void; + +export interface MDCAutoInit { + (root?: Document, warn?: MDCLogger): MDCAutoInit; + register(componentName: string, Ctor: (...args: any[]) => any, warn?: MDCLogger): void; + deregister(componentName: string): void; + deregisterAll(): void; +} + +/** + * Auto-initializes all mdc components on a page. + */ +declare const mdcAutoInit: MDCAutoInit; + +export default mdcAutoInit; diff --git a/types/material__auto-init/tsconfig.json b/types/material__auto-init/tsconfig.json new file mode 100644 index 0000000000..0cbce49fc7 --- /dev/null +++ b/types/material__auto-init/tsconfig.json @@ -0,0 +1,25 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__auto-init/tslint.json b/types/material__auto-init/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__auto-init/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__base/component.d.ts b/types/material__base/component.d.ts new file mode 100644 index 0000000000..0a645b26a4 --- /dev/null +++ b/types/material__base/component.d.ts @@ -0,0 +1,63 @@ +/** + * @license + * Copyright 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from './foundation'; + +export class MDCComponent> { + static attachTo(root: Element): MDCComponent>; + + constructor(root: Element, foundation?: F, ...args: any[]); + + // Subclasses can override this to do any additional setup work that would be considered part of a + // "constructor". Essentially, it is a hook into the parent constructor before the foundation is + // initialized. Any additional arguments besides root and foundation will be passed in here. + initialize(...args: any[]): void; + + // Subclasses must override this method to return a properly configured foundation class for the + // component. + getDefaultFoundation(): F; + + // Subclasses should override this method if they need to perform work to synchronize with a host DOM + // object. An example of this would be a form control wrapper that needs to synchronize its internal state + // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM + // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor. + initialSyncWithDOM(): void; + + // Subclasses may implement this method to release any resources / deregister any listeners they have + // attached. An example of this might be deregistering a resize event from the window object. + destroy(): void; + + /** + * Wrapper method to add an event listener to the component's root element. This is most useful when + * listening for custom events. + */ + listen(evtType: string, handler: EventListenerOrEventListenerObject): void; + + /** + * Wrapper method to remove an event listener to the component's root element. This is most useful when + * unlistening for custom events. + */ + unlisten(evtType: string, handler: EventListenerOrEventListenerObject): void; + + /** + * Fires a cross-browser-compatible custom event from the component root of the given type, + * with the given data. + */ + emit(evtType: string, evtData: any, shouldBubble?: boolean): void; +} + +export default MDCComponent; diff --git a/types/material__base/foundation.d.ts b/types/material__base/foundation.d.ts new file mode 100644 index 0000000000..7612d0daea --- /dev/null +++ b/types/material__base/foundation.d.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCStrings { + [key: string]: string; +} + +export interface MDCNumbers { + [key: string]: number; +} + +export class MDCFoundation { + static readonly cssClasses: MDCStrings; + + static readonly strings: MDCStrings; + + static readonly numbers: MDCNumbers; + + static readonly defaultAdapter: any; + + constructor(adapter: A); + + // Subclasses should override this method to perform initialization routines (registering events, etc.) + init(): void; + + // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.) + destroy(): void; +} + +export default MDCFoundation; diff --git a/types/material__base/index.d.ts b/types/material__base/index.d.ts new file mode 100644 index 0000000000..0172cb35f6 --- /dev/null +++ b/types/material__base/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCNumbers, MDCStrings, MDCFoundation } from './foundation'; +import MDCComponent from './component'; + +export {MDCNumbers, MDCStrings, MDCFoundation, MDCComponent}; diff --git a/types/material__base/tsconfig.json b/types/material__base/tsconfig.json new file mode 100644 index 0000000000..3cd07b146b --- /dev/null +++ b/types/material__base/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [ + "component.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__base/tslint.json b/types/material__base/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__base/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__checkbox/adapter.d.ts b/types/material__checkbox/adapter.d.ts new file mode 100644 index 0000000000..aedeed30f5 --- /dev/null +++ b/types/material__checkbox/adapter.d.ts @@ -0,0 +1,54 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSelectionControlState } from 'material__selection-control'; + +/** + * Adapter for MDC Checkbox. Provides an interface for managing + * - classes + * - dom + * - event handlers + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + */ +export class MDCCheckboxAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + registerAnimationEndHandler(handler: EventListener): void; + + deregisterAnimationEndHandler(handler: EventListener): void; + + registerChangeHandler(handler: EventListener): void; + + deregisterChangeHandler(handler: EventListener): void; + + getNativeControl(): MDCSelectionControlState; + + forceLayout(): void; + + isAttachedToDOM(): boolean; +} + +export default MDCCheckboxAdapter; diff --git a/types/material__checkbox/constants.d.ts b/types/material__checkbox/constants.d.ts new file mode 100644 index 0000000000..ee665f4c05 --- /dev/null +++ b/types/material__checkbox/constants.d.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + UPGRADED: 'mdc-checkbox--upgraded'; + CHECKED: 'mdc-checkbox--checked'; + INDETERMINATE: 'mdc-checkbox--indeterminate'; + DISABLED: 'mdc-checkbox--disabled'; + ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked'; + ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate'; + ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked'; + ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate'; + ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked'; + ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked'; +} + +export interface strings extends MDCStrings { + NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control'; + TRANSITION_STATE_INIT: 'init'; + TRANSITION_STATE_CHECKED: 'checked'; + TRANSITION_STATE_UNCHECKED: 'unchecked'; + TRANSITION_STATE_INDETERMINATE: 'indeterminate'; +} + +export interface numbers extends MDCNumbers { + ANIM_END_LATCH_MS: 100; +} diff --git a/types/material__checkbox/foundation.d.ts b/types/material__checkbox/foundation.d.ts new file mode 100644 index 0000000000..73216efcd6 --- /dev/null +++ b/types/material__checkbox/foundation.d.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCCheckboxAdapter from './adapter'; +import { cssClasses, strings, numbers } from './constants'; + +export class MDCCheckboxFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCCheckboxAdapter; + + isChecked(): boolean; + + setChecked(checked: boolean): boolean; + + isIndeterminate(): boolean; + + setIndeterminate(indeterminate: boolean): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; + + getValue(): string; + + setValue(value: string): void; +} + +export default MDCCheckboxFoundation; diff --git a/types/material__checkbox/index.d.ts b/types/material__checkbox/index.d.ts new file mode 100644 index 0000000000..9190c3d5a9 --- /dev/null +++ b/types/material__checkbox/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCCheckboxAdapter from './adapter'; +import { MDCSelectionControl } from 'material__selection-control'; +import MDCCheckboxFoundation from './foundation'; +import { MDCRipple } from 'material__ripple'; + +export {MDCCheckboxAdapter, MDCCheckboxFoundation}; + +export class MDCCheckbox extends MDCComponent implements MDCSelectionControl { + static attachTo(root: Element): MDCCheckbox; + + getDefaultFoundation(): MDCCheckboxFoundation; + + readonly ripple: MDCRipple; + + checked: boolean; + + indeterminate: boolean; + + disabled: boolean; + + value: string; + + destroy(): void; +} diff --git a/types/material__checkbox/tsconfig.json b/types/material__checkbox/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__checkbox/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__checkbox/tslint.json b/types/material__checkbox/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__checkbox/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__dialog/adapter.d.ts b/types/material__dialog/adapter.d.ts new file mode 100644 index 0000000000..fd6bc3cf9f --- /dev/null +++ b/types/material__dialog/adapter.d.ts @@ -0,0 +1,55 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MSDDialogAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + addBodyClass(className: string): void; + + removeBodyClass(className: string): void; + + eventTargetHasClass(target: EventTarget, className: string): boolean; + + registerInteractionHandler(evt: string, handler: EventListener): void; + + deregisterInteractionHandler(evt: string, handler: EventListener): void; + + registerSurfaceInteractionHandler(evt: string, handler: EventListener): void; + + deregisterSurfaceInteractionHandler(evt: string, handler: EventListener): void; + + registerDocumentKeydownHandler(handler: EventListener): void; + + deregisterDocumentKeydownHandler(handler: EventListener): void; + + registerTransitionEndHandler(handler: EventListener): void; + + deregisterTransitionEndHandler(handler: EventListener): void; + + notifyAccept(): void; + + notifyCancel(): void; + + trapFocusOnSurface(): void; + + untrapFocusOnSurface(): void; + + isDialog(el: Element): boolean; + + layoutFooterRipples(): void; +} diff --git a/types/material__dialog/constants.d.ts b/types/material__dialog/constants.d.ts new file mode 100644 index 0000000000..a45628627c --- /dev/null +++ b/types/material__dialog/constants.d.ts @@ -0,0 +1,35 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-dialog'; + OPEN: 'mdc-dialog--open'; + ANIMATING: 'mdc-dialog--animating'; + BACKDROP: 'mdc-dialog__backdrop'; + SCROLL_LOCK: 'mdc-dialog-scroll-lock'; + ACCEPT_BTN: 'mdc-dialog__footer__button--accept'; + CANCEL_BTN: 'mdc-dialog__footer__button--cancel'; +} + +export interface strings extends MDCStrings { + OPEN_DIALOG_SELECTOR: '.mdc-dialog--open'; + DIALOG_SURFACE_SELECTOR: '.mdc-dialog__surface'; + ACCEPT_SELECTOR: '.mdc-dialog__footer__button--accept'; + ACCEPT_EVENT: 'MDCDialog:accept'; + CANCEL_EVENT: 'MDCDialog:cancel'; +} diff --git a/types/material__dialog/foundation.d.ts b/types/material__dialog/foundation.d.ts new file mode 100644 index 0000000000..f28c541dd2 --- /dev/null +++ b/types/material__dialog/foundation.d.ts @@ -0,0 +1,39 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { cssClasses, strings } from './constants'; +import { MSDDialogAdapter } from './adapter'; + +export class MDCDialogFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MSDDialogAdapter; + + open(): void; + + close(): void; + + isOpen(): boolean; + + accept(shouldNotify: boolean): void; + + cancel(shouldNotify: boolean): void; +} + +export default MDCDialogFoundation; diff --git a/types/material__dialog/index.d.ts b/types/material__dialog/index.d.ts new file mode 100644 index 0000000000..7d8ab69e30 --- /dev/null +++ b/types/material__dialog/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCRipple } from 'material__ripple'; + +import MDCDialogFoundation from './foundation'; +import { MSDDialogAdapter } from './adapter'; +import * as util from './util'; + +export {MSDDialogAdapter, MDCDialogFoundation, util}; + +export class MDCDialog extends MDCComponent { + static attachTo(root: Element): MDCDialog; + + readonly open: boolean; + + initialize(): void; + + destroy(): void; + + show(): void; + + close(): void; + + getDefaultFoundation(): MDCDialogFoundation; +} diff --git a/types/material__dialog/tsconfig.json b/types/material__dialog/tsconfig.json new file mode 100644 index 0000000000..9f215e4ee0 --- /dev/null +++ b/types/material__dialog/tsconfig.json @@ -0,0 +1,29 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "util.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__dialog/tslint.json b/types/material__dialog/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__dialog/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__dialog/util.d.ts b/types/material__dialog/util.d.ts new file mode 100644 index 0000000000..cfc7e3fda0 --- /dev/null +++ b/types/material__dialog/util.d.ts @@ -0,0 +1,19 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type MDCFocusTrapFactory = (a: Element, b: {initialFocus: Element, clickOutsideDeactivates: boolean}) => any; + +export function createFocusTrapInstance(surfaceEl: Element, acceptButtonEl: Element, focusTrapFactory?: MDCFocusTrapFactory): any; diff --git a/types/material__drawer/index.d.ts b/types/material__drawer/index.d.ts new file mode 100644 index 0000000000..379ed35599 --- /dev/null +++ b/types/material__drawer/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as util from './util'; +export {MDCSlidableDrawerAdapter} from './slidable'; +export {MDCTemporaryDrawer, MDCTemporaryDrawerFoundation} from './temporary'; +export {MDCPersistentDrawer, MDCPersistentDrawerFoundation} from './persistent'; +export {util}; diff --git a/types/material__drawer/persistent/constants.d.ts b/types/material__drawer/persistent/constants.d.ts new file mode 100644 index 0000000000..3d5f7c56ba --- /dev/null +++ b/types/material__drawer/persistent/constants.d.ts @@ -0,0 +1,30 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-persistent-drawer'; + OPEN: 'mdc-persistent-drawer--open'; + ANIMATING: 'mdc-persistent-drawer--animating'; +} + +export interface strings extends MDCStrings { + DRAWER_SELECTOR: '.mdc-persistent-drawer__drawer'; + FOCUSABLE_ELEMENTS: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]'; + OPEN_EVENT: 'MDCPersistentDrawer:open'; + CLOSE_EVENT: 'MDCPersistentDrawer:close'; +} diff --git a/types/material__drawer/persistent/foundation.d.ts b/types/material__drawer/persistent/foundation.d.ts new file mode 100644 index 0000000000..7d4d53f884 --- /dev/null +++ b/types/material__drawer/persistent/foundation.d.ts @@ -0,0 +1,28 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSlidableDrawerAdapter, MDCSlidableDrawerFoundation } from '../slidable'; +import { cssClasses, strings } from './constants'; + +export class MDCPersistentDrawerFoundation extends MDCSlidableDrawerFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSlidableDrawerAdapter; +} + +export default MDCPersistentDrawerFoundation; diff --git a/types/material__drawer/persistent/index.d.ts b/types/material__drawer/persistent/index.d.ts new file mode 100644 index 0000000000..1c2286fd01 --- /dev/null +++ b/types/material__drawer/persistent/index.d.ts @@ -0,0 +1,33 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCPersistentDrawerFoundation } from './foundation'; +import { MDCSlidableDrawerAdapter } from '../slidable'; +import * as util from '../util'; + +export {MDCSlidableDrawerAdapter, MDCPersistentDrawerFoundation, util}; + +export class MDCPersistentDrawer extends MDCComponent { + static attachTo(root: Element): MDCPersistentDrawer; + + open: boolean; + + // Return the drawer element inside the component. + readonly drawer: Element | null; + + getDefaultFoundation(): MDCPersistentDrawerFoundation; +} diff --git a/types/material__drawer/slidable/adapter.d.ts b/types/material__drawer/slidable/adapter.d.ts new file mode 100644 index 0000000000..3659742558 --- /dev/null +++ b/types/material__drawer/slidable/adapter.d.ts @@ -0,0 +1,59 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSlidableDrawerAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + hasClass(className: string): void; + + hasNecessaryDom(): boolean; + + registerInteractionHandler(evt: string, handler: EventListener): void; + + deregisterInteractionHandler(evt: string, handler: EventListener): void; + + registerDrawerInteractionHandler(evt: string, handler: EventListener): void; + + deregisterDrawerInteractionHandler(evt: string, handler: EventListener): void; + + registerTransitionEndHandler(handler: EventListener): void; + + deregisterTransitionEndHandler(handler: EventListener): void; + + registerDocumentKeydownHandler(handler: EventListener): void; + + deregisterDocumentKeydownHandler(handler: EventListener): void; + + setTranslateX(value: number | null): void; + + getFocusableElements(): NodeList; + + saveElementTabState(el: Element): void; + + restoreElementTabState(el: Element): void; + + makeElementUntabbable(el: Element): void; + + notifyOpen(): void; + + notifyClose(): void; + + isRtl(): boolean; + + getDrawerWidth(): number; +} diff --git a/types/material__drawer/slidable/constants.d.ts b/types/material__drawer/slidable/constants.d.ts new file mode 100644 index 0000000000..bfae67fa90 --- /dev/null +++ b/types/material__drawer/slidable/constants.d.ts @@ -0,0 +1,17 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const FOCUSABLE_ELEMENTS: string; diff --git a/types/material__drawer/slidable/foundation.d.ts b/types/material__drawer/slidable/foundation.d.ts new file mode 100644 index 0000000000..60995e0a95 --- /dev/null +++ b/types/material__drawer/slidable/foundation.d.ts @@ -0,0 +1,30 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { MDCSlidableDrawerAdapter } from './adapter'; + +export class MDCSlidableDrawerFoundation extends MDCFoundation { + static readonly defaultAdapter: MDCSlidableDrawerAdapter; + + constructor(adapter: MDCSlidableDrawerAdapter, rootCssClass: string, animatingCssClass: string, openCssClass: string); + + open(): void; + + close(): void; + + isOpen(): boolean; +} diff --git a/types/material__drawer/slidable/index.d.ts b/types/material__drawer/slidable/index.d.ts new file mode 100644 index 0000000000..b56661948d --- /dev/null +++ b/types/material__drawer/slidable/index.d.ts @@ -0,0 +1,19 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export {FOCUSABLE_ELEMENTS} from './constants'; +export {MDCSlidableDrawerFoundation} from './foundation'; +export {MDCSlidableDrawerAdapter} from './adapter'; diff --git a/types/material__drawer/temporary/constants.d.ts b/types/material__drawer/temporary/constants.d.ts new file mode 100644 index 0000000000..b175492a82 --- /dev/null +++ b/types/material__drawer/temporary/constants.d.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-temporary-drawer'; + OPEN: 'mdc-temporary-drawer--open'; + ANIMATING: 'mdc-temporary-drawer--animating'; + SCROLL_LOCK: 'mdc-drawer-scroll-lock'; +} + +export interface strings extends MDCStrings { + DRAWER_SELECTOR: '.mdc-temporary-drawer__drawer'; + OPACITY_VAR_NAME: '--mdc-temporary-drawer-opacity'; + FOCUSABLE_ELEMENTS: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]'; + OPEN_EVENT: 'MDCTemporaryDrawer:open'; + CLOSE_EVENT: 'MDCTemporaryDrawer:close'; +} diff --git a/types/material__drawer/temporary/foundation.d.ts b/types/material__drawer/temporary/foundation.d.ts new file mode 100644 index 0000000000..df1763c274 --- /dev/null +++ b/types/material__drawer/temporary/foundation.d.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSlidableDrawerFoundation, MDCSlidableDrawerAdapter } from '../slidable'; +import { cssClasses, strings } from './constants'; + +export class MDCTemporaryDrawerFoundation extends MDCSlidableDrawerFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSlidableDrawerAdapter; + + open(): void; + + close(): void; +} + +export default MDCTemporaryDrawerFoundation; diff --git a/types/material__drawer/temporary/index.d.ts b/types/material__drawer/temporary/index.d.ts new file mode 100644 index 0000000000..4e27965e43 --- /dev/null +++ b/types/material__drawer/temporary/index.d.ts @@ -0,0 +1,33 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import MDCTemporaryDrawerFoundation from './foundation'; +import { MDCSlidableDrawerAdapter } from '../slidable'; +import * as util from '../util'; + +export {MDCSlidableDrawerAdapter, MDCTemporaryDrawerFoundation, util}; + +export class MDCTemporaryDrawer extends MDCComponent { + static attachTo(root: Element): MDCTemporaryDrawer; + + open: boolean; + + /* Return the drawer element inside the component. */ + readonly drawer: Element | null; + + getDefaultFoundation(): MDCTemporaryDrawerFoundation; +} diff --git a/types/material__drawer/tsconfig.json b/types/material__drawer/tsconfig.json new file mode 100644 index 0000000000..4a95cf90f8 --- /dev/null +++ b/types/material__drawer/tsconfig.json @@ -0,0 +1,36 @@ +{ + "files": [ + "persistent/constants.d.ts", + "persistent/index.d.ts", + "persistent/foundation.d.ts", + "slidable/constants.d.ts", + "slidable/adapter.d.ts", + "slidable/index.d.ts", + "slidable/foundation.d.ts", + "temporary/constants.d.ts", + "temporary/index.d.ts", + "temporary/foundation.d.ts", + "util.d.ts", + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__drawer/tslint.json b/types/material__drawer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__drawer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__drawer/util.d.ts b/types/material__drawer/util.d.ts new file mode 100644 index 0000000000..66fa930b43 --- /dev/null +++ b/types/material__drawer/util.d.ts @@ -0,0 +1,33 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Remap touch events to pointer events, if the browser doesn't support touch events. +export function remapEvent(eventName: string, globalObj?: Window): string; + +// Choose the correct transform property to use on the current browser. +export function getTransformPropertyName(globalObj?: Window, forceRefresh?: boolean): string; + +// Determine whether the current browser supports CSS properties. +export function supportsCssCustomProperties(globalObj?: Window): boolean; + +// Determine whether the current browser supports passive event listeners, and if so, use them. +export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean; + +// Save the tab state for an element. +export function saveElementTabState(el: Element): void; + +// Restore the tab state for an element, if it was saved. +export function restoreElementTabState(el: Element): void; diff --git a/types/material__form-field/adapter.d.ts b/types/material__form-field/adapter.d.ts new file mode 100644 index 0000000000..7033f363eb --- /dev/null +++ b/types/material__form-field/adapter.d.ts @@ -0,0 +1,43 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Form Field. Provides an interface for managing + * - event handlers + * - ripple activation + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ +export class MDCFormFieldAdapter { + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + activateInputRipple(): void; + + deactivateInputRipple(): void; +} + +export default MDCFormFieldAdapter; diff --git a/types/material__form-field/constants.d.ts b/types/material__form-field/constants.d.ts new file mode 100644 index 0000000000..ba55acabcd --- /dev/null +++ b/types/material__form-field/constants.d.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-form-field'; +} + +export interface strings extends MDCStrings { + LABEL_SELECTOR: '.mdc-form-field > label'; +} diff --git a/types/material__form-field/foundation.d.ts b/types/material__form-field/foundation.d.ts new file mode 100644 index 0000000000..026beedfc2 --- /dev/null +++ b/types/material__form-field/foundation.d.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCFormFieldAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCFormFieldFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCFormFieldAdapter; +} + +export default MDCFormFieldFoundation; diff --git a/types/material__form-field/index.d.ts b/types/material__form-field/index.d.ts new file mode 100644 index 0000000000..1fcc30b4c4 --- /dev/null +++ b/types/material__form-field/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCFormFieldFoundation from './foundation'; +import MDCFormFieldAdapter from './adapter'; +import { MDCSelectionControl } from 'material__selection-control'; + +export {MDCFormFieldAdapter, MDCFormFieldFoundation}; + +export class MDCFormField extends MDCComponent { + static attachTo(root: Element): MDCFormField; + + input: MDCSelectionControl; + + getDefaultFoundation(): MDCFormFieldFoundation; +} diff --git a/types/material__form-field/tsconfig.json b/types/material__form-field/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__form-field/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__form-field/tslint.json b/types/material__form-field/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__form-field/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__grid-list/adapter.d.ts b/types/material__grid-list/adapter.d.ts new file mode 100644 index 0000000000..1dcbcbf251 --- /dev/null +++ b/types/material__grid-list/adapter.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCGridListAdapter { + getOffsetWidth(): number; + + getNumberOfTiles(): number; + + getOffsetWidthForTileAtIndex(index: number): number; + + setStyleForTilesElement(property: string, value: string): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; +} diff --git a/types/material__grid-list/constants.d.ts b/types/material__grid-list/constants.d.ts new file mode 100644 index 0000000000..22cf67bbfc --- /dev/null +++ b/types/material__grid-list/constants.d.ts @@ -0,0 +1,22 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + TILES_SELECTOR: '.mdc-grid-list__tiles'; + TILE_SELECTOR: '.mdc-grid-tile'; +} diff --git a/types/material__grid-list/foundation.d.ts b/types/material__grid-list/foundation.d.ts new file mode 100644 index 0000000000..04843273d6 --- /dev/null +++ b/types/material__grid-list/foundation.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { strings } from './constants'; +import { MDCGridListAdapter } from './adapter'; + +export class MDCGridListFoundation extends MDCFoundation { + static readonly strings: strings; + + static readonly defaultAdapter: MDCGridListAdapter; + + alignCenter(): void; +} + +export default MDCGridListFoundation; diff --git a/types/material__grid-list/index.d.ts b/types/material__grid-list/index.d.ts new file mode 100644 index 0000000000..2a1e98d912 --- /dev/null +++ b/types/material__grid-list/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCGridListAdapter } from './adapter'; +import MDCGridListFoundation from './foundation'; + +export {MDCGridListAdapter, MDCGridListFoundation}; + +export class MDCGridList extends MDCComponent { + static attachTo(root: Element): MDCGridList; + + getDefaultFoundation(): MDCGridListFoundation; +} diff --git a/types/material__grid-list/tsconfig.json b/types/material__grid-list/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__grid-list/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__grid-list/tslint.json b/types/material__grid-list/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__grid-list/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__icon-toggle/adapter.d.ts b/types/material__icon-toggle/adapter.d.ts new file mode 100644 index 0000000000..52481fe732 --- /dev/null +++ b/types/material__icon-toggle/adapter.d.ts @@ -0,0 +1,63 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Icon Toggle. Provides an interface for managing + * - classes + * - dom + * - inner text + * - event handlers + * - event dispatch + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ + +export class MDCIconToggleAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + setText(text: string): void; + + getTabIndex(): number; + + setTabIndex(tabIndex: number): void; + + getAttr(name: string): string; + + setAttr(name: string, value: string): void; + + rmAttr(name: string): void; + + notifyChange(evtData: IconToggleEvent): void; +} + +export interface IconToggleEvent { + isOn: boolean; +} diff --git a/types/material__icon-toggle/constants.d.ts b/types/material__icon-toggle/constants.d.ts new file mode 100644 index 0000000000..e7140ecefa --- /dev/null +++ b/types/material__icon-toggle/constants.d.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-icon-toggle'; + DISABLED: 'mdc-icon-toggle--disabled'; +} + +export interface strings extends MDCStrings { + DATA_TOGGLE_ON: 'data-toggle-on'; + DATA_TOGGLE_OFF: 'data-toggle-off'; + ARIA_PRESSED: 'aria-pressed'; + ARIA_DISABLED: 'aria-disabled'; + ARIA_LABEL: 'aria-label'; + CHANGE_EVENT: 'MDCIconToggle:change'; +} diff --git a/types/material__icon-toggle/foundation.d.ts b/types/material__icon-toggle/foundation.d.ts new file mode 100644 index 0000000000..65d25c1307 --- /dev/null +++ b/types/material__icon-toggle/foundation.d.ts @@ -0,0 +1,64 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { MDCIconToggleAdapter, IconToggleEvent } from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCIconToggleFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCIconToggleAdapter; + + refreshToggleData(): void; + + isOn(): boolean; + + toggle(isOn?: boolean): void; + + isDisabled(): boolean; + + setDisabled(isDisabled: boolean): void; + + isKeyboardActivated(): boolean; +} + +export interface KeyboardKey { + key: string; + keyCode: number; +} + +export function isSpace(keyboardKey: KeyboardKey): boolean; + +export class IconToggleState { + /** + * The aria-label value of the icon toggle, or undefined if there is no aria-label. + */ + label: string|undefined; + /** + * The text for the icon toggle, or undefined if there is no text. + */ + content: string|undefined; + /** + * The CSS class to add to the icon toggle, or undefined if there is no CSS class. + */ + cssClass: string|undefined; +} + +export default MDCIconToggleFoundation; diff --git a/types/material__icon-toggle/index.d.ts b/types/material__icon-toggle/index.d.ts new file mode 100644 index 0000000000..bfced0b532 --- /dev/null +++ b/types/material__icon-toggle/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCIconToggleFoundation from './foundation'; +import { MDCIconToggleAdapter } from './adapter'; +import { MDCRipple, MDCRippleFoundation } from 'material__ripple'; + +export {MDCIconToggleAdapter, MDCIconToggleFoundation}; + +export class MDCIconToggle extends MDCComponent { + static attachTo(root: Element): MDCIconToggle; + + destroy(): void; + + getDefaultFoundation(): MDCIconToggleFoundation; + + initialSyncWithDOM(): void; + + readonly ripple: MDCRipple; + + on: boolean; + + disabled: boolean; + + refreshToggleData(): void; +} diff --git a/types/material__icon-toggle/tsconfig.json b/types/material__icon-toggle/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__icon-toggle/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__icon-toggle/tslint.json b/types/material__icon-toggle/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__icon-toggle/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__linear-progress/adapter.d.ts b/types/material__linear-progress/adapter.d.ts new file mode 100644 index 0000000000..92afccc19d --- /dev/null +++ b/types/material__linear-progress/adapter.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCLinearProgressAdapter { + addClass(className: string): void; + + getPrimaryBar(): Element; + + getBuffer(): Element; + + hasClass(className: string): boolean; + + removeClass(className: string): void; + + setStyle(el: Element, styleProperty: string, value: number): void; +} diff --git a/types/material__linear-progress/constants.d.ts b/types/material__linear-progress/constants.d.ts new file mode 100644 index 0000000000..af83ae9922 --- /dev/null +++ b/types/material__linear-progress/constants.d.ts @@ -0,0 +1,28 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + CLOSED_CLASS: 'mdc-linear-progress--closed'; + INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate'; + REVERSED_CLASS: 'mdc-linear-progress--reversed'; +} + +export interface strings extends MDCStrings { + PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar'; + BUFFER_SELECTOR: '.mdc-linear-progress__buffer'; +} diff --git a/types/material__linear-progress/foundation.d.ts b/types/material__linear-progress/foundation.d.ts new file mode 100644 index 0000000000..4abd553a09 --- /dev/null +++ b/types/material__linear-progress/foundation.d.ts @@ -0,0 +1,40 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { transformStyleProperties } from 'material__animation'; +import { MDCLinearProgressAdapter } from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCLinearProgressFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCLinearProgressAdapter; + + setDeterminate(isDeterminate: boolean): void; + + setProgress(value: number): void; + + setBuffer(value: number): void; + + setReverse(isReversed: boolean): void; + + open(): void; + + close(): void; +} diff --git a/types/material__linear-progress/index.d.ts b/types/material__linear-progress/index.d.ts new file mode 100644 index 0000000000..765d8cb368 --- /dev/null +++ b/types/material__linear-progress/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCLinearProgressAdapter } from './adapter'; +import { MDCLinearProgressFoundation } from './foundation'; + +export {MDCLinearProgressAdapter, MDCLinearProgressFoundation}; + +export class MDCLinearProgress extends MDCComponent { + static attachTo(root: Element): MDCLinearProgress; + + determinate: boolean; + + progress: number; + + buffer: number; + + reverse: boolean; + + open(): void; + + close(): void; + + getDefaultFoundation(): MDCLinearProgressFoundation; +} diff --git a/types/material__linear-progress/tsconfig.json b/types/material__linear-progress/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__linear-progress/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__linear-progress/tslint.json b/types/material__linear-progress/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__linear-progress/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__menu/index.d.ts b/types/material__menu/index.d.ts new file mode 100644 index 0000000000..af9360d1a8 --- /dev/null +++ b/types/material__menu/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as util from './util'; +import { MDCSimpleMenu, MDCSimpleMenuAdapter, MDCSimpleMenuFoundation } from './simple/index'; +export { MDCSimpleMenu, MDCSimpleMenuAdapter, MDCSimpleMenuFoundation, util }; diff --git a/types/material__menu/simple/adapter.d.ts b/types/material__menu/simple/adapter.d.ts new file mode 100644 index 0000000000..7fdd1e4f3a --- /dev/null +++ b/types/material__menu/simple/adapter.d.ts @@ -0,0 +1,104 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Simple Menu. Provides an interface for managing + * - classes + * - dom + * - focus + * - position + * - dimensions + * - event handlers + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ +export default class MDCSimpleMenuAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + hasClass(className: string): boolean; + + hasNecessaryDom(): boolean; + + getAttributeForEventTarget(target: EventTarget, attributeName: string): string; + + getInnerDimensions(): {width: number, height: number}; + + hasAnchor(): boolean; + + getAnchorDimensions(): {width: number, height: number, top: number, right: number, bottom: number, left: number}; + + getWindowDimensions(): {width: number, height: number}; + + setScale(x: number, y: number): void; + + setInnerScale(x: number, y: number): void; + + getNumberOfItems(): number; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + registerBodyClickHandler(handler: EventListener): void; + + deregisterBodyClickHandler(handler: EventListener): void; + + getYParamsForItemAtIndex(index: number): {top: number, height: number}; + + setTransitionDelayForItemAtIndex(index: number, value: string|null): void; + + getIndexForEventTarget(target: EventTarget): number; + + notifySelected(evtData: {index: number}): void; + + notifyCancel(): void; + + saveFocus(): void; + + restoreFocus(): void; + + isFocused(): boolean; + + focus(): void; + + getFocusedItemIndex(): number; + + focusItemAtIndex(index: number): void; + + isRtl(): boolean; + + setTransformOrigin(origin: string): void; + + setPosition(position: { + top: string|undefined, + right: string|undefined, + bottom: string|undefined, + left: string|undefined + }): void; + + getAccurateTime(): number; +} diff --git a/types/material__menu/simple/constants.d.ts b/types/material__menu/simple/constants.d.ts new file mode 100644 index 0000000000..58e2f16614 --- /dev/null +++ b/types/material__menu/simple/constants.d.ts @@ -0,0 +1,52 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-simple-menu'; + OPEN: 'mdc-simple-menu--open'; + ANIMATING: 'mdc-simple-menu--animating'; + TOP_RIGHT: 'mdc-simple-menu--open-from-top-right'; + BOTTOM_LEFT: 'mdc-simple-menu--open-from-bottom-left'; + BOTTOM_RIGHT: 'mdc-simple-menu--open-from-bottom-right'; +} + +export interface strings extends MDCStrings { + ITEMS_SELECTOR: '.mdc-simple-menu__items'; + SELECTED_EVENT: 'MDCSimpleMenu:selected'; + CANCEL_EVENT: 'MDCSimpleMenu:cancel'; + ARIA_DISABLED_ATTR: 'aria-disabled'; +} + +export interface numbers extends MDCNumbers { + // Amount of time to wait before triggering a selected event on the menu. Note that this time + // will most likely be bumped up once interactive lists are supported to allow for the ripple to + // animate before closing the menu + SELECTED_TRIGGER_DELAY: 50; + // Total duration of the menu animation. + TRANSITION_DURATION_MS: 300; + // The menu starts its open animation with the X axis at this time value (0 - 1). + TRANSITION_SCALE_ADJUSTMENT_X: 0.5; + // The time value the menu waits until the animation starts on the Y axis (0 - 1). + TRANSITION_SCALE_ADJUSTMENT_Y: 0.2; + // The cubic bezier control points for the animation (cubic-bezier(0, 0, 0.2, 1)). + TRANSITION_X1: 0; + TRANSITION_Y1: 0; + TRANSITION_X2: 0.2; + TRANSITION_Y2: 1; +} diff --git a/types/material__menu/simple/foundation.d.ts b/types/material__menu/simple/foundation.d.ts new file mode 100644 index 0000000000..78071374b3 --- /dev/null +++ b/types/material__menu/simple/foundation.d.ts @@ -0,0 +1,43 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCSimpleMenuAdapter from './adapter'; +import { cssClasses, strings, numbers } from './constants'; +import { clamp, bezierProgress } from '../util'; + +export default class MDCSimpleMenuFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCSimpleMenuAdapter; + + /** + * Open the menu. + */ + open(options?: {focusIndex?: number}): void; + + /** + * Closes the menu. + */ + close(evt?: Event): void; + + isOpen(): boolean; +} diff --git a/types/material__menu/simple/index.d.ts b/types/material__menu/simple/index.d.ts new file mode 100644 index 0000000000..c2315810ba --- /dev/null +++ b/types/material__menu/simple/index.d.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCSimpleMenuFoundation from './foundation'; +import MDCSimpleMenuAdapter from './adapter'; +import { getTransformPropertyName } from '../util'; + +export {MDCSimpleMenuAdapter, MDCSimpleMenuFoundation}; + +export class MDCSimpleMenu extends MDCComponent { + static attachTo(root: Element): MDCSimpleMenu; + + open: boolean; + + show(options?: {focusIndex?: number}): void; + + hide(): void; + + /** + * Return the items within the menu. Note that this only contains the set of elements within + * the items container that are proper list items, and not supplemental / presentational DOM + * elements. + */ + readonly items: Element[]; + + getDefaultFoundation(): MDCSimpleMenuFoundation; +} diff --git a/types/material__menu/tsconfig.json b/types/material__menu/tsconfig.json new file mode 100644 index 0000000000..6eb7f942cc --- /dev/null +++ b/types/material__menu/tsconfig.json @@ -0,0 +1,30 @@ +{ + "files": [ + "simple/constants.d.ts", + "simple/adapter.d.ts", + "simple/index.d.ts", + "simple/foundation.d.ts", + "util.d.ts", + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__menu/tslint.json b/types/material__menu/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__menu/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__menu/util.d.ts b/types/material__menu/util.d.ts new file mode 100644 index 0000000000..d5e02a37e2 --- /dev/null +++ b/types/material__menu/util.d.ts @@ -0,0 +1,37 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Returns the name of the correct transform property to use on the current browser. + */ +export function getTransformPropertyName(globalObj: Window, forceRefresh?: boolean): string|undefined; + +/** + * Clamps a value between the minimum and the maximum, returning the clamped value. + */ +export function clamp(value: number, min?: number, max?: number): number; + +/** + * Returns the easing value to apply at time t, for a given cubic bezier curve. + * Control points P0 and P3 are assumed to be (0,0) and (1,1), respectively. + * Parameters are as follows: + * - time: The current time in the animation, scaled between 0 and 1. + * - x1: The x value of control point P1. + * - y1: The y value of control point P1. + * - x2: The x value of control point P2. + * - y2: The y value of control point P2. + */ +export function bezierProgress(time: number, x1: number, y1: number, x2: number, y2: number): number; diff --git a/types/material__radio/adapter.d.ts b/types/material__radio/adapter.d.ts new file mode 100644 index 0000000000..91035ea177 --- /dev/null +++ b/types/material__radio/adapter.d.ts @@ -0,0 +1,40 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCSelectionControlState } from 'material__selection-control'; + +/** + * Adapter for MDC Radio. Provides an interface for managing + * - classes + * - dom + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + */ +export class MDCRadioAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + getNativeControl(): MDCSelectionControlState; +} + +export default MDCRadioAdapter; diff --git a/types/material__radio/constants.d.ts b/types/material__radio/constants.d.ts new file mode 100644 index 0000000000..5c73f72faf --- /dev/null +++ b/types/material__radio/constants.d.ts @@ -0,0 +1,26 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control'; +} + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-radio'; + DISABLED: 'mdc-radio--disabled'; +} diff --git a/types/material__radio/foundation.d.ts b/types/material__radio/foundation.d.ts new file mode 100644 index 0000000000..f27bd30f1b --- /dev/null +++ b/types/material__radio/foundation.d.ts @@ -0,0 +1,42 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { MDCSelectionControlState } from 'material__selection-control'; +import MDCRadioAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export class MDCRadioFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCRadioAdapter; + + isChecked(): boolean; + + setChecked(checked: boolean): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; + + getValue(): string; + + setValue(value?: string): void; +} + +export default MDCRadioFoundation; diff --git a/types/material__radio/index.d.ts b/types/material__radio/index.d.ts new file mode 100644 index 0000000000..e9001d9d84 --- /dev/null +++ b/types/material__radio/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import { MDCSelectionControl } from 'material__selection-control'; +import MDCRadioAdapter from './adapter'; +import MDCRadioFoundation from './foundation'; +import { MDCRipple, MDCRippleFoundation } from 'material__ripple'; + +export {MDCRadioAdapter, MDCRadioFoundation}; + +export class MDCRadio extends MDCComponent implements MDCSelectionControl { + static attachTo(root: Element): MDCRadio; + + checked: boolean; + + disabled: boolean; + + value: string; + + readonly ripple: MDCRipple; + + destroy(): void; + + getDefaultFoundation(): MDCRadioFoundation; +} diff --git a/types/material__radio/tsconfig.json b/types/material__radio/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__radio/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__radio/tslint.json b/types/material__radio/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__radio/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__ripple/adapter.d.ts b/types/material__ripple/adapter.d.ts new file mode 100644 index 0000000000..0d2d319aab --- /dev/null +++ b/types/material__ripple/adapter.d.ts @@ -0,0 +1,65 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Ripple. Provides an interface for managing + * - classes + * - dom + * - CSS variables + * - position + * - dimensions + * - scroll position + * - event handlers + * - unbounded, active and disabled states + * + * Additionally, provides type information for the adapter to the Closure + * compiler. + * + * Implement this adapter for your framework of choice to delegate updates to + * the component in your framework of choice. See architecture documentation + * for more details. + * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md + * + * @record + */ +export default class MDCRippleAdapter { + browserSupportsCssVars(): boolean; + + isUnbounded(): boolean; + + isSurfaceActive(): boolean; + + isSurfaceDisabled(): boolean; + + addClass(className: string): void; + + removeClass(className: string): void; + + registerInteractionHandler(evtType: string, handler: EventListener): void; + + deregisterInteractionHandler(evtType: string, handler: EventListener): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + updateCssVariable(varName: string, value: number|string): void; + + computeBoundingRect(): ClientRect; + + getWindowPageOffset(): {x: number, y: number}; +} diff --git a/types/material__ripple/constants.d.ts b/types/material__ripple/constants.d.ts new file mode 100644 index 0000000000..285d5f3f2c --- /dev/null +++ b/types/material__ripple/constants.d.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + // Ripple is a special case where the "root" component is really a "mixin" of sorts, + // given that it's an 'upgrade' to an existing component. That being said it is the root + // CSS class that all other CSS classes derive from. + ROOT: 'mdc-ripple-upgraded'; + UNBOUNDED: 'mdc-ripple-upgraded--unbounded'; + BG_FOCUSED: 'mdc-ripple-upgraded--background-focused'; + BG_ACTIVE_FILL: 'mdc-ripple-upgraded--background-active-fill'; + FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation'; + FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation'; +} + +export interface strings extends MDCStrings { + VAR_FG_SIZE: '--mdc-ripple-fg-size'; + VAR_LEFT: '--mdc-ripple-left'; + VAR_TOP: '--mdc-ripple-top'; + VAR_FG_SCALE: '--mdc-ripple-fg-scale'; + VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start'; + VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end'; +} + +export interface numbers extends MDCNumbers { + PADDING: 10; + INITIAL_ORIGIN_SCALE: 0.6; + DEACTIVATION_TIMEOUT_MS: 300; + FG_DEACTIVATION_MS: 83; +} diff --git a/types/material__ripple/foundation.d.ts b/types/material__ripple/foundation.d.ts new file mode 100644 index 0000000000..b67632e441 --- /dev/null +++ b/types/material__ripple/foundation.d.ts @@ -0,0 +1,69 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCRippleAdapter from './adapter'; +import { cssClasses, strings, numbers } from './constants'; +import { getNormalizedEventCoords } from './util'; + +export interface ActivationStateType { + isActivated: boolean|undefined; + hasDeactivationUXRun: boolean|undefined; + wasActivatedByPointer: boolean|undefined; + wasElementMadeActive: boolean|undefined; + activationStartTime: number|undefined; + activationEvent: Event; + isProgrammatic: boolean|undefined; +} + +export interface ListenerInfoType { + activate: string|undefined; + deactivate: string|undefined; + focus: string|undefined; + blur: string|undefined; +} + +export interface ListenersType { + activate(e: Event): void; + + deactivate(e: Event): void; + + focus(): void; + + blur(): void; +} + +export interface PointType { + x: number; + y: number; +} + +export default class MDCRippleFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCRippleAdapter; + + activate(event?: Event): void; + + deactivate(event?: Event): void; + + layout(): void; +} diff --git a/types/material__ripple/index.d.ts b/types/material__ripple/index.d.ts new file mode 100644 index 0000000000..2f8379ac84 --- /dev/null +++ b/types/material__ripple/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import MDCRippleAdapter from './adapter'; +import MDCRippleFoundation from './foundation'; +import * as util from './util'; + +export {MDCRippleAdapter, MDCRippleFoundation, util}; + +export class MDCRipple extends MDCComponent { + static attachTo(root: Element, bound?: {isUnbounded: boolean|undefined}): MDCRipple; + + static createAdapter(instance: RippleCapableSurface): MDCRippleAdapter; + + unbounded: boolean; + + activate(): void; + + deactivate(): void; + + layout(): void; + + getDefaultFoundation(): MDCRippleFoundation; + + initialSyncWithDOM(): void; +} + +/** + * See Material Design spec for more details on when to use ripples. + * https://material.io/guidelines/motion/choreography.html#choreography-creation + * @record + */ +export class RippleCapableSurface { + protected root_: Element; + + /** + * Whether or not the ripple bleeds out of the bounds of the element. + */ + unbounded: boolean|undefined; + + /** + * Whether or not the ripple is attached to a disabled component. + */ + disabled: boolean|undefined; +} diff --git a/types/material__ripple/tsconfig.json b/types/material__ripple/tsconfig.json new file mode 100644 index 0000000000..9f215e4ee0 --- /dev/null +++ b/types/material__ripple/tsconfig.json @@ -0,0 +1,29 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "util.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__ripple/tslint.json b/types/material__ripple/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__ripple/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__ripple/util.d.ts b/types/material__ripple/util.d.ts new file mode 100644 index 0000000000..ed684eca8f --- /dev/null +++ b/types/material__ripple/util.d.ts @@ -0,0 +1,27 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export function supportsCssVariables(windowObj: Window, forceRefresh?: boolean): boolean|undefined; + +/** + * Determine whether the current browser supports passive event listeners, and if so, use them. + */ +export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean|{passive: boolean}; + +export function getMatchesProperty(HTMLElementPrototype: object): string[]; + +export function getNormalizedEventCoords(ev: Event, pageOffset: {x: number, y: number}, clientRect: ClientRect): {x: number, y: number}; diff --git a/types/material__select/adapter.d.ts b/types/material__select/adapter.d.ts new file mode 100644 index 0000000000..2828b77361 --- /dev/null +++ b/types/material__select/adapter.d.ts @@ -0,0 +1,81 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSelectAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + addBodyClass(className: string): void; + + removeBodyClass(className: string): void; + + setAttr(attr: string, value: string): void; + + rmAttr(attr: string): void; + + computeBoundingRect(): {left: number, top: number}; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + focus(): void; + + makeTabbable(): void; + + makeUntabbable(): void; + + getComputedStyleValue(propertyName: string): string; + + setStyle(propertyName: string, value: string): void; + + create2dRenderingContext(): {font: string, measureText: (val: string) => {width: number}}; + + setMenuElStyle(propertyName: string, value: string): void; + + setMenuElAttr(attr: string, value: string): void; + + rmMenuElAttr(attr: string): void; + + getMenuElOffsetHeight(): number; + + openMenu(focusIndex: number): void; + + isMenuOpen(): boolean; + + setSelectedTextContent(textContent: string): void; + + getNumberOfOptions(): number; + + getTextForOptionAtIndex(index: number): string; + + getValueForOptionAtIndex(index: number): string; + + setAttrForOptionAtIndex(index: number, attr: string, value: string): void; + + rmAttrForOptionAtIndex(index: number, attr: string): void; + + getOffsetTopForOptionAtIndex(index: number): number; + + registerMenuInteractionHandler(type: string, handler: EventListener): void; + + deregisterMenuInteractionHandler(type: string, handler: EventListener): void; + + notifyChange(): void; + + getWindowInnerHeight(): number; +} diff --git a/types/material__select/constants.d.ts b/types/material__select/constants.d.ts new file mode 100644 index 0000000000..1566d71322 --- /dev/null +++ b/types/material__select/constants.d.ts @@ -0,0 +1,28 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-select'; + OPEN: 'mdc-select--open'; + DISABLED: 'mdc-select--disabled'; + SCROLL_LOCK: 'mdc-select-scroll-lock'; +} + +export interface strings extends MDCStrings { + CHANGE_EVENT: 'MDCSelect:change'; +} diff --git a/types/material__select/foundation.d.ts b/types/material__select/foundation.d.ts new file mode 100644 index 0000000000..6f66f79b5f --- /dev/null +++ b/types/material__select/foundation.d.ts @@ -0,0 +1,40 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { cssClasses, strings } from './constants'; +import { MDCSimpleMenuFoundation } from 'material__menu'; +import { MDCSelectAdapter } from './adapter'; + +export default class MDCSelectFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSelectAdapter; + + getValue(): string; + + getSelectedIndex(): number; + + setSelectedIndex(index: number): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; + + resize(): void; +} diff --git a/types/material__select/index.d.ts b/types/material__select/index.d.ts new file mode 100644 index 0000000000..78746a97d1 --- /dev/null +++ b/types/material__select/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCSimpleMenu } from 'material__menu'; + +import { MDCSelectAdapter } from './adapter'; +import MDCSelectFoundation from './foundation'; + +export {MDCSelectAdapter, MDCSelectFoundation}; + +export class MDCSelect extends MDCComponent { + static attachTo(root: Element): MDCSelect; + + readonly value: string; + + readonly options: Element[]; + + readonly selectedOptions: NodeListOf; + + selectedIndex: number; + + disabled: boolean; + + item(index: number): Element|null; + + nameditem(key: string): Element|null; + + initialize(menuFactory?: (el: Element) => MDCSimpleMenu): void; + + getDefaultFoundation(): MDCSelectFoundation; + + initialSyncWithDOM(): void; +} diff --git a/types/material__select/tsconfig.json b/types/material__select/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__select/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__select/tslint.json b/types/material__select/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__select/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__selection-control/index.d.ts b/types/material__selection-control/index.d.ts new file mode 100644 index 0000000000..9c7f90c3fd --- /dev/null +++ b/types/material__selection-control/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCRipple } from 'material__ripple'; + +export interface MDCSelectionControlState { + checked: boolean; + indeterminate: boolean; + disabled: boolean; + value?: string; +} + +export class MDCSelectionControl { + readonly ripple: MDCRipple; +} diff --git a/types/material__selection-control/tsconfig.json b/types/material__selection-control/tsconfig.json new file mode 100644 index 0000000000..0cbce49fc7 --- /dev/null +++ b/types/material__selection-control/tsconfig.json @@ -0,0 +1,25 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__selection-control/tslint.json b/types/material__selection-control/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__selection-control/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__slider/adapter.d.ts b/types/material__slider/adapter.d.ts new file mode 100644 index 0000000000..940ae04d76 --- /dev/null +++ b/types/material__slider/adapter.d.ts @@ -0,0 +1,67 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSliderAdapter { + hasClass(className: string): boolean; + + addClass(className: string): void; + + removeClass(className: string): void; + + getAttribute(name: string): string|null; + + setAttribute(name: string, value: string): void; + + removeAttribute(name: string): void; + + computeBoundingRect(): ClientRect; + + getTabIndex(): number; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + registerThumbContainerInteractionHandler(type: string, handler: EventListener): void; + + deregisterThumbContainerInteractionHandler(type: string, handler: EventListener): void; + + registerBodyInteractionHandler(type: string, handler: EventListener): void; + + deregisterBodyInteractionHandler(type: string, handler: EventListener): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + notifyInput(): void; + + notifyChange(): void; + + setThumbContainerStyleProperty(propertyName: string, value: string): void; + + setTrackStyleProperty(propertyName: string, value: string): void; + + setMarkerValue(value: number): void; + + appendTrackMarkers(numMarkers: number): void; + + removeTrackMarkers(): void; + + setLastTrackMarkersStyleProperty(propertyName: string, value: string): void; + + isRTL(): boolean; +} diff --git a/types/material__slider/constants.d.ts b/types/material__slider/constants.d.ts new file mode 100644 index 0000000000..444eb38f91 --- /dev/null +++ b/types/material__slider/constants.d.ts @@ -0,0 +1,46 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ACTIVE: 'mdc-slider--active'; + DISABLED: 'mdc-slider--disabled'; + DISCRETE: 'mdc-slider--discrete'; + FOCUS: 'mdc-slider--focus'; + IN_TRANSIT: 'mdc-slider--in-transit'; + IS_DISCRETE: 'mdc-slider--discrete'; + HAS_TRACK_MARKER: 'mdc-slider--display-markers'; +} + +export interface strings extends MDCStrings { + TRACK_SELECTOR: '.mdc-slider__track'; + TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container'; + LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child'; + THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container'; + PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker'; + ARIA_VALUEMIN: 'aria-valuemin'; + ARIA_VALUEMAX: 'aria-valuemax'; + ARIA_VALUENOW: 'aria-valuenow'; + ARIA_DISABLED: 'aria-disabled'; + STEP_DATA_ATTR: 'data-step'; + CHANGE_EVENT: 'MDCSlider:change'; + INPUT_EVENT: 'MDCSlider:input'; +} + +export interface numbers extends MDCNumbers { + PAGE_FACTOR: 4; +} diff --git a/types/material__slider/foundation.d.ts b/types/material__slider/foundation.d.ts new file mode 100644 index 0000000000..5da6942f49 --- /dev/null +++ b/types/material__slider/foundation.d.ts @@ -0,0 +1,55 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { cssClasses, strings, numbers } from './constants'; + +import { getCorrectEventName, getCorrectPropertyName } from 'material__animation'; +import MDCFoundation from 'material__base/foundation'; +import { MDCSliderAdapter } from './adapter'; + +export default class MDCSliderFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCSliderAdapter; + + setupTrackMarker(): void; + + layout(): void; + + getValue(): number; + + setValue(value: number): void; + + getMax(): number; + + setMax(max: number): void; + + getMin(): number; + + setMin(min: number): void; + + getStep(): number; + + setStep(step: number): void; + + isDisabled(): boolean; + + setDisabled(disabled: boolean): void; +} diff --git a/types/material__slider/index.d.ts b/types/material__slider/index.d.ts new file mode 100644 index 0000000000..0d0e472775 --- /dev/null +++ b/types/material__slider/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import MDCSliderFoundation from './foundation'; +import { MDCSliderAdapter } from './adapter'; + +export {MDCSliderAdapter, MDCSliderFoundation}; + +export class MDCSlider extends MDCComponent { + static attachTo(root: Element): MDCSlider; + + value: number; + + min: number; + + max: number; + + step: number; + + disabled: boolean; + + initialize(): void; + + getDefaultFoundation(): MDCSliderFoundation; + + initialSyncWithDOM(): void; + + layout(): void; + + stepUp(amount?: number): void; + + stepDown(amount?: number): void; +} diff --git a/types/material__slider/tsconfig.json b/types/material__slider/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__slider/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__slider/tslint.json b/types/material__slider/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__slider/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__snackbar/adapter.d.ts b/types/material__snackbar/adapter.d.ts new file mode 100644 index 0000000000..412329bd97 --- /dev/null +++ b/types/material__snackbar/adapter.d.ts @@ -0,0 +1,38 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCSnackbarAdapter { + addClass(className: string): void; + removeClass(className: string): void; + setAriaHidden(): void; + unsetAriaHidden(): void; + setActionAriaHidden(): void; + unsetActionAriaHidden(): void; + setActionText(actionText: string): void; + setMessageText(message: string): void; + setFocus(): void; + visibilityIsHidden(): boolean; + registerCapturedBlurHandler(handler: EventListener): void; + deregisterCapturedBlurHandler(handler: EventListener): void; + registerVisibilityChangeHandler(handler: EventListener): void; + deregisterVisibilityChangeHandler(handler: EventListener): void; + registerCapturedInteractionHandler(evtType: string, handler: EventListener): void; + deregisterCapturedInteractionHandler(evtType: string, handler: EventListener): void; + registerActionClickHandler(handler: EventListener): void; + deregisterActionClickHandler(handler: EventListener): void; + registerTransitionEndHandler(handler: EventListener): void; + deregisterTransitionEndHandler(handler: EventListener): void; +} diff --git a/types/material__snackbar/constants.d.ts b/types/material__snackbar/constants.d.ts new file mode 100644 index 0000000000..7bf6758a0a --- /dev/null +++ b/types/material__snackbar/constants.d.ts @@ -0,0 +1,37 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-snackbar'; + TEXT: 'mdc-snackbar__text'; + ACTION_WRAPPER: 'mdc-snackbar__action-wrapper'; + ACTION_BUTTON: 'mdc-snackbar__action-button'; + ACTIVE: 'mdc-snackbar--active'; + MULTILINE: 'mdc-snackbar--multiline'; + ACTION_ON_BOTTOM: 'mdc-snackbar--action-on-bottom'; +} + +export interface strings extends MDCStrings { + TEXT_SELECTOR: '.mdc-snackbar__text'; + ACTION_WRAPPER_SELECTOR: '.mdc-snackbar__action-wrapper'; + ACTION_BUTTON_SELECTOR: '.mdc-snackbar__action-button'; +} + +export interface numbers extends MDCNumbers { + MESSAGE_TIMEOUT: 2750; +} diff --git a/types/material__snackbar/foundation.d.ts b/types/material__snackbar/foundation.d.ts new file mode 100644 index 0000000000..5c85ab5f85 --- /dev/null +++ b/types/material__snackbar/foundation.d.ts @@ -0,0 +1,44 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCFoundation } from 'material__base'; +import { cssClasses, strings, numbers } from './constants'; +import { MDCSnackbarAdapter } from './adapter'; + +export interface MDCSnackbarData { + message: string; + actionHandler: EventListener; + actionText: string; + multiline?: boolean; + actionOnBottom?: boolean; + timeout?: number; +} + +export class MDCSnackbarFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCSnackbarAdapter; + + readonly active: boolean; + + dismissesOnAction(): boolean; + + setDismissOnAction(dismissOnAction: boolean): void; + + show(data: MDCSnackbarData): void; +} diff --git a/types/material__snackbar/index.d.ts b/types/material__snackbar/index.d.ts new file mode 100644 index 0000000000..11ac69f573 --- /dev/null +++ b/types/material__snackbar/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; +import { MDCSnackbarAdapter } from './adapter'; +import { MDCSnackbarFoundation, MDCSnackbarData } from './foundation'; +import { getCorrectEventName } from 'material__animation'; + +export {MDCSnackbarAdapter, MDCSnackbarFoundation}; + +export class MDCSnackbar extends MDCComponent { + static attachTo(root: Element): MDCSnackbar; + + show(data: MDCSnackbarData): void; + + getDefaultFoundation(): MDCSnackbarFoundation; + + dismissesOnAction: boolean; +} diff --git a/types/material__snackbar/tsconfig.json b/types/material__snackbar/tsconfig.json new file mode 100644 index 0000000000..06c0ac3c43 --- /dev/null +++ b/types/material__snackbar/tsconfig.json @@ -0,0 +1,28 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__snackbar/tslint.json b/types/material__snackbar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__snackbar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__tabs/index.d.ts b/types/material__tabs/index.d.ts new file mode 100644 index 0000000000..b268e55a8d --- /dev/null +++ b/types/material__tabs/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export {MDCTabFoundation, MDCTab} from './tab/index'; +export {MDCTabBarAdapter, MDCTabBarFoundation, MDCTabBar} from './tab-bar/index'; +export {MDCTabBarScrollerAdapter, MDCTabBarScrollerFoundation, MDCTabBarScroller} from './tab-bar-scroller/index'; diff --git a/types/material__tabs/tab-bar-scroller/adapter.d.ts b/types/material__tabs/tab-bar-scroller/adapter.d.ts new file mode 100644 index 0000000000..8c1286fc74 --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/adapter.d.ts @@ -0,0 +1,69 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCTabBarScrollerAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + eventTargetHasClass(target: EventTarget, className: string): boolean; + + addClassToForwardIndicator(className: string): void; + + removeClassFromForwardIndicator(className: string): void; + + addClassToBackIndicator(className: string): void; + + removeClassFromBackIndicator(className: string): void; + + isRTL(): boolean; + + registerBackIndicatorClickHandler(handler: EventListener): void; + + deregisterBackIndicatorClickHandler(handler: EventListener): void; + + registerForwardIndicatorClickHandler(handler: EventListener): void; + + deregisterForwardIndicatorClickHandler(handler: EventListener): void; + + registerCapturedInteractionHandler(evt: string, handler: EventListener): void; + + deregisterCapturedInteractionHandler(evt: string, handler: EventListener): void; + + registerWindowResizeHandler(handler: EventListener): void; + + deregisterWindowResizeHandler(handler: EventListener): void; + + getNumberOfTabs(): number; + + getComputedWidthForTabAtIndex(): number; + + getComputedLeftForTabAtIndex(): number; + + getOffsetWidthForScrollFrame(): number; + + getScrollLeftForScrollFrame(): number; + + setScrollLeftForScrollFrame(scrollLeftAmount: number): void; + + getOffsetWidthForTabBar(): number; + + setTransformStyleForTabBar(value: string): void; + + getOffsetLeftForEventTarget(target: EventTarget): number; + + getOffsetWidthForEventTarget(target: EventTarget): number; +} diff --git a/types/material__tabs/tab-bar-scroller/constants.d.ts b/types/material__tabs/tab-bar-scroller/constants.d.ts new file mode 100644 index 0000000000..b78ac1b937 --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/constants.d.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + INDICATOR_FORWARD: 'mdc-tab-bar-scroller__indicator--forward'; + INDICATOR_BACK: 'mdc-tab-bar-scroller__indicator--back'; + INDICATOR_ENABLED: 'mdc-tab-bar-scroller__indicator--enabled'; + TAB: 'mdc-tab'; +} + +export interface strings extends MDCStrings { + FRAME_SELECTOR: '.mdc-tab-bar-scroller__scroll-frame'; + TABS_SELECTOR: '.mdc-tab-bar-scroller__scroll-frame__tabs'; + TAB_SELECTOR: '.mdc-tab'; + INDICATOR_FORWARD_SELECTOR: '.mdc-tab-bar-scroller__indicator--forward'; + INDICATOR_BACK_SELECTOR: '.mdc-tab-bar-scroller__indicator--back'; +} diff --git a/types/material__tabs/tab-bar-scroller/foundation.d.ts b/types/material__tabs/tab-bar-scroller/foundation.d.ts new file mode 100644 index 0000000000..ed470c20d2 --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/foundation.d.ts @@ -0,0 +1,36 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; + +import { cssClasses, strings } from './constants'; +import { MDCTabBarScrollerAdapter } from './adapter'; + +export default class MDCTabBarScrollerFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTabBarScrollerAdapter; + + scrollBack(evt?: Event): void; + + scrollForward(evt?: Event): void; + + layout(): void; + + scrollToTabAtIndex(index: number): void; +} diff --git a/types/material__tabs/tab-bar-scroller/index.d.ts b/types/material__tabs/tab-bar-scroller/index.d.ts new file mode 100644 index 0000000000..a9d71b305c --- /dev/null +++ b/types/material__tabs/tab-bar-scroller/index.d.ts @@ -0,0 +1,36 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { getCorrectPropertyName } from 'material__animation'; +import MDCComponent from 'material__base/component'; + +import { MDCTabBar } from '../tab-bar/index'; +import MDCTabBarScrollerFoundation from './foundation'; +import { MDCTabBarScrollerAdapter } from './adapter'; + +export {MDCTabBarScrollerAdapter, MDCTabBarScrollerFoundation}; + +export class MDCTabBarScroller extends MDCComponent { + static attachTo(root: Element): MDCTabBarScroller; + + readonly tabBar: MDCTabBar; + + initialize(tabBarFactory?: (el: Element) => MDCTabBar): void; + + getDefaultFoundation(): MDCTabBarScrollerFoundation; + + layout(): void; +} diff --git a/types/material__tabs/tab-bar/adapter.d.ts b/types/material__tabs/tab-bar/adapter.d.ts new file mode 100644 index 0000000000..1efa73f52c --- /dev/null +++ b/types/material__tabs/tab-bar/adapter.d.ts @@ -0,0 +1,53 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCTabBarAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + bindOnMDCTabSelectedEvent(): void; + + unbindOnMDCTabSelectedEvent(): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + getOffsetWidth(): number; + + setStyleForIndicator(propertyName: string, value: string): void; + + getOffsetWidthForIndicator(): number; + + notifyChange(evtData: {activeTabIndex: number}): void; + + getNumberOfTabs(): number; + + isTabActiveAtIndex(index: number): boolean; + + setTabActiveAtIndex(index: number, isActive: true): void; + + isDefaultPreventedOnClickForTabAtIndex(index: number): boolean; + + setPreventDefaultOnClickForTabAtIndex(index: number, preventDefaultOnClick: boolean): void; + + measureTabAtIndex(index: number): void; + + getComputedWidthForTabAtIndex(index: number): number; + + getComputedLeftForTabAtIndex(index: number): number; +} diff --git a/types/material__tabs/tab-bar/constants.d.ts b/types/material__tabs/tab-bar/constants.d.ts new file mode 100644 index 0000000000..21120fb1e9 --- /dev/null +++ b/types/material__tabs/tab-bar/constants.d.ts @@ -0,0 +1,27 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + UPGRADED: 'mdc-tab-bar-upgraded'; +} + +export interface strings extends MDCStrings { + TAB_SELECTOR: '.mdc-tab'; + INDICATOR_SELECTOR: '.mdc-tab-bar__indicator'; + CHANGE_EVENT: 'MDCTabBar:change'; +} diff --git a/types/material__tabs/tab-bar/foundation.d.ts b/types/material__tabs/tab-bar/foundation.d.ts new file mode 100644 index 0000000000..2e5ccb1de2 --- /dev/null +++ b/types/material__tabs/tab-bar/foundation.d.ts @@ -0,0 +1,35 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { getCorrectPropertyName } from 'material__animation'; + +import { cssClasses, strings } from './constants'; +import { MDCTabBarAdapter } from './adapter'; + +export default class MDCTabBarFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTabBarAdapter; + + layout(): void; + + switchToTabAtIndex(index: number, shouldNotify: boolean): void; + + getActiveTabIndex(): number; +} diff --git a/types/material__tabs/tab-bar/index.d.ts b/types/material__tabs/tab-bar/index.d.ts new file mode 100644 index 0000000000..127a62217f --- /dev/null +++ b/types/material__tabs/tab-bar/index.d.ts @@ -0,0 +1,39 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import { MDCTab, MDCTabFoundation } from '../tab/index'; +import MDCTabBarFoundation from './foundation'; +import { MDCTabBarAdapter } from './adapter'; + +export {MDCTabBarAdapter, MDCTabBarFoundation}; + +export class MDCTabBar extends MDCComponent { + static attachTo(root: Element): MDCTabBar; + + readonly tabs: MDCTab[]; + + activeTab: MDCTab; + + activeTabIndex: number; + + initialize(tabFactory?: (el: Element) => MDCTab): void; + + getDefaultFoundation(): MDCTabBarFoundation; + + layout(): void; +} diff --git a/types/material__tabs/tab/adapter.d.ts b/types/material__tabs/tab/adapter.d.ts new file mode 100644 index 0000000000..bc07aa5aa7 --- /dev/null +++ b/types/material__tabs/tab/adapter.d.ts @@ -0,0 +1,31 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCTabAdapter { + addClass(className: string): void; + + removeClass(className: string): void; + + registerInteractionHandler(type: string, handler: EventListener): void; + + deregisterInteractionHandler(type: string, handler: EventListener): void; + + getOffsetWidth(): number; + + getOffsetLeft(): number; + + notifySelected(): void; +} diff --git a/types/material__tabs/tab/constants.d.ts b/types/material__tabs/tab/constants.d.ts new file mode 100644 index 0000000000..1023f253db --- /dev/null +++ b/types/material__tabs/tab/constants.d.ts @@ -0,0 +1,25 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface cssClasses extends MDCStrings { + ACTIVE: 'mdc-tab--active'; +} + +export interface strings extends MDCStrings { + SELECTED_EVENT: 'MDCTab:selected'; +} diff --git a/types/material__tabs/tab/foundation.d.ts b/types/material__tabs/tab/foundation.d.ts new file mode 100644 index 0000000000..46e14065c8 --- /dev/null +++ b/types/material__tabs/tab/foundation.d.ts @@ -0,0 +1,41 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { cssClasses, strings } from './constants'; +import { MDCTabAdapter } from './adapter'; + +export class MDCTabFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTabAdapter; + + getComputedWidth(): number; + + getComputedLeft(): number; + + isActive(): boolean; + + setActive(isActive: boolean): void; + + preventsDefaultOnClick(): boolean; + + setPreventDefaultOnClick(preventDefaultOnClick: boolean): void; + + measureSelf(): void; +} diff --git a/types/material__tabs/tab/index.d.ts b/types/material__tabs/tab/index.d.ts new file mode 100644 index 0000000000..bf41b77e65 --- /dev/null +++ b/types/material__tabs/tab/index.d.ts @@ -0,0 +1,44 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import { MDCRipple } from 'material__ripple'; + +import { MDCTabAdapter } from './adapter'; +import { cssClasses } from './constants'; +import { MDCTabFoundation } from './foundation'; + +export {MDCTabAdapter, MDCTabFoundation}; + +export class MDCTab extends MDCComponent { + static attachTo(root: Element): MDCTab; + + readonly computedWidth: number; + + readonly computedLeft: number; + + isActive: boolean; + + preventDefaultOnClick: boolean; + + destroy(): void; + + getDefaultFoundation(): MDCTabFoundation; + + initialSyncWithDOM(): void; + + measureSelf(): void; +} diff --git a/types/material__tabs/tsconfig.json b/types/material__tabs/tsconfig.json new file mode 100644 index 0000000000..69e44f2eef --- /dev/null +++ b/types/material__tabs/tsconfig.json @@ -0,0 +1,37 @@ +{ + "files": [ + "tab-bar/constants.d.ts", + "tab-bar/adapter.d.ts", + "tab-bar/index.d.ts", + "tab-bar/foundation.d.ts", + "tab/constants.d.ts", + "tab/adapter.d.ts", + "tab/index.d.ts", + "tab/foundation.d.ts", + "index.d.ts", + "tab-bar-scroller/constants.d.ts", + "tab-bar-scroller/adapter.d.ts", + "tab-bar-scroller/index.d.ts", + "tab-bar-scroller/foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__tabs/tslint.json b/types/material__tabs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__tabs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__textfield/adapter.d.ts b/types/material__textfield/adapter.d.ts new file mode 100644 index 0000000000..ca13544c26 --- /dev/null +++ b/types/material__textfield/adapter.d.ts @@ -0,0 +1,161 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCTextFieldBottomLineFoundation from './bottom-line/foundation'; +import MDCTextFieldHelperTextFoundation from './helper-text/foundation'; + +export interface NativeInputType { + value: string; + disabled: boolean; + badInput: boolean; + checkValidity(): boolean; +} + +/** + * Adapter for MDC Text Field. + * + * Defines the shape of the adapter expected by the foundation. Implement this + * adapter to integrate the Text Field into your framework. See + * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md + * for more information. + * + * @record + */ +export class MDCTextFieldAdapter { + /** + * Adds a class to the root Element. + */ + addClass(className: string): void; + + /** + * Removes a class from the root Element. + */ + removeClass(className: string): void; + + /** + * Adds a class to the label Element. We recommend you add a conditional + * check here, and in removeClassFromLabel for whether or not the label is + * present so that the JS component could be used with text fields that don't + * require a label, such as the full-width text field. + */ + addClassToLabel(className: string): void; + + /** + * Removes a class from the label Element. + */ + removeClassFromLabel(className: string): void; + + /** + * Sets an attribute on the icon Element. + */ + setIconAttr(name: string, value: string): void; + + /** + * Returns true if classname exists for a given target element. + */ + eventTargetHasClass(target: EventTarget, className: string): boolean; + + /** + * Registers an event handler on the root element for a given event. + */ + registerTextFieldInteractionHandler(type: string, handler: EventListener): void; + + /** + * Deregisters an event handler on the root element for a given event. + */ + deregisterTextFieldInteractionHandler(type: string, handler: EventListener): void; + + /** + * Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon. + */ + notifyIconAction(): void; + + /** + * Adds a class to the helper text element. Note that in our code we check for + * whether or not we have a helper text element and if we don't, we simply + * return. + */ + addClassToHelperText(className: string): void; + + /** + * Removes a class from the helper text element. + */ + removeClassFromHelperText(className: string): void; + + /** + * Returns whether or not the helper text element contains the given class. + */ + helperTextHasClass(className: string): boolean; + + /** + * Registers an event listener on the native input element for a given event. + */ + registerInputInteractionHandler(evtType: string, handler: EventListener): void; + + /** + * Deregisters an event listener on the native input element for a given event. + */ + deregisterInputInteractionHandler(evtType: string, handler: EventListener): void; + + /** + * Registers an event listener on the bottom line element for a given event. + */ + registerBottomLineEventHandler(evtType: string, handler: EventListener): void; + + /** + * Deregisters an event listener on the bottom line element for a given event. + */ + deregisterBottomLineEventHandler(evtType: string, handler: EventListener): void; + + /** + * Sets an attribute with a given value on the helper text element. + */ + setHelperTextAttr(name: string, value: string): void; + + /** + * Removes an attribute from the helper text element. + */ + removeHelperTextAttr(name: string): void; + + /** + * Sets the text content for the help text element + */ + setHelperTextContent(content: string): void; + + /** + * Returns an object representing the native text input element, with a + * similar API shape. The object returned should include the value, disabled + * and badInput properties, as well as the checkValidity() function. We never + * alter the value within our code, however we do update the disabled + * property, so if you choose to duck-type the return value for this method + * in your implementation it's important to keep this in mind. Also note that + * this method can return null, which the foundation will handle gracefully. + */ + getNativeInput(): Element|NativeInputType; + + /** + * Returns the foundation for the bottom line element. Returns undefined if + * there is no bottom line element. + */ + getBottomLineFoundation(): MDCTextFieldBottomLineFoundation; + + /** + * Returns the foundation for the helper text element. Returns undefined if + * there is no helper text element. + */ + getHelperTextFoundation(): MDCTextFieldHelperTextFoundation; +} diff --git a/types/material__textfield/bottom-line/adapter.d.ts b/types/material__textfield/bottom-line/adapter.d.ts new file mode 100644 index 0000000000..25b8de0477 --- /dev/null +++ b/types/material__textfield/bottom-line/adapter.d.ts @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC TextField Bottom Line. + * + * Defines the shape of the adapter expected by the foundation. Implement this + * adapter to integrate the TextField bottom line into your framework. See + * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md + * for more information. + * + * @record + */ +export default class MDCTextFieldBottomLineAdapter { + /** + * Adds a class to the bottom line element. + */ + addClass(className: string): void; + + /** + * Removes a class from the bottom line element. + */ + removeClass(className: string): void; + + /** + * Sets an attribute with a given value on the bottom line element. + */ + setAttr(attr: string, value: string): void; + + /** + * Registers an event listener on the bottom line element for a given event. + */ + registerEventHandler(evtType: string, handler: EventListener): void; + + /** + * Deregisters an event listener on the bottom line element for a given event. + */ + deregisterEventHandler(evtType: string, handler: EventListener): void; + + /** + * Emits a custom event "MDCTextFieldBottomLine:animation-end" denoting the + * bottom line has finished its animation; either the activate or + * deactivate animation + */ + notifyAnimationEnd(): void; +} diff --git a/types/material__textfield/bottom-line/constants.d.ts b/types/material__textfield/bottom-line/constants.d.ts new file mode 100644 index 0000000000..519b9fb8e5 --- /dev/null +++ b/types/material__textfield/bottom-line/constants.d.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + ANIMATION_END_EVENT: 'MDCTextFieldBottomLine:animation-end'; +} + +export interface cssClasses extends MDCStrings { + BOTTOM_LINE_ACTIVE: 'mdc-text-field__bottom-line--active'; +} diff --git a/types/material__textfield/bottom-line/foundation.d.ts b/types/material__textfield/bottom-line/foundation.d.ts new file mode 100644 index 0000000000..6945695348 --- /dev/null +++ b/types/material__textfield/bottom-line/foundation.d.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCTextFieldBottomLineAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export default class MDCTextFieldBottomLineFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTextFieldBottomLineAdapter; + + /** + * Activates the bottom line + */ + activate(): void; + + /** + * Sets the transform origin given a user's click location. + */ + setTransformOrigin(evt: Event): void; + + /** + * Deactivates the bottom line + */ + deactivate(): void; + + /** + * Handles a transition end event + */ + handleTransitionEnd(evt: Event): void; +} diff --git a/types/material__textfield/bottom-line/index.d.ts b/types/material__textfield/bottom-line/index.d.ts new file mode 100644 index 0000000000..a0ed4ff36d --- /dev/null +++ b/types/material__textfield/bottom-line/index.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import MDCTextFieldBottomLineAdapter from './adapter'; +import MDCTextFieldBottomLineFoundation from './foundation'; + +export {MDCTextFieldBottomLineAdapter, MDCTextFieldBottomLineFoundation}; + +export class MDCTextFieldBottomLine extends MDCComponent { + static attachTo(root: Element): MDCTextFieldBottomLine; + + readonly foundation: MDCTextFieldBottomLineFoundation; + + getDefaultFoundation(): MDCTextFieldBottomLineFoundation; +} diff --git a/types/material__textfield/constants.d.ts b/types/material__textfield/constants.d.ts new file mode 100644 index 0000000000..7150bb4b14 --- /dev/null +++ b/types/material__textfield/constants.d.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + ARIA_CONTROLS: 'aria-controls'; + INPUT_SELECTOR: '.mdc-text-field__input'; + LABEL_SELECTOR: '.mdc-text-field__label'; + ICON_SELECTOR: '.mdc-text-field__icon'; + ICON_EVENT: 'MDCTextField:icon'; + BOTTOM_LINE_SELECTOR: '.mdc-text-field__bottom-line'; +} + +export interface cssClasses extends MDCStrings { + ROOT: 'mdc-text-field'; + UPGRADED: 'mdc-text-field--upgraded'; + DISABLED: 'mdc-text-field--disabled'; + FOCUSED: 'mdc-text-field--focused'; + INVALID: 'mdc-text-field--invalid'; + LABEL_FLOAT_ABOVE: 'mdc-text-field__label--float-above'; + LABEL_SHAKE: 'mdc-text-field__label--shake'; + BOX: 'mdc-text-field--box'; + TEXT_FIELD_ICON: 'mdc-text-field__icon'; + TEXTAREA: 'mdc-text-field--textarea'; +} diff --git a/types/material__textfield/foundation.d.ts b/types/material__textfield/foundation.d.ts new file mode 100644 index 0000000000..d36d83867e --- /dev/null +++ b/types/material__textfield/foundation.d.ts @@ -0,0 +1,79 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import { MDCTextFieldAdapter, NativeInputType } from './adapter'; +import MDCTextFieldBottomLineFoundation from './bottom-line/foundation'; +import { cssClasses, strings } from './constants'; + +export default class MDCTextFieldFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTextFieldAdapter; + + handleTextFieldInteraction(evt: Event): void; + + /** + * Activates the text field focus state. + */ + activateFocus(): void; + + /** + * Sets the bottom line's transform origin, so that the bottom line activate + * animation will animate out from the user's click location. + */ + setBottomLineTransformOrigin(evt: Event): void; + + /** + * Activates the Text Field's focus state in cases when the input value + * changes without user input (e.g. programatically). + */ + autoCompleteFocus(): void; + + /** + * Handles when bottom line animation ends, performing actions that must wait + * for animations to finish. + */ + handleBottomLineAnimationEnd(): void; + + /** + * Deactives the Text Field's focus state. + */ + deactivateFocus(): void; + + /** + * True if the Text Field is disabled. + */ + isDisabled(): boolean; + + /** + * Sets the text-field disabled or enabled. + */ + setDisabled(disabled: boolean): void; + + /** + * Sets the content of the helper text. + */ + setHelperTextContent(content: string): void; + + /** + * Sets the validity state of the Text Field. + */ + setValid(isValid: boolean): void; +} diff --git a/types/material__textfield/helper-text/adapter.d.ts b/types/material__textfield/helper-text/adapter.d.ts new file mode 100644 index 0000000000..d8320bd0f4 --- /dev/null +++ b/types/material__textfield/helper-text/adapter.d.ts @@ -0,0 +1,58 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Adapter for MDC Text Field Helper Text. + * + * Defines the shape of the adapter expected by the foundation. Implement this + * adapter to integrate the TextField helper text into your framework. See + * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md + * for more information. + * + * @record + */ +export default class MDCTextFieldHelperTextAdapter { + /** + * Adds a class to the helper text element. + */ + addClass(className: string): void; + + /** + * Removes a class from the helper text element. + */ + removeClass(className: string): void; + + /** + * Returns whether or not the helper text element contains the given class. + */ + hasClass(className: string): boolean; + + /** + * Sets an attribute with a given value on the helper text element. + */ + setAttr(attr: string, value: string): void; + + /** + * Removes an attribute from the helper text element. + */ + removeAttr(attr: string): void; + + /** + * Sets the text content for the helper text element. + */ + setContent(content: string): void; +} diff --git a/types/material__textfield/helper-text/constants.d.ts b/types/material__textfield/helper-text/constants.d.ts new file mode 100644 index 0000000000..5418851e63 --- /dev/null +++ b/types/material__textfield/helper-text/constants.d.ts @@ -0,0 +1,28 @@ +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings } from 'material__base'; + +export interface strings extends MDCStrings { + ARIA_HIDDEN: 'aria-hidden'; + ROLE: 'role'; +} + +export interface cssClasses extends MDCStrings { + HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent'; + HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg'; +} diff --git a/types/material__textfield/helper-text/foundation.d.ts b/types/material__textfield/helper-text/foundation.d.ts new file mode 100644 index 0000000000..eccf531e51 --- /dev/null +++ b/types/material__textfield/helper-text/foundation.d.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCFoundation from 'material__base/foundation'; +import MDCTextFieldHelperTextAdapter from './adapter'; +import { cssClasses, strings } from './constants'; + +export default class MDCTextFieldHelperTextFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly defaultAdapter: MDCTextFieldHelperTextAdapter; + + /** + * Sets the content of the helper text field. + */ + setContent(content: string): void; + + /** Makes the helper text visible to the screen reader. */ + showToScreenReader(): void; + + /** + * Sets the validity of the helper text based on the input validity. + */ + setValidity(inputIsValid: boolean): void; +} diff --git a/types/material__textfield/helper-text/index.d.ts b/types/material__textfield/helper-text/index.d.ts new file mode 100644 index 0000000000..6c26000366 --- /dev/null +++ b/types/material__textfield/helper-text/index.d.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; + +import MDCTextFieldHelperTextAdapter from './adapter'; +import MDCTextFieldHelperTextFoundation from './foundation'; + +export {MDCTextFieldHelperTextAdapter, MDCTextFieldHelperTextFoundation}; + +export class MDCTextFieldHelperText extends MDCComponent { + static attachTo(root: Element): MDCTextFieldHelperText; + + readonly foundation: MDCTextFieldHelperTextFoundation; + + getDefaultFoundation(): MDCTextFieldHelperTextFoundation; +} diff --git a/types/material__textfield/index.d.ts b/types/material__textfield/index.d.ts new file mode 100644 index 0000000000..85d4c36420 --- /dev/null +++ b/types/material__textfield/index.d.ts @@ -0,0 +1,61 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * @license + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import MDCComponent from 'material__base/component'; +import { MDCRipple } from 'material__ripple'; + +import { cssClasses, strings } from './constants'; +import { MDCTextFieldAdapter } from './adapter'; +import MDCTextFieldFoundation from './foundation'; +import { MDCTextFieldBottomLine } from './bottom-line/index'; +import { MDCTextFieldHelperText } from './helper-text/index'; + +export {MDCTextFieldAdapter, MDCTextFieldFoundation}; + +export class MDCTextField extends MDCComponent { + static attachTo(root: Element): MDCTextField; + + initialize( + rippleFactory?: (el: Element) => MDCRipple, + bottomLineFactory?: (el: Element) => MDCTextFieldBottomLine + ): void; + + destroy(): void; + + /** + * Initiliazes the Text Field's internal state based on the environment's + * state. + */ + initialSyncWithDom(): void; + + disabled: boolean; + + valid: boolean; + + /** + * Sets the helper text element content. + */ + helperTextContent: string; + + getDefaultFoundation(): MDCTextFieldFoundation; +} diff --git a/types/material__textfield/tsconfig.json b/types/material__textfield/tsconfig.json new file mode 100644 index 0000000000..e9d0a01a13 --- /dev/null +++ b/types/material__textfield/tsconfig.json @@ -0,0 +1,36 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "helper-text/constants.d.ts", + "helper-text/adapter.d.ts", + "helper-text/index.d.ts", + "helper-text/foundation.d.ts", + "bottom-line/constants.d.ts", + "bottom-line/adapter.d.ts", + "bottom-line/index.d.ts", + "bottom-line/foundation.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__textfield/tslint.json b/types/material__textfield/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__textfield/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__toolbar/adapter.d.ts b/types/material__toolbar/adapter.d.ts new file mode 100644 index 0000000000..625b296cf8 --- /dev/null +++ b/types/material__toolbar/adapter.d.ts @@ -0,0 +1,49 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface MDCToolbarAdapter { + hasClass(className: string): boolean; + + addClass(className: string): void; + + removeClass(className: string): void; + + registerScrollHandler(handler: EventListener): void; + + deregisterScrollHandler(handler: EventListener): void; + + registerResizeHandler(handler: EventListener): void; + + deregisterResizeHandler(handler: EventListener): void; + + getViewportWidth(): number; + + getViewportScrollY(): number; + + getOffsetHeight(): number; + + getFirstRowElementOffsetHeight(): number; + + notifyChange(evtData: {flexibleExpansionRatio: number}): void; + + setStyle(property: string, value: string): void; + + setStyleForTitleElement(property: string, value: string): void; + + setStyleForFlexibleRowElement(property: string, value: string): void; + + setStyleForFixedAdjustElement(property: string, value: string): void; +} diff --git a/types/material__toolbar/constants.d.ts b/types/material__toolbar/constants.d.ts new file mode 100644 index 0000000000..8f984ac113 --- /dev/null +++ b/types/material__toolbar/constants.d.ts @@ -0,0 +1,41 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCStrings, MDCNumbers } from 'material__base'; + +export interface cssClasses extends MDCStrings { + FIXED: 'mdc-toolbar--fixed'; + FIXED_LASTROW: 'mdc-toolbar--fixed-lastrow-only'; + FIXED_AT_LAST_ROW: 'mdc-toolbar--fixed-at-last-row'; + TOOLBAR_ROW_FLEXIBLE: 'mdc-toolbar--flexible'; + FLEXIBLE_DEFAULT_BEHAVIOR: 'mdc-toolbar--flexible-default-behavior'; + FLEXIBLE_MAX: 'mdc-toolbar--flexible-space-maximized'; + FLEXIBLE_MIN: 'mdc-toolbar--flexible-space-minimized'; +} + +export interface strings extends MDCStrings { + TITLE_SELECTOR: '.mdc-toolbar__title'; + FIRST_ROW_SELECTOR: '.mdc-toolbar__row:first-child'; + CHANGE_EVENT: 'MDCToolbar:change'; +} + +export interface numbers extends MDCNumbers { + MAX_TITLE_SIZE: 2.125; + MIN_TITLE_SIZE: 1.25; + TOOLBAR_ROW_HEIGHT: 64; + TOOLBAR_ROW_MOBILE_HEIGHT: 56; + TOOLBAR_MOBILE_BREAKPOINT: 600; +} diff --git a/types/material__toolbar/foundation.d.ts b/types/material__toolbar/foundation.d.ts new file mode 100644 index 0000000000..883c0b19e0 --- /dev/null +++ b/types/material__toolbar/foundation.d.ts @@ -0,0 +1,30 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import MDCFoundation from 'material__base/foundation'; +import { cssClasses, strings, numbers } from './constants'; +import { MDCToolbarAdapter } from './adapter'; + +export default class MDCToolbarFoundation extends MDCFoundation { + static readonly cssClasses: cssClasses; + + static readonly strings: strings; + + static readonly numbers: numbers; + + static readonly defaultAdapter: MDCToolbarAdapter; + + updateAdjustElementStyles(): void; +} diff --git a/types/material__toolbar/index.d.ts b/types/material__toolbar/index.d.ts new file mode 100644 index 0000000000..1b048c64c9 --- /dev/null +++ b/types/material__toolbar/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for Material Components Web 0.26 +// Project: https://material.io/components/ +// Definitions by: Brent Douglas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { MDCComponent } from 'material__base'; + +import MDCToolbarFoundation from './foundation'; +import { MDCToolbarAdapter } from './adapter'; +import * as util from './util'; + +export {MDCToolbarAdapter, MDCToolbarFoundation, util}; + +export class MDCToolbar extends MDCComponent { + static attachTo(root: HTMLElement): MDCToolbar; + + fixedAdjustElement: HTMLElement; + + getDefaultFoundation(): MDCToolbarFoundation; +} diff --git a/types/material__toolbar/tsconfig.json b/types/material__toolbar/tsconfig.json new file mode 100644 index 0000000000..9f215e4ee0 --- /dev/null +++ b/types/material__toolbar/tsconfig.json @@ -0,0 +1,29 @@ +{ + "files": [ + "constants.d.ts", + "adapter.d.ts", + "util.d.ts", + "index.d.ts", + "foundation.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/types/material__toolbar/tslint.json b/types/material__toolbar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/material__toolbar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/material__toolbar/util.d.ts b/types/material__toolbar/util.d.ts new file mode 100644 index 0000000000..37506958e7 --- /dev/null +++ b/types/material__toolbar/util.d.ts @@ -0,0 +1,18 @@ +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Determine whether the current browser supports passive event listeners, and if so, use them. +export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean; diff --git a/types/materialize-css/tsconfig.json b/types/materialize-css/tsconfig.json index 316e2f8361..e018875d4a 100644 --- a/types/materialize-css/tsconfig.json +++ b/types/materialize-css/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -23,4 +24,4 @@ "test/materialize-css-module.test.ts", "test/materialize-css-jquery.test.ts" ] -} +} \ No newline at end of file diff --git a/types/materialize-css/v0/index.d.ts b/types/materialize-css/v0/index.d.ts index a457c3ad1a..87629ed699 100644 --- a/types/materialize-css/v0/index.d.ts +++ b/types/materialize-css/v0/index.d.ts @@ -5,6 +5,7 @@ // Sukhdeep Singh // Jean-Francois Cere // Sebastien Cote +// Liad Idan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -475,11 +476,15 @@ declare namespace Materialize { } /** - * Declare Pickadate namespace again in order to add more Materialize specific properties to TimeOptions interface + * Declare Pickadate namespace again in order to add more Materialize specific properties to TimeOptions and DateOptions interfaces * * @see http://www.typescriptlang.org/docs/handbook/declaration-merging.html */ declare namespace Pickadate { + interface DateOptions { + weekdaysLetter?: string[]; + } + interface TimeOptions { /** * Set default time such as : 'now', '1:30AM', '16:30'. diff --git a/types/materialize-css/v0/tsconfig.json b/types/materialize-css/v0/tsconfig.json index 4f000774ea..a627672707 100644 --- a/types/materialize-css/v0/tsconfig.json +++ b/types/materialize-css/v0/tsconfig.json @@ -20,10 +20,11 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "materialize-css-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/math3d/tsconfig.json b/types/math3d/tsconfig.json index 95a0a4148d..9137199265 100644 --- a/types/math3d/tsconfig.json +++ b/types/math3d/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mathjax/tsconfig.json b/types/mathjax/tsconfig.json index dcf27a92fb..2112b99a25 100644 --- a/types/mathjax/tsconfig.json +++ b/types/mathjax/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mathjs/tsconfig.json b/types/mathjs/tsconfig.json index c2aefff773..b303869490 100644 --- a/types/mathjs/tsconfig.json +++ b/types/mathjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/matter-js/tsconfig.json b/types/matter-js/tsconfig.json index bac77b2a64..b2badceadf 100644 --- a/types/matter-js/tsconfig.json +++ b/types/matter-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/maxmind/tsconfig.json b/types/maxmind/tsconfig.json index 0b1011f8f7..6891fe1c23 100644 --- a/types/maxmind/tsconfig.json +++ b/types/maxmind/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mcustomscrollbar/tsconfig.json b/types/mcustomscrollbar/tsconfig.json index b112ee023e..d30025133e 100644 --- a/types/mcustomscrollbar/tsconfig.json +++ b/types/mcustomscrollbar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/md5/tsconfig.json b/types/md5/tsconfig.json index 0f2d4677ab..a8d504f6fd 100644 --- a/types/md5/tsconfig.json +++ b/types/md5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mdns/tsconfig.json b/types/mdns/tsconfig.json index 94e58f4170..66eb855866 100644 --- a/types/mdns/tsconfig.json +++ b/types/mdns/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mdurl/tsconfig.json b/types/mdurl/tsconfig.json index c00c56ef07..38ef207a0a 100644 --- a/types/mdurl/tsconfig.json +++ b/types/mdurl/tsconfig.json @@ -14,10 +14,11 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ "index.d.ts", "mdurl-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/media-typer/tsconfig.json b/types/media-typer/tsconfig.json index fe5268288d..4a1fc1c9a7 100644 --- a/types/media-typer/tsconfig.json +++ b/types/media-typer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/medium-editor/tsconfig.json b/types/medium-editor/tsconfig.json index 10748accf4..405b91f5c7 100644 --- a/types/medium-editor/tsconfig.json +++ b/types/medium-editor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mem/tsconfig.json b/types/mem/tsconfig.json index 3545985694..b43f6271a3 100644 --- a/types/mem/tsconfig.json +++ b/types/mem/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/memcached/index.d.ts b/types/memcached/index.d.ts index fffbb57c82..8e330fa88d 100644 --- a/types/memcached/index.d.ts +++ b/types/memcached/index.d.ts @@ -280,5 +280,9 @@ declare namespace Memcached { * 5000, the idle timeout for the connections. */ idle ?: number; + /** + * '', sentinel to prepend to all memcache keys for namespacing the entries. + */ + namespace ?: string; } } diff --git a/types/memcached/tsconfig.json b/types/memcached/tsconfig.json index 720907bb10..daeddba4b9 100644 --- a/types/memcached/tsconfig.json +++ b/types/memcached/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/memoizee/tsconfig.json b/types/memoizee/tsconfig.json index b8aa9634f1..9e24c851b1 100644 --- a/types/memoizee/tsconfig.json +++ b/types/memoizee/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/memory-cache/tsconfig.json b/types/memory-cache/tsconfig.json index 1d0ac845ac..12a7e2cd2f 100644 --- a/types/memory-cache/tsconfig.json +++ b/types/memory-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/memory-fs/tsconfig.json b/types/memory-fs/tsconfig.json index 13eb7da317..b2cc01072d 100644 --- a/types/memory-fs/tsconfig.json +++ b/types/memory-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/memwatch-next/tsconfig.json b/types/memwatch-next/tsconfig.json index 4541aaa1cf..36ae49fd1d 100644 --- a/types/memwatch-next/tsconfig.json +++ b/types/memwatch-next/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/menubar/menubar-tests.ts b/types/menubar/menubar-tests.ts index 7fd1a9dbe4..9501574164 100644 --- a/types/menubar/menubar-tests.ts +++ b/types/menubar/menubar-tests.ts @@ -1,4 +1,4 @@ -import * as menubar from "menubar"; +import menubar = require("menubar"); var mb1 = menubar(); diff --git a/types/menubar/tsconfig.json b/types/menubar/tsconfig.json index d9d6d843b4..2e3879f42f 100644 --- a/types/menubar/tsconfig.json +++ b/types/menubar/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meow/index.d.ts b/types/meow/index.d.ts index 2585d421ae..20e40c63f7 100644 --- a/types/meow/index.d.ts +++ b/types/meow/index.d.ts @@ -1,11 +1,13 @@ -// Type definitions for meow 3.6 +// Type definitions for meow 4.x // Project: https://github.com/sindresorhus/meow -// Definitions by: KnisterPeter +// Definitions by: KnisterPeter , Lindsey Smith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -import * as minimist from 'minimist'; +import * as buildOptions from "minimist-options"; -declare function meow(options: string | string[] | meow.Options, minimistOptions?: minimist.Opts): meow.Result; +declare function meow(helpMessage: string | string[], options: meow.Options): meow.Result; +declare function meow(options: string | string[] | meow.Options): meow.Result; declare namespace meow { interface Options { description?: string | boolean; @@ -14,14 +16,18 @@ declare namespace meow { pkg?: any; argv?: string[]; inferType?: boolean; + flags?: buildOptions.Options; + autoHelp?: boolean; + autoVersion?: boolean; } interface Result { input: string[]; flags: { [name: string]: any }; - pkg: any; + pkg: object; help: string; showHelp(code?: number): void; + showVersion(): void; } } diff --git a/types/meow/meow-tests.ts b/types/meow/meow-tests.ts index 6560b76bef..8915603292 100644 --- a/types/meow/meow-tests.ts +++ b/types/meow/meow-tests.ts @@ -1,19 +1,39 @@ import meow = require('meow'); -import Options = meow.Options; -const options: Options = {}; -options.description = true; -options.description = 'string'; -options.help = true; -options.help = 'string'; -options.version = true; -options.version = 'string'; -options.argv = ['string', 'string']; -options.inferType = true; +const cli = meow("Help text", + { + flags: { + unicorn: { + type: 'boolean', + alias: 'u' + }, + fooBar: { + type: 'string', + default: 'foo' + } + } + } +); -meow(options); -meow('Usage text', { - alias: { - opt: 'opt' - } +const cli2 = meow("Help text"); + +const cli3 = meow({ + description: "version string", + help: "help string", + version: "1.0.0", + pkg: {}, + argv: ['foo', 'bar'], + inferType: true, + autoHelp: true, + autoVersion: true, + flags: { + unicorn: { + type: 'boolean', + alias: 'u' + }, + fooBar: { + type: 'string', + default: 'foo' + } + } }); diff --git a/types/meow/tsconfig.json b/types/meow/tsconfig.json index 33dd0b0883..a0ad2daded 100644 --- a/types/meow/tsconfig.json +++ b/types/meow/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/merge-descriptors/tsconfig.json b/types/merge-descriptors/tsconfig.json index 23f7dfbcce..59d838f171 100644 --- a/types/merge-descriptors/tsconfig.json +++ b/types/merge-descriptors/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/merge-stream/tsconfig.json b/types/merge-stream/tsconfig.json index d68bbea99f..f36f9609f1 100644 --- a/types/merge-stream/tsconfig.json +++ b/types/merge-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/merge2/merge2-tests.ts b/types/merge2/merge2-tests.ts index ba11597dfa..c96747973d 100644 --- a/types/merge2/merge2-tests.ts +++ b/types/merge2/merge2-tests.ts @@ -1,5 +1,5 @@ import * as gulp from 'gulp'; -import * as merge2 from 'merge2'; +import merge2 = require('merge2'); gulp.task('app-js', () => merge2( diff --git a/types/merge2/tsconfig.json b/types/merge2/tsconfig.json index e39e70032b..7b84762f1a 100644 --- a/types/merge2/tsconfig.json +++ b/types/merge2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/merkle/tsconfig.json b/types/merkle/tsconfig.json index f52ca0bab3..0c54ad7910 100644 --- a/types/merkle/tsconfig.json +++ b/types/merkle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mersenne-twister/tsconfig.json b/types/mersenne-twister/tsconfig.json index 418c7a0355..4d4863d526 100644 --- a/types/mersenne-twister/tsconfig.json +++ b/types/mersenne-twister/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meshblu/tsconfig.json b/types/meshblu/tsconfig.json index a00e392388..89b1d2672e 100644 --- a/types/meshblu/tsconfig.json +++ b/types/meshblu/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mess/tsconfig.json b/types/mess/tsconfig.json index 8ca702b9a4..813664418e 100644 --- a/types/mess/tsconfig.json +++ b/types/mess/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/messenger/tsconfig.json b/types/messenger/tsconfig.json index 15915e2f35..ba06a057d8 100644 --- a/types/messenger/tsconfig.json +++ b/types/messenger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-accounts-phone/tsconfig.json b/types/meteor-accounts-phone/tsconfig.json index f6945ba442..84dc40357b 100644 --- a/types/meteor-accounts-phone/tsconfig.json +++ b/types/meteor-accounts-phone/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-collection-hooks/tsconfig.json b/types/meteor-collection-hooks/tsconfig.json index 462b5cb2fe..a0a676b908 100644 --- a/types/meteor-collection-hooks/tsconfig.json +++ b/types/meteor-collection-hooks/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-jboulhous-dev/tsconfig.json b/types/meteor-jboulhous-dev/tsconfig.json index 6a0bc28585..d31afd862e 100644 --- a/types/meteor-jboulhous-dev/tsconfig.json +++ b/types/meteor-jboulhous-dev/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-persistent-session/tsconfig.json b/types/meteor-persistent-session/tsconfig.json index 9f9adaeead..683c700a9d 100644 --- a/types/meteor-persistent-session/tsconfig.json +++ b/types/meteor-persistent-session/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-prime8consulting-oauth2/tsconfig.json b/types/meteor-prime8consulting-oauth2/tsconfig.json index 1d71e79d3c..c389ce9cf9 100644 --- a/types/meteor-prime8consulting-oauth2/tsconfig.json +++ b/types/meteor-prime8consulting-oauth2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-publish-composite/tsconfig.json b/types/meteor-publish-composite/tsconfig.json index 81c22f6ce3..0785ede5be 100644 --- a/types/meteor-publish-composite/tsconfig.json +++ b/types/meteor-publish-composite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor-roles/tsconfig.json b/types/meteor-roles/tsconfig.json index 037db6b9f4..51a1ad5bde 100644 --- a/types/meteor-roles/tsconfig.json +++ b/types/meteor-roles/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/meteor/tsconfig.json b/types/meteor/tsconfig.json index 6185ff9c61..52e222c94e 100644 --- a/types/meteor/tsconfig.json +++ b/types/meteor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "accounts.d.ts", @@ -41,4 +42,4 @@ "index.d.ts", "meteor-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/method-override/tsconfig.json b/types/method-override/tsconfig.json index 1487adc964..650db93067 100644 --- a/types/method-override/tsconfig.json +++ b/types/method-override/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/methods/tsconfig.json b/types/methods/tsconfig.json index 1b3353ca82..3a5f1b3b18 100644 --- a/types/methods/tsconfig.json +++ b/types/methods/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/metric-suffix/tsconfig.json b/types/metric-suffix/tsconfig.json index fc4d7b871f..47128d3617 100644 --- a/types/metric-suffix/tsconfig.json +++ b/types/metric-suffix/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mfiles/tsconfig.json b/types/mfiles/tsconfig.json index 295542875a..530a0d5827 100644 --- a/types/mfiles/tsconfig.json +++ b/types/mfiles/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/micro/micro-tests.ts b/types/micro/micro-tests.ts index 010fe012cb..e47645deb9 100644 --- a/types/micro/micro-tests.ts +++ b/types/micro/micro-tests.ts @@ -1,5 +1,5 @@ import micro, { json, RequestHandler, buffer, text, send, createError } from 'micro'; -import * as socketIO from 'socket.io'; +import socketIO = require('socket.io'); // Json sample diff --git a/types/micro/tsconfig.json b/types/micro/tsconfig.json index 7f1e37655b..2d341abe8d 100644 --- a/types/micro/tsconfig.json +++ b/types/micro/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/micromatch/tsconfig.json b/types/micromatch/tsconfig.json index 277346ea71..02774511a8 100644 --- a/types/micromatch/tsconfig.json +++ b/types/micromatch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/micromatch/v2/tsconfig.json b/types/micromatch/v2/tsconfig.json index e011e8c1cc..a0e11a8a22 100644 --- a/types/micromatch/v2/tsconfig.json +++ b/types/micromatch/v2/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/microrouter/tsconfig.json b/types/microrouter/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/microrouter/tsconfig.json +++ b/types/microrouter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/microsoft-ajax/tsconfig.json b/types/microsoft-ajax/tsconfig.json index 3a8d8bcc37..1e27f3d6dd 100644 --- a/types/microsoft-ajax/tsconfig.json +++ b/types/microsoft-ajax/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/microsoft-live-connect/tsconfig.json b/types/microsoft-live-connect/tsconfig.json index 7895e4debe..555540b344 100644 --- a/types/microsoft-live-connect/tsconfig.json +++ b/types/microsoft-live-connect/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/microsoft-sdk-soap/tsconfig.json b/types/microsoft-sdk-soap/tsconfig.json index 3eee7c6b1c..6bc4ac7835 100644 --- a/types/microsoft-sdk-soap/tsconfig.json +++ b/types/microsoft-sdk-soap/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/microsoftteams/tsconfig.json b/types/microsoftteams/tsconfig.json index 95b8785492..6014c8e5d7 100644 --- a/types/microsoftteams/tsconfig.json +++ b/types/microsoftteams/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/microtime/tsconfig.json b/types/microtime/tsconfig.json index c5989f5799..7991d90494 100644 --- a/types/microtime/tsconfig.json +++ b/types/microtime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/milkcocoa/tsconfig.json b/types/milkcocoa/tsconfig.json index def0b291ed..22c7cb7830 100644 --- a/types/milkcocoa/tsconfig.json +++ b/types/milkcocoa/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/milliseconds/tsconfig.json b/types/milliseconds/tsconfig.json index eb756035ba..aa931efbdb 100644 --- a/types/milliseconds/tsconfig.json +++ b/types/milliseconds/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mime-db/tsconfig.json b/types/mime-db/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/mime-db/tsconfig.json +++ b/types/mime-db/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/mime-types/tsconfig.json b/types/mime-types/tsconfig.json index d197e5f93c..f197d1a1a5 100644 --- a/types/mime-types/tsconfig.json +++ b/types/mime-types/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mime/tsconfig.json b/types/mime/tsconfig.json index 8e0eb9488e..45e7b9f82f 100644 --- a/types/mime/tsconfig.json +++ b/types/mime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mimos/tsconfig.json b/types/mimos/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/mimos/tsconfig.json +++ b/types/mimos/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/mina/tsconfig.json b/types/mina/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/mina/tsconfig.json +++ b/types/mina/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/minilog/tsconfig.json b/types/minilog/tsconfig.json index b999744170..eabf1dc6ad 100644 --- a/types/minilog/tsconfig.json +++ b/types/minilog/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/minimatch/tsconfig.json b/types/minimatch/tsconfig.json index 7180fe6a29..c0e55963be 100644 --- a/types/minimatch/tsconfig.json +++ b/types/minimatch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/minimist-options/tsconfig.json b/types/minimist-options/tsconfig.json index b43c584555..54036aa94c 100644 --- a/types/minimist-options/tsconfig.json +++ b/types/minimist-options/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "minimist-options-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/minimist/tsconfig.json b/types/minimist/tsconfig.json index 27be869de4..55bf6c93ab 100644 --- a/types/minimist/tsconfig.json +++ b/types/minimist/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/minipass/tsconfig.json b/types/minipass/tsconfig.json index 9115c6fe85..4d54021296 100644 --- a/types/minipass/tsconfig.json +++ b/types/minipass/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mirrorx/tsconfig.json b/types/mirrorx/tsconfig.json index 561f5cdab4..8adf5ab4b5 100644 --- a/types/mirrorx/tsconfig.json +++ b/types/mirrorx/tsconfig.json @@ -1,5 +1,5 @@ { - "files": [ + "files": [ "index.d.ts", "mirrorx-tests.ts" ], @@ -21,6 +21,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/mithril-global/tsconfig.json b/types/mithril-global/tsconfig.json index f48de2bee8..0a7b5cb267 100644 --- a/types/mithril-global/tsconfig.json +++ b/types/mithril-global/tsconfig.json @@ -11,6 +11,7 @@ "strictFunctionTypes": true, "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/mithril/tsconfig.json b/types/mithril/tsconfig.json index 3164285eb5..e336b24f36 100644 --- a/types/mithril/tsconfig.json +++ b/types/mithril/tsconfig.json @@ -10,6 +10,7 @@ "strictNullChecks": true, "strictFunctionTypes": false, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "noEmit": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/mitm/tsconfig.json b/types/mitm/tsconfig.json index bb19fc1d20..86cb3b52d7 100644 --- a/types/mitm/tsconfig.json +++ b/types/mitm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mixpanel/tsconfig.json b/types/mixpanel/tsconfig.json index f5cbbce2f5..c12c4200d9 100644 --- a/types/mixpanel/tsconfig.json +++ b/types/mixpanel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mixto/tsconfig.json b/types/mixto/tsconfig.json index 8cbc98843f..f780617abc 100644 --- a/types/mixto/tsconfig.json +++ b/types/mixto/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mkdirp/tsconfig.json b/types/mkdirp/tsconfig.json index a5bd09ff68..605500591f 100644 --- a/types/mkdirp/tsconfig.json +++ b/types/mkdirp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mkpath/tsconfig.json b/types/mkpath/tsconfig.json index e114847c25..8fdbb85d17 100644 --- a/types/mkpath/tsconfig.json +++ b/types/mkpath/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mmmagic/tsconfig.json b/types/mmmagic/tsconfig.json index 074e791e6d..775da23960 100644 --- a/types/mmmagic/tsconfig.json +++ b/types/mmmagic/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mobx-apollo/tsconfig.json b/types/mobx-apollo/tsconfig.json index c4c2acace4..969ca52e32 100644 --- a/types/mobx-apollo/tsconfig.json +++ b/types/mobx-apollo/tsconfig.json @@ -1,17 +1,25 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "target": "es5", "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": ["index.d.ts", "mobx-apollo-tests.ts"] -} + "files": [ + "index.d.ts", + "mobx-apollo-tests.ts" + ] +} \ No newline at end of file diff --git a/types/mocha-phantomjs/tsconfig.json b/types/mocha-phantomjs/tsconfig.json index 12d2f5cf28..4ab29d667e 100644 --- a/types/mocha-phantomjs/tsconfig.json +++ b/types/mocha-phantomjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mocha-steps/tsconfig.json b/types/mocha-steps/tsconfig.json index 0a75385b3a..8447cc6306 100644 --- a/types/mocha-steps/tsconfig.json +++ b/types/mocha-steps/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mocha-steps-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mocha/index.d.ts b/types/mocha/index.d.ts index df0a1c66dd..06ef96c618 100644 --- a/types/mocha/index.d.ts +++ b/types/mocha/index.d.ts @@ -86,9 +86,9 @@ declare class Mocha { bail(value?: boolean): Mocha; addFile(file: string): Mocha; /** Sets reporter by name, defaults to "spec". */ - reporter(name: string): Mocha; + reporter(name: string, reporterOptions?: any): Mocha; /** Sets reporter constructor, defaults to mocha.reporters.Spec. */ - reporter(reporter: ReporterConstructor): Mocha; + reporter(reporter: ReporterConstructor, reporterOptions?: any): Mocha; ui(value: string): Mocha; grep(value: string): Mocha; grep(value: RegExp): Mocha; @@ -147,6 +147,7 @@ declare namespace Mocha { sync: boolean; timedOut: boolean; timeout(n: number | string): this; + duration?: number; } /** Partial interface for Mocha's `Suite` class. */ @@ -170,9 +171,30 @@ declare namespace Mocha { currentTest: ITest; } + interface IStats { + suites: number; + tests: number; + passes: number; + pending: number; + failures: number; + start?: Date; + end?: Date; + duration?: Date; + } /** Partial interface for Mocha's `Runner` class. */ - interface IRunner { } + interface IRunner { + stats?: IStats; + started: boolean; + suite: ISuite; + total: number; + failures: number; + grep: (re: string, invert: boolean) => this; + grepTotal: (suite: ISuite) => number; + globals: (arr: ReadonlyArray) => this | string[]; + abort: () => this; + run: (fn?: (failures: number) => void) => this; + } interface IContextDefinition { (description: string, callback: (this: ISuiteCallbackContext) => void): ISuite; @@ -191,13 +213,7 @@ declare namespace Mocha { export module reporters { export class Base { - stats: { - suites: number; - tests: number; - passes: number; - pending: number; - failures: number; - }; + stats: IStats; constructor(runner: IRunner); } diff --git a/types/mocha/mocha-tests.ts b/types/mocha/mocha-tests.ts index 2549c3cb68..0146c04b13 100644 --- a/types/mocha/mocha-tests.ts +++ b/types/mocha/mocha-tests.ts @@ -1,5 +1,8 @@ let boolean: boolean; let string: string; +let number: number; +let stringOrUndefined: string | undefined; +let dateOrUndefined: Date | undefined; function test_describe() { describe('something', () => { }); @@ -112,7 +115,7 @@ function test_setup() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); setup(function () { @@ -123,7 +126,7 @@ function test_setup() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); setup(function (done) { @@ -134,7 +137,7 @@ function test_setup() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -158,7 +161,7 @@ function test_teardown() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); teardown(function () { @@ -169,7 +172,7 @@ function test_teardown() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); teardown(function (done) { @@ -180,7 +183,7 @@ function test_teardown() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -192,7 +195,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach(function () { @@ -203,7 +206,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach(function (done) { @@ -214,7 +217,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach("my description", function () { @@ -224,7 +227,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); beforeEach("my description", function (done) { @@ -235,7 +238,7 @@ function test_beforeEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -255,7 +258,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach(function () { @@ -266,7 +269,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach(function (done) { @@ -277,7 +280,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach("my description", function () { @@ -287,7 +290,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); afterEach("my description", function (done) { @@ -298,7 +301,7 @@ function test_afterEach() { boolean = this.currentTest.timedOut; string = this.currentTest.title; string = this.currentTest.fullTitle(); - string = this.currentTest.state; + stringOrUndefined = this.currentTest.state; }); } @@ -455,3 +458,44 @@ function test_run_withOnComplete() { function test_throwError() { mocha.throwError(new Error("I'm an error!")); } + +function test_mochaRunner_properties(runner: MochaDef.IRunner, suite: MochaDef.ISuite) { + runner = runner.abort(); + + if (runner.stats !== undefined) { + number = runner.stats.failures; + number = runner.stats.passes; + number = runner.stats.pending; + number = runner.stats.suites; + number = runner.stats.tests; + + dateOrUndefined = runner.stats.start; + dateOrUndefined = runner.stats.end; + dateOrUndefined = runner.stats.duration; + } + + let s: MochaDef.ISuite = runner.suite; + boolean = runner.started; + number = runner.total; + number = runner.failures; + + runner = runner.grep("regex", false); + number = runner.grepTotal(suite); + + let globals: string[] | MochaDef.IRunner= runner.globals(["hello", "world"]); + + runner = runner.run(); + runner = runner.run((f: number) => {}); +} + +function test_base_reporter_properties(reporter: MochaDef.reporters.Base) { + number = reporter.stats.failures; + number = reporter.stats.passes; + number = reporter.stats.pending; + number = reporter.stats.suites; + number = reporter.stats.tests; + + dateOrUndefined = reporter.stats.start; + dateOrUndefined = reporter.stats.end; + dateOrUndefined = reporter.stats.duration; +} \ No newline at end of file diff --git a/types/mocha/tsconfig.json b/types/mocha/tsconfig.json index 43be806414..469634a2f1 100644 --- a/types/mocha/tsconfig.json +++ b/types/mocha/tsconfig.json @@ -6,8 +6,8 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, + "noImplicitThis": true, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mochaccino/tsconfig.json b/types/mochaccino/tsconfig.json index 166b3f4203..a309a1969a 100644 --- a/types/mochaccino/tsconfig.json +++ b/types/mochaccino/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mochaccino-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mock-aws-s3/tsconfig.json b/types/mock-aws-s3/tsconfig.json index 9b5aeeacaa..352631ebac 100644 --- a/types/mock-aws-s3/tsconfig.json +++ b/types/mock-aws-s3/tsconfig.json @@ -1,16 +1,24 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": ["index.d.ts", "mock-aws-s3-tests.ts"] -} + "files": [ + "index.d.ts", + "mock-aws-s3-tests.ts" + ] +} \ No newline at end of file diff --git a/types/mock-fs/tsconfig.json b/types/mock-fs/tsconfig.json index b460b4d1d1..03b1ec9bf9 100644 --- a/types/mock-fs/tsconfig.json +++ b/types/mock-fs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mock-knex/mock-knex-tests.ts b/types/mock-knex/mock-knex-tests.ts index ec4ef0024e..f9fa69aea1 100644 --- a/types/mock-knex/mock-knex-tests.ts +++ b/types/mock-knex/mock-knex-tests.ts @@ -1,4 +1,4 @@ -import * as knex from "knex"; +import knex = require("knex"); import * as mockDb from "mock-knex"; const db = knex({ diff --git a/types/mock-knex/tsconfig.json b/types/mock-knex/tsconfig.json index 427ad9f843..c06624f84a 100644 --- a/types/mock-knex/tsconfig.json +++ b/types/mock-knex/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mock-knex-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mock-raf/tsconfig.json b/types/mock-raf/tsconfig.json index dfb1b63e78..2430cbd74e 100644 --- a/types/mock-raf/tsconfig.json +++ b/types/mock-raf/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mock-require/tsconfig.json b/types/mock-require/tsconfig.json index 1f6be404c6..3cd28faba0 100644 --- a/types/mock-require/tsconfig.json +++ b/types/mock-require/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mockdate/tsconfig.json b/types/mockdate/tsconfig.json index 062a1f1110..a5d4ba452b 100644 --- a/types/mockdate/tsconfig.json +++ b/types/mockdate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mockery/tsconfig.json b/types/mockery/tsconfig.json index a8eef69452..0b91197c4d 100644 --- a/types/mockery/tsconfig.json +++ b/types/mockery/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mockjs/tsconfig.json b/types/mockjs/tsconfig.json index 631ad48210..6a407840b6 100644 --- a/types/mockjs/tsconfig.json +++ b/types/mockjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/modernizr/tsconfig.json b/types/modernizr/tsconfig.json index 291b4008d2..5a57efda40 100644 --- a/types/modernizr/tsconfig.json +++ b/types/modernizr/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/modesl/tsconfig.json b/types/modesl/tsconfig.json index 3fc91a7f71..9454dd9a5a 100644 --- a/types/modesl/tsconfig.json +++ b/types/modesl/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moji/tsconfig.json b/types/moji/tsconfig.json index a6b2e51f26..f529d10796 100644 --- a/types/moji/tsconfig.json +++ b/types/moji/tsconfig.json @@ -1,24 +1,25 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ - "index.d.ts", - "moji-tests.ts" + "index.d.ts", + "moji-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/moment-business-time/tsconfig.json b/types/moment-business-time/tsconfig.json index c1212caa2f..06211c3c46 100644 --- a/types/moment-business-time/tsconfig.json +++ b/types/moment-business-time/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "moment-business-time-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/moment-business/tsconfig.json b/types/moment-business/tsconfig.json index b7307b4121..2f206c8966 100644 --- a/types/moment-business/tsconfig.json +++ b/types/moment-business/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moment-duration-format/index.d.ts b/types/moment-duration-format/index.d.ts index 402db8a75b..4506311ab6 100644 --- a/types/moment-duration-format/index.d.ts +++ b/types/moment-duration-format/index.d.ts @@ -1,7 +1,11 @@ -// Type definitions for moment-duration-format 1.3 +// Type definitions for moment-duration-format 2.2 // Project: https://github.com/jsmreese/moment-duration-format -// Definitions by: Swint De Coninck , Niklas Walter , Leonard Thieu +// Definitions by: Swint De Coninck +// Niklas Walter +// Leonard Thieu +// Lukasz Bendykowski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as moment from "moment"; @@ -22,33 +26,66 @@ declare module "moment" { (settings?: DurationFormatSettings): string; } + type UnitOfTrimV1 = 'left' | 'right'; + type UnitOfTrim = ( + 'large' | 'small' | 'both' | + 'mid' | 'all' | 'final' + ); + interface DurationFormatSettings { - escape?: RegExp; - years?: RegExp; - months?: RegExp; - weeks?: RegExp; - days?: RegExp; - hours?: RegExp; - minutes?: RegExp; - seconds?: RegExp; - milliseconds?: RegExp; - general?: RegExp; + trim?: false | UnitOfTrimV1 | UnitOfTrim | string | Array; + largest?: number; + trunc?: true; + stopTrim?: string; - types?: string; + minValue?: number; + maxValue?: number; - // "left" - template tokens are trimmed from the left until the first moment token that has a value >= 1 - // "right" - template tokens are trimmed from the right until the first moment token that has a value >= 1 - // (the final moment token is not trimmed, regardless of value) - // `false` - template tokens are not trimmed - trim?: 'left' | 'right' | false; - - // number of decimal digits to include after (to the right of) the decimal point (positive integer) - // or the number of digits to truncate to 0 before (to the left of) the decimal point (negative integer) + useGrouping?: boolean; precision?: number; + decimalSeparator?: string; + groupingSeparator?: string; + grouping?: number[]; - // force first moment token with a value to render at full length even when template is trimmed and first moment token has length of 1 - forceLength?: boolean | null; + useSignificantDigits?: true; + + forceLength?: boolean; template?: string | TemplateFunction; + + userLocale?: string; + usePlural?: boolean; + useLeftUnits?: boolean; + useToLocaleString?: boolean; + } + + type DurationLabelType = "long" | "standard" | "short"; + type DurationTemplate = "HMS" | "HM" | "MS"; + type DurationToken = ( + "S" | "SS" | "SSS" | + "s" | "ss" | "sss" | + "m" | "mm" | "mmm" | + "h" | "hh" | "hhh" | + "d" | "dd" | "ddd" | + "w" | "ww" | "www" | + "M" | "MM" | "MMM" | + "y" | "yy" | "yyy" + ); + + type DurationLabelDef = {[duration in DurationToken]: string}; + type DurationTimeDef = {[template in DurationTemplate]: string}; + + interface DurationLabelTypeDef { + type: DurationLabelType; + string: string; + } + + interface LocaleSpecification { + durationLabelsLong: DurationLabelDef; + durationLabelsStandard: DurationLabelDef; + durationLabelsShort: DurationLabelDef; + durationTimeTemplates: DurationTimeDef; + durationLabelTypes: DurationLabelTypeDef[]; + durationPluralKey: (token: string, integerValue: number, decimalValue: number) => string; } type TemplateFunction = ((this: DurationFormatSettings) => string); diff --git a/types/moment-duration-format/moment-duration-format-tests.ts b/types/moment-duration-format/moment-duration-format-tests.ts index 52f313b9b4..135131ce71 100644 --- a/types/moment-duration-format/moment-duration-format-tests.ts +++ b/types/moment-duration-format/moment-duration-format-tests.ts @@ -43,30 +43,333 @@ moment.duration(123, "seconds").format("hh:mm:ss"); moment.duration(123, "seconds").format("h:mm:ss", { forceLength: true }); // "02:03" -moment.duration.fn.format.defaults.escape = /\((.+?)\)/; -moment.duration(123, "seconds").format("m (minutes)", 2); -// "2.04 minutes" +moment.duration(123, "minutes").format("d[d] h:mm:ss"); +// "2:03:00" -moment.duration.fn.format.defaults.years = /[Aa]+/; -moment.duration(123, "weeks").format("a [años]", 2); -// "2.35 años" +moment.duration(123, "minutes").format("s [seconds], m [minutes], h [hours], d [days]"); +// "0 seconds, 3 minutes, 2 hours" -moment.duration.fn.format.defaults.months = /m+/; -moment.duration(123, "weeks").format("m M", 2); -// "28.36 M" +moment.duration(123, "minutes").format("d[d] h:mm:ss", { + trim: false +}); +// "0d 2:03:00" -moment.duration.fn.format.defaults.weeks = /w+/; -moment.duration(123, "days").format("w W", 2); -// "17.57 W" +moment.duration(123, "minutes").format("d[d] h:mm:ss"); +// "2:03:00" -moment.duration.fn.format.defaults.days = /d+/; -moment.duration(123, "hours").format("d D", 2); -// "5.12 D" +moment.duration(123, "minutes").format("d[d] h:mm:ss", { + trim: "large" +}); +// "2:03:00" -moment.duration.fn.format.defaults.hours = /h+/; -moment.duration(123, "minutes").format("h H", 2); -// "2.04 H" +moment.duration(0, "minutes").format("d[d] h:mm:ss", { + trim: "large" +}); +// "0" -moment.duration.fn.format.defaults.minutes = /n+/; -moment.duration(123, "seconds").format("n:ss"); +moment.duration(123, "minutes").format("d[d] h:mm:ss", { + trim: "small" +}); +// "0d 2:03" + +moment.duration(0, "minutes").format("d[d] h:mm:ss", { + trim: "small" +}); +// "0d" + +moment.duration(123, "minutes").format("d[d] h[h] m[m] s[s]", { + trim: "both" +}); +// "2h 3m" + +moment.duration(0, "minutes").format("d[d] h[h] m[m] s[s]", { + trim: "both" +}); +// "0s" + +moment.duration(1441, "minutes").format("w[w] d[d] h[h] m[m] s[s]", { + trim: "mid" +}); +// "0w 1d 1m 0s" + +moment.duration(1441, "minutes").format("w[w] d[d] h[h] m[m] s[s]", { + trim: "large mid" +}); +// "1d 1m 0s" + +moment.duration(1441, "minutes").format("w[w] d[d] h[h] m[m] s[s]", { + trim: "small mid" +}); +// "0w 1d 1m" + +moment.duration(1441, "minutes").format("w[w] d[d] h[h] m[m] s[s]", { + trim: "both mid" +}); +// "1d 1m" + +moment.duration(0, "minutes").format("w[w] d[d] h[h] m[m] s[s]", { + trim: "both mid" +}); +// "0s" + +moment.duration(0, "minutes").format("d[d] h:mm:ss", { + trim: "large final" +}); +// "" + +moment.duration(0, "minutes").format("d[d] h:mm:ss", { + trim: "small final" +}); +// "" + +moment.duration(0, "minutes").format("d[d] h[h] m[m] s[s]", { + trim: "both final" +}); +// "" + +moment.duration(0, "minutes").format("d[d] h[h] m[m] s[s]", { + trim: "all" +}); +// "" + +moment.duration(7322, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + largest: 2 +}); +// "2 hours, 2 minutes" + +moment.duration(1216922, "seconds").format("y [years], w [weeks], d [days], h [hours], m [minutes], s [seconds]", { + largest: 2 +}); +// "2 weeks, 2 hours" + +moment.duration(23, "minutes").format("d[d] h:mm:ss", { + stopTrim: "h" +}); +// "0:23:00" + +moment.duration(23, "minutes").format("d[d] *h:mm:ss"); +// "0:23:00" + +moment.duration(2, "hours").format("y [years], d [days], h [hours], m [minutes], s [seconds]", { + trim: "both", + stopTrim: "d m" +}); +// "0 days, 2 hours, 0 minutes" + +moment.duration(2, "hours").format("y [years], *d [days], h [hours], *m [minutes], s [seconds]", { + trim: "both" +}); +// "0 days, 2 hours, 0 minutes" + +moment.duration(2, "hours").format("y [years], d [days], h [hours], m [minutes], s [seconds]", { + trim: "both", + stopTrim: "d m", + largest: 2 +}); +// "2 hours" + +moment.duration(179, "seconds").format("m [minutes]"); +// "3 minutes" + +moment.duration(3780, "seconds").format("h [hours]", 1); +// "1.1 hours" + +moment.duration(179, "seconds").format("m [minutes]", { + trunc: true +}); +// "2 minutes" + +moment.duration(3780, "seconds").format("h [hours]", 1, { + trunc: true +}); +// "1.0 hours" + +moment.duration(59, "seconds").format("d [days], h [hours], m [minutes]", { + trunc: true, + trim: "both" +}); +// "0 minutes" + +moment.duration(59, "seconds").format("d [days], h [hours], m [minutes]", { + trunc: true, + trim: "all" +}); +// "" + +moment.duration(59, "seconds").format("d [days], h [hours], m [minutes]", { + trunc: true, + largest: 1 +}); +// "" + +moment.duration(59, "seconds").format("h [hours], m [minutes]", { + minValue: 1 +}); +// "< 1 minute" + +moment.duration(59, "seconds").format("h [hours], m [minutes]", { + minValue: 1, + trim: "both" +}); +// "< 1 minute" + +moment.duration(7229, "seconds").format("h [hours], m [minutes]", { + minValue: 1, + trim: "both" +}); +// "2 hours" + +moment.duration(59, "seconds").format("h [hours], m [minutes]", { + minValue: 1, + trunc: true, + trim: "all" +}); +// "" + +moment.duration(-59, "seconds").format("h [hours], m [minutes]", { + minValue: 1 +}); +// "> -1 minute" + +moment.duration(59, "seconds").format("h [hours], m [minutes]", { + minValue: 1, + trim: false, + largest: 2 +}); +// "< 1 minute" + +moment.duration(15, "days").format("w [weeks]", { + maxValue: 2 +}); +// "> 2 weeks" + +moment.duration(-15, "days").format("w [weeks]]", { + maxValue: 2 +}); +// "< -2 weeks" + +moment.duration(15, "days").format("w [weeks], d [days]", { + maxValue: 2, + trim: false, + largest: 2 +}); +// "> 2 weeks" + +moment.duration(123, "seconds").format("h:mm:ss"); // "2:03" + +moment.duration(123, "seconds").format("hh:mm:ss"); +// "02:03" + +moment.duration(123, "seconds").format("h:mm:ss", { + forceLength: true +}); +// "02:03" + +moment.duration(99999, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + useSignificantDigits: true, + precision: 3 +}); +// "1 day, 3 hours, 50 minutes" + +moment.duration(99999, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + useSignificantDigits: true, + precision: 3, + trunc: true +}); +// "1 day, 3 hours, 40 minutes" + +moment.duration(99999, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + useSignificantDigits: true, + precision: 5 +}); +// "1 day, 3 hours, 46 minutes, 40 seconds" + +moment.duration(99999, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + useSignificantDigits: true, + trunc: true, + precision: 5 +}); +// "1 day, 3 hours, 46 minutes, 30 seconds" + +moment.duration(99999, "seconds").format("d [days], h [hours], m [minutes], s [seconds]", { + useSignificantDigits: true, + precision: 6 +}); +// "1 day, 3 hours, 46 minutes, 39 seconds" + +moment.duration(1234567, "seconds").format("m [minutes]", 3); +// "20,576.117 minutes" + +moment.duration(1234567, "seconds").format("m [minutes]", 3, { + userLocale: "de-DE" +}); +// "20.576,117 minutes" + +moment.duration(2, "minutes").format("m _"); +// "2 mins" + +moment.duration(2, "minutes").format("m __"); +// "2 minutes" + +moment.duration(3661, "seconds").format("_HMS_"); +// "1:01:01" + +moment.duration(3661, "seconds").format("_HM_"); +// "1:01" + +moment.duration(61, "seconds").format("_MS_"); +// "1:01" + +moment.duration(1, "minutes").format("m [minutes]"); +// "1 minute" + +moment.duration(1, "minutes").format("m [mins]"); +// "1 min" + +moment.duration(2, "minutes").format("m [minute]"); +// "2 minutes" + +moment.duration(2, "minutes").format("m [min]"); +// "2 mins" + +moment.duration(1, "minutes").format("m [minutes]", { + usePlural: false +}); +// "1 minutes" + +moment.duration(1, "minutes").format("m [mins]", { + usePlural: false +}); +// "1 mins" + +moment.duration(2, "minutes").format("m [minute]", { + usePlural: false +}); +// "2 minute" + +moment.duration(2, "minutes").format("m [min]", { + usePlural: false +}); +// "2 min" + +moment.duration(1, "minutes").format("m [minutes]", 2); +// "1.00 minutes" + +moment.duration(7322, "seconds").format("_ h, _ m, _ s", { + useLeftUnits: true +}); +// "hrs 2, mins 2, secs 2" + +moment.duration(1234, "seconds").format("s [seconds]"); +// "1,234 seconds" + +moment.duration(1234, "seconds").format("s [seconds]", { + useGrouping: false +}); +// "1234 seconds" + +moment.duration(1234567, "seconds").format("m [minutes]", 3, { + userLocale: "de-DE" +}); +// "20.576,117 minutes" diff --git a/types/moment-duration-format/tsconfig.json b/types/moment-duration-format/tsconfig.json index 997b0f907e..49adb2a08e 100644 --- a/types/moment-duration-format/tsconfig.json +++ b/types/moment-duration-format/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moment-holiday/tsconfig.json b/types/moment-holiday/tsconfig.json index d03f37e12c..886bd77564 100644 --- a/types/moment-holiday/tsconfig.json +++ b/types/moment-holiday/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "moment-holiday-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/moment-jalaali/tsconfig.json b/types/moment-jalaali/tsconfig.json index 6c52d43cbf..4d2026fec3 100644 --- a/types/moment-jalaali/tsconfig.json +++ b/types/moment-jalaali/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moment-range/tsconfig.json b/types/moment-range/tsconfig.json index 1da3b569e0..aa339a6027 100644 --- a/types/moment-range/tsconfig.json +++ b/types/moment-range/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moment-round/tsconfig.json b/types/moment-round/tsconfig.json index f6761bd247..13758cbc39 100644 --- a/types/moment-round/tsconfig.json +++ b/types/moment-round/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moment-strftime2/tsconfig.json b/types/moment-strftime2/tsconfig.json index cd5862e99f..c4c30990bd 100644 --- a/types/moment-strftime2/tsconfig.json +++ b/types/moment-strftime2/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "moment-strftime2-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/moment-timezone/index.d.ts b/types/moment-timezone/index.d.ts index c3927415c6..da5e42bc2d 100644 --- a/types/moment-timezone/index.d.ts +++ b/types/moment-timezone/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Michel Salib , Alan Brazil Lins // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import * as moment from 'moment'; +import moment = require('moment'); // require("moment-timezone") === require("moment") export = moment; diff --git a/types/moment-timezone/tsconfig.json b/types/moment-timezone/tsconfig.json index 62cbfb4214..16a786e080 100644 --- a/types/moment-timezone/tsconfig.json +++ b/types/moment-timezone/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index 4364c0efe2..dd4f44f38a 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 { @@ -1453,3 +1455,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 +} diff --git a/types/mongodb/tsconfig.json b/types/mongodb/tsconfig.json index 8ed16ed7e6..b5c0a3c5de 100644 --- a/types/mongodb/tsconfig.json +++ b/types/mongodb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongodb/v1/tsconfig.json b/types/mongodb/v1/tsconfig.json index c20dfaa9c6..e082a3d12e 100644 --- a/types/mongodb/v1/tsconfig.json +++ b/types/mongodb/v1/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongodb/v2/tsconfig.json b/types/mongodb/v2/tsconfig.json index 7bfc92fc32..34cee3be18 100644 --- a/types/mongodb/v2/tsconfig.json +++ b/types/mongodb/v2/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-auto-increment/tsconfig.json b/types/mongoose-auto-increment/tsconfig.json index faef447b4d..451044e5e6 100644 --- a/types/mongoose-auto-increment/tsconfig.json +++ b/types/mongoose-auto-increment/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-deep-populate/tsconfig.json b/types/mongoose-deep-populate/tsconfig.json index eb2e278299..6f3c2c0a9a 100644 --- a/types/mongoose-deep-populate/tsconfig.json +++ b/types/mongoose-deep-populate/tsconfig.json @@ -12,9 +12,15 @@ "typeRoots": [ "../" ], + "paths": { + "mongoose": [ + "mongoose/v4" + ] + }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-geojson-schema/tsconfig.json b/types/mongoose-geojson-schema/tsconfig.json index 9d3afc8952..4a9b4ef787 100644 --- a/types/mongoose-geojson-schema/tsconfig.json +++ b/types/mongoose-geojson-schema/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mongoose-geojson-schema-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mongoose-mock/tsconfig.json b/types/mongoose-mock/tsconfig.json index b3cacf1757..8555533c01 100644 --- a/types/mongoose-mock/tsconfig.json +++ b/types/mongoose-mock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-paginate/mongoose-paginate-tests.ts b/types/mongoose-paginate/mongoose-paginate-tests.ts index d541c44da8..320077bc3a 100644 --- a/types/mongoose-paginate/mongoose-paginate-tests.ts +++ b/types/mongoose-paginate/mongoose-paginate-tests.ts @@ -1,5 +1,3 @@ -/// - /** * Created by Linus Brolin . */ @@ -12,7 +10,7 @@ import { PaginateResult, Document } from 'mongoose'; -import * as mongoosePaginate from 'mongoose-paginate'; +import mongoosePaginate = require('mongoose-paginate'); import { Router, Request, Response } from 'express'; diff --git a/types/mongoose-paginate/tsconfig.json b/types/mongoose-paginate/tsconfig.json index 3194368f11..c7d7fccdcc 100644 --- a/types/mongoose-paginate/tsconfig.json +++ b/types/mongoose-paginate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-promise/tsconfig.json b/types/mongoose-promise/tsconfig.json index 68c68b35a1..1116f1ca84 100644 --- a/types/mongoose-promise/tsconfig.json +++ b/types/mongoose-promise/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-seeder/tsconfig.json b/types/mongoose-seeder/tsconfig.json index d5d44b75cc..7b4ef1eaa1 100644 --- a/types/mongoose-seeder/tsconfig.json +++ b/types/mongoose-seeder/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-sequence/mongoose-sequence-tests.ts b/types/mongoose-sequence/mongoose-sequence-tests.ts index b4173e0002..85c46633e0 100644 --- a/types/mongoose-sequence/mongoose-sequence-tests.ts +++ b/types/mongoose-sequence/mongoose-sequence-tests.ts @@ -1,12 +1,10 @@ -/// - /** * Based on the examples on: https://github.com/ramiel/mongoose-sequence * Created by Linus Brolin . */ import { SequenceDocument, SequenceOptions, SequenceSchema, Document, Schema, Model, model } from 'mongoose'; -import * as mongooseSequence from 'mongoose-sequence'; +import mongooseSequence = require('mongoose-sequence'); //#region Test Models interface User extends SequenceDocument { diff --git a/types/mongoose-sequence/tsconfig.json b/types/mongoose-sequence/tsconfig.json index 79efa97e34..e9e23837ed 100644 --- a/types/mongoose-sequence/tsconfig.json +++ b/types/mongoose-sequence/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-simple-random/mongoose-simple-random-tests.ts b/types/mongoose-simple-random/mongoose-simple-random-tests.ts index f5b26dbebb..1ed3051652 100644 --- a/types/mongoose-simple-random/mongoose-simple-random-tests.ts +++ b/types/mongoose-simple-random/mongoose-simple-random-tests.ts @@ -1,5 +1,5 @@ import * as mongoose from 'mongoose'; -import * as mongoose_simple_random from "mongoose-simple-random"; +import mongoose_simple_random = require("mongoose-simple-random"); // test compatibility with other libraries - from @types/mongoose import * as _ from 'lodash'; diff --git a/types/mongoose-simple-random/tsconfig.json b/types/mongoose-simple-random/tsconfig.json index 3b879fd8f0..7c2f108e9e 100644 --- a/types/mongoose-simple-random/tsconfig.json +++ b/types/mongoose-simple-random/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts b/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts index 59ada92a3c..ded6f76ae4 100644 --- a/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts +++ b/types/mongoose-unique-validator/mongoose-unique-validator-tests.ts @@ -1,5 +1,5 @@ import { Schema } from "mongoose"; -import * as uniqueValidator from "mongoose-unique-validator"; +import uniqueValidator = require("mongoose-unique-validator"); const schema = new Schema({ test: { type: String } diff --git a/types/mongoose-unique-validator/tsconfig.json b/types/mongoose-unique-validator/tsconfig.json index 02d461889d..8ab3ec79c9 100644 --- a/types/mongoose-unique-validator/tsconfig.json +++ b/types/mongoose-unique-validator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index ee703de783..3cf4e4ca2a 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Mongoose 4.7.1 +// Type definitions for Mongoose 5.0.1 // Project: http://mongoosejs.com/ -// Definitions by: simonxca , horiuchi , sindrenm , lukasz-zak +// Definitions by: simonxca , horiuchi , sindrenm , lukasz-zak , Alorel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -25,45 +25,6 @@ * changes just copy/paste them into here. * - Check the files off as you go. Some files below might not have anything in them. That's ok, this * is just a simple heuristic to keep track of our progress. - * - * TODO for version 4.x [updated][tested]: - * [x][x] index.js - * [x][x] querystream.js - * [x][x] connection.js - * [x][x] utils.js - * [x][x] browser.js - * [x][x] drivers/node-mongodb-native/collection.js - * [x][x] drivers/node-mongodb-native/connection.js - * [x][x] error/messages.js - * [x][x] error/validation.js - * [x][x] error.js - * [x][x] querycursor.js - * [x][x] virtualtype.js - * [x][x] schema.js - * [x][x] document.js - * [x][x] types/subdocument.js - * [x][x] types/array.js - * [x][x] types/documentarray.js - * [x][x] types/buffer.js - * [x][x] types/objectid.js - * [x][x] types/embedded.js - * [x][x] query.js - * [x][x] schema/array.js - * [x][x] schema/string.js - * [x][x] schema/documentarray.js - * [x][x] schema/number.js - * [x][x] schema/date.js - * [x][x] schema/buffer.js - * [x][x] schema/boolean.js - * [x][x] schema/objectid.js - * [x][x] schema/mixed.js - * [x][x] schema/embedded.js - * [x][x] aggregate.js - * [x][x] schematype.js - * [x][x] promise.js - * [x][x] ES6Promise.js - * [x][x] model.js - * [x][x] collection.js */ /* @@ -80,6 +41,9 @@ declare module "mongoose" { import stream = require('stream'); import mongoose = require('mongoose'); + /** Pluralises the given name */ + export function pluralize(str: string): string; + /* * Some mongoose classes have the same name as the native JS classes * Keep references to native classes using a "Native" prefix @@ -99,7 +63,7 @@ declare module "mongoose" { export var SchemaTypes: typeof Schema.Types; /** Expose connection states for user-land */ - export var STATES: Object; + export var STATES: any; /** The default connection of the mongoose module. */ export var connection: Connection; /** The node-mongodb-native driver Mongoose uses. */ @@ -112,11 +76,9 @@ declare module "mongoose" { * Options passed take precedence over options included in connection strings. * @returns pseudo-promise wrapper around this */ - export function connect(uris: string, - options?: ConnectionOptions, - callback?: (err: mongodb.MongoError) => void): MongooseThenable; - export function connect(uris: string, - callback?: (err: mongodb.MongoError) => void): MongooseThenable; + export function connect(uris: string, options: ConnectionOptions, callback: (err: mongodb.MongoError) => void): null; + export function connect(uris: string, callback: (err: mongodb.MongoError) => void): null; + export function connect(uris: string, options?: ConnectionOptions): Promise; /** * Creates a Connection instance. @@ -130,16 +92,14 @@ declare module "mongoose" { export function createConnection(uri: string, options?: ConnectionOptions ): Connection; - export function createConnection(host: string, database_name: string, port?: number, - options?: ConnectionOptions - ): Connection; /** * Disconnects all connections. * @param fn called after all connection close. - * @returns pseudo-promise wrapper around this */ - export function disconnect(fn?: (error: any) => void): MongooseThenable; + export function disconnect(fn: (error?: any) => void): null; + /** Disconnects all connections. */ + export function disconnect(): Promise; /** Gets mongoose options */ export function get(key: string): any; @@ -173,26 +133,11 @@ declare module "mongoose" { * @param fn plugin callback * @param opts optional options */ - export function plugin(fn: Function, opts?: Object): typeof mongoose; + export function plugin(fn: Function, opts?: any): typeof mongoose; /** Sets mongoose options */ export function set(key: string, value: any): void; - type MongooseThenable = typeof mongoose & { - /** - * Ability to use mongoose object as a pseudo-promise so .connect().then() - * and .disconnect().then() are viable. - */ - then(onFulfill?: () => void | TRes | PromiseLike, - onRejected?: (err: mongodb.MongoError) => void | TRes | PromiseLike): Promise; - - /** - * Ability to use mongoose object as a pseudo-promise so .connect().then() - * and .disconnect().then() are viable. - */ - catch(onRejected?: (err: mongodb.MongoError) => void | TRes | PromiseLike): Promise; - } - class CastError extends Error { /** * The Mongoose CastError constructor @@ -204,49 +149,6 @@ declare module "mongoose" { constructor(type: string, value: any, path: string, reason?: NativeError); } - /* - * section querystream.js - * http://mongoosejs.com/docs/api.html#querystream-js - * - * QueryStream can only be accessed using query#stream(), we only - * expose its interface here. - */ - interface QueryStream extends stream.Stream { - /** - * Provides a Node.js 0.8 style ReadStream interface for Queries. - * @event data emits a single Mongoose document - * @event error emits when an error occurs during streaming. This will emit before the close event. - * @event close emits when the stream reaches the end of the cursor or an error occurs, or the stream - * is manually destroyed. After this event, no more events are emitted. - */ - constructor(query: Query, options?: { - /** - * optional function which accepts a mongoose document. The return value - * of the function will be emitted on data. - */ - transform?: Function; - [other: string]: any; - }): QueryStream; - - /** - * Destroys the stream, closing the underlying cursor, which emits the close event. - * No more events will be emitted after the close event. - */ - destroy(err?: NativeError): void; - - /** Pauses this stream. */ - pause(): void; - /** Pipes this query stream into another stream. This method is inherited from NodeJS Streams. */ - pipe(destination: T, options?: { end?: boolean; }): T; - /** Resumes this stream. */ - resume(): void; - - /** Flag stating whether or not this stream is paused. */ - paused: boolean; - /** Flag stating whether or not this stream is readable. */ - readable: boolean; - } - /* * section connection.js * http://mongoosejs.com/docs/api.html#connection-js @@ -288,7 +190,13 @@ declare module "mongoose" { options?: ConnectionOpenOptions, callback?: (err: any) => void): any; /** Helper for dropDatabase() */ - dropDatabase(callback?: (err: any) => void): Promise; + dropDatabase(callback?: (err: any) => void): Promise; + + /** Helper for creating a collection */ + createCollection(name: string, options?: mongodb.CollectionCreateOptions, cb?: (err: any, collection: mongodb.Collection) => void): Promise; + + /** Helper for dropCollection() */ + dropCollection(name: string, callback?: (err: any) => void): Promise; /** * Opens the connection to a replica set. @@ -308,7 +216,7 @@ declare module "mongoose" { * @param name name of the collection * @param options optional collection options */ - collection(name: string, options?: Object): Collection; + collection(name: string, options?: any): Collection; /** * Defines or retrieves a model. @@ -332,7 +240,7 @@ declare module "mongoose" { modelNames(): string[]; /** A hash of the global options that are associated with this connection */ - config: Object; + config: any; /** The mongodb.Db instance, set when the connection is opened */ db: mongodb.Db; @@ -445,6 +353,9 @@ declare module "mongoose" { /** See http://mongoosejs.com/docs/connections.html#use-mongo-client **/ useMongoClient?: boolean; + + /** See http://mongoosejs.com/docs/guide.html#bufferCommands */ + bufferCommands?: boolean; } interface ConnectionOptions extends @@ -463,7 +374,7 @@ declare module "mongoose" { * @param conn A MongooseConnection instance * @param opts optional collection options */ - new(name: string, conn: Connection, opts?: Object): Collection; + new(name: string, conn: Connection, opts?: any): Collection; /** Formatter for debug print args */ $format(arg: any): string; /** Debug print helper */ @@ -485,7 +396,7 @@ declare module "mongoose" { useDb(name: string): Connection; /** Expose the possible connection states. */ - static STATES: Object; + static STATES: any; } /* @@ -517,10 +428,10 @@ declare module "mongoose" { * {MIN} is replaced with the declared min value for the Number.min validator * {MAX} is replaced with the declared max value for the Number.max validator */ - static messages: Object; + static messages: any; /** For backwards compatibility. Same as mongoose.Error.messages */ - static Messages: Object; + static Messages: any; } interface EachAsyncOptions { @@ -550,7 +461,7 @@ declare module "mongoose" { * @event data Emitted when the stream is flowing and the next doc is ready * @event end Emitted when the stream is exhausted */ - constructor(query: Query, options: Object): QueryCursor; + constructor(query: Query, options: any): QueryCursor; /** Marks this cursor as closed. Will stop streaming and subsequent calls to next() will error. */ close(callback?: (error: any, result: any) => void): Promise; @@ -593,11 +504,11 @@ declare module "mongoose" { */ class VirtualType { /** This is what mongoose uses to define virtual attributes via Schema.prototype.virtual. */ - constructor(options: Object, name: string); + constructor(options: any, name: string); /** Applies getters to value using optional scope. */ - applyGetters(value: Object, scope: Object): any; + applyGetters(value: any, scope: any): any; /** Applies setters to value using optional scope. */ - applySetters(value: Object, scope: Object): any; + applySetters(value: any, scope: any): any; /** Defines a getter. */ get(fn: Function): this; /** Defines a setter. */ @@ -620,6 +531,9 @@ declare module "mongoose" { /** Adds key path / schema type pairs to this schema. */ add(obj: SchemaDefinition, prefix?: string): void; + /** Return a deep copy of this schema */ + clone(): Schema; + /** * Iterates the schemas paths similar to Array.forEach. * @param fn callback function @@ -639,7 +553,7 @@ declare module "mongoose" { * @param options.expires Mongoose-specific syntactic sugar, uses ms to convert * expires option into seconds for the expireAfterSeconds in the above link. */ - index(fields: Object, options?: { + index(fields: any, options?: { expires?: string; [other: string]: any; }): this; @@ -678,7 +592,7 @@ declare module "mongoose" { * Registers a plugin for this schema. * @param plugin callback */ - plugin(plugin: (schema: Schema, options?: Object) => void, opts?: Object): this; + plugin(plugin: (schema: Schema, options?: any) => void, opts?: any): this; /** * Defines a post hook for the document @@ -734,7 +648,7 @@ declare module "mongoose" { static(nameObj: { [name: string]: Function }): this; /** Creates a virtual type with the given name. */ - virtual(name: string, options?: Object): VirtualType; + virtual(name: string, options?: any): VirtualType; /** Returns the virtual type with the given name. */ virtualpath(name: string): VirtualType; @@ -748,7 +662,7 @@ declare module "mongoose" { * b/c they conflict with mongoose functionality. Using these key name * will throw an error. */ - static reserved: Object; + static reserved: any; /** Object of currently defined methods on this schema. */ methods: any; @@ -760,40 +674,41 @@ declare module "mongoose" { // Hook functions: https://github.com/vkarpov15/hooks-fixed interface HookSyncCallback { - (next: HookNextFunction, ...hookArgs:any[]): any; + (next: HookNextFunction): any; } interface HookAsyncCallback { - (next: HookNextFunction, done: HookDoneFunction, ...hookArgs: any[]): any; + (next: HookNextFunction, done: HookDoneFunction): any; } interface HookErrorCallback { - (error: Error): any; + (error?: Error): any; } interface HookNextFunction { - (error: Error): any; - (...hookArgs: any[]): any; + (error?: Error): any; } interface HookDoneFunction { - (error: Error): any; - (...hookArgs: any[]): any; + (error?: Error): any; } interface SchemaOptions { - /** defaults to null (which means use the connection's autoIndex option) */ + /** defaults to false (which means use the connection's autoIndex option) */ autoIndex?: boolean; /** defaults to true */ bufferCommands?: boolean; /** defaults to false */ capped?: boolean | number | { size?: number; max?: number; autoIndexId?: boolean; }; + /** Sets a default collation for every query and aggregation. */ + collation?: CollationOptions; /** no default */ collection?: string; /** defaults to "__t" */ discriminatorKey?: string; /** defaults to false. */ emitIndexErrors?: boolean; + excludeIndexes?: any; /** defaults to true */ id?: boolean; /** defaults to true */ @@ -803,38 +718,40 @@ declare module "mongoose" { read?: string; /** defaults to true. */ safe?: boolean | { w?: number | string; wtimeout?: number; j?: boolean }; + /** defaults to null */ shardKey?: boolean; /** defaults to true */ strict?: boolean; /** no default */ - toJSON?: Object; + toJSON?: DocumentToObjectOptions; /** no default */ - toObject?: Object; + toObject?: DocumentToObjectOptions; /** defaults to 'type' */ typeKey?: string; /** defaults to false */ useNestedStrict?: boolean; - /** defaults to false */ - usePushEach?: boolean; /** defaults to true */ validateBeforeSave?: boolean; /** defaults to "__v" */ versionKey?: string|boolean; - /** defaults to false */ - retainKeyOrder?: boolean; /** * skipVersioning allows excluding paths from * versioning (the internal revision will not be * incremented even if these paths are updated). */ - skipVersioning?: Object; + skipVersioning?: any; /** * If set timestamps, mongoose assigns createdAt * and updatedAt fields to your schema, the type * assigned is Date. */ - timestamps?: Object; + timestamps?: boolean | SchemaTimestampsConfig; + } + + interface SchemaTimestampsConfig { + createdAt?: boolean | string; + updatedAt?: boolean | string; } /* @@ -870,6 +787,8 @@ declare module "mongoose" { * - http://mongoosejs.com/docs/api.html#schema_Schema.Types */ interface SchemaTypeOpts { + alias?: string; + /* Common Options for all schema types */ type?: T; @@ -880,7 +799,7 @@ declare module "mongoose" { * Getters allow you to transform the representation of the data as it travels * from the raw mongodb document to the value that you see. */ - get?: (value: T, schematype?: this) => T | Object; + get?: (value: T, schematype?: this) => T | any; /** Declares the index options for this schematype. */ index?: SchemaTypeOpts.IndexOpts | boolean | string; @@ -892,7 +811,7 @@ declare module "mongoose" { required?: SchemaTypeOpts.RequiredFn | boolean | [boolean, string] | string | [string, string] | - Object; + any; /** * Sets default select() behavior for this path. @@ -900,19 +819,19 @@ declare module "mongoose" { * if it should be excluded by default. This setting can be overridden at * the query level. */ - select?: boolean | Object; + select?: boolean | any; /** * Setters allow you to transform the data before it gets to the raw mongodb * document and is set as a value on an actual key. */ - set?: (value: T, schematype?: this) => T | Object; + set?: (value: T, schematype?: this) => T | any; /** Declares a sparse index. */ - sparse?: boolean | Object; + sparse?: boolean | any; /** Declares a full text index. */ - text?: boolean | Object; + text?: boolean | any; /** * Adds validator(s) for this document path. @@ -922,27 +841,27 @@ declare module "mongoose" { validate?: RegExp | [RegExp, string] | SchemaTypeOpts.ValidateFn | [SchemaTypeOpts.ValidateFn, string] | SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.ValidateOpts[] | - Object; + SchemaTypeOpts.AsyncValidateOpts | SchemaTypeOpts.AsyncValidateOpts[]; /** Declares an unique index. */ - unique?: boolean | Object; + unique?: boolean | any; /* Options for specific schema types (String, Number, Date, etc.) */ /** String only - Adds an enum validator */ - enum?: T[] | SchemaTypeOpts.EnumOpts | Object; + enum?: T[] | SchemaTypeOpts.EnumOpts | any; /** String only - Adds a lowercase setter. */ - lowercase?: boolean | Object; + lowercase?: boolean | any; /** String only - Sets a regexp validator. */ - match?: RegExp | [RegExp, string] | Object; + match?: RegExp | [RegExp, string] | any; /** String only - Sets a maximum length validator. */ - maxlength?: number | [number, string] | Object; + maxlength?: number | [number, string] | any; /** String only - Sets a minimum length validator. */ - minlength?: number | [number, string] | Object; + minlength?: number | [number, string] | any; /** String only - Adds a trim setter. */ - trim?: boolean | Object; + trim?: boolean | any; /** String only - Adds an uppercase setter. */ - uppercase?: boolean | Object; + uppercase?: boolean | any; /** * Date, Number only - Sets a minimum number validator. @@ -950,7 +869,7 @@ declare module "mongoose" { */ min?: number | [number, string] | Date | [Date, string] | - Object; + any; /** * Date, Number only - Sets a maximum number validator. @@ -958,16 +877,16 @@ declare module "mongoose" { */ max?: number | [number, string] | Date | [Date, string] | - Object; + any; /** * Date only - Declares a TTL index (rounded to the nearest second) * for Date types only. */ - expires?: number | string | Object; + expires?: number | string | any; /** ObjectId only - Adds an auto-generated ObjectId default if turnOn is true. */ - auto?: boolean | Object; + auto?: boolean | any; [other: string]: any; } @@ -983,13 +902,26 @@ declare module "mongoose" { } interface ValidateFn { - (obj: RegExp | Function, message?: string, type?: string): T; + (value: T): boolean; } - interface ValidateOpts { - validator?: RegExp | Function, - msg?: string, - type?: string + interface AsyncValidateFn { + (value: T, done: (result: boolean) => void): void; + } + + interface ValidateOptsBase { + msg?: string; + type?: string; + } + + interface ValidateOpts extends ValidateOptsBase { + isAsync?: false; + validator?: RegExp | ValidateFn; + } + + interface AsyncValidateOpts extends ValidateOptsBase { + isAsync: true; + validator: AsyncValidateFn; } interface EnumOpts { @@ -1019,7 +951,7 @@ declare module "mongoose" { * Takes a populated field and returns it to its unpopulated state. * If the path was not populated, this is a no-op. */ - depopulate(path: string): void; + depopulate(path: string): this; /** * Returns true if the Document stores the same data as doc. @@ -1036,6 +968,9 @@ declare module "mongoose" { */ execPopulate(): Promise; + /** Checks if path was explicitly selected. If no projection, always returns true. */ + isDirectSelected(path: string): boolean; + /** * Returns the value of a path. * @param type optionally specify a type for on-the-fly attributes @@ -1046,13 +981,12 @@ declare module "mongoose" { * Initializes the document without setters or marking anything modified. * Called internally after a document is returned from mongodb. * @param doc document returned by mongo - * @param fn callback + * @param opts Options */ - init(doc: MongooseDocument, fn?: () => void): this; - init(doc: MongooseDocument, opts: Object, fn?: () => void): this; + init(doc: MongooseDocument, opts?: any): this; /** Helper for console.log */ - inspect(options?: Object): any; + inspect(options?: any): any; /** * Marks a path as invalid, causing validation to fail. @@ -1118,9 +1052,9 @@ declare module "mongoose" { * @param type optionally specify a type for "on-the-fly" attributes * @param options optionally specify options that modify the behavior of the set */ - set(path: string, val: any, options?: Object): this; - set(path: string, val: any, type: any, options?: Object): this; - set(value: Object): this; + set(path: string, val: any, options?: any): this; + set(path: string, val: any, type: any, options?: any): this; + set(value: any): this; /** * The return value of this method is used in calls to JSON.stringify(doc). @@ -1128,13 +1062,13 @@ declare module "mongoose" { * options to every document of your schema by default, set your schemas * toJSON option to the same argument. */ - toJSON(options?: DocumentToObjectOptions): Object; + toJSON(options?: DocumentToObjectOptions): any; /** * Converts this document into a plain javascript object, ready for storage in MongoDB. * Buffers are converted to instances of mongodb.Binary for proper storage. */ - toObject(options?: DocumentToObjectOptions): Object; + toObject(options?: DocumentToObjectOptions): any; /** Helper for console.log */ toString(): string; @@ -1146,8 +1080,8 @@ declare module "mongoose" { unmarkModified(path: string): void; /** Sends an update command with this document _id as the query selector. */ - update(doc: Object, callback?: (err: any, raw: any) => void): Query; - update(doc: Object, options: ModelUpdateOptions, + update(doc: any, callback?: (err: any, raw: any) => void): Query; + update(doc: any, options: ModelUpdateOptions, callback?: (err: any, raw: any) => void): Query; /** @@ -1156,7 +1090,7 @@ declare module "mongoose" { * @param callback callback called after validation completes, passing an error if one occurred */ validate(callback?: (err: any) => void): Promise; - validate(optional: Object, callback?: (err: any) => void): Promise; + validate(optional: any, callback?: (err: any) => void): Promise; /** * Executes registered validation rules (skipping asynchronous validators) for this document. @@ -1167,7 +1101,7 @@ declare module "mongoose" { validateSync(pathsToValidate?: string | string[]): Error; /** Hash containing current validation errors. */ - errors: Object; + errors: any; /** This documents _id. */ _id: any; /** Boolean flag specifying if the document is new. */ @@ -1199,17 +1133,11 @@ declare module "mongoose" { * @param ret The plain object representation which has been converted * @param options The options in use (either schema options or the options passed inline) */ - transform?: (doc: any, ret: Object, options: Object) => any; + transform?: (doc: any, ret: any, options: any) => any; /** depopulate any populated paths, replacing them with their original refs (defaults to false) */ depopulate?: boolean; /** whether to include the version key (defaults to true) */ versionKey?: boolean; - /** - * keep the order of object keys. If this is set to true, - * Object.keys(new Doc({ a: 1, b: 2}).toObject()) will - * always produce ['a', 'b'] (defaults to false) - */ - retainKeyOrder?: boolean; } namespace Types { @@ -1226,7 +1154,7 @@ declare module "mongoose" { * @param callback optional callback for compatibility with Document.prototype.remove */ remove(callback?: (err: any) => void): void; - remove(options: Object, callback?: (err: any) => void): void; + remove(options: any, callback?: (err: any) => void): void; } /* @@ -1327,7 +1255,7 @@ declare module "mongoose" { splice(...args: any[]): T[]; /** Returns a native js Array. */ - toObject(options?: Object): T[]; + toObject(options?: any): T[]; /** * Wraps Array#unshift with proper change tracking. @@ -1348,7 +1276,7 @@ declare module "mongoose" { * This is the same subdocument constructor used for casting. * @param obj the value to cast to this arrays SubDocument schema */ - create(obj: Object): T; + create(obj: any): T; /** * Searches array items for the first document with a matching _id. @@ -1364,7 +1292,7 @@ declare module "mongoose" { * @param options optional options to pass to each documents toObject * method call during conversion */ - toObject(options?: Object): T[]; + toObject(options?: any): T[]; } /* @@ -1419,7 +1347,7 @@ declare module "mongoose" { */ class Embedded extends MongooseDocument { /** Helper for console.log */ - inspect(): Object; + inspect(): any; /** * Marks a path as invalid, causing validation to fail. @@ -1478,20 +1406,30 @@ declare module "mongoose" { * Specifies arguments for a $and condition. * @param array array of conditions */ - and(array: Object[]): this; + and(array: any[]): this; /** Specifies the batchSize option. Cannot be used with distinct() */ batchSize(val: number): this; + /** Get the current error flag value */ + error(): Error | null; + /** Unset the error flag set on this query */ + error(unset: null): this; + /** + * Set the error flag on this query + * @param err The error flag + */ + error(err: Error): this; + /** * Specifies a $box condition * @param Upper Right Coords */ - box(val: Object): this; + box(val: any): this; box(lower: number[], upper: number[]): this; /** Casts this query to the schema of model, If obj is present, it is cast instead of this query.*/ - cast(model: any, obj?: Object): Object; + cast(model: any, obj?: any): any; /** * Executes the query returning a Promise which will be @@ -1505,19 +1443,18 @@ declare module "mongoose" { * Specifies a $center or $centerSphere condition. * @deprecated Use circle instead. */ - center(area: Object): this; - center(path: string, area: Object): this; - + center(area: any): this; + center(path: string, area: any): this; /** * DEPRECATED Specifies a $centerSphere condition * @deprecated Use circle instead. */ - centerSphere(path: string, val: Object): this; - centerSphere(val: Object): this; + centerSphere(path: string, val: any): this; + centerSphere(val: any): this; /** Specifies a $center or $centerSphere condition. */ - circle(area: Object): this; - circle(path: string, area: Object): this; + circle(area: any): this; + circle(path: string, area: any): this; /** Adds a collation to this op (MongoDB 3.4 and up) */ collation(value: CollationOptions): this; @@ -1530,28 +1467,28 @@ declare module "mongoose" { * @param criteria mongodb selector */ count(callback?: (err: any, count: number) => void): Query; - count(criteria: Object, callback?: (err: any, count: number) => void): Query; + count(criteria: any, callback?: (err: any, count: number) => void): Query; /** * Returns a wrapper around a mongodb driver cursor. A QueryCursor exposes a * Streams3-compatible interface, as well as a .next() function. */ - cursor(options?: Object): QueryCursor; + cursor(options?: any): QueryCursor; /** Declares or executes a distict() operation. Passing a callback executes the query. */ distinct(callback?: (err: any, res: any[]) => void): Query; distinct(field: string, callback?: (err: any, res: any[]) => void): Query; - distinct(field: string, criteria: Object | Query, + distinct(field: string, criteria: any | Query, callback?: (err: any, res: any[]) => void): Query; /** Specifies an $elemMatch condition */ elemMatch(criteria: (elem: Query) => void): this; - elemMatch(criteria: Object): this; - elemMatch(path: string | Object | Function, criteria: (elem: Query) => void): this; - elemMatch(path: string | Object | Function, criteria: Object): this; + elemMatch(criteria: any): this; + elemMatch(path: string | any | Function, criteria: (elem: Query) => void): this; + elemMatch(path: string | any | Function, criteria: any): this; /** Specifies the complementary comparison value for paths specified with where() */ - equals(val: Object): this; + equals(val: any): this; /** Executes the query */ exec(callback?: (err: any, res: T) => void): Promise; @@ -1567,7 +1504,7 @@ declare module "mongoose" { * @param criteria mongodb selector */ find(callback?: (err: any, res: DocType[]) => void): DocumentQuery; - find(criteria: Object, + find(criteria: any, callback?: (err: any, res: DocType[]) => void): DocumentQuery; /** @@ -1578,7 +1515,7 @@ declare module "mongoose" { * @param projection optional fields to return */ findOne(callback?: (err: any, res: DocType | null) => void): DocumentQuery; - findOne(criteria: Object, + findOne(criteria: any, callback?: (err: any, res: DocType | null) => void): DocumentQuery; /** @@ -1587,9 +1524,9 @@ declare module "mongoose" { * callback. Executes immediately if callback is passed. */ findOneAndRemove(callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; - findOneAndRemove(conditions: Object, + findOneAndRemove(conditions: any, callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; - findOneAndRemove(conditions: Object, options: QueryFindOneAndRemoveOptions, + findOneAndRemove(conditions: any, options: QueryFindOneAndRemoveOptions, callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; /** @@ -1598,11 +1535,11 @@ declare module "mongoose" { * the found document (if any) to the callback. The query executes immediately if callback is passed. */ findOneAndUpdate(callback?: (err: any, doc: DocType | null) => void): DocumentQuery; - findOneAndUpdate(update: Object, + findOneAndUpdate(update: any, callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; - findOneAndUpdate(query: Object | Query, update: Object, + findOneAndUpdate(query: any | Query, update: any, callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; - findOneAndUpdate(query: Object | Query, update: Object, options: QueryFindOneAndUpdateOptions, + findOneAndUpdate(query: any | Query, update: any, options: QueryFindOneAndUpdateOptions, callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; /** @@ -1642,7 +1579,7 @@ declare module "mongoose" { * Sets query hints. * @param val a hint object */ - hint(val: Object): this; + hint(val: any): this; /** * Specifies an $in query condition. @@ -1652,7 +1589,7 @@ declare module "mongoose" { in(path: string, val: any[]): this; /** Declares an intersects query for geometry(). MUST be used after where(). */ - intersects(arg?: Object): this; + intersects(arg?: any): this; /** * Sets the lean option. @@ -1696,7 +1633,7 @@ declare module "mongoose" { * Merges another Query or conditions object into this one. * When a Query is passed, conditions, field selection and options are merged. */ - merge(source: Object | Query): this; + merge(source: any | Query): this; /** Specifies a $mod condition */ mod(val: number[]): this; @@ -1710,15 +1647,15 @@ declare module "mongoose" { ne(path: string, val: any): this; /** Specifies a $near or $nearSphere condition. */ - near(val: Object): this; - near(path: string, val: Object): this; + near(val: any): this; + near(path: string, val: any): this; /** * DEPRECATED Specifies a $nearSphere condition * @deprecated Use query.near() instead with the spherical option set to true. */ - nearSphere(val: Object): this; - nearSphere(path: string, val: Object): this; + nearSphere(val: any): this; + nearSphere(path: string, val: any): this; /** * Specifies a $nin query condition. @@ -1731,13 +1668,13 @@ declare module "mongoose" { * Specifies arguments for a $nor condition. * @param array array of conditions */ - nor(array: Object[]): this; + nor(array: any[]): this; /** * Specifies arguments for an $or condition. * @param array array of conditions */ - or(array: Object[]): this; + or(array: any[]): this; /** Specifies a $polygon condition */ polygon(...coordinatePairs: number[][]): this; @@ -1755,8 +1692,8 @@ declare module "mongoose" { * @param match Conditions for the population query * @param options Options for the population query (sort, etc) */ - populate(path: string | Object, select?: string | Object, model?: any, - match?: Object, options?: Object): this; + populate(path: string | any, select?: string | any, model?: any, + match?: any, options?: any): this; populate(options: ModelPopulateOptions | ModelPopulateOptions[]): this; /** @@ -1764,7 +1701,7 @@ declare module "mongoose" { * @param pref one of the listed preference options or aliases * @tags optional tags for this query */ - read(pref: string, tags?: Object[]): this; + read(pref: string, tags?: any[]): this; /** * Specifies a $regex query condition. @@ -1779,11 +1716,11 @@ declare module "mongoose" { * you must first call remove() and then execute it by using the exec() method. * @param criteria mongodb selector */ - remove(callback?: (err: any) => void): Query; - remove(criteria: Object | Query, callback?: (err: any) => void): Query; + remove(callback?: (err: any) => void): Query; + remove(criteria: any | Query, callback?: (err: any) => void): Query; /** Specifies which document fields to include or exclude (also known as the query "projection") */ - select(arg: string | Object): this; + select(arg: string | any): this; /** Determines if field selection has been made. */ selected(): boolean; /** Determines if exclusive field selection has been made.*/ @@ -1791,7 +1728,7 @@ declare module "mongoose" { /** Determines if inclusive field selection has been made. */ selectedInclusively(): boolean; /** Sets query options. */ - setOptions(options: Object): this; + setOptions(options: any): this; /** * Specifies a $size query condition. @@ -1827,10 +1764,7 @@ declare module "mongoose" { * sort order of each path is ascending unless the path name is prefixed with - * which will be treated as descending. */ - sort(arg: string | Object): this; - - /** Returns a Node.js 0.8 style read stream interface. */ - stream(options?: { transform?: Function; }): QueryStream; + sort(arg: string | any): this; /** * Sets the tailable option (for use with capped collections). Cannot be used with distinct() @@ -1861,17 +1795,17 @@ declare module "mongoose" { * @param doc the update command */ update(callback?: (err: any, affectedRows: number) => void): Query; - update(doc: Object, callback?: (err: any, affectedRows: number) => void): Query; - update(criteria: Object, doc: Object, + update(doc: any, callback?: (err: any, affectedRows: number) => void): Query; + update(criteria: any, doc: any, callback?: (err: any, affectedRows: number) => void): Query; - update(criteria: Object, doc: Object, options: QueryUpdateOptions, + update(criteria: any, doc: any, options: QueryUpdateOptions, callback?: (err: any, affectedRows: number) => void): Query; /** Specifies a path for use with chaining. */ - where(path?: string | Object, val?: any): this; + where(path?: string | any, val?: any): this; /** Defines a $within or $geoWithin argument for geo-spatial queries. */ - within(val?: Object): this; + within(val?: any): this; within(coordinate: number[], ...coordinatePairs: number[][]): this; /** Flag to opt out of using $geoWithin. */ @@ -1889,7 +1823,7 @@ declare module "mongoose" { /** puts a time limit on the query - requires mongodb >= 2.6.0 */ maxTimeMS?: number; /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ - passRawResult?: boolean; + rawResult?: boolean; } interface QueryFindOneAndUpdateOptions extends QueryFindOneAndRemoveOptions { @@ -1898,7 +1832,7 @@ declare module "mongoose" { /** creates the object if it doesn't exist. defaults to false. */ upsert?: boolean; /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ - fields?: Object | string; + fields?: any | string; /** if true, runs update validators on this command. Update validators validate the update operation against the model's schema. */ runValidators?: boolean; /** @@ -1941,7 +1875,7 @@ declare module "mongoose" { */ class Array extends SchemaType { /** Array SchemaType constructor */ - constructor(key: string, cast?: SchemaType, options?: Object); + constructor(key: string, cast?: SchemaType, options?: any); /** * Check if the given value satisfies a required validator. The given value @@ -1959,7 +1893,7 @@ declare module "mongoose" { */ class String extends SchemaType { /** String SchemaType constructor. */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** Check if the given value satisfies a required validator. */ checkRequired(value: any, doc: MongooseDocument): boolean; @@ -1968,7 +1902,7 @@ declare module "mongoose" { * Adds an enum validator * @param args enumeration values */ - enum(args: string | string[] | Object): this; + enum(args: string | string[] | any): this; /** Adds a lowercase setter. */ lowercase(): this; @@ -2010,7 +1944,7 @@ declare module "mongoose" { */ class DocumentArray extends Array { /** SubdocsArray SchemaType constructor */ - constructor(key: string, schema: Schema, options?: Object); + constructor(key: string, schema: Schema, options?: any); /** This schema type's name, to defend against minifiers that mangle function names. */ static schemaName: string; @@ -2022,7 +1956,7 @@ declare module "mongoose" { */ class Number extends SchemaType { /** Number SchemaType constructor. */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** Check if the given value satisfies a required validator. */ checkRequired(value: any, doc: MongooseDocument): boolean; @@ -2051,7 +1985,7 @@ declare module "mongoose" { */ class Date extends SchemaType { /** Date SchemaType constructor. */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** * Check if the given value satisfies a required validator. To satisfy @@ -2086,7 +2020,7 @@ declare module "mongoose" { */ class Buffer extends SchemaType { /** Buffer SchemaType constructor */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** * Check if the given value satisfies a required validator. To satisfy a @@ -2106,7 +2040,7 @@ declare module "mongoose" { */ class Boolean extends SchemaType { /** Boolean SchemaType constructor. */ - constructor(path: string, options?: Object); + constructor(path: string, options?: any); /** * Check if the given value satisfies a required validator. For a @@ -2125,7 +2059,7 @@ declare module "mongoose" { */ class ObjectId extends SchemaType { /** ObjectId SchemaType constructor. */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** * Adds an auto-generated ObjectId default if turnOn is true. @@ -2145,7 +2079,7 @@ declare module "mongoose" { */ class Decimal128 extends SchemaType { /** Decimal128 SchemaType constructor. */ - constructor(key: string, options?: Object); + constructor(key: string, options?: any); /** Check if the given value satisfies a required validator. */ checkRequired(value: any, doc: MongooseDocument): boolean; @@ -2160,7 +2094,7 @@ declare module "mongoose" { */ class Mixed extends SchemaType { /** Mixed SchemaType constructor. */ - constructor(path: string, options?: Object); + constructor(path: string, options?: any); /** This schema type's name, to defend against minifiers that mangle function names. */ static schemaName: string; @@ -2172,7 +2106,7 @@ declare module "mongoose" { */ class Embedded extends SchemaType { /** Sub-schema schematype constructor */ - constructor(schema: Schema, key: string, options?: Object); + constructor(schema: Schema, key: string, options?: any); } } } @@ -2187,11 +2121,17 @@ declare module "mongoose" { * Returned when calling Model.aggregate(). * @param ops aggregation operator(s) or operator array */ - constructor(ops?: Object | any[], ...args: any[]); + constructor(ops?: any | any[], ...args: any[]); /** Adds a cursor flag */ addCursorFlag(flag: string, value: boolean): this; + /** + * Appends a new $addFields operator to this aggregate pipeline. Requires MongoDB v3.4+ to work + * @param arg field specification + */ + addFields(arg: any): this; + /** * Sets the allowDiskUse option for the aggregation query (ignored for < 2.6.0) * @param value Should tell server it can use hard drive to store data during aggregation. @@ -2203,7 +2143,7 @@ declare module "mongoose" { * Appends new operators to this aggregate pipeline * @param ops operator(s) to append */ - append(...ops: Object[]): this; + append(...ops: any[]): this; /** Adds a collation. */ collation(options: CollationOptions): this; @@ -2214,7 +2154,7 @@ declare module "mongoose" { * is necessary. * @param options set the cursor batch size */ - cursor(options: Object): this; + cursor(options: any): this; // If cursor option is on, could return an object /** Executes the aggregate pipeline on the currently bound Model. */ @@ -2227,7 +2167,7 @@ declare module "mongoose" { * Appends a new custom $group operator to this aggregate pipeline. * @param arg $group operator contents */ - group(arg: Object): this; + group(arg: any): this; /** * Appends a new $limit operator to this aggregate pipeline. @@ -2239,13 +2179,13 @@ declare module "mongoose" { * Appends new custom $lookup operator(s) to this aggregate pipeline. * @param options to $lookup as described in the above link */ - lookup(options: Object): this; + lookup(options: any): this; /** * Appends a new custom $match operator to this aggregate pipeline. * @param arg $match operator contents */ - match(arg: Object): this; + match(arg: any): this; /** * Binds this aggregate to a model. @@ -2253,25 +2193,41 @@ declare module "mongoose" { */ model(model: any): this; + /** + * Appends new custom $graphLookup operator(s) to this aggregate pipeline, performing a recursive search on a collection. + * Note that graphLookup can only consume at most 100MB of memory, and does not allow disk use even if { allowDiskUse: true } is specified. + * @param options options to $graphLookup + */ + graphLookup(options: any): this; + /** * Appends a new $geoNear operator to this aggregate pipeline. * MUST be used as the first operator in the pipeline. */ - near(parameters: Object): this; + near(parameters: any): this; + + /** + * Lets you set arbitrary options, for middleware or plugins. + * @param value keys to merge into current options + */ + option(value: any): this; + + /** Returns the current pipeline */ + pipeline(): any[]; /** * Appends a new $project operator to this aggregate pipeline. * Mongoose query selection syntax is also supported. * @param arg field specification */ - project(arg: string | Object): this; + project(arg: string | any): this; /** * Sets the readPreference option for the aggregation query. * @param pref one of the listed preference options or their aliases * @param tags optional tags for this query */ - read(pref: string, tags?: Object[]): this; + read(pref: string, tags?: any[]): this; /** * Appends new custom $sample operator(s) to this aggregate pipeline. @@ -2292,7 +2248,7 @@ declare module "mongoose" { * of each path is ascending unless the path name is prefixed with - which will be treated * as descending. */ - sort(arg: string | Object): this; + sort(arg: string | any): this; /** Provides promise for aggregate. */ then(resolve?: (val: T) => void | TRes | PromiseLike, @@ -2318,7 +2274,7 @@ declare module "mongoose" { */ class SchemaType { /** SchemaType constructor */ - constructor(path: string, options?: Object, instance?: string); + constructor(path: string, options?: any, instance?: string); /** * Sets a default value for this SchemaType. @@ -2336,7 +2292,7 @@ declare module "mongoose" { * Declares the index options for this schematype. * Indexes are created in the background by default. Specify background: false to override. */ - index(options: Object | boolean | string): this; + index(options: any | boolean | string): this; /** * Adds a required validator to this SchemaType. The validator gets added @@ -2365,7 +2321,7 @@ declare module "mongoose" { * @param errorMsg optional error message * @param type optional validator type */ - validate(obj: RegExp | Function | Object, errorMsg?: string, + validate(obj: RegExp | Function | any, errorMsg?: string, type?: string): this; } @@ -2426,7 +2382,31 @@ declare module "mongoose" { * Model#ensureIndexes. If an error occurred it is passed with the event. * The fields, options, and index name are also passed. */ - new(doc?: Object): T; + new(doc?: any): T; + + /** + * Requires a replica set running MongoDB >= 3.6.0. Watches the underlying collection for changes using MongoDB change streams. + * This function does not trigger any middleware. In particular, it does not trigger aggregate middleware. + * @param options See https://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#watch + */ + watch(options?: mongodb.ChangeStreamOptions & {session?: any}): mongodb.ChangeStream; + + /** + * Translate any aliases fields/conditions so the final query or document object is pure + * @param raw fields/conditions that may contain aliased keys + * @return the translated 'pure' fields/conditions + */ + translateAliases(raw: any): any; + + /** + * Sends multiple insertOne, updateOne, updateMany, replaceOne, deleteOne, and/or deleteMany operations to the MongoDB server in one command. This is faster than sending multiple independent operations (like) if you use create()) because with bulkWrite() there is only one round trip to MongoDB. + * Mongoose will perform casting on all operations you provide. + * This function does not trigger any middleware, not save() nor update(). If you need to trigger save() middleware for every document use create() instead. + * @param writes Operations + * @param cb callback + * @return `BulkWriteOpResult` if the operation succeeds + */ + bulkWrite(writes: any[], cb?: (err: any, res: mongodb.BulkWriteOpResultObject) => void): Promise; /** * Finds a single document by its _id field. findById(id) is almost* @@ -2434,11 +2414,11 @@ declare module "mongoose" { * @param id value of _id to query by * @param projection optional fields to return */ - findById(id: Object | string | number, + findById(id: any | string | number, callback?: (err: any, res: T | null) => void): DocumentQuery; - findById(id: Object | string | number, projection: Object, + findById(id: any | string | number, projection: any, callback?: (err: any, res: T | null) => void): DocumentQuery; - findById(id: Object | string | number, projection: Object, options: Object, + findById(id: any | string | number, projection: any, options: any, callback?: (err: any, res: T | null) => void): DocumentQuery; model(name: string): Model; @@ -2453,13 +2433,13 @@ declare module "mongoose" { * Performs aggregations on the models collection. * If a callback is passed, the aggregate is executed and a Promise is returned. * If a callback is not passed, the aggregate itself is returned. - * @param ... aggregation pipeline operator(s) or operator array + * @param aggregations pipeline operator(s) or operator array */ - aggregate(...aggregations: Object[]): Aggregate; - aggregate(...aggregationsWithCallback: Object[]): Promise; + aggregate(aggregations: any[]): Aggregate; + aggregate(aggregations: any[], cb: Function): Promise; /** Counts number of matching documents in a database collection. */ - count(conditions: Object, callback?: (err: any, count: number) => void): Query; + count(conditions: any, callback?: (err: any, count: number) => void): Query; /** * Shortcut for saving one or more documents to the database. MyModel.create(docs) @@ -2467,8 +2447,8 @@ declare module "mongoose" { * Triggers the save() hook. */ create(docs: any[], callback?: (err: any, res: T[]) => void): Promise; - create(...docs: Object[]): Promise; - create(...docsWithCallback: Object[]): Promise; + create(...docs: any[]): Promise; + create(...docsWithCallback: any[]): Promise; /** * Adds a discriminator type. @@ -2479,7 +2459,7 @@ declare module "mongoose" { /** Creates a Query for a distinct operation. Passing a callback immediately executes the query. */ distinct(field: string, callback?: (err: any, res: any[]) => void): Query; - distinct(field: string, conditions: Object, + distinct(field: string, conditions: any, callback?: (err: any, res: any[]) => void): Query; /** @@ -2488,17 +2468,23 @@ declare module "mongoose" { * @param cb optional callback */ ensureIndexes(callback?: (err: any) => void): Promise; - ensureIndexes(options: Object, callback?: (err: any) => void): Promise; + ensureIndexes(options: any, callback?: (err: any) => void): Promise; + + /** + * Similar to ensureIndexes(), except for it uses the createIndex function. The ensureIndex() function checks to see if an index with that name already exists, and, if not, does not attempt to create the index. createIndex() bypasses this check. + * @param cb Optional callback + */ + createIndexes(cb?: (err: any) => void): Promise; /** * Finds documents. * @param projection optional fields to return */ find(callback?: (err: any, res: T[]) => void): DocumentQuery; - find(conditions: Object, callback?: (err: any, res: T[]) => void): DocumentQuery; - find(conditions: Object, projection?: Object | null, + find(conditions: any, callback?: (err: any, res: T[]) => void): DocumentQuery; + find(conditions: any, projection?: any | null, callback?: (err: any, res: T[]) => void): DocumentQuery; - find(conditions: Object, projection?: Object | null, options?: Object | null, + find(conditions: any, projection?: any | null, options?: any | null, callback?: (err: any, res: T[]) => void): DocumentQuery; @@ -2511,13 +2497,13 @@ declare module "mongoose" { * @param id value of _id to query by */ findByIdAndRemove(): DocumentQuery; - findByIdAndRemove(id: Object | number | string, + findByIdAndRemove(id: any | number | string, callback?: (err: any, res: T | null) => void): DocumentQuery; - findByIdAndRemove(id: Object | number | string, options: { + findByIdAndRemove(id: any | number | string, options: { /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ - sort?: Object; + sort?: any; /** sets the document fields to return */ - select?: Object; + select?: any; }, callback?: (err: any, res: T | null) => void): DocumentQuery; /** @@ -2526,9 +2512,9 @@ declare module "mongoose" { * @param id value of _id to query by */ findByIdAndUpdate(): DocumentQuery; - findByIdAndUpdate(id: Object | number | string, update: Object, + findByIdAndUpdate(id: any | number | string, update: any, callback?: (err: any, res: T | null) => void): DocumentQuery; - findByIdAndUpdate(id: Object | number | string, update: Object, + findByIdAndUpdate(id: any | number | string, update: any, options: ModelFindByIdAndUpdateOptions, callback?: (err: any, res: T | null) => void): DocumentQuery; @@ -2537,11 +2523,11 @@ declare module "mongoose" { * The conditions are cast to their respective SchemaTypes before the command is sent. * @param projection optional fields to return */ - findOne(conditions?: Object, + findOne(conditions?: any, callback?: (err: any, res: T | null) => void): DocumentQuery; - findOne(conditions: Object, projection: Object, + findOne(conditions: any, projection: any, callback?: (err: any, res: T | null) => void): DocumentQuery; - findOne(conditions: Object, projection: Object, options: Object, + findOne(conditions: any, projection: any, options: any, callback?: (err: any, res: T | null) => void): DocumentQuery; /** @@ -2550,18 +2536,18 @@ declare module "mongoose" { * Executes immediately if callback is passed else a Query object is returned. */ findOneAndRemove(): DocumentQuery; - findOneAndRemove(conditions: Object, + findOneAndRemove(conditions: any, callback?: (err: any, res: T | null) => void): DocumentQuery; - findOneAndRemove(conditions: Object, options: { + findOneAndRemove(conditions: any, options: { /** * if multiple docs are found by the conditions, sets the sort order to choose * which doc to update */ - sort?: Object; + sort?: any; /** puts a time limit on the query - requires mongodb >= 2.6.0 */ maxTimeMS?: number; /** sets the document fields to return */ - select?: Object; + select?: any; }, callback?: (err: any, res: T | null) => void): DocumentQuery; /** @@ -2571,34 +2557,19 @@ declare module "mongoose" { * if callback is passed else a Query object is returned. */ findOneAndUpdate(): DocumentQuery; - findOneAndUpdate(conditions: Object, update: Object, + findOneAndUpdate(conditions: any, update: any, callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery; - findOneAndUpdate(conditions: Object, update: Object, + findOneAndUpdate(conditions: any, update: any, options: ModelFindOneAndUpdateOptions, callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery; - /** - * geoNear support for Mongoose - * @param GeoJSON point or legacy coordinate pair [x,y] to search near - * @param options for the qurery - * @param callback optional callback for the query - */ - geoNear(point: number[] | { - type: string; - coordinates: number[] - }, options: { - /** return the raw object */ - lean?: boolean; - [other: string]: any; - }, callback?: (err: any, res: T[], stats: any) => void): DocumentQuery; - /** * Implements $geoSearch functionality for Mongoose * @param conditions an object that specifies the match condition (required) * @param options for the geoSearch, some (near, maxDistance) are required * @param callback optional callback */ - geoSearch(conditions: Object, options: { + geoSearch(conditions: any, options: { /** x,y point to search for */ near: number[]; /** the maximum distance from the point near that a result can be */ @@ -2614,7 +2585,7 @@ declare module "mongoose" { * pre-saved in the DB. The document returned has no paths marked * as modified initially. */ - hydrate(obj: Object): T; + hydrate(obj: any): T; /** * Shortcut for validating an array of documents and inserting them into @@ -2625,7 +2596,7 @@ declare module "mongoose" { */ insertMany(docs: any[], callback?: (error: any, docs: T[]) => void): Promise; insertMany(doc: any, callback?: (error: any, doc: T) => void): Promise; - insertMany(...docsWithCallback: Object[]): Promise; + insertMany(...docsWithCallback: any[]): Promise; /** * Executes a mapReduce command. @@ -2643,35 +2614,41 @@ declare module "mongoose" { * @param options A hash of key/val (path, options) used for population. * @param callback Optional callback, executed upon completion. Receives err and the doc(s). */ - populate(docs: Object[], options: ModelPopulateOptions | ModelPopulateOptions[], + populate(docs: any[], options: ModelPopulateOptions | ModelPopulateOptions[], callback?: (err: any, res: T[]) => void): Promise; - populate(docs: Object, options: ModelPopulateOptions | ModelPopulateOptions[], + populate(docs: any, options: ModelPopulateOptions | ModelPopulateOptions[], callback?: (err: any, res: T) => void): Promise; /** Removes documents from the collection. */ - remove(conditions: Object, callback?: (err: any) => void): Query; - deleteOne(conditions: Object, callback?: (err: any) => void): Query; - deleteMany(conditions: Object, callback?: (err: any) => void): Query; + remove(conditions: any, callback?: (err: any) => void): Query; + deleteOne(conditions: any, callback?: (err: any) => void): Query; + deleteMany(conditions: any, callback?: (err: any) => void): Query; + + /** + * Same as update(), except MongoDB replace the existing document with the given document (no atomic operators like $set). + * This function triggers the following middleware: replaceOne + */ + replaceOne(conditions: any, replacement: any, callback?: (err: any, raw: any) => void): Query; /** * Updates documents in the database without returning them. * All update values are cast to their appropriate SchemaTypes before being sent. */ - update(conditions: Object, doc: Object, + update(conditions: any, doc: any, callback?: (err: any, raw: any) => void): Query; - update(conditions: Object, doc: Object, options: ModelUpdateOptions, + update(conditions: any, doc: any, options: ModelUpdateOptions, callback?: (err: any, raw: any) => void): Query; - updateOne(conditions: Object, doc: Object, + updateOne(conditions: any, doc: any, callback?: (err: any, raw: any) => void): Query; - updateOne(conditions: Object, doc: Object, options: ModelUpdateOptions, + updateOne(conditions: any, doc: any, options: ModelUpdateOptions, callback?: (err: any, raw: any) => void): Query; - updateMany(conditions: Object, doc: Object, + updateMany(conditions: any, doc: any, callback?: (err: any, raw: any) => void): Query; - updateMany(conditions: Object, doc: Object, options: ModelUpdateOptions, + updateMany(conditions: any, doc: any, options: ModelUpdateOptions, callback?: (err: any, raw: any) => void): Query; /** Creates a Query, applies the passed conditions, and returns the Query. */ - where(path: string, val?: Object): Query; + where(path: string, val?: any): Query; } interface Document extends MongooseDocument, NodeJS.EventEmitter, ModelProperties { @@ -2684,6 +2661,11 @@ declare module "mongoose" { */ model(name: string): Model; + /** Override whether mongoose thinks this doc is deleted or not */ + isDeleted(isDeleted: boolean): void; + /** whether mongoose thinks this doc is deleted. */ + isDeleted(): boolean; + /** * Removes this document from the db. * @param fn optional callback @@ -2697,8 +2679,8 @@ declare module "mongoose" { * @param options.validateBeforeSave set to false to save without validating. * @param fn optional callback */ - save(options?: SaveOptions, fn?: (err: any, product: this, numAffected: number) => void): Promise; - save(fn?: (err: any, product: this, numAffected: number) => void): Promise; + save(options?: SaveOptions, fn?: (err: any, product: this) => void): Promise; + save(fn?: (err: any, product: this) => void): Promise; /** * Version using default version key. See http://mongoosejs.com/docs/guide.html#versionKey @@ -2765,27 +2747,22 @@ declare module "mongoose" { */ setDefaultsOnInsert?: boolean; /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ - sort?: Object; + sort?: any; /** sets the document fields to return */ - select?: Object; + select?: any; /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ - passRawResult?: boolean; + rawResult?: boolean; /** overwrites the schema's strict mode option for this update */ strict?: boolean; - /** - * if true, run all setters defined on the associated model's schema for all fields - * defined in the query and the update. - */ - runSettersOnQuery?: boolean; } interface ModelFindOneAndUpdateOptions extends ModelFindByIdAndUpdateOptions { /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ - fields?: Object | string; + fields?: any | string; /** puts a time limit on the query - requires mongodb >= 2.6.0 */ maxTimeMS?: number; /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ - passRawResult?: boolean; + rawResult?: boolean; } interface ModelPopulateOptions { @@ -2794,11 +2771,11 @@ declare module "mongoose" { /** optional fields to select */ select?: any; /** optional query conditions to match */ - match?: Object; + match?: any; /** optional name of the model to use for population */ model?: string; /** optional query options like sort, limit, etc */ - options?: Object; + options?: any; /** deep populate */ populate?: ModelPopulateOptions | ModelPopulateOptions[]; } @@ -2833,9 +2810,9 @@ declare module "mongoose" { map: Function | string; reduce: (key: Key, vals: T[]) => Val; /** query filter object. */ - query?: Object; + query?: any; /** sort input objects using this key */ - sort?: Object; + sort?: any; /** max number of documents */ limit?: number; /** keep temporary data default: false */ @@ -2843,7 +2820,7 @@ declare module "mongoose" { /** finalize function */ finalize?: (key: Key, val: Val) => Val; /** scope variables exposed to map/reduce/finalize during execution */ - scope?: Object; + scope?: any; /** it is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X default: false */ jsMode?: boolean; /** provide statistics on job execution time. default: false */ diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 92adb61d83..e63a0e612d 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -20,33 +20,31 @@ var cb = function () {}; * http://mongoosejs.com/docs/api.html#index-js */ var connectUri = 'mongodb://user:pass@localhost:port/database'; -mongoose.connect(connectUri).then(cb).catch(cb); -mongoose.connect(connectUri, { +const connection1: Promise = mongoose.connect(connectUri); +const connection2: Promise = mongoose.connect(connectUri, { user: 'larry', pass: 'housan', config: { autoIndex: true }, - mongos: true -}).then(cb); -mongoose.connect(connectUri, function (error) { + mongos: true, + bufferCommands: false +}); +const connection3: null = mongoose.connect(connectUri, function (error) { error.stack; }); + var mongooseConnection: mongoose.Connection = mongoose.createConnection(); +mongooseConnection.dropDatabase().then(()=>{}); +mongooseConnection.dropCollection('foo').then(()=>{}); mongoose.createConnection(connectUri).open(''); mongoose.createConnection(connectUri, { db: { native_parser: true } }).open(''); -mongoose.createConnection('localhost', 'database', 3000).open(''); -mongoose.createConnection('localhost', 'database', 3000, { - user: 'larry', - config: { - autoIndex: false - } -}).open(''); -mongoose.disconnect(cb).then(cb); +const dcWithCallback: null = mongoose.disconnect(cb); +const dcPromise: Promise = mongoose.disconnect(); mongoose.get('test'); mongoose.model('Actor', new mongoose.Schema({ name: String @@ -67,29 +65,6 @@ mongoose.Types.ObjectId; mongoose.Types.Decimal128; mongoose.version.toLowerCase(); -/* - * section querystream.js - * http://mongoosejs.com/docs/api.html#querystream-js - */ -var querystream = {}; -querystream.destroy(new Error()); -querystream.pause(); -querystream.pipe(process.stdout, {end: true}).end(); -querystream.resume(); -querystream.paused; -querystream.readable; -/* inherited properties */ -querystream.getMaxListeners(); -/* practical examples */ -var QSModel = {}; -var QSStream: mongoose.QueryStream = QSModel.find().stream(); -QSStream.on('data', function (doc: any) { - doc.save(); -}).on('error', function (err: any) { - throw err; -}).on('close', cb); -QSModel.where('created').gte(20000).stream().pipe(process.stdout); - /* * section collection.js * http://mongoosejs.com/docs/api.html#collection-js @@ -174,6 +149,8 @@ mongooseError.stack; mongoose.Error.messages.hasOwnProperty(''); mongoose.Error.Messages.hasOwnProperty(''); +const plural: string = mongoose.pluralize('foo'); + /* * section querycursor.js * http://mongoosejs.com/docs/api.html#querycursor-js @@ -209,6 +186,16 @@ querycursor.map(function (doc) { console.log(doc.foo); }); +QCModel.watch().once('change', (change: any) => { + console.log(change); +}); + +QCModel.watch({ + maxAwaitTimeMS: 10 +}).once('change', (change: any) => { + console.log(change); +}); + /* * section virtualtype.js * http://mongoosejs.com/docs/api.html#virtualtype-js @@ -369,7 +356,22 @@ new mongoose.Schema({ integerOnly: { type: Number, get: (v: number) => Math.round(v), - set: (v: number) => Math.round(v) + set: (v: number) => Math.round(v), + validate: { + isAsync: false, + validator: (val: number): boolean => { + return false; + } + } + }, + asyncValidated: { + type: Number, + validate: { + isAsync: true, + validator: (val: number, done): void => { + setImmediate(done, true); + } + } } }); new mongoose.Schema({ name: { type: String, validate: [ @@ -431,8 +433,8 @@ new mongoose.Schema({ }); export default function(schema: mongoose.Schema) { - schema.pre('init', function(this: mongoose.Document, next: (err?: Error) => void, data: any): void { - data.name = 'Hello world'; + schema.pre('init', function(this: mongoose.Document, next: (err?: Error) => void): void { + console.log('success!'); }); } @@ -442,13 +444,13 @@ export default function(schema: mongoose.Schema) { */ var doc = {}; doc.$isDefault('path').valueOf(); -doc.depopulate('path'); +const docDotDepopulate: mongoose.MongooseDocument = doc.depopulate('path'); doc.equals(doc).valueOf(); doc.execPopulate().then(function (arg) { arg.execPopulate(); }).catch(function (err) {}); doc.get('path', Number); -doc.init(doc, cb).init(doc, {}, cb); +doc.init(doc).init(doc, {}); doc.inspect(); doc.invalidate('path', new Error('hi'), 999).toString(); doc.isDirectModified('path').valueOf(); @@ -491,6 +493,7 @@ doc.validateSync(['path1', 'path2']).stack; var MyModel = mongoose.model('test', new mongoose.Schema({ name: { type: String, + alias: 'foo', default: 'Val ' } })); @@ -501,6 +504,14 @@ MyModel.findOne().populate('author').exec(function (err, doc) { doc.depopulate('author'); } }); +MyModel.replaceOne({foo: 'bar'}, {qux: 'baz'}).where(); +MyModel.replaceOne({foo: 'bar'}, {qux: 'baz'}, (err, raw) => {}) +MyModel.bulkWrite([{foo:'bar'}]).then(r => { + console.log(r.deletedCount); +}); +MyModel.bulkWrite([], (err, res) => { + console.log(res.modifiedCount) +}) doc.populate('path'); doc.populate({path: 'hello'}); doc.populate('path', cb) @@ -514,6 +525,8 @@ const ImageSchema = new mongoose.Schema({ id: {type: Number, unique: true, required: true, index: true}, }, { id: false }); +const clonedSchema: mongoose.Schema = new mongoose.Schema().clone(); + interface ImageDoc extends mongoose.Document { name: string, id: number @@ -731,7 +744,7 @@ query.findOne(function (err, res) { res.execPopulate(); }).findOne(); query.findOneAndRemove({name: 'aa'}, { - passRawResult: true + rawResult: true }, function (err, doc) { doc.execPopulate(); }).findOneAndRemove(); @@ -739,7 +752,7 @@ query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, { }); query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, { - passRawResult: true + rawResult: true }, cb); query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, cb); query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}); @@ -842,10 +855,6 @@ query.where('comments').slice([-10, 5]); query.snapshot().snapshot(true); query.sort({ field: 'asc', test: -1 }); query.sort('field -test'); -query.stream().on('data', function (doc: any) { -}).on('error', function (err: any) { -}).on('close', function () { -}); query.tailable().tailable(false); query.then(cb).catch(cb); (new (query.toConstructor())(1, 2, 3)).toConstructor(); @@ -1023,7 +1032,7 @@ schemaembedded.sparse(true); * http://mongoosejs.com/docs/api.html#aggregate-js */ var aggregate: mongoose.Aggregate; -aggregate = mongoose.model('ex').aggregate({ $match: { age: { $gte: 21 }}}); +aggregate = mongoose.model('ex').aggregate([{ $match: { age: { $gte: 21 }}}]); aggregate = new mongoose.Aggregate(); aggregate = new mongoose.Aggregate({ $project: { a: 1, b: 1 } }); aggregate = new mongoose.Aggregate({ $project: { a: 1, b: 1 } }, { $skip: 5 }); @@ -1035,6 +1044,8 @@ aggregate.append([{ $match: { daw: 'Logic Audio X' }} ]); aggregate.collation({ locale: 'en_US', strength: 1 }); aggregate.cursor({ batchSize: 1000 }).exec().each(cb); aggregate.exec().then(cb).catch(cb); +aggregate.option({foo: 'bar'}).exec(); +const aggregateDotPipeline: any[] = aggregate.pipeline(); aggregate.explain(cb).then(cb).catch(cb); aggregate.group({ _id: "$department" }).group({ _id: "$department" }); aggregate.limit(10).limit(10); @@ -1241,7 +1252,7 @@ mongoose.model('').findOne({}) str.toLowerCase; }); -mongoose.model('').aggregate() +mongoose.model('').aggregate([]) .then(function (arg) { return 2; }).then(function (num) { @@ -1278,7 +1289,7 @@ MongoModel.find({}).$where('indexOf("val") !== -1').exec(function (err, docs) { docs[0].__v; }); MongoModel.findById(999, function (err, doc) { - var handleSave = function(err: Error, product: mongoose.Document, numAffected: number) {}; + var handleSave = function(err: Error, product: mongoose.Document) {}; if (!doc) { return; } @@ -1290,9 +1301,9 @@ MongoModel.findById(999, function (err, doc) { doc.save({ safe: { w: 'majority', wtimeout: 10000 } }, handleSave).then(cb).catch(cb); // test if Typescript can infer the types of (err, product, numAffected) - doc.save(function(err, product, numAffected) { product.save(); }) + doc.save(function(err, product) { product.save(); }) .then(function(p) { p.save() }).catch(cb); - doc.save({ validateBeforeSave: false }, function(err, product, numAffected) { + doc.save({ validateBeforeSave: false }, function(err, product) { product.save(); }).then(function(p) { p.save() }).catch(cb); }); @@ -1311,10 +1322,13 @@ mongoModel.save().then(function (product) { product.save().then(cb).catch(cb); }); MongoModel.aggregate( - { $group: { _id: null, maxBalance: { $max: '$balance' }}} - , { $project: { _id: 0, maxBalance: 1 }} - , cb); -MongoModel.aggregate() + [ + { $group: { _id: null, maxBalance: { $max: '$balance' }}}, + { $project: { _id: 0, maxBalance: 1 }} + ], + cb +); +MongoModel.aggregate([]) .group({ _id: null, maxBalance: { $max: '$balance' } }) .exec(cb); MongoModel.count({ type: 'jungle' }, function (err, count) { @@ -1402,14 +1416,6 @@ MongoModel.findOneAndUpdate({}, {}, {}); MongoModel.findOneAndUpdate({}, {}, cb); MongoModel.findOneAndUpdate({}, {}); MongoModel.findOneAndUpdate(); -MongoModel.geoNear([1,3], { maxDistance : 5, spherical : true }, function(err, results, stats) { - results[0].on('data', cb); -}); -MongoModel.geoNear({ type : "Point", coordinates : [9,9] }, { - maxDistance : 5, spherical : true -}, function(err, results, stats) { - console.log(results); -}); MongoModel.geoSearch({ type : "house" }, { near: [10, 10], maxDistance: 5 }, function(err, res) { @@ -1649,3 +1655,47 @@ const x = new extended({ username: 'hi', // required in baseSchema email: 'beddiw', // required in extededSchema }); + +new mongoose.Schema({}, { + timestamps: { + createdAt: 'foo', + updatedAt: 'bar' + } +}); + +new mongoose.Schema({}, { + collation: { + strength: 1, + locale: 'en_US' + } +}); + +new mongoose.Schema({}, { + toObject: { + versionKey: false + }, + toJSON: { + depopulate: true + } +}) + +const aggregatePrototypeGraphLookup: mongoose.Aggregate = MyModel.aggregate([]).graphLookup({}); +const addFieldsAgg: mongoose.Aggregate = aggregatePrototypeGraphLookup.addFields({}) + +MyModel.findById('foo').then((doc: mongoose.Document) => { + const a: boolean = doc.isDirectSelected('bar'); + const b: boolean = doc.isDeleted(); + doc.isDeleted(true); +}); + +MyModel.translateAliases({}); + +const queryPrototypeError: Error | null = MyModel.findById({}).error(); +const queryProrotypeErrorSetUnset: mongoose.Query = MyModel.findById({}).error(null).error(new Error('foo')); + +MyModel.createIndexes().then(() => {}); +MyModel.createIndexes((err: any): void => {}).then(() => {}); + +mongoose.connection.createCollection('foo').then(() => {}); +mongoose.connection.createCollection('foo', {wtimeout: 5}).then(() => {}); +mongoose.connection.createCollection('foo', {wtimeout: 5}, (err: Error, coll): void => {coll.collectionName}).then(() => {}); diff --git a/types/mongoose/tsconfig.json b/types/mongoose/tsconfig.json index 55e06ad201..04f1bc2b3b 100644 --- a/types/mongoose/tsconfig.json +++ b/types/mongoose/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose/v3/tsconfig.json b/types/mongoose/v3/tsconfig.json index 2ea987dff7..505d24e636 100644 --- a/types/mongoose/v3/tsconfig.json +++ b/types/mongoose/v3/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mongoose/v4/README.md b/types/mongoose/v4/README.md new file mode 100644 index 0000000000..0ba91612e2 --- /dev/null +++ b/types/mongoose/v4/README.md @@ -0,0 +1,233 @@ +## MongooseJS Typescript Docs +Below are some examples of how to use these Definitions.
+Scenarios where the Typescript code is identical to plain Javascript code are omitted. + +### Table of Contents +* [Mongoose Methods, Properties, Constructors](#mongoose-methods-properties-constructors) +* [Creating and Saving Documents](#creating-and-saving-documents) +* [Promises](#promises) +* [Instance Methods, Virtual Properties](#instance-methods-and-virtual-properties) +* [Static Methods](#static-methods) +* [Plugins](#plugins) +* [FAQ and Common Mistakes](#faq-and-common-mistakes) + +#### Mongoose Methods, Properties, Constructors +You can call methods from the mongoose instance using: +```typescript +import * as mongoose from 'mongoose'; +var MyModel = mongoose.model(...); +var MySchema: mongoose.Schema = new mongoose.Schema(...); +``` + +Alternatively, you can import individual names and call them: +```typescript +import { model, Schema } from 'mongoose'; +var MyModel = model(...); +var MySchema: Schema = new Schema(...): +``` +[top](#mongoosejs-typescript-docs) + +#### Creating and Saving Documents +```typescript +import {Document, model, Model, Schema} from 'mongoose'; + +var UserSchema: Schema = new Schema({ + username: { + type: String, + required: true, + unique: true + }, + age: Number, + friends: [String], + data: [Schema.Types.Mixed] +}); + +interface IUser extends Document { + username: string; + age: number; + friends: string[]; + data: any[]; +} + +var UserModel: Model = model('User', UserSchema); + +var user = new UserModel({name: 'Jane'}); +user.username; // IUser properties are available +user.save(); // mongoose Document methods are available + +UserModel.findOne({}, (err: any, user: IUser) => { + user.username; // IUser properties are available + user.save(); // mongoose Document methods are available +}); +``` +[top](#mongoosejs-typescript-docs) + +#### Promises +These definitions use `global.Promise` by default. If you would like to use mongoose's own mpromise +definition (which is deprecated), you can install definitions for [mongoose-promise](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/mongoose-promise). + +If you'd like to use something other than `global.Promise`, you'll need to create a simple `.d.ts` file: +```typescript +// promise-bluebird.d.ts +import * as Bluebird from 'bluebird'; + +declare module 'mongoose' { + type Promise = Bluebird; +} + +// promise-q.d.ts +import * as Q from 'q'; + +declare module 'mongoose' { + type Promise = Q.Promise; +} + +// another-promise.d.ts +... +``` +To use it, you will need to `/// ` in one of your source code files, +or include the `.d.ts` file in your compile. + +To assign the new promise library in your code, you will need to use one of the following options (since +Typescript does not allow assigning properties of imported modules): + +* `(mongoose).Promise = YOUR_PROMISE;` +* `require('mongoose').Promise = YOUR_PROMISE;` +* `import mongoose = require('mongoose'); ... mongoose.Promise = YOUR_PROMISE;` + +[top](#mongoosejs-typescript-docs) + +#### Instance Methods and Virtual Properties +```typescript +import {Document, model, Model, Schema} from 'mongoose'; + +var UserSchema: Schema = new Schema({ + name: String +}); + +UserSchema.methods.method1 = function () { return '' }; + +UserSchema.virtual('nameInCaps').get(function () { + return this.name.toUpperCase(); +}); +UserSchema.virtual('nameInCaps').set(function (caps) { + this.name = caps.toLowerCase(); +}); + +interface IUser extends Document { + name: string; + method1: () => string; + nameInCaps: string; +} + +var UserModel: Model = model('User', UserSchema); +var user = new UserModel({name: 'Billy'}); + +user.method1(); // IUser methods are available +user.nameInCaps; // virtual properties can be used + +UserModel.findOne({}, (err: any, user: IUser) => { + user.method1(); // IUser methods are available + user.nameInCaps; // virtual properties can be used +}); +``` +[top](#mongoosejs-typescript-docs) + +#### Static Methods +```typescript +import {Document, model, Model, Schema} from 'mongoose'; + +var UserSchema = new Schema({}); +UserSchema.statics.static1 = function () { return '' }; + +interface IUserDocument extends Document {...} +interface IUserModel extends Model { + static1: () => string; +} + +var UserModel: IUserModel = model('User', UserSchema); +UserModel.static1(); // static methods are available +``` +[top](#mongoosejs-typescript-docs) + +#### Plugins +To write definitions for plugins, extend the mongoose module and create a simple plugin module: +```typescript +// plugin.d.ts +declare module 'mongoose' { + export interface PassportLocalDocument {...} + export interface PassportLocalSchema extends Schema {...} + export interface PassportLocalModel extends Model {...} + ... +} + +declare module 'passport-local-mongoose' { + import mongoose = require('mongoose'); + var _: (schema: mongoose.Schema, options?: Object) => void; + export = _; +} + +// user.ts +import { + model, + PassportLocalDocument, + PassportLocalSchema, + PassportLocalModel + Schema +} from 'mongoose'; +import * as passportLocalMongoose from 'passport-local-mongoose'; + +var UserSchema: PassportLocalSchema = new Schema({}); +UserSchema.plugin(passportLocalMongoose, options); + +interface IUser extends PassportLocalDocument {...} +interface IUserModel extends PassportLocalModel {...} + +var UserModel: IUserModel = model('User', UserSchema); +``` +Full example for [Passport Local Mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/passport-local-mongoose/passport-local-mongoose.d.ts)
+[top](#mongoosejs-typescript-docs) + +#### FAQ and Common Mistakes +**Q: When to use `mongoose.Schema.Types.ObjectId` and `mongoose.Types.ObjectId`**
+When creating schemas in code use `mongoose.Schema.Types.ObjectId`. This is not a type, this is an instance +of `SchemaType` containing metadata for the ObjectId type: +```typescript +var UserSchema = new mongoose.Schema({ + id: mongoose.Schema.Types.ObjectId +}); +``` +When defining your interface, you should use the type definition `mongoose.Types.ObjectId`: +```typescript +interface IUser extends mongoose.Document { + id: mongoose.Types.ObjectId; // for type-checking, doesn't affect code behaviour +} + +var UserSchema = new UserSchema({ + id: mongoose.Schema.Types.ObjectId; // for creating the schema only +}); + +var User = mongoose.model('User', UserSchema); +var user = new User({}); +user.id = new mongoose.Types.ObjectId(); +``` +[top](#mongoosejs-typescript-docs) + +**Q: Why are there 2 interfaces for Documents called Document and MongooseDocument?**
+People have been using this for a long time: +```typescript +interface IUser extends mongoose.Document { + ... +} +``` +When it should really be this: +```typescript +interface IUser extends mongoose.model { + ... +} +``` +For backwards compatibility Document is an interface for [mongoose.model](https://github.com/Automattic/mongoose/blob/master/lib/model.js#L3162)
+And MongooseDocument is an interface for [mongoose.Document](https://github.com/Automattic/mongoose/blob/master/lib/model.js#L3162)
+At some point in the future this may get fixed, which would require fixing your code. +
+[top](#mongoosejs-typescript-docs) diff --git a/types/mongoose/v4/index.d.ts b/types/mongoose/v4/index.d.ts new file mode 100644 index 0000000000..5f416b513a --- /dev/null +++ b/types/mongoose/v4/index.d.ts @@ -0,0 +1,2905 @@ +// Type definitions for Mongoose 4.7.1 +// Project: http://mongoosejs.com/ +// Definitions by: simonxca , horiuchi , sindrenm , lukasz-zak +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +/// + + +/* + * Guidelines for maintaining these definitions: + * - If you spot an error here or there, please submit a PR. + * Give some examples/links to documentation if you can. + * + * For patches and minor releases: + * - Browse the changelog at https://github.com/Automattic/mongoose/blob/master/History.md + * and make necessary changes. Afterwards, update the version number at the top so we know + * which version we are on. + * + * For major releases: + * - Refer to the updated docs at http://mongoosejs.com/docs/api.html + * - On the left-hand side of the docs is a list of .js files. Reset and update the TODO list below + * then go through one-by-one, making any updates to params list, return type, etc. For documentation + * changes just copy/paste them into here. + * - Check the files off as you go. Some files below might not have anything in them. That's ok, this + * is just a simple heuristic to keep track of our progress. + * + * TODO for version 4.x [updated][tested]: + * [x][x] index.js + * [x][x] querystream.js + * [x][x] connection.js + * [x][x] utils.js + * [x][x] browser.js + * [x][x] drivers/node-mongodb-native/collection.js + * [x][x] drivers/node-mongodb-native/connection.js + * [x][x] error/messages.js + * [x][x] error/validation.js + * [x][x] error.js + * [x][x] querycursor.js + * [x][x] virtualtype.js + * [x][x] schema.js + * [x][x] document.js + * [x][x] types/subdocument.js + * [x][x] types/array.js + * [x][x] types/documentarray.js + * [x][x] types/buffer.js + * [x][x] types/objectid.js + * [x][x] types/embedded.js + * [x][x] query.js + * [x][x] schema/array.js + * [x][x] schema/string.js + * [x][x] schema/documentarray.js + * [x][x] schema/number.js + * [x][x] schema/date.js + * [x][x] schema/buffer.js + * [x][x] schema/boolean.js + * [x][x] schema/objectid.js + * [x][x] schema/mixed.js + * [x][x] schema/embedded.js + * [x][x] aggregate.js + * [x][x] schematype.js + * [x][x] promise.js + * [x][x] ES6Promise.js + * [x][x] model.js + * [x][x] collection.js + */ + +/* +For easier searching, add a header to each section like so: +To find a section, CTRL+F and type "section ___.js" +/* + * section filename.js + * http://mongoosejs.com/docs/api.html#filename-js + */ + +declare module "mongoose" { + import events = require('events'); + import mongodb = require('mongodb'); + import stream = require('stream'); + import mongoose = require('mongoose'); + + /* + * Some mongoose classes have the same name as the native JS classes + * Keep references to native classes using a "Native" prefix + */ + class NativeBuffer extends global.Buffer {} + class NativeDate extends global.Date {} + class NativeError extends global.Error {} + + /* + * section index.js + * http://mongoosejs.com/docs/api.html#index-js + */ + export var DocumentProvider: any; + // recursive constructor + export var Mongoose: new(...args: any[]) => typeof mongoose; + type Mongoose = typeof mongoose; + export var SchemaTypes: typeof Schema.Types; + + /** Expose connection states for user-land */ + export var STATES: any; + /** The default connection of the mongoose module. */ + export var connection: Connection; + /** The node-mongodb-native driver Mongoose uses. */ + export var mongo: typeof mongodb; + /** The Mongoose version */ + export var version: string; + + /** + * Opens the default mongoose connection. + * Options passed take precedence over options included in connection strings. + * @returns pseudo-promise wrapper around this + */ + export function connect(uris: string, + options?: ConnectionOptions, + callback?: (err: mongodb.MongoError) => void): MongooseThenable; + export function connect(uris: string, + callback?: (err: mongodb.MongoError) => void): MongooseThenable; + + /** + * Creates a Connection instance. + * Each connection instance maps to a single database. This method is helpful + * when mangaging multiple db connections. + * @param uri a mongodb:// URI + * @param options options to pass to the driver + * @returns the created Connection object + */ + export function createConnection(): Connection; + export function createConnection(uri: string, + options?: ConnectionOptions + ): Connection; + export function createConnection(host: string, database_name: string, port?: number, + options?: ConnectionOptions + ): Connection; + + /** + * Disconnects all connections. + * @param fn called after all connection close. + * @returns pseudo-promise wrapper around this + */ + export function disconnect(fn?: (error: any) => void): MongooseThenable; + + /** Gets mongoose options */ + export function get(key: string): any; + + /** + * Defines a model or retrieves it. + * Models defined on the mongoose instance are available to all connection + * created by the same mongoose instance. + * @param name model name + * @param collection (optional, induced from model name) + * @param skipInit whether to skip initialization (defaults to false) + */ + export function model(name: string, schema?: Schema, collection?: string, + skipInit?: boolean): Model; + export function model>( + name: string, + schema?: Schema, + collection?: string, + skipInit?: boolean + ): U; + + /** + * Returns an array of model names created on this instance of Mongoose. + * Does not include names of models created using connection.model(). + */ + export function modelNames(): string[]; + + /** + * Declares a global plugin executed on all Schemas. + * Equivalent to calling .plugin(fn) on each Schema you create. + * @param fn plugin callback + * @param opts optional options + */ + export function plugin(fn: Function, opts?: any): typeof mongoose; + + /** Sets mongoose options */ + export function set(key: string, value: any): void; + + type MongooseThenable = typeof mongoose & { + /** + * Ability to use mongoose object as a pseudo-promise so .connect().then() + * and .disconnect().then() are viable. + */ + then(onFulfill?: () => void | TRes | PromiseLike, + onRejected?: (err: mongodb.MongoError) => void | TRes | PromiseLike): Promise; + + /** + * Ability to use mongoose object as a pseudo-promise so .connect().then() + * and .disconnect().then() are viable. + */ + catch(onRejected?: (err: mongodb.MongoError) => void | TRes | PromiseLike): Promise; + } + + class CastError extends Error { + /** + * The Mongoose CastError constructor + * @param type The name of the type + * @param value The value that failed to cast + * @param path The path a.b.c in the doc where this cast error occurred + * @param reason The original error that was thrown + */ + constructor(type: string, value: any, path: string, reason?: NativeError); + } + + /* + * section querystream.js + * http://mongoosejs.com/docs/api.html#querystream-js + * + * QueryStream can only be accessed using query#stream(), we only + * expose its interface here. + */ + interface QueryStream extends stream.Stream { + /** + * Provides a Node.js 0.8 style ReadStream interface for Queries. + * @event data emits a single Mongoose document + * @event error emits when an error occurs during streaming. This will emit before the close event. + * @event close emits when the stream reaches the end of the cursor or an error occurs, or the stream + * is manually destroyed. After this event, no more events are emitted. + */ + constructor(query: Query, options?: { + /** + * optional function which accepts a mongoose document. The return value + * of the function will be emitted on data. + */ + transform?: Function; + [other: string]: any; + }): QueryStream; + + /** + * Destroys the stream, closing the underlying cursor, which emits the close event. + * No more events will be emitted after the close event. + */ + destroy(err?: NativeError): void; + + /** Pauses this stream. */ + pause(): void; + /** Pipes this query stream into another stream. This method is inherited from NodeJS Streams. */ + pipe(destination: T, options?: { end?: boolean; }): T; + /** Resumes this stream. */ + resume(): void; + + /** Flag stating whether or not this stream is paused. */ + paused: boolean; + /** Flag stating whether or not this stream is readable. */ + readable: boolean; + } + + /* + * section connection.js + * http://mongoosejs.com/docs/api.html#connection-js + * + * The Connection class exposed by require('mongoose') + * is actually the driver's NativeConnection class. + * connection.js defines a base class that the native + * versions extend. See: + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-connection-js + */ + abstract class ConnectionBase extends events.EventEmitter { + /** + * For practical reasons, a Connection equals a Db. + * @param base a mongoose instance + * @event connecting Emitted when connection.{open,openSet}() is executed on this connection. + * @event connected Emitted when this connection successfully connects to the db. May be emitted multiple times in reconnected scenarios. + * @event open Emitted after we connected and onOpen is executed on all of this connections models. + * @event disconnecting Emitted when connection.close() was executed. + * @event disconnected Emitted after getting disconnected from the db. + * @event close Emitted after we disconnected and onClose executed on all of this connections models. + * @event reconnected Emitted after we connected and subsequently disconnected, followed by successfully another successfull connection. + * @event error Emitted when an error occurs on this connection. + * @event fullsetup Emitted in a replica-set scenario, when primary and at least one seconaries specified in the connection string are connected. + * @event all Emitted in a replica-set scenario, when all nodes specified in the connection string are connected. + */ + constructor(base: typeof mongoose); + + /** + * Opens the connection to MongoDB. + * @param mongodb://uri or the host to which you are connecting + * @param database database name + * @param port database port + * @param options Mongoose forces the db option forceServerObjectId false and cannot be overridden. + * Mongoose defaults the server auto_reconnect options to true which can be overridden. + * See the node-mongodb-native driver instance for options that it understands. + * Options passed take precedence over options included in connection strings. + */ + open(connection_string: string, database?: string, port?: number, + options?: ConnectionOpenOptions, callback?: (err: any) => void): any; + + /** Helper for dropDatabase() */ + dropDatabase(callback?: (err: any) => void): Promise; + + /** + * Opens the connection to a replica set. + * @param uris comma-separated mongodb:// URIs + * @param database database name if not included in uris + * @param options passed to the internal driver + */ + openSet(uris: string, database?: string, options?: ConnectionOpenSetOptions, + callback?: (err: any) => void): any; + + /** Closes the connection */ + close(callback?: (err: any) => void): Promise; + + /** + * Retrieves a collection, creating it if not cached. + * Not typically needed by applications. Just talk to your collection through your model. + * @param name name of the collection + * @param options optional collection options + */ + collection(name: string, options?: any): Collection; + + /** + * Defines or retrieves a model. + * When no collection argument is passed, Mongoose produces a collection name by passing + * the model name to the utils.toCollectionName method. This method pluralizes the name. + * If you don't like this behavior, either pass a collection name or set your schemas + * collection name option. + * @param name the model name + * @param schema a schema. necessary when defining a model + * @param collection name of mongodb collection (optional) if not given it will be induced from model name + * @returns The compiled model + */ + model(name: string, schema?: Schema, collection?: string): Model; + model>( + name: string, + schema?: Schema, + collection?: string + ): U; + + /** Returns an array of model names created on this connection. */ + modelNames(): string[]; + + /** A hash of the global options that are associated with this connection */ + config: any; + + /** The mongodb.Db instance, set when the connection is opened */ + db: mongodb.Db; + + /** A hash of the collections associated with this connection */ + collections: { [index: string]: Collection }; + + /** + * Connection ready state + * 0 = disconnected + * 1 = connected + * 2 = connecting + * 3 = disconnecting + * Each state change emits its associated event name. + */ + readyState: number; + } + + interface ConnectionOptionsBase { + /** passed to the connection db instance */ + db?: any; + /** passed to the connection server instance(s) */ + server?: any; + /** passed to the connection ReplSet instance */ + replset?: any; + /** username for authentication */ + user?: string; + /** password for authentication */ + pass?: string; + /** options for authentication (see http://mongodb.github.com/node-mongodb-native/api-generated/db.html#authenticate) */ + auth?: any; + /** Use ssl connection (needs to have a mongod server with ssl support) (default: true) */ + ssl?: boolean; + /** Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher) */ + sslValidate?: object; + /** Number of connections in the connection pool for each server instance, set to 5 as default for legacy reasons. */ + poolSize?: number; + /** Reconnect on error (default: true) */ + autoReconnect?: boolean; + /** TCP KeepAlive on the socket with a X ms delay before start (default: 0). */ + keepAlive?: number; + /** TCP Connection timeout setting (default: 0) */ + connectTimeoutMS?: number; + /** TCP Socket timeout setting (default: 0) */ + socketTimeoutMS?: number; + /** If the database authentication is dependent on another databaseName. */ + authSource?: string; + /** If you're connected to a single server or mongos proxy (as opposed to a replica set), + * the MongoDB driver will try to reconnect every reconnectInterval milliseconds for reconnectTries + * times, and give up afterward. When the driver gives up, the mongoose connection emits a + * reconnectFailed event. (default: 30) */ + reconnectTries?: number; + /** Will wait # milliseconds between retries (default: 1000) */ + reconnectInterval?: number; + /** The name of the replicaset to connect to. */ + replicaSet?: string; + /** The current value of the parameter native_parser */ + nativeParser?: boolean; + /** Auth mechanism */ + authMechanism?: any; + /** Specify a journal write concern (default: false). */ + journal?: boolean; + /** The write concern */ + w?: number|string; + /** The write concern timeout. */ + wTimeoutMS?: number; + /** The ReadPreference mode as listed here: http://mongodb.github.io/node-mongodb-native/2.1/api/ReadPreference.html */ + readPreference?: string; + /** An object representing read preference tags, see: http://mongodb.github.io/node-mongodb-native/2.1/api/ReadPreference.html */ + readPreferencetags?: object; + /** Triggers the server instance to call ismaster (default: true). */ + monitoring?: boolean; + /** The interval of calling ismaster when monitoring is enabled (default: 10000). */ + haInterval?: number; + /** Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit (default: false). */ + domainsEnabled?: boolean; + /** How long driver keeps waiting for servers to come back up (default: Number.MAX_VALUE) */ + bufferMaxEntries?: number; + + // TODO + safe?: any; + fsync?: any; + rs_name?: any; + slaveOk?: any; + authdb?: any; + } + + /** See the node-mongodb-native driver instance for options that it understands. */ + interface ConnectionOpenOptions extends ConnectionOptionsBase { + /** mongoose-specific options */ + config?: { + /** + * set to false to disable automatic index creation for all + * models associated with this connection. + */ + autoIndex?: boolean; + }; + } + + /** See the node-mongodb-native driver instance for options that it understands. */ + interface ConnectionOpenSetOptions extends ConnectionOptionsBase { + /** + * If true, enables High Availability support for mongos + * If connecting to multiple mongos servers, set the mongos option to true. + */ + mongos?: boolean; + + /** sets the underlying driver's promise library (see http://mongodb.github.io/node-mongodb-native/2.1/api/MongoClient.html) */ + promiseLibrary?: any; + + /** See http://mongoosejs.com/docs/connections.html#use-mongo-client **/ + useMongoClient?: boolean; + } + + interface ConnectionOptions extends + ConnectionOpenOptions, + ConnectionOpenSetOptions {} + + /* + * section drivers/node-mongodb-native/collection.js + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-collection-js + */ + var Collection: Collection; + interface Collection extends CollectionBase { + /** + * Collection constructor + * @param name name of the collection + * @param conn A MongooseConnection instance + * @param opts optional collection options + */ + new(name: string, conn: Connection, opts?: any): Collection; + /** Formatter for debug print args */ + $format(arg: any): string; + /** Debug print helper */ + $print(name: any, i: any, args: any[]): void; + /** Retreives information about this collections indexes. */ + getIndexes(): any; + } + + /* + * section drivers/node-mongodb-native/connection.js + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-connection-js + */ + class Connection extends ConnectionBase { + /** + * Switches to a different database using the same connection pool. + * @param name The database name + * @returns New Connection Object + */ + useDb(name: string): Connection; + + /** Expose the possible connection states. */ + static STATES: any; + } + + /* + * section error/validation.js + * http://mongoosejs.com/docs/api.html#error-validation-js + */ + class ValidationError extends Error { + /** Console.log helper */ + toString(): string; + } + + /* + * section error.js + * http://mongoosejs.com/docs/api.html#error-js + */ + class Error extends global.Error { + /** + * MongooseError constructor + * @param msg Error message + */ + constructor(msg: string); + + /** + * The default built-in validator error messages. These may be customized. + * As you might have noticed, error messages support basic templating + * {PATH} is replaced with the invalid document path + * {VALUE} is replaced with the invalid value + * {TYPE} is replaced with the validator type such as "regexp", "min", or "user defined" + * {MIN} is replaced with the declared min value for the Number.min validator + * {MAX} is replaced with the declared max value for the Number.max validator + */ + static messages: any; + + /** For backwards compatibility. Same as mongoose.Error.messages */ + static Messages: any; + } + + interface EachAsyncOptions { + /** defaults to 1 */ + parallel?: number; + } + + /* + * section querycursor.js + * http://mongoosejs.com/docs/api.html#querycursor-js + * + * Callback signatures are from: http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html#close + * QueryCursor can only be accessed by query#cursor(), we only + * expose its interface to enable type-checking. + */ + interface QueryCursor extends stream.Readable { + /** + * A QueryCursor is a concurrency primitive for processing query results + * one document at a time. A QueryCursor fulfills the Node.js streams3 API, + * in addition to several other mechanisms for loading documents from MongoDB + * one at a time. + * Unless you're an advanced user, do not instantiate this class directly. + * Use Query#cursor() instead. + * @param options query options passed to .find() + * @event cursor Emitted when the cursor is created + * @event error Emitted when an error occurred + * @event data Emitted when the stream is flowing and the next doc is ready + * @event end Emitted when the stream is exhausted + */ + constructor(query: Query, options: any): QueryCursor; + + /** Marks this cursor as closed. Will stop streaming and subsequent calls to next() will error. */ + close(callback?: (error: any, result: any) => void): Promise; + + /** + * Execute fn for every document in the cursor. If fn returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + * @param fn Function to be executed for every document in the cursor + * @param callback Executed when all docs have been processed + */ + eachAsync(fn: (doc: T) => any, callback?: (err: any) => void): Promise; + + /** + * Execute fn for every document in the cursor. If fn returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + * @param fn Function to be executed for every document in the cursor + * @param options Async options (e. g. parallel function execution) + * @param callback Executed when all docs have been processed + */ + eachAsync(fn: (doc: T) => any, options: EachAsyncOptions, callback?: (err: any) => void): Promise; + + /** + * Registers a transform function which subsequently maps documents retrieved + * via the streams interface or .next() + */ + map(fn: (doc: T) => T): this; + + /** + * Get the next document from this cursor. Will return null when there are + * no documents left. + */ + next(callback?: (err: any, doc?: T) => void): Promise; + } + + /* + * section virtualtype.js + * http://mongoosejs.com/docs/api.html#virtualtype-js + */ + class VirtualType { + /** This is what mongoose uses to define virtual attributes via Schema.prototype.virtual. */ + constructor(options: any, name: string); + /** Applies getters to value using optional scope. */ + applyGetters(value: any, scope: any): any; + /** Applies setters to value using optional scope. */ + applySetters(value: any, scope: any): any; + /** Defines a getter. */ + get(fn: Function): this; + /** Defines a setter. */ + set(fn: Function): this; + } + + /* + * section schema.js + * http://mongoosejs.com/docs/api.html#schema-js + */ + class Schema extends events.EventEmitter { + /** + * Schema constructor. + * When nesting schemas, (children in the example above), always declare + * the child schema first before passing it into its parent. + * @event init Emitted after the schema is compiled into a Model. + */ + constructor(definition?: SchemaDefinition, options?: SchemaOptions); + + /** Adds key path / schema type pairs to this schema. */ + add(obj: SchemaDefinition, prefix?: string): void; + + /** + * Iterates the schemas paths similar to Array.forEach. + * @param fn callback function + * @returns this + */ + eachPath(fn: (path: string, type: SchemaType) => void): this; + + /** + * Gets a schema option. + * @param key option name + */ + get(key: string): any; + + /** + * Defines an index (most likely compound) for this schema. + * @param options Options to pass to MongoDB driver's createIndex() function + * @param options.expires Mongoose-specific syntactic sugar, uses ms to convert + * expires option into seconds for the expireAfterSeconds in the above link. + */ + index(fields: any, options?: { + expires?: string; + [other: string]: any; + }): this; + + /** Compiles indexes from fields and schema-level indexes */ + indexes(): any[]; + + /** + * Loads an ES6 class into a schema. Maps setters + getters, static methods, and + * instance methods to schema virtuals, statics, and methods. + */ + loadClass(model: Function): this; + + /** + * Adds an instance method to documents constructed from Models compiled from this schema. + * If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as methods. + */ + method(method: string, fn: Function): this; + method(methodObj: { [name: string]: Function }): this; + + /** + * Gets/sets schema paths. + * Sets a path (if arity 2) + * Gets a path (if arity 1) + */ + path(path: string): SchemaType; + path(path: string, constructor: any): this; + + /** + * Returns the pathType of path for this schema. + * @returns whether it is a real, virtual, nested, or ad-hoc/undefined path. + */ + pathType(path: string): string; + + /** + * Registers a plugin for this schema. + * @param plugin callback + */ + plugin(plugin: (schema: Schema, options?: any) => void, opts?: any): this; + + /** + * Defines a post hook for the document + * Post hooks fire on the event emitted from document instances of Models compiled + * from this schema. + * @param method name of the method to hook + * @param fn callback + */ + post(method: string, fn: ( + error: mongodb.MongoError, doc: T, next: (err?: NativeError) => void + ) => void): this; + + post(method: string, fn: ( + doc: T, next: (err?: NativeError) => void + ) => void): this; + + /** + * Defines a pre hook for the document. + */ + pre(method: string, parallel: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): this; + pre(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): this; + + /** + * Adds a method call to the queue. + * @param name name of the document method to call later + * @param args arguments to pass to the method + */ + queue(name: string, args: any[]): this; + + /** + * Removes the given path (or [paths]). + */ + remove(path: string | string[]): void; + + /** + * @param invalidate refresh the cache + * @returns an Array of path strings that are required by this schema. + */ + requiredPaths(invalidate?: boolean): string[]; + + /** + * Sets/gets a schema option. + * @param key option name + * @param value if not passed, the current option value is returned + */ + set(key: string): any; + set(key: string, value: any): this; + + /** + * Adds static "class" methods to Models compiled from this schema. + */ + static(name: string, fn: Function): this; + static(nameObj: { [name: string]: Function }): this; + + /** Creates a virtual type with the given name. */ + virtual(name: string, options?: any): VirtualType; + + /** Returns the virtual type with the given name. */ + virtualpath(name: string): VirtualType; + + /** The allowed index types */ + static indexTypes: string[]; + + /** + * Reserved document keys. + * Keys in this object are names that are rejected in schema declarations + * b/c they conflict with mongoose functionality. Using these key name + * will throw an error. + */ + static reserved: any; + + /** Object of currently defined methods on this schema. */ + methods: any; + /** Object of currently defined statics on this schema. */ + statics: any; + /** The original object passed to the schema constructor */ + obj: any; + } + + // Hook functions: https://github.com/vkarpov15/hooks-fixed + interface HookSyncCallback { + (next: HookNextFunction, ...hookArgs:any[]): any; + } + + interface HookAsyncCallback { + (next: HookNextFunction, done: HookDoneFunction, ...hookArgs: any[]): any; + } + + interface HookErrorCallback { + (error: Error): any; + } + + interface HookNextFunction { + (error: Error): any; + (...hookArgs: any[]): any; + } + + interface HookDoneFunction { + (error: Error): any; + (...hookArgs: any[]): any; + } + + interface SchemaOptions { + /** defaults to null (which means use the connection's autoIndex option) */ + autoIndex?: boolean; + /** defaults to true */ + bufferCommands?: boolean; + /** defaults to false */ + capped?: boolean | number | { size?: number; max?: number; autoIndexId?: boolean; }; + /** no default */ + collection?: string; + /** defaults to "__t" */ + discriminatorKey?: string; + /** defaults to false. */ + emitIndexErrors?: boolean; + /** defaults to true */ + id?: boolean; + /** defaults to true */ + _id?: boolean; + /** controls document#toObject behavior when called manually - defaults to true */ + minimize?: boolean; + read?: string; + /** defaults to true. */ + safe?: boolean | { w?: number | string; wtimeout?: number; j?: boolean }; + /** defaults to null */ + shardKey?: boolean; + /** defaults to true */ + strict?: boolean; + /** no default */ + toJSON?: any; + /** no default */ + toObject?: any; + /** defaults to 'type' */ + typeKey?: string; + /** defaults to false */ + useNestedStrict?: boolean; + /** defaults to false */ + usePushEach?: boolean; + /** defaults to true */ + validateBeforeSave?: boolean; + /** defaults to "__v" */ + versionKey?: string|boolean; + /** defaults to false */ + retainKeyOrder?: boolean; + /** + * skipVersioning allows excluding paths from + * versioning (the internal revision will not be + * incremented even if these paths are updated). + */ + skipVersioning?: any; + /** + * If set timestamps, mongoose assigns createdAt + * and updatedAt fields to your schema, the type + * assigned is Date. + */ + timestamps?: any; + } + + /* + * Intellisense for Schema definitions + */ + interface SchemaDefinition { + [path: string]: SchemaTypeOpts | Schema | SchemaType; + } + + /* + * The standard options available when configuring a schema type: + * new Schema({ + * name: { + * type: String, + * required: true, + * ... + * } + * }); + * + * Note: the properties have Object as a fallback type: | Object + * because this interface does not apply to a schematype that + * does not have a type property. Ex: + * new Schema({ + * name: { + * first: String, // since name does not have a "type" property + * last: String // first and last can have any valid type + * ... + * } + * }); + * + * References: + * - http://mongoosejs.com/docs/schematypes.html + * - http://mongoosejs.com/docs/api.html#schema_Schema.Types + */ + interface SchemaTypeOpts { + /* Common Options for all schema types */ + type?: T; + + /** Sets a default value for this SchemaType. */ + default?: SchemaTypeOpts.DefaultFn | T; + + /** + * Getters allow you to transform the representation of the data as it travels + * from the raw mongodb document to the value that you see. + */ + get?: (value: T, schematype?: this) => T | any; + + /** Declares the index options for this schematype. */ + index?: SchemaTypeOpts.IndexOpts | boolean | string; + + /** + * Adds a required validator to this SchemaType. The validator gets added + * to the front of this SchemaType's validators array using unshift(). + */ + required?: SchemaTypeOpts.RequiredFn | + boolean | [boolean, string] | + string | [string, string] | + any; + + /** + * Sets default select() behavior for this path. + * Set to true if this path should always be included in the results, false + * if it should be excluded by default. This setting can be overridden at + * the query level. + */ + select?: boolean | any; + + /** + * Setters allow you to transform the data before it gets to the raw mongodb + * document and is set as a value on an actual key. + */ + set?: (value: T, schematype?: this) => T | any; + + /** Declares a sparse index. */ + sparse?: boolean | any; + + /** Declares a full text index. */ + text?: boolean | any; + + /** + * Adds validator(s) for this document path. + * Validators always receive the value to validate as their first argument + * and must return Boolean. Returning false means validation failed. + */ + validate?: RegExp | [RegExp, string] | + SchemaTypeOpts.ValidateFn | [SchemaTypeOpts.ValidateFn, string] | + SchemaTypeOpts.ValidateOpts | SchemaTypeOpts.ValidateOpts[] | + any; + + /** Declares an unique index. */ + unique?: boolean | any; + + + /* Options for specific schema types (String, Number, Date, etc.) */ + /** String only - Adds an enum validator */ + enum?: T[] | SchemaTypeOpts.EnumOpts | any; + /** String only - Adds a lowercase setter. */ + lowercase?: boolean | any; + /** String only - Sets a regexp validator. */ + match?: RegExp | [RegExp, string] | any; + /** String only - Sets a maximum length validator. */ + maxlength?: number | [number, string] | any; + /** String only - Sets a minimum length validator. */ + minlength?: number | [number, string] | any; + /** String only - Adds a trim setter. */ + trim?: boolean | any; + /** String only - Adds an uppercase setter. */ + uppercase?: boolean | any; + + /** + * Date, Number only - Sets a minimum number validator. + * Sets a minimum date validator. + */ + min?: number | [number, string] | + Date | [Date, string] | + any; + + /** + * Date, Number only - Sets a maximum number validator. + * Sets a maximum date validator. + */ + max?: number | [number, string] | + Date | [Date, string] | + any; + + /** + * Date only - Declares a TTL index (rounded to the nearest second) + * for Date types only. + */ + expires?: number | string | any; + + /** ObjectId only - Adds an auto-generated ObjectId default if turnOn is true. */ + auto?: boolean | any; + + [other: string]: any; + } + + // Interfaces specific to schema type options should be scoped in this namespace + namespace SchemaTypeOpts { + interface DefaultFn { + (...args: any[]): T; + } + + interface RequiredFn { + (required: boolean, message?: string): T; + } + + interface ValidateFn { + (obj: RegExp | Function, message?: string, type?: string): T; + } + + interface ValidateOpts { + validator?: RegExp | Function, + msg?: string, + type?: string + } + + interface EnumOpts { + values?: T[]; + message?: string; + } + + interface IndexOpts { + background?: boolean, + expires?: number | string + sparse?: boolean, + type?: string, + unique?: boolean, + } + } + + /* + * section document.js + * http://mongoosejs.com/docs/api.html#document-js + */ + interface MongooseDocument extends MongooseDocumentOptionals { } + class MongooseDocument { + /** Checks if a path is set to its default. */ + $isDefault(path?: string): boolean; + + /** + * Takes a populated field and returns it to its unpopulated state. + * If the path was not populated, this is a no-op. + */ + depopulate(path: string): void; + + /** + * Returns true if the Document stores the same data as doc. + * Documents are considered equal when they have matching _ids, unless neither document + * has an _id, in which case this function falls back to usin deepEqual(). + * @param doc a document to compare + */ + equals(doc: MongooseDocument): boolean; + + /** + * Explicitly executes population and returns a promise. + * Useful for ES2015 integration. + * @returns promise that resolves to the document when population is done + */ + execPopulate(): Promise; + + /** + * Returns the value of a path. + * @param type optionally specify a type for on-the-fly attributes + */ + get(path: string, type?: any): any; + + /** + * Initializes the document without setters or marking anything modified. + * Called internally after a document is returned from mongodb. + * @param doc document returned by mongo + * @param fn callback + */ + init(doc: MongooseDocument, fn?: () => void): this; + init(doc: MongooseDocument, opts: any, fn?: () => void): this; + + /** Helper for console.log */ + inspect(options?: any): any; + + /** + * Marks a path as invalid, causing validation to fail. + * The errorMsg argument will become the message of the ValidationError. + * The value argument (if passed) will be available through the ValidationError.value property. + * @param path the field to invalidate + * @param errorMsg the error which states the reason path was invalid + * @param value optional invalid value + * @param kind optional kind property for the error + * @returns the current ValidationError, with all currently invalidated paths + */ + invalidate(path: string, errorMsg: string | NativeError, value: any, kind?: string): ValidationError | boolean; + + /** Returns true if path was directly set and modified, else false. */ + isDirectModified(path: string): boolean; + + /** Checks if path was initialized */ + isInit(path: string): boolean; + + /** + * Returns true if this document was modified, else false. + * If path is given, checks if a path or any full path containing path as part of its path + * chain has been modified. + */ + isModified(path?: string): boolean; + + /** Checks if path was selected in the source query which initialized this document. */ + isSelected(path: string): boolean; + + /** + * Marks the path as having pending changes to write to the db. + * Very helpful when using Mixed types. + * @param path the path to mark modified + */ + markModified(path: string): void; + + /** Returns the list of paths that have been modified. */ + modifiedPaths(): string[]; + + /** + * Populates document references, executing the callback when complete. + * If you want to use promises instead, use this function with + * execPopulate() + * Population does not occur unless a callback is passed or you explicitly + * call execPopulate(). Passing the same path a second time will overwrite + * the previous path options. See Model.populate() for explaination of options. + * @param path The path to populate or an options object + * @param names The properties to fetch from the populated document + * @param callback When passed, population is invoked + */ + populate(callback: (err: any, res: this) => void): this; + populate(path: string, callback?: (err: any, res: this) => void): this; + populate(path: string, names: string, callback?: (err: any, res: this) => void): this; + populate(options: ModelPopulateOptions | ModelPopulateOptions[], callback?: (err: any, res: this) => void): this; + + /** Gets _id(s) used during population of the given path. If the path was not populated, undefined is returned. */ + populated(path: string): any; + + /** + * Sets the value of a path, or many paths. + * @param path path or object of key/vals to set + * @param val the value to set + * @param type optionally specify a type for "on-the-fly" attributes + * @param options optionally specify options that modify the behavior of the set + */ + set(path: string, val: any, options?: any): this; + set(path: string, val: any, type: any, options?: any): this; + set(value: any): this; + + /** + * The return value of this method is used in calls to JSON.stringify(doc). + * This method accepts the same options as Document#toObject. To apply the + * options to every document of your schema by default, set your schemas + * toJSON option to the same argument. + */ + toJSON(options?: DocumentToObjectOptions): any; + + /** + * Converts this document into a plain javascript object, ready for storage in MongoDB. + * Buffers are converted to instances of mongodb.Binary for proper storage. + */ + toObject(options?: DocumentToObjectOptions): any; + + /** Helper for console.log */ + toString(): string; + + /** + * Clears the modified state on the specified path. + * @param path the path to unmark modified + */ + unmarkModified(path: string): void; + + /** Sends an update command with this document _id as the query selector. */ + update(doc: any, callback?: (err: any, raw: any) => void): Query; + update(doc: any, options: ModelUpdateOptions, + callback?: (err: any, raw: any) => void): Query; + + /** + * Executes registered validation rules for this document. + * @param optional options internal options + * @param callback callback called after validation completes, passing an error if one occurred + */ + validate(callback?: (err: any) => void): Promise; + validate(optional: any, callback?: (err: any) => void): Promise; + + /** + * Executes registered validation rules (skipping asynchronous validators) for this document. + * This method is useful if you need synchronous validation. + * @param pathsToValidate only validate the given paths + * @returns MongooseError if there are errors during validation, or undefined if there is no error. + */ + validateSync(pathsToValidate?: string | string[]): Error; + + /** Hash containing current validation errors. */ + errors: any; + /** This documents _id. */ + _id: any; + /** Boolean flag specifying if the document is new. */ + isNew: boolean; + /** The documents schema. */ + schema: Schema; + } + + interface MongooseDocumentOptionals { + /** + * Virtual getter that by default returns the document's _id field cast to a string, + * or in the case of ObjectIds, its hexString. This id getter may be disabled by + * passing the option { id: false } at schema construction time. If disabled, id + * behaves like any other field on a document and can be assigned any value. + */ + id?: any; + } + + interface DocumentToObjectOptions { + /** apply all getters (path and virtual getters) */ + getters?: boolean; + /** apply virtual getters (can override getters option) */ + virtuals?: boolean; + /** remove empty objects (defaults to true) */ + minimize?: boolean; + /** + * A transform function to apply to the resulting document before returning + * @param doc The mongoose document which is being converted + * @param ret The plain object representation which has been converted + * @param options The options in use (either schema options or the options passed inline) + */ + transform?: (doc: any, ret: any, options: any) => any; + /** depopulate any populated paths, replacing them with their original refs (defaults to false) */ + depopulate?: boolean; + /** whether to include the version key (defaults to true) */ + versionKey?: boolean; + /** + * keep the order of object keys. If this is set to true, + * Object.keys(new Doc({ a: 1, b: 2}).toObject()) will + * always produce ['a', 'b'] (defaults to false) + */ + retainKeyOrder?: boolean; + } + + namespace Types { + /* + * section types/subdocument.js + * http://mongoosejs.com/docs/api.html#types-subdocument-js + */ + class Subdocument extends MongooseDocument { + /** Returns the top level document of this sub-document. */ + ownerDocument(): MongooseDocument; + + /** + * Null-out this subdoc + * @param callback optional callback for compatibility with Document.prototype.remove + */ + remove(callback?: (err: any) => void): void; + remove(options: any, callback?: (err: any) => void): void; + } + + /* + * section types/array.js + * http://mongoosejs.com/docs/api.html#types-array-js + */ + class Array extends global.Array { + /** + * Atomically shifts the array at most one time per document save(). + * Calling this mulitple times on an array before saving sends the same command as + * calling it once. This update is implemented using the MongoDB $pop method which + * enforces this restriction. + */ + $shift(): T; + + /** Alias of pull */ + remove(...args: any[]): this; + + /** + * Pops the array atomically at most one time per document save(). + * Calling this mulitple times on an array before saving sends the same command as + * calling it once. This update is implemented using the MongoDB $pop method which + * enforces this restriction. + */ + $pop(): T; + + /** + * Adds values to the array if not already present. + * @returns the values that were added + */ + addToSet(...args: any[]): T[]; + + /** + * Return the index of obj or -1 if not found. + * @param obj he item to look for + */ + indexOf(obj: any): number; + + /** Helper for console.log */ + inspect(): any; + + /** + * Marks the entire array as modified, which if saved, will store it as a $set + * operation, potentially overwritting any changes that happen between when you + * retrieved the object and when you save it. + * @returns new length of the array + */ + nonAtomicPush(...args: any[]): number; + + /** + * Wraps Array#pop with proper change tracking. + * marks the entire array as modified which will pass the entire thing to $set + * potentially overwritting any changes that happen between when you retrieved + * the object and when you save it. + */ + pop(): T; + + /** + * Pulls items from the array atomically. Equality is determined by casting + * the provided value to an embedded document and comparing using + * the Document.equals() function. + */ + pull(...args: any[]): this; + + /** + * Wraps Array#push with proper change tracking. + * @returns new length of the array + */ + push(...args: any[]): number; + + /** Sets the casted val at index i and marks the array modified. */ + set(i: number, val: any): this; + + /** + * Wraps Array#shift with proper change tracking. + * Marks the entire array as modified, which if saved, will store it as a $set operation, + * potentially overwritting any changes that happen between when you retrieved the object + * and when you save it. + */ + shift(): T; + + /** + * Wraps Array#sort with proper change tracking. + * Marks the entire array as modified, which if saved, will store it as a $set operation, + * potentially overwritting any changes that happen between when you retrieved the object + * and when you save it. + */ + // some lib.d.ts have return type "this" and others have return type "T[]" + // which causes errors. Let the inherited array provide the sort() method. + //sort(compareFn?: (a: T, b: T) => number): T[]; + + /** + * Wraps Array#splice with proper change tracking and casting. + * Marks the entire array as modified, which if saved, will store it as a $set operation, + * potentially overwritting any changes that happen between when you retrieved the object + * and when you save it. + */ + splice(...args: any[]): T[]; + + /** Returns a native js Array. */ + toObject(options?: any): T[]; + + /** + * Wraps Array#unshift with proper change tracking. + * Marks the entire array as modified, which if saved, will store it as a $set operation, + * potentially overwritting any changes that happen between when you retrieved the object + * and when you save it. + */ + unshift(...args: any[]): number; + } + + /* + * section types/documentarray.js + * http://mongoosejs.com/docs/api.html#types-documentarray-js + */ + class DocumentArray extends Types.Array { + /** + * Creates a subdocument casted to this schema. + * This is the same subdocument constructor used for casting. + * @param obj the value to cast to this arrays SubDocument schema + */ + create(obj: any): T; + + /** + * Searches array items for the first document with a matching _id. + * @returns the subdocument or null if not found. + */ + id(id: ObjectId | string | number | NativeBuffer): T; + + /** Helper for console.log */ + inspect(): T[]; + + /** + * Returns a native js Array of plain js objects + * @param options optional options to pass to each documents toObject + * method call during conversion + */ + toObject(options?: any): T[]; + } + + /* + * section types/buffer.js + * http://mongoosejs.com/docs/api.html#types-buffer-js + */ + class Buffer extends global.Buffer { + /** + * Copies the buffer. + * Buffer#copy does not mark target as modified so you must copy + * from a MongooseBuffer for it to work as expected. This is a + * work around since copy modifies the target, not this. + */ + copy(target: NativeBuffer, ...nodeBufferArgs: any[]): number; + + /** Determines if this buffer is equals to other buffer */ + equals(other: NativeBuffer): boolean; + + /** Sets the subtype option and marks the buffer modified. */ + subtype(subtype: number): void; + + /** Converts this buffer to its Binary type representation. */ + toObject(subtype?: number): mongodb.Binary; + + /** Writes the buffer. */ + write(string: string, ...nodeBufferArgs: any[]): number; + } + + /* + * section types/objectid.js + * http://mongoosejs.com/docs/api.html#types-objectid-js + */ + var ObjectId: ObjectIdConstructor; + + // mongodb.ObjectID does not allow mongoose.Types.ObjectId(id). This is + // commonly used in mongoose and is found in an example in the docs: + // http://mongoosejs.com/docs/api.html#aggregate_Aggregate + // constructor exposes static methods of mongodb.ObjectID and ObjectId(id) + type ObjectIdConstructor = typeof mongodb.ObjectID & { + (s?: string | number): mongodb.ObjectID; + }; + + // var objectId: mongoose.Types.ObjectId should reference mongodb.ObjectID not + // the ObjectIdConstructor, so we add the interface below + interface ObjectId extends mongodb.ObjectID {} + + class Decimal128 extends mongodb.Decimal128 {} + + /* + * section types/embedded.js + * http://mongoosejs.com/docs/api.html#types-embedded-js + */ + class Embedded extends MongooseDocument { + /** Helper for console.log */ + inspect(): any; + + /** + * Marks a path as invalid, causing validation to fail. + * @param path the field to invalidate + * @param err error which states the reason path was invalid + */ + invalidate(path: string, err: string | NativeError): boolean; + + /** Returns the top level document of this sub-document. */ + ownerDocument(): MongooseDocument; + /** Returns this sub-documents parent document. */ + parent(): MongooseDocument; + /** Returns this sub-documents parent array. */ + parentArray(): DocumentArray; + + /** Removes the subdocument from its parent array. */ + remove(options?: { + noop?: boolean; + }, fn?: (err: any) => void): this; + + /** + * Marks the embedded doc modified. + * @param path the path which changed + */ + markModified(path: string): void; + } + } + + /* + * section query.js + * http://mongoosejs.com/docs/api.html#query-js + * + * Query is for backwards compatibility. Example: Query.find() returns Query. + * If later in the query chain a method returns Query, we will need to know type T. + * So we save this type as the second type parameter in DocumentQuery. Since people have + * been using Query, we set it as an alias of DocumentQuery. + */ + class Query extends DocumentQuery {} + class DocumentQuery extends mquery { + /** + * Specifies a javascript function or expression to pass to MongoDBs query system. + * Only use $where when you have a condition that cannot be met using other MongoDB + * operators like $lt. Be sure to read about all of its caveats before using. + * @param js javascript string or function + */ + $where(js: string | Function): this; + + /** + * Specifies an $all query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + all(val: number): this; + all(path: string, val: number): this; + + /** + * Specifies arguments for a $and condition. + * @param array array of conditions + */ + and(array: any[]): this; + + /** Specifies the batchSize option. Cannot be used with distinct() */ + batchSize(val: number): this; + + /** + * Specifies a $box condition + * @param Upper Right Coords + */ + box(val: any): this; + box(lower: number[], upper: number[]): this; + + /** Casts this query to the schema of model, If obj is present, it is cast instead of this query.*/ + cast(model: any, obj?: any): any; + + /** + * Executes the query returning a Promise which will be + * resolved with either the doc(s) or rejected with the error. + * Like .then(), but only takes a rejection handler. + */ + catch(reject?: (err: any) => void | TRes | PromiseLike): Promise; + + /** + * DEPRECATED Alias for circle + * Specifies a $center or $centerSphere condition. + * @deprecated Use circle instead. + */ + center(area: any): this; + center(path: string, area: any): this; + + /** + * DEPRECATED Specifies a $centerSphere condition + * @deprecated Use circle instead. + */ + centerSphere(path: string, val: any): this; + centerSphere(val: any): this; + + /** Specifies a $center or $centerSphere condition. */ + circle(area: any): this; + circle(path: string, area: any): this; + + /** Adds a collation to this op (MongoDB 3.4 and up) */ + collation(value: CollationOptions): this; + + /** Specifies the comment option. Cannot be used with distinct() */ + comment(val: string): this; + + /** + * Specifying this query as a count query. Passing a callback executes the query. + * @param criteria mongodb selector + */ + count(callback?: (err: any, count: number) => void): Query; + count(criteria: any, callback?: (err: any, count: number) => void): Query; + + /** + * Returns a wrapper around a mongodb driver cursor. A QueryCursor exposes a + * Streams3-compatible interface, as well as a .next() function. + */ + cursor(options?: any): QueryCursor; + + /** Declares or executes a distict() operation. Passing a callback executes the query. */ + distinct(callback?: (err: any, res: any[]) => void): Query; + distinct(field: string, callback?: (err: any, res: any[]) => void): Query; + distinct(field: string, criteria: any | Query, + callback?: (err: any, res: any[]) => void): Query; + + /** Specifies an $elemMatch condition */ + elemMatch(criteria: (elem: Query) => void): this; + elemMatch(criteria: any): this; + elemMatch(path: string | any | Function, criteria: (elem: Query) => void): this; + elemMatch(path: string | any | Function, criteria: any): this; + + /** Specifies the complementary comparison value for paths specified with where() */ + equals(val: any): this; + + /** Executes the query */ + exec(callback?: (err: any, res: T) => void): Promise; + exec(operation: string | Function, callback?: (err: any, res: T) => void): Promise; + + /** Specifies an $exists condition */ + exists(val?: boolean): this; + exists(path: string, val?: boolean): this; + + /** + * Finds documents. When no callback is passed, the query is not executed. When the + * query is executed, the result will be an array of documents. + * @param criteria mongodb selector + */ + find(callback?: (err: any, res: DocType[]) => void): DocumentQuery; + find(criteria: any, + callback?: (err: any, res: DocType[]) => void): DocumentQuery; + + /** + * Declares the query a findOne operation. When executed, the first found document is + * passed to the callback. Passing a callback executes the query. The result of the query + * is a single document. + * @param criteria mongodb selector + * @param projection optional fields to return + */ + findOne(callback?: (err: any, res: DocType | null) => void): DocumentQuery; + findOne(criteria: any, + callback?: (err: any, res: DocType | null) => void): DocumentQuery; + + /** + * Issues a mongodb findAndModify remove command. + * Finds a matching document, removes it, passing the found document (if any) to the + * callback. Executes immediately if callback is passed. + */ + findOneAndRemove(callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; + findOneAndRemove(conditions: any, + callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; + findOneAndRemove(conditions: any, options: QueryFindOneAndRemoveOptions, + callback?: (error: any, doc: DocType | null, result: any) => void): DocumentQuery; + + /** + * Issues a mongodb findAndModify update command. + * Finds a matching document, updates it according to the update arg, passing any options, and returns + * the found document (if any) to the callback. The query executes immediately if callback is passed. + */ + findOneAndUpdate(callback?: (err: any, doc: DocType | null) => void): DocumentQuery; + findOneAndUpdate(update: any, + callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; + findOneAndUpdate(query: any | Query, update: any, + callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; + findOneAndUpdate(query: any | Query, update: any, options: QueryFindOneAndUpdateOptions, + callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; + + /** + * Specifies a $geometry condition. geometry() must come after either intersects() or within(). + * @param object Must contain a type property which is a String and a coordinates property which + * is an Array. See the examples. + */ + geometry(object: { type: string, coordinates: any[] }): this; + + /** + * Returns the current query conditions as a JSON object. + * @returns current query conditions + */ + getQuery(): any; + + /** + * Returns the current update operations as a JSON object. + * @returns current update operations + */ + getUpdate(): any; + + /** + * Specifies a $gt query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + gt(val: number): this; + gt(path: string, val: number): this; + + /** + * Specifies a $gte query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + gte(val: number): this; + gte(path: string, val: number): this; + + /** + * Sets query hints. + * @param val a hint object + */ + hint(val: any): this; + + /** + * Specifies an $in query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + in(val: any[]): this; + in(path: string, val: any[]): this; + + /** Declares an intersects query for geometry(). MUST be used after where(). */ + intersects(arg?: any): this; + + /** + * Sets the lean option. + * Documents returned from queries with the lean option enabled are plain + * javascript objects, not MongooseDocuments. They have no save method, + * getters/setters or other Mongoose magic applied. + * @param bool defaults to true + */ + lean(bool?: boolean): Query; + + /** Specifies the maximum number of documents the query will return. Cannot be used with distinct() */ + limit(val: number): this; + + /** + * Specifies a $lt query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + lt(val: number): this; + lt(path: string, val: number): this; + + /** + * Specifies a $lte query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + lte(val: number): this; + lte(path: string, val: number): this; + + /** + * Specifies a $maxDistance query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + maxDistance(val: number): this; + maxDistance(path: string, val: number): this; + + /** @deprecated Alias of maxScan */ + maxscan(val: number): this; + /** Specifies the maxScan option. Cannot be used with distinct() */ + maxScan(val: number): this; + + /** + * Merges another Query or conditions object into this one. + * When a Query is passed, conditions, field selection and options are merged. + */ + merge(source: any | Query): this; + + /** Specifies a $mod condition */ + mod(val: number[]): this; + mod(path: string, val: number[]): this; + + /** + * Specifies a $ne query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + ne(val: any): this; + ne(path: string, val: any): this; + + /** Specifies a $near or $nearSphere condition. */ + near(val: any): this; + near(path: string, val: any): this; + + /** + * DEPRECATED Specifies a $nearSphere condition + * @deprecated Use query.near() instead with the spherical option set to true. + */ + nearSphere(val: any): this; + nearSphere(path: string, val: any): this; + + /** + * Specifies a $nin query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + nin(val: any[]): this; + nin(path: string, val: any[]): this; + + /** + * Specifies arguments for a $nor condition. + * @param array array of conditions + */ + nor(array: any[]): this; + + /** + * Specifies arguments for an $or condition. + * @param array array of conditions + */ + or(array: any[]): this; + + /** Specifies a $polygon condition */ + polygon(...coordinatePairs: number[][]): this; + polygon(path: string, ...coordinatePairs: number[][]): this; + + /** + * Specifies paths which should be populated with other documents. + * Paths are populated after the query executes and a response is received. A separate + * query is then executed for each path specified for population. After a response for + * each query has also been returned, the results are passed to the callback. + * @param path either the path to populate or an object specifying all parameters + * @param select Field selection for the population query + * @param model The model you wish to use for population. If not specified, populate + * will look up the model by the name in the Schema's ref field. + * @param match Conditions for the population query + * @param options Options for the population query (sort, etc) + */ + populate(path: string | any, select?: string | any, model?: any, + match?: any, options?: any): this; + populate(options: ModelPopulateOptions | ModelPopulateOptions[]): this; + + /** + * Determines the MongoDB nodes from which to read. + * @param pref one of the listed preference options or aliases + * @tags optional tags for this query + */ + read(pref: string, tags?: any[]): this; + + /** + * Specifies a $regex query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + regex(val: RegExp): this; + regex(path: string, val: RegExp): this; + + /** + * Declare and/or execute this query as a remove() operation. + * The operation is only executed when a callback is passed. To force execution without a callback, + * you must first call remove() and then execute it by using the exec() method. + * @param criteria mongodb selector + */ + remove(callback?: (err: any) => void): Query; + remove(criteria: any | Query, callback?: (err: any) => void): Query; + + /** Specifies which document fields to include or exclude (also known as the query "projection") */ + select(arg: string | any): this; + /** Determines if field selection has been made. */ + selected(): boolean; + /** Determines if exclusive field selection has been made.*/ + selectedExclusively(): boolean; + /** Determines if inclusive field selection has been made. */ + selectedInclusively(): boolean; + /** Sets query options. */ + setOptions(options: any): this; + + /** + * Specifies a $size query condition. + * When called with one argument, the most recent path passed to where() is used. + */ + size(val: number): this; + size(path: string, val: number): this; + + /** Specifies the number of documents to skip. Cannot be used with distinct() */ + skip(val: number): this; + + /** + * DEPRECATED Sets the slaveOk option. + * @param v defaults to true + * @deprecated in MongoDB 2.2 in favor of read preferences. + */ + slaveOk(v?: boolean): this; + + /** + * Specifies a $slice projection for an array. + * @param val number/range of elements to slice + */ + slice(val: number | number[]): this; + slice(path: string, val: number | number[]): this; + + /** Specifies this query as a snapshot query. Cannot be used with distinct() */ + snapshot(v?: boolean): this; + + /** + * Sets the sort order + * If an object is passed, values allowed are asc, desc, ascending, descending, 1, and -1. + * If a string is passed, it must be a space delimited list of path names. The + * sort order of each path is ascending unless the path name is prefixed with - + * which will be treated as descending. + */ + sort(arg: string | any): this; + + /** Returns a Node.js 0.8 style read stream interface. */ + stream(options?: { transform?: Function; }): QueryStream; + + /** + * Sets the tailable option (for use with capped collections). Cannot be used with distinct() + * @param bool defaults to true + * @param opts options to set + * @param opts.numberOfRetries if cursor is exhausted, retry this many times before giving up + * @param opts.tailableRetryInterval if cursor is exhausted, wait this many milliseconds before retrying + */ + tailable(bool?: boolean, opts?: { + numberOfRetries?: number; + tailableRetryInterval?: number; + }): this; + + /** Executes this query and returns a promise */ + then(resolve?: (res: T) => void | TRes | PromiseLike, + reject?: (err: any) => void | TRes | PromiseLike): Promise; + + /** + * Converts this query to a customized, reusable query + * constructor with all arguments and options retained. + */ + toConstructor(): new(...args: any[]) => Query; + toConstructor(): new(...args: any[]) => DocumentQuery; + + /** + * Declare and/or execute this query as an update() operation. + * All paths passed that are not $atomic operations will become $set ops. + * @param doc the update command + */ + update(callback?: (err: any, affectedRows: number) => void): Query; + update(doc: any, callback?: (err: any, affectedRows: number) => void): Query; + update(criteria: any, doc: any, + callback?: (err: any, affectedRows: number) => void): Query; + update(criteria: any, doc: any, options: QueryUpdateOptions, + callback?: (err: any, affectedRows: number) => void): Query; + + /** Specifies a path for use with chaining. */ + where(path?: string | any, val?: any): this; + + /** Defines a $within or $geoWithin argument for geo-spatial queries. */ + within(val?: any): this; + within(coordinate: number[], ...coordinatePairs: number[][]): this; + + /** Flag to opt out of using $geoWithin. */ + static use$geoWithin: boolean; + } + + // https://github.com/aheckmann/mquery + // mquery currently does not have a type definition please + // replace it if one is ever created + class mquery {} + + interface QueryFindOneAndRemoveOptions { + /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ + sort?: any; + /** puts a time limit on the query - requires mongodb >= 2.6.0 */ + maxTimeMS?: number; + /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ + passRawResult?: boolean; + } + + interface QueryFindOneAndUpdateOptions extends QueryFindOneAndRemoveOptions { + /** if true, return the modified document rather than the original. defaults to false (changed in 4.0) */ + new?: boolean; + /** creates the object if it doesn't exist. defaults to false. */ + upsert?: boolean; + /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ + fields?: any | string; + /** if true, runs update validators on this command. Update validators validate the update operation against the model's schema. */ + runValidators?: boolean; + /** + * if this and upsert are true, mongoose will apply the defaults specified in the model's schema if a new document + * is created. This option only works on MongoDB >= 2.4 because it relies on MongoDB's $setOnInsert operator. + */ + setDefaultsOnInsert?: boolean; + /** + * if set to 'query' and runValidators is on, this will refer to the query in custom validator + * functions that update validation runs. Does nothing if runValidators is false. + */ + context?: string; + } + + interface QueryUpdateOptions extends ModelUpdateOptions { + /** + * if set to 'query' and runValidators is on, this will refer to the query + * in customvalidator functions that update validation runs. Does nothing + * if runValidators is false. + */ + context?: string; + } + + interface CollationOptions { + locale?: string; + caseLevel?: boolean; + caseFirst?: string; + strength?: number; + numericOrdering?: boolean; + alternate?: string; + maxVariable?: string; + backwards?: boolean; + } + + namespace Schema { + namespace Types { + /* + * section schema/array.js + * http://mongoosejs.com/docs/api.html#schema-array-js + */ + class Array extends SchemaType { + /** Array SchemaType constructor */ + constructor(key: string, cast?: SchemaType, options?: any); + + /** + * Check if the given value satisfies a required validator. The given value + * must be not null nor undefined, and have a non-zero length. + */ + checkRequired(value: T): boolean; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/string.js + * http://mongoosejs.com/docs/api.html#schema-string-js + */ + class String extends SchemaType { + /** String SchemaType constructor. */ + constructor(key: string, options?: any); + + /** Check if the given value satisfies a required validator. */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** + * Adds an enum validator + * @param args enumeration values + */ + enum(args: string | string[] | any): this; + + /** Adds a lowercase setter. */ + lowercase(): this; + + /** + * Sets a regexp validator. Any value that does not pass regExp.test(val) will fail validation. + * @param regExp regular expression to test against + * @param message optional custom error message + */ + match(regExp: RegExp, message?: string): this; + + /** + * Sets a maximum length validator. + * @param value maximum string length + * @param message optional custom error message + */ + maxlength(value: number, message?: string): this; + + /** + * Sets a minimum length validator. + * @param value minimum string length + * @param message optional custom error message + */ + minlength(value: number, message?: string): this; + + /** Adds a trim setter. The string value will be trimmed when set. */ + trim(): this; + /** Adds an uppercase setter. */ + uppercase(): this; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + + } + + /* + * section schema/documentarray.js + * http://mongoosejs.com/docs/api.html#schema-documentarray-js + */ + class DocumentArray extends Array { + /** SubdocsArray SchemaType constructor */ + constructor(key: string, schema: Schema, options?: any); + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/number.js + * http://mongoosejs.com/docs/api.html#schema-number-js + */ + class Number extends SchemaType { + /** Number SchemaType constructor. */ + constructor(key: string, options?: any); + + /** Check if the given value satisfies a required validator. */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** + * Sets a maximum number validator. + * @param maximum number + * @param message optional custom error message + */ + max(maximum: number, message?: string): this; + + /** + * Sets a minimum number validator. + * @param value minimum number + * @param message optional custom error message + */ + min(value: number, message?: string): this; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/date.js + * http://mongoosejs.com/docs/api.html#schema-date-js + */ + class Date extends SchemaType { + /** Date SchemaType constructor. */ + constructor(key: string, options?: any); + + /** + * Check if the given value satisfies a required validator. To satisfy + * a required validator, the given value must be an instance of Date. + */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** Declares a TTL index (rounded to the nearest second) for Date types only. */ + expires(when: number | string): this; + + /** + * Sets a maximum date validator. + * @param maximum date + * @param message optional custom error message + */ + max(maximum: NativeDate, message?: string): this; + + /** + * Sets a minimum date validator. + * @param value minimum date + * @param message optional custom error message + */ + min(value: NativeDate, message?: string): this; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/buffer.js + * http://mongoosejs.com/docs/api.html#schema-buffer-js + */ + class Buffer extends SchemaType { + /** Buffer SchemaType constructor */ + constructor(key: string, options?: any); + + /** + * Check if the given value satisfies a required validator. To satisfy a + * required validator, a buffer must not be null or undefined and have + * non-zero length. + */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + + } + + /* + * section schema/boolean.js + * http://mongoosejs.com/docs/api.html#schema-boolean-js + */ + class Boolean extends SchemaType { + /** Boolean SchemaType constructor. */ + constructor(path: string, options?: any); + + /** + * Check if the given value satisfies a required validator. For a + * boolean to satisfy a required validator, it must be strictly + * equal to true or to false. + */ + checkRequired(value: any): boolean; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/objectid.js + * http://mongoosejs.com/docs/api.html#schema-objectid-js + */ + class ObjectId extends SchemaType { + /** ObjectId SchemaType constructor. */ + constructor(key: string, options?: any); + + /** + * Adds an auto-generated ObjectId default if turnOn is true. + * @param turnOn auto generated ObjectId defaults + */ + auto(turnOn: boolean): this; + + /** Check if the given value satisfies a required validator. */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + /* + * section schema/decimal128.js + * http://mongoosejs.com/docs/api.html#schema-decimal128-js + */ + class Decimal128 extends SchemaType { + /** Decimal128 SchemaType constructor. */ + constructor(key: string, options?: any); + + /** Check if the given value satisfies a required validator. */ + checkRequired(value: any, doc: MongooseDocument): boolean; + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/mixed.js + * http://mongoosejs.com/docs/api.html#schema-mixed-js + */ + class Mixed extends SchemaType { + /** Mixed SchemaType constructor. */ + constructor(path: string, options?: any); + + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + } + + /* + * section schema/embedded.js + * http://mongoosejs.com/docs/api.html#schema-embedded-js + */ + class Embedded extends SchemaType { + /** Sub-schema schematype constructor */ + constructor(schema: Schema, key: string, options?: any); + } + } + } + + /* + * section aggregate.js + * http://mongoosejs.com/docs/api.html#aggregate-js + */ + class Aggregate { + /** + * Aggregate constructor used for building aggregation pipelines. + * Returned when calling Model.aggregate(). + * @param ops aggregation operator(s) or operator array + */ + constructor(ops?: any | any[], ...args: any[]); + + /** Adds a cursor flag */ + addCursorFlag(flag: string, value: boolean): this; + + /** + * Sets the allowDiskUse option for the aggregation query (ignored for < 2.6.0) + * @param value Should tell server it can use hard drive to store data during aggregation. + * @param tags optional tags for this query + */ + allowDiskUse(value: boolean, tags?: any[]): this; + + /** + * Appends new operators to this aggregate pipeline + * @param ops operator(s) to append + */ + append(...ops: any[]): this; + + /** Adds a collation. */ + collation(options: CollationOptions): this; + + /** + * Sets the cursor option option for the aggregation query (ignored for < 2.6.0). + * Note the different syntax below: .exec() returns a cursor object, and no callback + * is necessary. + * @param options set the cursor batch size + */ + cursor(options: any): this; + + // If cursor option is on, could return an object + /** Executes the aggregate pipeline on the currently bound Model. */ + exec(callback?: (err: any, result: T) => void): Promise | any; + + /** Execute the aggregation with explain */ + explain(callback?: (err: any, result: T) => void): Promise; + + /** + * Appends a new custom $group operator to this aggregate pipeline. + * @param arg $group operator contents + */ + group(arg: any): this; + + /** + * Appends a new $limit operator to this aggregate pipeline. + * @param num maximum number of records to pass to the next stage + */ + limit(num: number): this; + + /** + * Appends new custom $lookup operator(s) to this aggregate pipeline. + * @param options to $lookup as described in the above link + */ + lookup(options: any): this; + + /** + * Appends a new custom $match operator to this aggregate pipeline. + * @param arg $match operator contents + */ + match(arg: any): this; + + /** + * Binds this aggregate to a model. + * @param model the model to which the aggregate is to be bound + */ + model(model: any): this; + + /** + * Appends a new $geoNear operator to this aggregate pipeline. + * MUST be used as the first operator in the pipeline. + */ + near(parameters: any): this; + + /** + * Appends a new $project operator to this aggregate pipeline. + * Mongoose query selection syntax is also supported. + * @param arg field specification + */ + project(arg: string | any): this; + + /** + * Sets the readPreference option for the aggregation query. + * @param pref one of the listed preference options or their aliases + * @param tags optional tags for this query + */ + read(pref: string, tags?: any[]): this; + + /** + * Appends new custom $sample operator(s) to this aggregate pipeline. + * @param size number of random documents to pick + */ + sample(size: number): this; + + /** + * Appends a new $skip operator to this aggregate pipeline. + * @param num number of records to skip before next stage + */ + skip(num: number): this; + + /** + * Appends a new $sort operator to this aggregate pipeline. + * If an object is passed, values allowed are asc, desc, ascending, descending, 1, and -1. + * If a string is passed, it must be a space delimited list of path names. The sort order + * of each path is ascending unless the path name is prefixed with - which will be treated + * as descending. + */ + sort(arg: string | any): this; + + /** Provides promise for aggregate. */ + then(resolve?: (val: T) => void | TRes | PromiseLike, + reject?: (err: any) => void | TRes | PromiseLike): Promise; + + /** + * Appends new custom $unwind operator(s) to this aggregate pipeline. + * Note that the $unwind operator requires the path name to start with '$'. + * Mongoose will prepend '$' if the specified field doesn't start '$'. + * @param fields the field(s) to unwind + */ + unwind(...fields: string[]): this; + /** + * Appends new custom $unwind operator(s) to this aggregate pipeline + * new in mongodb 3.2 + */ + unwind(...opts: { path: string, includeArrayIndex?: string, preserveNullAndEmptyArrays?: boolean }[]): this; + } + + /* + * section schematype.js + * http://mongoosejs.com/docs/api.html#schematype-js + */ + class SchemaType { + /** SchemaType constructor */ + constructor(path: string, options?: any, instance?: string); + + /** + * Sets a default value for this SchemaType. + * Defaults can be either functions which return the value to use as the + * default or the literal value itself. Either way, the value will be cast + * based on its schema type before being set during document creation. + * @param val the default value + */ + default(val: any): any; + + /** Adds a getter to this schematype. */ + get(fn: Function): this; + + /** + * Declares the index options for this schematype. + * Indexes are created in the background by default. Specify background: false to override. + */ + index(options: any | boolean | string): this; + + /** + * Adds a required validator to this SchemaType. The validator gets added + * to the front of this SchemaType's validators array using unshift(). + * @param required enable/disable the validator + * @param message optional custom error message + */ + required(required: boolean, message?: string): this; + + /** Sets default select() behavior for this path. */ + select(val: boolean): this; + /** Adds a setter to this schematype. */ + set(fn: Function): this; + /** Declares a sparse index. */ + sparse(bool: boolean): this; + /** Declares a full text index. */ + text(bool: boolean): this; + /** Declares an unique index. */ + unique(bool: boolean): this; + + /** + * Adds validator(s) for this document path. + * Validators always receive the value to validate as their first argument + * and must return Boolean. Returning false means validation failed. + * @param obj validator + * @param errorMsg optional error message + * @param type optional validator type + */ + validate(obj: RegExp | Function | any, errorMsg?: string, + type?: string): this; + } + + /* + * section promise.js + * http://mongoosejs.com/docs/api.html#promise-js + */ + /** + * To assign your own promise library: + * + * 1. Typescript does not allow assigning properties of imported modules. + * To avoid compile errors use one of the options below in your code: + * + * - (mongoose).Promise = YOUR_PROMISE; + * - require('mongoose').Promise = YOUR_PROMISE; + * - import mongoose = require('mongoose'); + * mongoose.Promise = YOUR_PROMISE; + * + * 2. To assign type definitions for your promise library, you will need + * to have a .d.ts file with the following code when you compile: + * + * - import * as Q from 'q'; + * declare module 'mongoose' { + * type Promise = Q.promise; + * } + * + * - import * as Bluebird from 'bluebird'; + * declare module 'mongoose' { + * type Promise = Bluebird; + * } + * + * Uses global.Promise by default. If you would like to use mongoose default + * mpromise implementation (which is deprecated), you can omit step 1 and + * run npm install @types/mongoose-promise + */ + export var Promise: any; + export var PromiseProvider: any; + + /* + * section model.js + * http://mongoosejs.com/docs/api.html#model-js + */ + export var Model: Model; + interface Model extends NodeJS.EventEmitter, ModelProperties { + /** + * Model constructor + * Provides the interface to MongoDB collections as well as creates document instances. + * @param doc values with which to create the document + * @event error If listening to this event, it is emitted when a document + * was saved without passing a callback and an error occurred. If not + * listening, the event bubbles to the connection used to create this Model. + * @event index Emitted after Model#ensureIndexes completes. If an error + * occurred it is passed with the event. + * @event index-single-start Emitted when an individual index starts within + * Model#ensureIndexes. The fields and options being used to build the index + * are also passed with the event. + * @event index-single-done Emitted when an individual index finishes within + * Model#ensureIndexes. If an error occurred it is passed with the event. + * The fields, options, and index name are also passed. + */ + new(doc?: any): T; + + /** + * Finds a single document by its _id field. findById(id) is almost* + * equivalent to findOne({ _id: id }). findById() triggers findOne hooks. + * @param id value of _id to query by + * @param projection optional fields to return + */ + findById(id: any | string | number, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findById(id: any | string | number, projection: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findById(id: any | string | number, projection: any, options: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + + model(name: string): Model; + + /** + * Creates a Query and specifies a $where condition. + * @param argument is a javascript string or anonymous function + */ + $where(argument: string | Function): DocumentQuery; + + /** + * Performs aggregations on the models collection. + * If a callback is passed, the aggregate is executed and a Promise is returned. + * If a callback is not passed, the aggregate itself is returned. + * @param ... aggregation pipeline operator(s) or operator array + */ + aggregate(...aggregations: any[]): Aggregate; + aggregate(...aggregationsWithCallback: any[]): Promise; + + /** Counts number of matching documents in a database collection. */ + count(conditions: any, callback?: (err: any, count: number) => void): Query; + + /** + * Shortcut for saving one or more documents to the database. MyModel.create(docs) + * does new MyModel(doc).save() for every doc in docs. + * Triggers the save() hook. + */ + create(docs: any[], callback?: (err: any, res: T[]) => void): Promise; + create(...docs: any[]): Promise; + create(...docsWithCallback: any[]): Promise; + + /** + * Adds a discriminator type. + * @param name discriminator model name + * @param schema discriminator model schema + */ + discriminator(name: string, schema: Schema): Model; + + /** Creates a Query for a distinct operation. Passing a callback immediately executes the query. */ + distinct(field: string, callback?: (err: any, res: any[]) => void): Query; + distinct(field: string, conditions: any, + callback?: (err: any, res: any[]) => void): Query; + + /** + * Sends ensureIndex commands to mongo for each index declared in the schema. + * @param options internal options + * @param cb optional callback + */ + ensureIndexes(callback?: (err: any) => void): Promise; + ensureIndexes(options: any, callback?: (err: any) => void): Promise; + + /** + * Finds documents. + * @param projection optional fields to return + */ + find(callback?: (err: any, res: T[]) => void): DocumentQuery; + find(conditions: any, callback?: (err: any, res: T[]) => void): DocumentQuery; + find(conditions: any, projection?: any | null, + callback?: (err: any, res: T[]) => void): DocumentQuery; + find(conditions: any, projection?: any | null, options?: any | null, + callback?: (err: any, res: T[]) => void): DocumentQuery; + + + + /** + * Issue a mongodb findAndModify remove command by a document's _id field. + * findByIdAndRemove(id, ...) is equivalent to findOneAndRemove({ _id: id }, ...). + * Finds a matching document, removes it, passing the found document (if any) to the callback. + * Executes immediately if callback is passed, else a Query object is returned. + * @param id value of _id to query by + */ + findByIdAndRemove(): DocumentQuery; + findByIdAndRemove(id: any | number | string, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findByIdAndRemove(id: any | number | string, options: { + /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ + sort?: any; + /** sets the document fields to return */ + select?: any; + }, callback?: (err: any, res: T | null) => void): DocumentQuery; + + /** + * Issues a mongodb findAndModify update command by a document's _id field. findByIdAndUpdate(id, ...) + * is equivalent to findOneAndUpdate({ _id: id }, ...). + * @param id value of _id to query by + */ + findByIdAndUpdate(): DocumentQuery; + findByIdAndUpdate(id: any | number | string, update: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findByIdAndUpdate(id: any | number | string, update: any, + options: ModelFindByIdAndUpdateOptions, + callback?: (err: any, res: T | null) => void): DocumentQuery; + + /** + * Finds one document. + * The conditions are cast to their respective SchemaTypes before the command is sent. + * @param projection optional fields to return + */ + findOne(conditions?: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findOne(conditions: any, projection: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findOne(conditions: any, projection: any, options: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + + /** + * Issue a mongodb findAndModify remove command. + * Finds a matching document, removes it, passing the found document (if any) to the callback. + * Executes immediately if callback is passed else a Query object is returned. + */ + findOneAndRemove(): DocumentQuery; + findOneAndRemove(conditions: any, + callback?: (err: any, res: T | null) => void): DocumentQuery; + findOneAndRemove(conditions: any, options: { + /** + * if multiple docs are found by the conditions, sets the sort order to choose + * which doc to update + */ + sort?: any; + /** puts a time limit on the query - requires mongodb >= 2.6.0 */ + maxTimeMS?: number; + /** sets the document fields to return */ + select?: any; + }, callback?: (err: any, res: T | null) => void): DocumentQuery; + + /** + * Issues a mongodb findAndModify update command. + * Finds a matching document, updates it according to the update arg, passing any options, + * and returns the found document (if any) to the callback. The query executes immediately + * if callback is passed else a Query object is returned. + */ + findOneAndUpdate(): DocumentQuery; + findOneAndUpdate(conditions: any, update: any, + callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery; + findOneAndUpdate(conditions: any, update: any, + options: ModelFindOneAndUpdateOptions, + callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery; + + /** + * geoNear support for Mongoose + * @param GeoJSON point or legacy coordinate pair [x,y] to search near + * @param options for the qurery + * @param callback optional callback for the query + */ + geoNear(point: number[] | { + type: string; + coordinates: number[] + }, options: { + /** return the raw object */ + lean?: boolean; + [other: string]: any; + }, callback?: (err: any, res: T[], stats: any) => void): DocumentQuery; + + /** + * Implements $geoSearch functionality for Mongoose + * @param conditions an object that specifies the match condition (required) + * @param options for the geoSearch, some (near, maxDistance) are required + * @param callback optional callback + */ + geoSearch(conditions: any, options: { + /** x,y point to search for */ + near: number[]; + /** the maximum distance from the point near that a result can be */ + maxDistance: number; + /** The maximum number of results to return */ + limit?: number; + /** return the raw object instead of the Mongoose Model */ + lean?: boolean; + }, callback?: (err: any, res: T[]) => void): DocumentQuery; + + /** + * Shortcut for creating a new Document from existing raw data, + * pre-saved in the DB. The document returned has no paths marked + * as modified initially. + */ + hydrate(obj: any): T; + + /** + * Shortcut for validating an array of documents and inserting them into + * MongoDB if they're all valid. This function is faster than .create() + * because it only sends one operation to the server, rather than one for each + * document. + * This function does not trigger save middleware. + */ + insertMany(docs: any[], callback?: (error: any, docs: T[]) => void): Promise; + insertMany(doc: any, callback?: (error: any, doc: T) => void): Promise; + insertMany(...docsWithCallback: any[]): Promise; + + /** + * Executes a mapReduce command. + * @param o an object specifying map-reduce options + * @param callbackoptional callback + */ + mapReduce( + o: ModelMapReduceOption, + callback?: (err: any, res: any) => void + ): Promise; + + /** + * Populates document references. + * @param docs Either a single document or array of documents to populate. + * @param options A hash of key/val (path, options) used for population. + * @param callback Optional callback, executed upon completion. Receives err and the doc(s). + */ + populate(docs: any[], options: ModelPopulateOptions | ModelPopulateOptions[], + callback?: (err: any, res: T[]) => void): Promise; + populate(docs: any, options: ModelPopulateOptions | ModelPopulateOptions[], + callback?: (err: any, res: T) => void): Promise; + + /** Removes documents from the collection. */ + remove(conditions: any, callback?: (err: any) => void): Query; + deleteOne(conditions: any, callback?: (err: any) => void): Query; + deleteMany(conditions: any, callback?: (err: any) => void): Query; + + /** + * Updates documents in the database without returning them. + * All update values are cast to their appropriate SchemaTypes before being sent. + */ + update(conditions: any, doc: any, + callback?: (err: any, raw: any) => void): Query; + update(conditions: any, doc: any, options: ModelUpdateOptions, + callback?: (err: any, raw: any) => void): Query; + updateOne(conditions: any, doc: any, + callback?: (err: any, raw: any) => void): Query; + updateOne(conditions: any, doc: any, options: ModelUpdateOptions, + callback?: (err: any, raw: any) => void): Query; + updateMany(conditions: any, doc: any, + callback?: (err: any, raw: any) => void): Query; + updateMany(conditions: any, doc: any, options: ModelUpdateOptions, + callback?: (err: any, raw: any) => void): Query; + + /** Creates a Query, applies the passed conditions, and returns the Query. */ + where(path: string, val?: any): Query; + } + + interface Document extends MongooseDocument, NodeJS.EventEmitter, ModelProperties { + /** Signal that we desire an increment of this documents version. */ + increment(): this; + + /** + * Returns another Model instance. + * @param name model name + */ + model(name: string): Model; + + /** + * Removes this document from the db. + * @param fn optional callback + */ + remove(fn?: (err: any, product: this) => void): Promise; + + /** + * Saves this document. + * @param options options optional options + * @param options.safe overrides schema's safe option + * @param options.validateBeforeSave set to false to save without validating. + * @param fn optional callback + */ + save(options?: SaveOptions, fn?: (err: any, product: this, numAffected: number) => void): Promise; + save(fn?: (err: any, product: this, numAffected: number) => void): Promise; + + /** + * Version using default version key. See http://mongoosejs.com/docs/guide.html#versionKey + * If you're using another key, you will have to access it using []: doc[_myVersionKey] + */ + __v?: number; + } + + interface SaveOptions { + safe?: boolean | WriteConcern; + validateBeforeSave?: boolean; + } + + interface WriteConcern { + j?: boolean; + w?: number | 'majority' | TagSet; + wtimeout?: number; + } + + interface TagSet { + [k: string]: string; + } + + interface ModelProperties { + /** Base Mongoose instance the model uses. */ + base: typeof mongoose; + + /** + * If this is a discriminator model, baseModelName is the + * name of the base model. + */ + baseModelName: String; + + /** Collection the model uses. */ + collection: Collection; + + /** Connection the model uses. */ + db: Connection; + + /** Registered discriminators for this model. */ + discriminators: any; + + /** The name of the model */ + modelName: string; + + /** Schema the model uses. */ + schema: Schema; + } + + interface ModelFindByIdAndUpdateOptions { + /** true to return the modified document rather than the original. defaults to false */ + new?: boolean; + /** creates the object if it doesn't exist. defaults to false. */ + upsert?: boolean; + /** + * if true, runs update validators on this command. Update validators validate the + * update operation against the model's schema. + */ + runValidators?: boolean; + /** + * if this and upsert are true, mongoose will apply the defaults specified in the model's + * schema if a new document is created. This option only works on MongoDB >= 2.4 because + * it relies on MongoDB's $setOnInsert operator. + */ + setDefaultsOnInsert?: boolean; + /** if multiple docs are found by the conditions, sets the sort order to choose which doc to update */ + sort?: any; + /** sets the document fields to return */ + select?: any; + /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ + passRawResult?: boolean; + /** overwrites the schema's strict mode option for this update */ + strict?: boolean; + /** + * if true, run all setters defined on the associated model's schema for all fields + * defined in the query and the update. + */ + runSettersOnQuery?: boolean; + } + + interface ModelFindOneAndUpdateOptions extends ModelFindByIdAndUpdateOptions { + /** Field selection. Equivalent to .select(fields).findOneAndUpdate() */ + fields?: any | string; + /** puts a time limit on the query - requires mongodb >= 2.6.0 */ + maxTimeMS?: number; + /** if true, passes the raw result from the MongoDB driver as the third callback parameter */ + passRawResult?: boolean; + } + + interface ModelPopulateOptions { + /** space delimited path(s) to populate */ + path: string; + /** optional fields to select */ + select?: any; + /** optional query conditions to match */ + match?: any; + /** optional name of the model to use for population */ + model?: string; + /** optional query options like sort, limit, etc */ + options?: any; + /** deep populate */ + populate?: ModelPopulateOptions | ModelPopulateOptions[]; + } + + interface ModelUpdateOptions { + /** safe mode (defaults to value set in schema (true)) */ + safe?: boolean; + /** whether to create the doc if it doesn't match (false) */ + upsert?: boolean; + /** whether multiple documents should be updated (false) */ + multi?: boolean; + /** + * If true, runs update validators on this command. Update validators validate + * the update operation against the model's schema. + */ + runValidators?: boolean; + /** + * If this and upsert are true, mongoose will apply the defaults specified in the + * model's schema if a new document is created. This option only works on MongoDB >= 2.4 + * because it relies on MongoDB's $setOnInsert operator. + */ + setDefaultsOnInsert?: boolean; + /** overrides the strict option for this update */ + strict?: boolean; + /** disables update-only mode, allowing you to overwrite the doc (false) */ + overwrite?: boolean; + /** other options */ + [other: string]: any; + } + + interface ModelMapReduceOption { + map: Function | string; + reduce: (key: Key, vals: T[]) => Val; + /** query filter object. */ + query?: any; + /** sort input objects using this key */ + sort?: any; + /** max number of documents */ + limit?: number; + /** keep temporary data default: false */ + keeptemp?: boolean; + /** finalize function */ + finalize?: (key: Key, val: Val) => Val; + /** scope variables exposed to map/reduce/finalize during execution */ + scope?: any; + /** it is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X default: false */ + jsMode?: boolean; + /** provide statistics on job execution time. default: false */ + verbose?: boolean; + readPreference?: string; + /** sets the output target for the map reduce job. default: {inline: 1} */ + out?: { + /** the results are returned in an array */ + inline?: number; + /** + * {replace: 'collectionName'} add the results to collectionName: the + * results replace the collection + */ + replace?: string; + /** + * {reduce: 'collectionName'} add the results to collectionName: if + * dups are detected, uses the reducer / finalize functions + */ + reduce?: string; + /** + * {merge: 'collectionName'} add the results to collectionName: if + * dups exist the new docs overwrite the old + */ + merge?: string; + }; + } + + interface MapReduceResult { + _id: Key; + value: Val; + } + + /* + * section collection.js + * http://mongoosejs.com/docs/api.html#collection-js + */ + interface CollectionBase extends mongodb.Collection { + /* + * Abstract methods. Some of these are already defined on the + * mongodb.Collection interface so they've been commented out. + */ + ensureIndex(...args: any[]): any; + //find(...args: any[]): any; + findAndModify(...args: any[]): any; + //findOne(...args: any[]): any; + getIndexes(...args: any[]): any; + //insert(...args: any[]): any; + //mapReduce(...args: any[]): any; + //save(...args: any[]): any; + //update(...args: any[]): any; + + /** The collection name */ + collectionName: string; + /** The Connection instance */ + conn: Connection; + /** The collection name */ + name: string; + } +} diff --git a/types/mongoose/v4/mongoose-tests.ts b/types/mongoose/v4/mongoose-tests.ts new file mode 100644 index 0000000000..92adb61d83 --- /dev/null +++ b/types/mongoose/v4/mongoose-tests.ts @@ -0,0 +1,1651 @@ +import * as mongoose from 'mongoose'; + +// test compatibility with other libraries +import * as _ from 'lodash'; +var fs = require('fs'); + +// dummy variables +var cb = function () {}; + +/* + * Most of these tests are taken directly from the examples + * in the Mongoose API documentation. + * + * http://mongoosejs.com/docs/guide.html + * http://mongoosejs.com/docs/api.html + */ + +/* + * section index.js + * http://mongoosejs.com/docs/api.html#index-js + */ +var connectUri = 'mongodb://user:pass@localhost:port/database'; +mongoose.connect(connectUri).then(cb).catch(cb); +mongoose.connect(connectUri, { + user: 'larry', + pass: 'housan', + config: { + autoIndex: true + }, + mongos: true +}).then(cb); +mongoose.connect(connectUri, function (error) { + error.stack; +}); +var mongooseConnection: mongoose.Connection = mongoose.createConnection(); +mongoose.createConnection(connectUri).open(''); +mongoose.createConnection(connectUri, { + db: { + native_parser: true + } +}).open(''); +mongoose.createConnection('localhost', 'database', 3000).open(''); +mongoose.createConnection('localhost', 'database', 3000, { + user: 'larry', + config: { + autoIndex: false + } +}).open(''); +mongoose.disconnect(cb).then(cb); +mongoose.get('test'); +mongoose.model('Actor', new mongoose.Schema({ + name: String +}), 'collectionName', true).find({}); +mongoose.model('Actor').find({}); +mongoose.modelNames()[0].toLowerCase(); +new (new mongoose.Mongoose(9, 8, 7)).Mongoose(1, 2, 3).connect(''); +mongoose.plugin(cb, {}).connect(''); +mongoose.set('test', 'value'); +mongoose.set('debug', function(collectionName: any, methodName: any, arg1: any, arg2: any) {}); +mongoose.STATES.hasOwnProperty(''); +mongoose.connection.on('error', cb); +new mongoose.mongo.MongoError('error').stack; +mongoose.SchemaTypes.String; +mongoose.SchemaTypes.ObjectId; +mongoose.SchemaTypes.Decimal128; +mongoose.Types.ObjectId; +mongoose.Types.Decimal128; +mongoose.version.toLowerCase(); + +/* + * section querystream.js + * http://mongoosejs.com/docs/api.html#querystream-js + */ +var querystream = {}; +querystream.destroy(new Error()); +querystream.pause(); +querystream.pipe(process.stdout, {end: true}).end(); +querystream.resume(); +querystream.paused; +querystream.readable; +/* inherited properties */ +querystream.getMaxListeners(); +/* practical examples */ +var QSModel = {}; +var QSStream: mongoose.QueryStream = QSModel.find().stream(); +QSStream.on('data', function (doc: any) { + doc.save(); +}).on('error', function (err: any) { + throw err; +}).on('close', cb); +QSModel.where('created').gte(20000).stream().pipe(process.stdout); + +/* + * section collection.js + * http://mongoosejs.com/docs/api.html#collection-js + * + * section drivers/node-mongodb-native/collection.js + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-collection-js + */ +var coll1 = {}; +coll1.$format(999).toLowerCase(); +coll1.$print('name', 'i', [1, 2, 3]); +coll1.getIndexes(); +/* inherited properties */ +coll1.collectionName; +coll1.conn; +coll1.name; +coll1.ensureIndex(); +coll1.find({}); +coll1.insert({}, {}); + +var coll2 = new mongoose.Collection('', new mongoose.Connection(mongoose)); +coll2.$format(999).toLowerCase(); +/* inherited properties */ +coll2.initializeOrderedBulkOp; +coll2.indexExists; + +/* + * section connection.js + * http://mongoosejs.com/docs/api.html#connection-js + * + * section section drivers/node-mongodb-native/connection.js + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-connection-js + */ +var conn1: mongoose.Connection = mongoose.createConnection('mongodb://user:pass@localhost:port/database'); +conn1 = new mongoose.Connection(mongoose); +conn1.open('mongodb://localhost/test', 'myDb', 27017, { + replset: null, + config: { + autoIndex: false + } +}, function (err) {}).open(''); +conn1.openSet('mongodb://localhost/test', 'db', { + replset: null, + mongos: true +}, function (err) {}).then(cb).catch(cb); +conn1.close().catch(function (err) {}); +conn1.collection('name').$format(999); +conn1.model('myModel', new mongoose.Schema({}), 'myCol').find(); +interface IStatics { + staticMethod1: (a: number) => string; +} +conn1.modelNames()[0].toLowerCase(); +conn1.config.hasOwnProperty(''); +conn1.db.bufferMaxEntries; +conn1.collections['coll'].$format(999); +conn1.readyState.toFixed(); +conn1.useDb('myDb').useDb(''); +mongoose.Connection.STATES.hasOwnProperty(''); +/* inherited properties */ +conn1.on('data', cb); +conn1.addListener('close', cb); + +/* + * section error/validation.js + * http://mongoosejs.com/docs/api.html#error-validation-js + */ +var validationError = {}; +validationError.toString().toLowerCase(); +/* inherited properties */ +validationError.stack; +validationError.message; + +/* + * section error.js + * http://mongoosejs.com/docs/api.html#error-js + */ +var mongooseError: mongoose.Error = new mongoose.Error('error'); +/* inherited properties */ +mongooseError.message; +mongooseError.name; +mongooseError.stack; +/* static properties */ +mongoose.Error.messages.hasOwnProperty(''); +mongoose.Error.Messages.hasOwnProperty(''); + +/* + * section querycursor.js + * http://mongoosejs.com/docs/api.html#querycursor-js + */ +var querycursor = > {}; +querycursor.close(function (error, result) { + result.execPopulate(); +}).catch(cb); +querycursor.eachAsync(function (doc) { + doc.execPopulate(); +}, function (err) {}).catch(cb); +querycursor.next(cb).catch(cb); +/* inherited properties */ +querycursor.pause(); +querycursor.pipe(process.stdout); +/* practical example */ +var QCModel = mongoose.model('QC', new mongoose.Schema({name: String})); +QCModel.find({}).cursor({}).on('data', function (doc: any) { + doc.depopulate('name'); +}).on('error', function (error: any) { + throw error; +}).close().then(cb).catch(cb); +querycursor.map(function (doc) { + doc.foo = "bar"; + return doc; +}).on('data', function (doc: any) { + console.log(doc.foo); +}); +querycursor.map(function (doc) { + doc.foo = "bar"; + return doc; +}).next(function (error, doc) { + console.log(doc.foo); +}); + +/* + * section virtualtype.js + * http://mongoosejs.com/docs/api.html#virtualtype-js + */ +var virtualtype: mongoose.VirtualType = new mongoose.VirtualType({}, 'hello'); +virtualtype.applyGetters({}, {}); +virtualtype.applySetters({}, {}); +virtualtype.get(cb).get(cb); +virtualtype.set(cb).set(cb); + +/* + * section schema.js + * http://mongoosejs.com/docs/api.html#schema-js + */ +var schema: mongoose.Schema = new mongoose.Schema({ + name: String, + binary: Buffer, + living: Boolean, + updated: { type: Date, default: Date.now }, + age: { type: Number, min: 18, max: 65 }, + mixed: mongoose.Schema.Types.Mixed, + _someId: mongoose.Schema.Types.ObjectId, + someDecimal:mongoose.Schema.Types.Decimal128, + array: [], + ofString: [String], + ofNumber: [Number], + ofDates: [Date], + ofBuffer: [Buffer], + ofBoolean: [Boolean], + ofMixed: [mongoose.Schema.Types.Mixed], + ofObjectId: [mongoose.Schema.Types.ObjectId], + nested: { + stuff: { type: String, lowercase: true, trim: true } + } +}); +schema.add({ + mixedArray: { + type: [mongoose.Schema.Types.Mixed], + required: true + } +}, 'prefix'); +schema.eachPath(function (path, type) { + path.toLowerCase(); + type.sparse(true); +}).eachPath(cb); +schema.get('path'); +schema.index({ + name: 1, + binary: -1 +}).index({}, {}); +schema.indexes().slice(); +schema.method('name', cb).method({ + m1: cb, + m2: cb +}); +schema.path('a', mongoose.Schema.Types.Buffer).path('a'); +schema.pathType('m1').toLowerCase(); +schema.plugin(function (schema, opts) { + schema.get('path'); + if (opts) { + opts.hasOwnProperty(''); + } +}).plugin(cb, {opts: true}); + +schema +.post('save', function (error, doc, next) { + error.stack; + doc.model; + next.apply; +}) +.post('save', function (doc: mongoose.Document, next: Function) { + doc.model; + next(new Error()); +}) +.post('save', function (doc: mongoose.Document) { + doc.model; +}); +schema.queue('m1', [1, 2, 3]).queue('m2', [[]]); +schema.remove('path'); +schema.remove(['path1', 'path2', 'path3']); +schema.requiredPaths(true)[0].toLowerCase(); +schema.set('key', 999).set('key'); +schema.static('static', cb).static({ + s1: cb, + s2: cb +}); +schema.virtual('virt', {}).applyGetters({}, {}); +schema.virtualpath('path').applyGetters({}, {}); +/* static properties */ +mongoose.Schema.indexTypes[0].toLowerCase(); +mongoose.Schema.reserved.hasOwnProperty(''); +/* inherited properties */ +schema.addListener('e', cb); +/* practical examples */ +var animalSchema = new mongoose.Schema({ + name: String, + type: String +}); +animalSchema.methods.findSimilarTypes = function (cb: any) { + return this.model('Aminal').find({ type: this.type }, cb); +}; +var Animal: any = mongoose.model('Animal', animalSchema); +var dog: any = new Animal({type: 'dog'}); +dog['findSimilarTypes'](function (err: any, dogs: any) { + console.log(dogs); +}); +new mongoose.Schema({ + title: String, + author: String, + body: String, + comments: [{ body: String, date: Date }], + date: { type: Date, default: Date.now }, + hidden: Boolean, + meta: { + votes: Number, + favs: Number, + text: String + }, + meta2: { + text: mongoose.Schema.Types.Number, + select: { + type: String + } + } +}); +new mongoose.Schema({ name: { type: String, index: true }}); +new mongoose.Schema({ loc: { type: [Number], index: 'hashed' }}); +new mongoose.Schema({ loc: { type: [Number], index: '2d', sparse: true }}); +new mongoose.Schema({ loc: { type: [Number], index: { type: '2dsphere', sparse: true }}}); +new mongoose.Schema({ date: { type: Date, index: { unique: true, expires: '1d' }}}); +new mongoose.Schema({ born: { type: Date, required: '{PATH} is required!' }}); +new mongoose.Schema({ born: { type: Date, required: function() { + return this.age >= 18; +}}}); +new mongoose.Schema({ state: { type: String, enum: ['opening', 'open', 'closing', 'closed'] }}); +new mongoose.Schema({ state: { type: String, enum: { + values: ['opening', 'open', 'closing', 'closed'], + message: 'enum validator failed for path `{PATH}` with value `{VALUE}`' +}}}); +new mongoose.Schema({ name: { type: String, match: /^a/ }}); +new mongoose.Schema({ name: { type: String, match: [ + /\.html$/, "That file doesn't end in .html ({VALUE})" +]}}); +new mongoose.Schema({ + createdAt: {type: Date, expires: 60 * 60 * 24} +}); +new mongoose.Schema({ createdAt: { type: Date, expires: '1.5h' }}); +new mongoose.Schema({ d: { type: Date, max: new Date('2014-01-01') }}); +new mongoose.Schema({ d: { type: Date, max: [ + new Date('2014-01-01'), + 'The value of path `{PATH}` ({VALUE}) exceeds the limit ({MAX}).' +]}}); +new mongoose.Schema({d: {type: Date, min: [ + new Date('1970-01-01'), + 'The value of path `{PATH}` ({VALUE}) is beneath the limit ({MIN}).' +]}}); +new mongoose.Schema({ + integerOnly: { + type: Number, + get: (v: number) => Math.round(v), + set: (v: number) => Math.round(v) + } +}); +new mongoose.Schema({ name: { type: String, validate: [ + { validator: () => {return true}, msg: 'uh oh' }, + { validator: () => {return true}, msg: 'failed' } +]}}); +animalSchema.statics.findByName = function(name: any, cb: any) { + return this.find({ name: new RegExp(name, 'i') }, cb); +}; +Animal['findByName']('fido', function(err: any, animals: any) { + console.log(animals); +}); +animalSchema.virtual('name.full').get(function () { + return this.name.first + ' ' + this.name.last; +}); +var childSchema = new mongoose.Schema({ name: String }); +var parentSchema = new mongoose.Schema({ + children: [childSchema], + child: childSchema, + name: { + index: true, + required: true + } +}); +new mongoose.Schema({ + eggs: { + type: Number, + min: [6, 'Too few eggs'], + max: 12 + }, + bacon: { + type: Number, + required: [true, 'Why no bacon?'] + }, + drink: { + type: String, + enum: ['Coffee', 'Tea'] + } +}); + +(new mongoose.Schema({})).plugin(function (schema: any, options: any) { + schema.add({ lastMod: Date }) + schema.pre('save', function (next: Function) { + this.lastMod = new Date + next() + }) + if (options && options['index']) { + schema.path('lastMod').index(options['index']) + } +}, { index: true }).plugin(function (schema: any, options: any) { + schema.add({ lastMod: Date }) + schema.pre('save', function (next: Function) { + this.lastMod = new Date + next() + }) + if (options && options['index']) { + schema.path('lastMod').index(options['index']) + } +}); + +export default function(schema: mongoose.Schema) { + schema.pre('init', function(this: mongoose.Document, next: (err?: Error) => void, data: any): void { + data.name = 'Hello world'; + }); +} + +/* + * section document.js + * http://mongoosejs.com/docs/api.html#document-js + */ +var doc = {}; +doc.$isDefault('path').valueOf(); +doc.depopulate('path'); +doc.equals(doc).valueOf(); +doc.execPopulate().then(function (arg) { + arg.execPopulate(); +}).catch(function (err) {}); +doc.get('path', Number); +doc.init(doc, cb).init(doc, {}, cb); +doc.inspect(); +doc.invalidate('path', new Error('hi'), 999).toString(); +doc.isDirectModified('path').valueOf(); +doc.isInit('path').valueOf(); +doc.isModified('path').valueOf(); +doc.isSelected('path').valueOf(); +doc.markModified('path'); +doc.modifiedPaths()[0].toLowerCase(); +doc.populate(function (err, doc) { + doc.populate('path', function (err, doc) { + doc.populate({ + path: 'path', + select: 'path', + match: {} + }); + }); +}); +doc.populated('path'); +doc.set('path', 999, {}).set({ path: 999 }); +doc.toJSON({ + getters: true, + virtuals: false +}); +doc.toObject({ + transform: function (doc, ret, options) { + doc.toObject(); + } +}); +doc.toString().toLowerCase(); +doc.unmarkModified('path'); +doc.update(doc, cb).cursor(); +doc.update(doc, { + safe: true, + upsert: true +}, cb).cursor(); +doc.validate({}, function (err) {}); +doc.validate().then(null).catch(null); +doc.validateSync(['path1', 'path2']).stack; +/* practical examples */ +var MyModel = mongoose.model('test', new mongoose.Schema({ + name: { + type: String, + default: 'Val ' + } +})); +doc = new MyModel(); +doc.$isDefault('name'); +MyModel.findOne().populate('author').exec(function (err, doc) { + if (doc) { + doc.depopulate('author'); + } +}); +doc.populate('path'); +doc.populate({path: 'hello'}); +doc.populate('path', cb) +doc.populate({path: 'hello'}, cb); +doc.populate(cb); +doc.populate({path: 'hello'}).execPopulate().catch(cb); +doc.update({$inc: {wheels:1}}, { w: 1 }, cb); + +const ImageSchema = new mongoose.Schema({ + name: {type: String, required: true}, + id: {type: Number, unique: true, required: true, index: true}, +}, { id: false }); + +interface ImageDoc extends mongoose.Document { + name: string, + id: number +} + +const ImageModel = mongoose.model('image', ImageSchema); + +ImageModel.findOne({}, function(err, doc) { + if (doc) { + doc.name; + doc.id; + } +}); + +/* + * section types/subdocument.js + * http://mongoosejs.com/docs/api.html#types-subdocument-js + */ +// The constructor is private api, but we'll use it to test +var subdocument: mongoose.Types.Subdocument = new mongoose.Types.Subdocument(); +subdocument.ownerDocument().errors; +subdocument.remove({}, function (err) { + return 6; +}); +/* inherited properties */ +subdocument.execPopulate(); + +/* + * section types/array.js + * http://mongoosejs.com/docs/api.html#types-array-js + */ +var mongooseArray: mongoose.Types.Array = new mongoose.Types.Array(); +mongooseArray.$shift().toLowerCase(); +mongooseArray.remove().$shift(); +mongooseArray.$pop().toLowerCase(); +mongooseArray.addToSet('hi', 9, 9, '4')[0].toLowerCase(); +mongooseArray.indexOf({name: 'obj'}).toFixed(); +mongooseArray.inspect(); +mongooseArray.nonAtomicPush(9, 8, 'hi').toFixed(); +mongooseArray.pop().toLowerCase(); +mongooseArray.pull(5, 4, 'hi').$shift(); +mongooseArray.push([]).toFixed(); +mongooseArray.set(1, 'hi').$shift(); +mongooseArray.shift().toLowerCase(); +mongooseArray.sort(function (a, b) { + return a.length - b.length; +}).unshift(); +mongooseArray.splice(4, 1).unshift(); +mongooseArray.toObject({depopulate: true}).unshift(); +mongooseArray.unshift(2, 4, 'hi').toFixed(); +/* inherited properties */ +mongooseArray.concat(); +mongooseArray.length; +/* practical examples */ +interface MySubEntity extends mongoose.Types.Subdocument { + property1: string; + property2: string; +} +interface MyEntity extends mongoose.Document { + sub: mongoose.Types.Array +} +var myEntity = {}; +var subDocArray = _.filter(myEntity.sub, function (sd) { + sd.property1; + sd.property2.toLowerCase(); + return true; +}); + + +/* + * section types/documentarray.js + * http://mongoosejs.com/docs/api.html#types-documentarray-js + */ +// The constructor is private api, but we'll use it to test +var documentArray: mongoose.Types.DocumentArray = + new mongoose.Types.DocumentArray(); +documentArray.create({}).errors; +documentArray.id(new Buffer('hi')); +documentArray.inspect(); +documentArray.toObject({}).length; +/* inherited from mongoose.Types.Array */ +documentArray.$shift(); +/* inherited from Native Array */ +documentArray.concat(); +/* practical example */ +interface MySubEntity1 extends mongoose.Types.Subdocument { + property1: string; + property2: string; +} +interface MyEntity1 extends mongoose.Document { + sub: mongoose.Types.DocumentArray +} +var newEnt = {}; +var newSub: MySubEntity1 = newEnt.sub.create({ property1: "example", property2: "example" }); + +/* + * section types/buffer.js + * http://mongoosejs.com/docs/api.html#types-buffer-js + */ +var mongooseBuffer: mongoose.Types.Buffer = new mongoose.Types.Buffer('hello'); +mongooseBuffer.copy(mongooseBuffer, 1, 2, 3).toFixed(); +mongooseBuffer.copy(new Buffer('hi')).toFixed(); +mongooseBuffer.equals(new Buffer('hi')).valueOf(); +mongooseBuffer.subtype(123); +mongooseBuffer.toObject().value(); +mongooseBuffer.write('world', 3, 2, 1).toFixed(); +/* inherited properties */ +mongooseBuffer.compare(mongooseBuffer); +/* inherited static properties */ +mongoose.Types.Buffer.from([1, 2, 3]); + +/* + * section types/decimal128.js + * http://mongoosejs.com/docs/api.html#types-decimal128-js + */ +var decimal128: mongoose.Types.Decimal128 = mongoose.Types.Decimal128.fromString('123.45678901234567'); +decimal128 = new mongoose.Types.Decimal128(new Buffer('12345')); +/* practical examples */ +export interface ILargeValuesSchema extends mongoose.MongooseDocument { + sum: mongoose.Schema.Types.Decimal128; +} +export var LargeValuesSchema = new mongoose.Schema({ + sum: { + type: mongoose.Schema.Types.Decimal128, + required: true + } +}); + +/* + * section types/objectid.js + * http://mongoosejs.com/docs/api.html#types-objectid-js + */ +var objectId: mongoose.Types.ObjectId = mongoose.Types.ObjectId.createFromHexString('0x1234'); +objectId = new mongoose.Types.ObjectId(12345); +objectId = mongoose.Types.ObjectId(12345); +objectId.getTimestamp(); +/* practical examples */ +export interface IManagerSchema extends mongoose.MongooseDocument { + user: mongoose.Schema.Types.ObjectId; +} +export var ManagerSchema = new mongoose.Schema({ + user: { + type: mongoose.Schema.Types.ObjectId, + ref: 'User', + required: true + } +}); + +/* + * section types/embedded.js + * http://mongoosejs.com/docs/api.html#types-embedded-js + */ +var embeddedDocument: mongoose.Types.Embedded = new mongoose.Types.Embedded(); +embeddedDocument.inspect().hasOwnProperty(''); +embeddedDocument.invalidate('hi', new Error('bleh')).valueOf(); +embeddedDocument.ownerDocument().execPopulate(); +embeddedDocument.parent().execPopulate(); +embeddedDocument.parentArray().$shift(); +embeddedDocument.remove().invalidate('hi', new Error('hi')); +embeddedDocument.markModified('path'); +/* inherited properties */ +embeddedDocument.execPopulate(); + +/* + * section query.js + * http://mongoosejs.com/docs/api.html#query-js + */ +var query = > {}; +query.$where('').$where(cb); +query.all(99).all('path', 99); +query.and([{ color: 'green' }, { status: 'ok' }]).and([]); +query.batchSize(100).batchSize(100); +var lowerLeft = [40.73083, -73.99756] +var upperRight = [40.741404, -73.988135] +query.where('loc').within().box(lowerLeft, upperRight) +query.box({ ll : lowerLeft, ur : upperRight }).box({}); +var queryModel = mongoose.model('QModel') +query.cast(new queryModel(), {}).hasOwnProperty(''); +query.catch(cb).catch(cb); +query.center({}).center({}); +query.centerSphere({ center: [50, 50], radius: 10 }).centerSphere('path', {}); +query.circle({ center: [50, 50], radius: 10 }).circle('path'); +query.collation({ locale: 'en_US', strength: 1 }); +query.comment('comment').comment('comment'); +query.where({color: 'black'}).count(function (err, count) { + count.toFixed(); +}).then(function (res) { + res.toFixed(); +}).catch(function (err) {}); +query.cursor().close(); +query.distinct('field', {}, cb); +query.distinct('field', {}); +query.distinct('field', cb); +query.distinct('field'); +query.distinct(cb); +query.distinct(); +query.elemMatch('comment', { + author: 'autobot', + votes: {$gte: 5} +}).elemMatch('comment', function (elem) { + elem.where('author').equals('autobot'); + elem.where('votes').gte(5); +}); +query.where('age').equals(49); +query.exec('find', function (err, res) { + res[0].execPopulate(); +}).then(function (arg) { + arg[0].execPopulate(); +}).catch(cb); +query.where('name').exists().exists('age', false); +query.find({name: 'aa'}, function (err, res) { + res[0].execPopulate(); +}).find(); +query.findOne(function (err, res) { + res.execPopulate(); +}).findOne(); +query.findOneAndRemove({name: 'aa'}, { + passRawResult: true +}, function (err, doc) { + doc.execPopulate(); +}).findOneAndRemove(); +query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, { + +}); +query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, { + passRawResult: true +}, cb); +query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}, cb); +query.findOneAndUpdate({name: 'aa'}, {name: 'bb'}); +query.findOneAndUpdate({name: 'bb'}, cb); +query.findOneAndUpdate({name: 'bb'}); +query.findOneAndUpdate(cb); +query.findOneAndUpdate().then(function (doc) { + doc.execPopulate(); +}).catch(cb); +var polyA = [[[ 10, 20 ], [ 10, 40 ], [ 30, 40 ], [ 30, 20 ]]] +query.where('loc').within().geometry({ type: 'Polygon', coordinates: polyA }) +var polyB = [[ 0, 0 ], [ 1, 1 ]] +query.where('loc').within().geometry({ type: 'LineString', coordinates: polyB }) +var polyC = [ 0, 0 ] +query.where('loc').within().geometry({ type: 'Point', coordinates: polyC }) +query.where('loc').intersects().geometry({ type: 'Point', coordinates: polyC }) +query.getQuery(); +query.getUpdate(); +query.find().where('age').gt(21); +query.find().gt('age', 21); +query.find().where('age').gte(21); +query.find().gte('age', 21); +query.hint({ indexA: 1, indexB: -1}).hint({}); +query.in([1, 2, 3]).in('num', [1, 2, 3]); +query.where('path').intersects().geometry({ + type: 'LineString' + , coordinates: [[180.0, 11.0], [180, 9.0]] +}); +query.where('path').intersects({ + type: 'LineString' + , coordinates: [[180.0, 11.0], [180, 9.0]] +}); +query.find().lean().exec(function (err: any, docs: any) { + docs[0]; +}); +query.limit(20).limit(20); +query.find().where('age').lt(21); +query.find().lt('age', 21); +query.find().where('age').lte(21); +query.find().lte('age', 21); +query.maxDistance('path', 21).maxDistance(21); +query.maxscan(100).maxScan(100); +query.maxScan(100).maxScan(100); +query.merge(query).merge({}); +query.mod([1, 2]).mod([5, 6]); +query.find().where('age').ne(21); +query.find().ne('age', 21); +query.where('loc').near({ center: [10, 10] }); +query.where('loc').near({ center: [10, 10], maxDistance: 5 }); +query.where('loc').near({ center: [10, 10], maxDistance: 5, spherical: true }); +query.near('loc', { center: [10, 10], maxDistance: 5 }); +query.where('loc').nearSphere({ center: [10, 10], maxDistance: 5 }); +query.find().where('age').in([20, 21]); +query.find().in('age', [20, 21]); +query.nor([{ color: 'green' }, { status: 'ok' }]).nor([]); +query.or([{ color: 'red' }, { status: 'emergency' }]).or([]); +query.where('loc').within().polygon([10,20], [13, 25], [7,15]); +query.polygon('loc', [10,20], [13, 25], [7,15]); +query.findOne().populate('owner').exec(function (err, kitten) { + kitten.execPopulate(); +}); +query.find().populate({ + path: 'owner' + , select: 'name' + , match: { color: 'black' } + , options: { sort: { name: -1 }} +}).exec(function (err, kittens) { + kittens[0].execPopulate(); +}); +query.find().populate('owner', 'name', null, {sort: { name: -1 }}).exec(function (err, kittens) { + kittens[0].execPopulate(); +}); +query.read('primary', []).read('primary'); +query.regex(/re/).regex('path', /re/); +query.remove({}, cb); +query.remove({}); +query.remove(cb); +query.remove(); +query.select('a b'); +query.select('-c -d'); +query.select({ a: 1, b: 1 }); +query.select({ c: 0, d: 0 }); +query.select('+path'); +query.selected(); +query.selectedExclusively(); +query.selectedInclusively(); +query.setOptions({ + tailable: true, + batchSize: true, + lean: false +}); +query.size(0).size('age', 0); +query.skip(100).skip(100); +query.slaveOk().slaveOk(false); +query.slice('comments', 5); +query.slice('comments', -5); +query.slice('comments', [10, 5]); +query.where('comments').slice(5); +query.where('comments').slice([-10, 5]); +query.snapshot().snapshot(true); +query.sort({ field: 'asc', test: -1 }); +query.sort('field -test'); +query.stream().on('data', function (doc: any) { +}).on('error', function (err: any) { +}).on('close', function () { +}); +query.tailable().tailable(false); +query.then(cb).catch(cb); +(new (query.toConstructor())(1, 2, 3)).toConstructor(); +query.update({}, doc, { + +}, cb); +query.update({}, doc, { + +}); +query.update({}, doc, cb); +query.update({}, doc); +query.update(doc, cb); +query.update(doc); +query.update(cb); +query.update(true); +query.update(); +query.where('age').gte(21).lte(65) + .where('name', /^vonderful/i) + .where('friends').slice(10) + .exec(cb); +query.where('path').within().box({}) +query.where('path').within().circle({}) +query.where('path').within().geometry({type: 'c', coordinates: []}); +query.where('loc').within({ center: [50,50], radius: 10, unique: true, spherical: true }); +query.where('loc').within({ box: [[40.73, -73.9], [40.7, -73.988]] }); +query.where('loc').within({ polygon: [[],[],[],[]] }); +query.where('loc').within([], [], []); +query.where('loc').within([], []); +query.where('loc').within({ type: 'LineString', coordinates: [] }); +mongoose.Query.use$geoWithin = false; +/* practical example */ +query. + find({ + occupation: /host/, + 'name.last': 'Ghost', + age: { $gt: 17, $lt: 66 }, + likes: { $in: ['vaporizing', 'talking'] } + }). + limit(10). + sort({ occupation: -1 }). + select({ name: 1, occupation: 1 }). + exec(cb).then(cb).catch(cb); +query. + find({ occupation: /host/ }). + where('name.last').equals('Ghost'). + where('age').gt(17).lt(66). + where('likes').in(['vaporizing', 'talking']). + limit(10). + sort('-occupation'). + select('name occupation'). + exec(cb).then(cb).catch(cb); + +/* + * section schema/array.js + * http://mongoosejs.com/docs/api.html#schema-array-js + */ +var schemaArray: mongoose.Schema.Types.Array = new mongoose.Schema.Types.Array('key', new mongoose.SchemaType('hi'), {}); +schemaArray.checkRequired('hello').valueOf(); +/** static properties */ +mongoose.Schema.Types.Array.schemaName.toLowerCase(); +/** inherited properties */ +schemaArray.sparse(true); + +/* + * section schema/string.js + * http://mongoosejs.com/docs/api.html#schema-string-js + */ +var MongoDocument = {}; +var schemastring: mongoose.Schema.Types.String = new mongoose.Schema.Types.String('hello'); +schemastring.checkRequired(234, MongoDocument).valueOf(); +schemastring.enum(['hi', 'a', 'b']).enum('hi').enum({}); +schemastring.lowercase().lowercase(); +schemastring.match(/re/, 'error').match(/re/); +schemastring.maxlength(999, 'error').maxlength(999); +schemastring.minlength(999, 'error').minlength(999); +schemastring.trim().trim(); +schemastring.uppercase().uppercase(); +/* static properties */ +mongoose.Schema.Types.String.schemaName.toLowerCase(); +/* inherited properties */ +schemastring.sparse(true); + +/* + * section schema/documentarray.js + * http://mongoosejs.com/docs/api.html#schema-documentarray-js + */ +var documentarray: mongoose.Schema.Types.DocumentArray = new mongoose.Schema.Types.DocumentArray('key', new mongoose.Schema()); +/* static properties */ +mongoose.Schema.Types.DocumentArray.schemaName.toLowerCase(); +/* inherited properties */ +documentarray.sparse(true); + +/* + * section schema/number.js + * http://mongoosejs.com/docs/api.html#schema-number-js + */ +var schemanumber: mongoose.Schema.Types.Number = new mongoose.Schema.Types.Number('num', {}); +schemanumber.checkRequired(999, MongoDocument).valueOf(); +schemanumber.max(999, 'error').max(999); +schemanumber.min(999, 'error').min(999); +/* static properties */ +mongoose.Schema.Types.Number.schemaName.toLowerCase(); +/* inherited properties */ +schemanumber.sparse(true); + +/* + * section schema/date.js + * http://mongoosejs.com/docs/api.html#schema-date-js + */ +var schemadate: mongoose.Schema.Types.Date = new mongoose.Schema.Types.Date('99'); +schemadate.checkRequired([], MongoDocument).valueOf(); +schemadate.expires(99).expires('now'); +schemadate.max(new Date(), 'error').max(new Date('')); +schemadate.min(new Date(), 'error').min(new Date('')); +/* static properties */ +mongoose.Schema.Types.Date.schemaName.toLowerCase(); +/* inherited properties */ +schemadate.sparse(true); + +/* + * section schema/buffer.js + * http://mongoosejs.com/docs/api.html#schema-buffer-js + */ +var schemabuffer: mongoose.Schema.Types.Buffer = new mongoose.Schema.Types.Buffer('99'); +schemabuffer.checkRequired(999, MongoDocument).valueOf(); +/* static properties */ +mongoose.Schema.Types.Buffer.schemaName.toLowerCase(); +/* inherited properties */ +schemabuffer.sparse(true); + +/* + * section schema/boolean.js + * http://mongoosejs.com/docs/api.html#schema-boolean-js + */ +var schemaboolean: mongoose.Schema.Types.Boolean = new mongoose.Schema.Types.Boolean('99'); +schemaboolean.checkRequired(99).valueOf(); +/* static properties */ +mongoose.Schema.Types.Boolean.schemaName.toLowerCase(); +/* inherited properties */ +schemaboolean.sparse(true); + +/* + * section schema/objectid.js + * http://mongoosejs.com/docs/api.html#schema-objectid-js + */ +var schemaobjectid: mongoose.Schema.Types.ObjectId = new mongoose.Schema.Types.ObjectId('99'); +schemaobjectid.auto(true).auto(false); +schemaobjectid.checkRequired(99, MongoDocument).valueOf(); +/* static properties */ +mongoose.Schema.Types.ObjectId.schemaName.toLowerCase(); +/* inherited properties */ +schemaobjectid.sparse(true); + +/* + * section schema/mixed.js + * http://mongoosejs.com/docs/api.html#schema-mixed-js + */ +var schemamixed: mongoose.Schema.Types.Mixed = new mongoose.Schema.Types.Mixed('99'); +/* static properties */ +mongoose.Schema.Types.Mixed.schemaName.toLowerCase(); +/* inherited properties */ +schemamixed.sparse(true); + +/* + * section schema/embedded.js + * http://mongoosejs.com/docs/api.html#schema-embedded-js + */ +var schemaembedded: mongoose.Schema.Types.Embedded = + new mongoose.Schema.Types.Embedded(new mongoose.Schema(), '99'); +/* inherited properties */ +schemaembedded.sparse(true); + +/* + * section aggregate.js + * http://mongoosejs.com/docs/api.html#aggregate-js + */ +var aggregate: mongoose.Aggregate; +aggregate = mongoose.model('ex').aggregate({ $match: { age: { $gte: 21 }}}); +aggregate = new mongoose.Aggregate(); +aggregate = new mongoose.Aggregate({ $project: { a: 1, b: 1 } }); +aggregate = new mongoose.Aggregate({ $project: { a: 1, b: 1 } }, { $skip: 5 }); +aggregate = new mongoose.Aggregate([{ $project: { a: 1, b: 1 } }, { $skip: 5 }]); +aggregate.addCursorFlag('flag', true).addCursorFlag('', false); +aggregate.allowDiskUse(true).allowDiskUse(false, []); +aggregate.append({ $project: { field: 1 }}, { $limit: 2 }); +aggregate.append([{ $match: { daw: 'Logic Audio X' }} ]); +aggregate.collation({ locale: 'en_US', strength: 1 }); +aggregate.cursor({ batchSize: 1000 }).exec().each(cb); +aggregate.exec().then(cb).catch(cb); +aggregate.explain(cb).then(cb).catch(cb); +aggregate.group({ _id: "$department" }).group({ _id: "$department" }); +aggregate.limit(10).limit(10); +var lookupOpt = { + from: 'users', localField: + 'userId', foreignField: '_id', + as: 'users' +}; +aggregate.lookup(lookupOpt).lookup(lookupOpt); +aggregate.match({ + department: {$in: [ "sales", "engineering"]} +}); +aggregate.model(new (mongoose.model('xx'))()).model(null); +aggregate.near({ + near: [40.724, -73.997], + distanceField: "dist.calculated", + maxDistance: 0.008, + query: { type: "public" }, + includeLocs: "dist.location", + uniqueDocs: true, + num: 5 +}); +aggregate.project("a b -_id"); +aggregate.project({a: 1, b: 1, _id: 0}); +aggregate.project({ + newField: '$b.nested' + , plusTen: { $add: ['$val', 10]} + , sub: { + name: '$a' + } +}) +aggregate.project({ salary_k: { $divide: [ "$salary", 1000 ]}}); +aggregate.read('primaryPreferred').read('pp'); +aggregate.sample(3).sample(3); +aggregate.skip(10).skip(10); +aggregate.sort({ field: 'asc', test: -1 }); +aggregate.sort('field -test'); +aggregate.then(cb).catch(cb); +aggregate.unwind("tags").unwind('tags'); +aggregate.unwind("a", "b", "c").unwind('tag1', 'tag2'); +aggregate.unwind( + { + path: "tags", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }) + .unwind({ + path: "tags", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }); +aggregate.unwind( + { + path: "a", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }, { + path: "b", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }, { + path: "c", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }) + .unwind({ + path: "tag1", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }, { + path: "tag2", + includeArrayIndex: "idx", + preserveNullAndEmptyArrays: true + }); + +/* + * section schematype.js + * http://mongoosejs.com/docs/api.html#schematype-js + */ +new mongoose.SchemaType('hello', 9, 'hello' ); +var STSchema = new mongoose.Schema({ + mixed: mongoose.Schema.Types.Mixed +}); +var schematype = schema.path('mixed'); +schematype.default('default'); +STSchema.path('born').get(cb).get(cb); +STSchema.path('name').index(true).index({ unique: true, sparse: true }); +schematype.required(true, 'mess').required(true); +schematype.select(true).select(false); +STSchema.path('name').set(cb).set(cb); +schematype.sparse(true).sparse(true); +schematype.text(true).text(true); +schematype.unique(true).unique(true); +schematype.validate(/re/) + .validate({}, 'error') + .validate(cb, 'try', 'tri'); + +/* + * section promise.js + * http://mongoosejs.com/docs/api.html#promise-js + */ +var mongopromise = new mongoose.Promise(); +mongopromise = new mongoose.Promise(function (err: any, arg: any) { + arg.sparse(true); + err.stack; +}); +mongopromise = new mongoose.Promise(function (err: any, arg1: any, arg2: any) { + arg1.sparse(true); + arg2.sparse(true); + err.stack; +}); +mongopromise.addBack(function (err: any, arg: any) { + err.stack; + arg.sparse(true); +}).addBack(function (err: any, arg1: any, arg2: any) { + err.stack; + arg1.sparse(true); + arg2.sparse(true); +}); +mongopromise.addCallback(function (arg: any) { + arg.sparse(true); +}).addCallback(function (arg1: any, arg2: any) { + arg1.sparse(true); + arg2.sparse(true); +}); +mongopromise.addErrback(function (err: any) { + err.stack; +}).addErrback(function () {}); +mongopromise.catch(function (err: any) { + err.stack; +}).catch(function () {}); +mongopromise.end(); +mongopromise.error(999).error([]); +mongopromise.on('init', function () {}).on('init', function () {}); +mongopromise.reject({}).reject('').reject(new Error('hi')); +mongopromise.resolve(new Error('hi'), {}).resolve(); +mongopromise.then(function (arg: any) { + arg.sparse(true); +}, function (err: any) { + err.stack; +}).then(function (arg1: any, arg2: any) { + arg1.sparse(true); + arg2.sparse(true); +}); +mongopromise.complete(new mongoose.SchemaType('')).complete( + new mongoose.SchemaType(''), + new mongoose.SchemaType('') +); +/* static properties */ +mongoose.Promise.ES6(function (complete: Function, error: Function) { + complete.apply(this); + error.apply(this); +}); + +/* inherited properties */ +mongopromise.chain(mongopromise); +mongoose.Promise.FAILURE; +/* practical example */ +mongoose.model('') + .findOne({}) + .exec() + .then(function (arg) { + if (arg) { + arg.save; + } + return 1; + }).then(function (num) { + num.toFixed; + return new Promise((resolve, reject) => { + resolve('string'); + }); + }).then(function (str) { + str.toLowerCase + return (mongoose.model('')).findOne({}).exec(); + }).then(function (arg) { + if (arg) { + arg.save; + } + return 1; + }).catch(function (err) { + return 1; + }).then(function (arg) { + arg.toFixed; + return new Promise<{a: string, b: number}>((resolve, reject) => { + resolve({a: 'hi', b: 29}); + }); + }).then(function (arg) { + arg.a.toLowerCase; + arg.b.toFixed; + }); + +mongoose.model('').findOne({}) + .then(function (arg) { + if (arg) { + arg.save; + } + return 2; + }).then(function (num) { + num.toFixed; + return new Promise((resolve, reject) => { + resolve('str'); + }); + }).then(function (str) { + str.toLowerCase; + }); + +mongoose.model('').aggregate() + .then(function (arg) { + return 2; + }).then(function (num) { + num.toFixed; + return new Promise((resolve, reject) => { + resolve('str'); + }); + }).then(function (str) { + str.toLowerCase; + }); + +/* pluggable promise */ +(mongoose).Promise = Promise; +require('mongoose').Promise = Promise; +mongoose.Promise.race; +mongoose.Promise.all; + +mongoose.model('').findOne() + .exec().then(cb); + +/* + * section model.js + * http://mongoosejs.com/docs/api.html#model-js + */ +var MongoModel = mongoose.model('MongoModel', new mongoose.Schema({ + name: String, + type: { + type: mongoose.Schema.Types.Mixed, + required: true + } +}), 'myCollection', true); +MongoModel.find({}).$where('indexOf("val") !== -1').exec(function (err, docs) { + docs[0].save(); + docs[0].__v; +}); +MongoModel.findById(999, function (err, doc) { + var handleSave = function(err: Error, product: mongoose.Document, numAffected: number) {}; + if (!doc) { + return; + } + doc.increment(); + doc.save(handleSave).then(cb).catch(cb); + doc.save({ validateBeforeSave: false }, handleSave).then(cb).catch(cb); + doc.save({ safe: true }, handleSave).then(cb).catch(cb); + doc.save({ safe: { w: 2, j: true } }, handleSave).then(cb).catch(cb); + doc.save({ safe: { w: 'majority', wtimeout: 10000 } }, handleSave).then(cb).catch(cb); + + // test if Typescript can infer the types of (err, product, numAffected) + doc.save(function(err, product, numAffected) { product.save(); }) + .then(function(p) { p.save() }).catch(cb); + doc.save({ validateBeforeSave: false }, function(err, product, numAffected) { + product.save(); + }).then(function(p) { p.save() }).catch(cb); +}); +MongoModel = (new MongoModel()).model('MongoModel'); +var mongoModel = new MongoModel(); +mongoModel.remove(function (err, product) { + if (err) throw(err); + MongoModel.findById(product._id, function (err, product) { + if (product) { + product.id.toLowerCase(); + product.remove(); + } + }); +}); +mongoModel.save().then(function (product) { + product.save().then(cb).catch(cb); +}); +MongoModel.aggregate( + { $group: { _id: null, maxBalance: { $max: '$balance' }}} + , { $project: { _id: 0, maxBalance: 1 }} + , cb); +MongoModel.aggregate() + .group({ _id: null, maxBalance: { $max: '$balance' } }) + .exec(cb); +MongoModel.count({ type: 'jungle' }, function (err, count) { + count.toFixed(); +}); +MongoModel.create({ + type: 'jelly bean' +}, { + type: 'snickers' +}, cb).then(function (a) { + a.save(); +}) +MongoModel.create([{ type: 'jelly bean' }, { + type: 'snickers' +}], function (err, candies) { + var jellybean = candies[0]; + var snickers = candies[1]; +}).then(function (arg) { + arg[0].save(); + arg[1].save(); +}); +MongoModel.distinct('url', { clicks: {$gt: 100}}, function (err, result) { +}); +MongoModel.distinct('url').exec(cb); +MongoModel.ensureIndexes({}, cb); +MongoModel.find({ name: 'john', age: { $gte: 18 }}); +MongoModel.find({ name: 'john', age: { $gte: 18 }}, function (err, docs) { + docs[0].remove(); + docs[1].execPopulate(); +}); +MongoModel.find({ name: /john/i }, 'name friends', function (err, docs) { }) +MongoModel.find({ name: /john/i }, null, { skip: 10 }) +MongoModel.find({ name: /john/i }, null, { skip: 10 }, function (err, docs) {}); +MongoModel.find({ name: /john/i }, null, { skip: 10 }).exec(function (err, docs) {}); +MongoModel.findById(999, function (err, adventure) {}); +MongoModel.findById(999).exec(cb); +MongoModel.findById(999, 'name length', function (err, adventure) { + if (adventure) { + adventure.save(); + } +}); +MongoModel.findById(999, 'name length').exec(cb); +MongoModel.findById(999, '-length').exec(function (err, adventure) { + if (adventure) { + adventure.addListener('click', cb); + } +}); +MongoModel.findById(999, 'name', { lean: true }, function (err, doc) {}); +MongoModel.findById(999, 'name').lean().exec(function (err, doc) {}); +MongoModel.findByIdAndRemove(999, {}, cb); +MongoModel.findByIdAndRemove(999, {}); +MongoModel.findByIdAndRemove(999, cb); +MongoModel.findByIdAndRemove(999); +MongoModel.findByIdAndRemove(); +MongoModel.findByIdAndUpdate(999, {}, {}, cb); +MongoModel.findByIdAndUpdate(999, {}, {}); +MongoModel.findByIdAndUpdate(999, {}, cb); +MongoModel.findByIdAndUpdate(999, {}); +MongoModel.findByIdAndUpdate(); +MongoModel.findOne({ type: 'iphone' }, function (err, adventure) {}); +MongoModel.findOne({ type: 'iphone' }).exec(function (err, adventure) {}); +MongoModel.findOne({ type: 'iphone' }, 'name', function (err, adventure) {}); +MongoModel.findOne({ type: 'iphone' }, 'name').exec(function (err, adventure) {}); +MongoModel.findOne({ type: 'iphone' }, 'name', { lean: true }, cb); +MongoModel.findOne({ type: 'iphone' }, 'name', { lean: true }).exec(cb); +MongoModel.findOne({ type: 'iphone' }).select('name').lean().exec(cb); +interface ModelUser { + _id: any; + name: string; + abctest: string; +} +MongoModel.findOne({ type: 'iphone' }).select('name').lean().exec() +.then(function(doc: ModelUser) { + doc._id; + doc.name; + doc.abctest; +}); +MongoModel.findOneAndRemove({}, {}, cb); +MongoModel.findOneAndRemove({}, {}); +MongoModel.findOneAndRemove({}, cb); +MongoModel.findOneAndRemove({}); +MongoModel.findOneAndRemove(); +MongoModel.findOneAndUpdate({}, {}, {}, cb); +MongoModel.findOneAndUpdate({}, {}, {}); +MongoModel.findOneAndUpdate({}, {}, cb); +MongoModel.findOneAndUpdate({}, {}); +MongoModel.findOneAndUpdate(); +MongoModel.geoNear([1,3], { maxDistance : 5, spherical : true }, function(err, results, stats) { + results[0].on('data', cb); +}); +MongoModel.geoNear({ type : "Point", coordinates : [9,9] }, { + maxDistance : 5, spherical : true +}, function(err, results, stats) { + console.log(results); +}); +MongoModel.geoSearch({ type : "house" }, { + near: [10, 10], maxDistance: 5 +}, function(err, res) { + res[0].remove(); +}); +MongoModel.hydrate({ + _id: '54108337212ffb6d459f854c', + type: 'jelly bean' +}).execPopulate(); +MongoModel.insertMany([ + { name: 'Star Wars' }, + { name: 'The Empire Strikes Back' } +], function(error, docs) {}); +MongoModel.insertMany({name: 'Star Wars'}, function(error, doc) {}); +MongoModel.mapReduce({ + map: cb, + reduce: cb +}, function (err, results) { + console.log(results) +}).then(function (model) { + return model.find().where('value').gt(10).exec(); +}).then(function (docs) { + console.log(docs); +}).then(null, cb); +MongoModel.findById(999, function (err, user) { + if (!user) { + return; + } + var opts = [ + { path: 'company', match: { x: 1 }, select: 'name' } + , { path: 'notes', options: { limit: 10 }, model: 'override' } + ] + MongoModel.populate(user, opts, cb); + MongoModel.populate(user, opts, function (err, user) { + console.log(user); + }); +}); +MongoModel.find(999, function (err, users) { + var opts = [{ path: 'company', match: { x: 1 }, select: 'name' }] + var promise = MongoModel.populate(users, opts); + promise.then(console.log); +}); +MongoModel.populate({ + name: 'Indiana Jones', + weapon: 389 +}, { + path: 'weapon', + model: 'Weapon' +}, cb); +var users = [{ name: 'Indiana Jones', weapon: 389 }] +users.push({ name: 'Batman', weapon: 8921 }) +MongoModel.populate(users, { path: 'weapon' }, function (err, users) { + users.forEach(cb); +}); +MongoModel.remove({ title: 'baby born from alien father' }, cb); +MongoModel.remove({_id: '999'}).exec().then(cb).catch(cb); +MongoModel.update({ age: { $gt: 18 } }, { oldEnough: true }, cb); +MongoModel.update({ name: 'Tobi' }, { ferret: true }, { multi: true }, cb); +MongoModel.where('age').gte(21).lte(65).exec(cb); +MongoModel.where('age').gte(21).lte(65).where('name', /^b/i); +new (mongoModel.base.model(''))(); +mongoModel.baseModelName.toLowerCase(); +mongoModel.collection.$format(99); +mongoModel.collection.initializeOrderedBulkOp; +mongoModel.collection.findOne; +mongoModel.db.openSet(''); +mongoModel.discriminators; +mongoModel.modelName.toLowerCase(); +MongoModel = mongoModel.base.model('new', mongoModel.schema); +/* inherited properties */ +MongoModel.modelName; +mongoModel.modelName; +MongoModel.collection; +mongoModel.collection; +mongoModel._id; +mongoModel.execPopulate(); +mongoModel.on('data', cb); +mongoModel.addListener('event', cb); +MongoModel.findOne({ title: /timex/i }) + .populate('_creator', 'name') + .exec(function (err, story) { + if (story) { + story.execPopulate(); + } + }); +MongoModel.find({ + id: 999 +}) +.populate({ + path: 'fans', + match: { age: { $gte: 21 }}, + select: 'name -_id', + options: { limit: 5 } +}) +.exec(); +/* practical example */ +interface Location extends mongoose.Document { + name: string; + address: string; + rating: number; + facilities: string[]; + coords: number[]; + openingTimes: any[]; + reviews: any[]; +}; +const locationSchema = new mongoose.Schema({ + name: { type: String, required: true }, + address: String, + rating: { type: Number, "default": 0, min: 0, max: 5 }, + facilities: [String], + coords: { type: [Number], index: "2dsphere" }, + openingTimes: [mongoose.Schema.Types.Mixed], + reviews: [mongoose.SchemaTypes.Mixed] +}); +var LocModel = mongoose.model("Location", locationSchema); +LocModel.findById(999) + .select("-reviews -rating") + .exec(function (err, location) { + if (!location) { + return; + } + location.name = 'blah'; + location.address = 'blah'; + location.reviews.forEach(review => {}); + location.facilities.forEach(facility => { + facility.toLowerCase(); + }); + }); +LocModel.find() + .select('-reviews -rating') + .exec(function (err, locations) { + locations.forEach(location => { + location.name = 'blah'; + location.address = 'blah'; + location.reviews.forEach(review => {}); + location.facilities.forEach(facility => { + facility.toLowerCase(); + }); + }); + }); +LocModel.find({}).$where('') + .exec(function (err, locations) { + locations[0].name; + locations[1].openingTimes; + }); +LocModel.count({}) + .exec(function (err, count) { + count.toFixed(); + }); +LocModel.distinct('') + .select('-review') + .exec(function (err, distinct) { + distinct.concat; + }) + .then(cb).catch(cb); +LocModel.findByIdAndRemove() + .exec(function (err, doc) { + if (!doc) { + return; + } + doc.addListener; + doc.openingTimes; + }); +LocModel.findByIdAndUpdate() + .select({}) + .exec(function (err, location) { + if (location) { + location.reviews; + } + }); +LocModel.findOne({}, function (err, doc) { + if (doc) { + doc.openingTimes; + } +}); +LocModel.findOneAndRemove() + .exec(function (err, location) { + if (location) { + location.name; + } + }); +LocModel.findOneAndUpdate().exec().then(function (arg) { + if (arg) { + arg.openingTimes; + } +}); +LocModel.geoSearch({}, { + near: [1, 2], + maxDistance: 22 +}, function (err, res) { res[0].openingTimes; }); +interface IStatics { + staticMethod2: (a: number) => string; +} +interface MyDocument extends mongoose.Document { + prop: string; + method: () => void; +} +interface MyModel extends mongoose.Model { + staticProp: string; + staticMethod: () => void; +} +interface ModelStruct { + doc: MyDocument; + model: MyModel; + method1: (callback: (model: MyModel, doc: MyDocument) => void) => MyModel; +} +var modelStruct1 = {}; +var myModel1: MyModel; +var myDocument1: MyDocument; +modelStruct1.method1(function (myModel1, myDocument1) { + myModel1.staticProp; + myModel1.staticMethod(); + myDocument1.prop; + myDocument1.method(); +}).staticProp.toLowerCase(); +var mySchema = new mongoose.Schema({}); +export var Final: MyModel = mongoose.connection.model('Final', mySchema); +Final.findOne(function (err: any, doc: MyDocument) { + doc.save(); + doc.remove(); + doc.model(''); +}); +export var Final2: MyModel = mongoose.model('Final2', mySchema); +Final2.staticMethod(); +Final2.staticProp; +var final2 = new Final2(); +final2.prop; +final2.method;interface ibase extends mongoose.Document { + username: string; +} +interface extended extends ibase { + email: string; +} +const base: mongoose.Model = mongoose.model('testfour') +const extended: mongoose.Model = base.discriminator('extendedS', schema); +const x = new extended({ + username: 'hi', // required in baseSchema + email: 'beddiw', // required in extededSchema +}); diff --git a/types/mongoose/v4/tsconfig.json b/types/mongoose/v4/tsconfig.json new file mode 100644 index 0000000000..f2e0b541c8 --- /dev/null +++ b/types/mongoose/v4/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": false, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "mongoose": [ + "mongoose/v4" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "mongoose-tests.ts" + ] +} \ No newline at end of file diff --git a/types/yfiles/tslint.json b/types/mongoose/v4/tslint.json similarity index 100% rename from types/yfiles/tslint.json rename to types/mongoose/v4/tslint.json diff --git a/types/moo/tsconfig.json b/types/moo/tsconfig.json index e2659ef342..2203d94341 100644 --- a/types/moo/tsconfig.json +++ b/types/moo/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moonjs/tsconfig.json b/types/moonjs/tsconfig.json index b66e636445..f26c03118b 100644 --- a/types/moonjs/tsconfig.json +++ b/types/moonjs/tsconfig.json @@ -20,6 +20,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/morgan/tsconfig.json b/types/morgan/tsconfig.json index 87ca0a6d5d..40d97bcb99 100644 --- a/types/morgan/tsconfig.json +++ b/types/morgan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/morris.js/tsconfig.json b/types/morris.js/tsconfig.json index 10aa9f3c2d..4be75cfd20 100644 --- a/types/morris.js/tsconfig.json +++ b/types/morris.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mousetrap/tsconfig.json b/types/mousetrap/tsconfig.json index ade8c0d47d..7cf51a0ec3 100644 --- a/types/mousetrap/tsconfig.json +++ b/types/mousetrap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/move-concurrently/tsconfig.json b/types/move-concurrently/tsconfig.json index a0e00356c8..d9ccd40b52 100644 --- a/types/move-concurrently/tsconfig.json +++ b/types/move-concurrently/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moviedb/tsconfig.json b/types/moviedb/tsconfig.json index 5b182007ca..9cd2ba13e8 100644 --- a/types/moviedb/tsconfig.json +++ b/types/moviedb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/moxios/tsconfig.json b/types/moxios/tsconfig.json index a0224c335f..000e8feeb0 100644 --- a/types/moxios/tsconfig.json +++ b/types/moxios/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mozilla-readability/mozilla-readability-tests.ts b/types/mozilla-readability/mozilla-readability-tests.ts index bcb17f4bf5..e5431dd14e 100644 --- a/types/mozilla-readability/mozilla-readability-tests.ts +++ b/types/mozilla-readability/mozilla-readability-tests.ts @@ -1,4 +1,4 @@ -import * as Readability from 'mozilla-readability'; +import Readability = require('mozilla-readability'); import { JSDOM } from 'jsdom'; // Compiling requires `--noImplicitUseStrict` diff --git a/types/mozilla-readability/tsconfig.json b/types/mozilla-readability/tsconfig.json index 007aac8b63..07af9472c3 100644 --- a/types/mozilla-readability/tsconfig.json +++ b/types/mozilla-readability/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mozilla-readability-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/mpromise/tsconfig.json b/types/mpromise/tsconfig.json index 6f5f9d6abc..e76a3809d8 100644 --- a/types/mpromise/tsconfig.json +++ b/types/mpromise/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mri/tsconfig.json b/types/mri/tsconfig.json index 9218819c6b..60f8ce3044 100644 --- a/types/mri/tsconfig.json +++ b/types/mri/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ms/tsconfig.json b/types/ms/tsconfig.json index aaaa9f14e8..080a128095 100644 --- a/types/ms/tsconfig.json +++ b/types/ms/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/msgpack-lite/tsconfig.json b/types/msgpack-lite/tsconfig.json index 014ff12483..73b2be7f36 100644 --- a/types/msgpack-lite/tsconfig.json +++ b/types/msgpack-lite/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/msgpack/tsconfig.json b/types/msgpack/tsconfig.json index b004630b6c..be68498cc9 100644 --- a/types/msgpack/tsconfig.json +++ b/types/msgpack/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/msgpack5/msgpack5-tests.ts b/types/msgpack5/msgpack5-tests.ts index 6cd9854992..d8a2829302 100644 --- a/types/msgpack5/msgpack5-tests.ts +++ b/types/msgpack5/msgpack5-tests.ts @@ -1,9 +1,9 @@ -import * as msgpack from 'msgpack5'; +import msgpack = require('msgpack5'); // msgpack() let packer = msgpack(); packer = msgpack({ forceFloat64: true }); -packer = msgpack({ compatibilityMode: true }); +packer = msgpack({ compatibilityMode: true }); class InputType { number: number; diff --git a/types/msgpack5/tsconfig.json b/types/msgpack5/tsconfig.json index f58f4a8a94..73f103564f 100644 --- a/types/msgpack5/tsconfig.json +++ b/types/msgpack5/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/msnodesql/tsconfig.json b/types/msnodesql/tsconfig.json index 8eb58e9531..5768b83caa 100644 --- a/types/msnodesql/tsconfig.json +++ b/types/msnodesql/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/msportalfx-test/tsconfig.json b/types/msportalfx-test/tsconfig.json index 4df355d685..043b903835 100644 --- a/types/msportalfx-test/tsconfig.json +++ b/types/msportalfx-test/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mssql/index.d.ts b/types/mssql/index.d.ts index a551d15ba8..272abb5e39 100644 --- a/types/mssql/index.d.ts +++ b/types/mssql/index.d.ts @@ -251,6 +251,7 @@ export declare class Request extends events.EventEmitter { public parameters: IRequestParameters; public verbose: boolean; public canceled: boolean; + public multiple: boolean; public stream: any; public constructor(connection?: ConnectionPool); public constructor(transaction: Transaction); diff --git a/types/mssql/tsconfig.json b/types/mssql/tsconfig.json index 51f03fd652..ee8e17a585 100644 --- a/types/mssql/tsconfig.json +++ b/types/mssql/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mu2/tsconfig.json b/types/mu2/tsconfig.json index 3e01589707..929e73f45b 100644 --- a/types/mu2/tsconfig.json +++ b/types/mu2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multer-gridfs-storage/multer-gridfs-storage-tests.ts b/types/multer-gridfs-storage/multer-gridfs-storage-tests.ts index 61114fa349..d34eaeeae6 100644 --- a/types/multer-gridfs-storage/multer-gridfs-storage-tests.ts +++ b/types/multer-gridfs-storage/multer-gridfs-storage-tests.ts @@ -1,4 +1,4 @@ -import * as MulterGridfsStorage from 'multer-gridfs-storage'; +import MulterGridfsStorage = require('multer-gridfs-storage'); import { Db, MongoClient, Server } from "mongodb"; // Exported interfaces diff --git a/types/multer-gridfs-storage/tsconfig.json b/types/multer-gridfs-storage/tsconfig.json index 1daa734d97..3644f79add 100644 --- a/types/multer-gridfs-storage/tsconfig.json +++ b/types/multer-gridfs-storage/tsconfig.json @@ -19,7 +19,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multer-gridfs-storage/v1/multer-gridfs-storage-tests.ts b/types/multer-gridfs-storage/v1/multer-gridfs-storage-tests.ts index 73522eebca..3578089b92 100644 --- a/types/multer-gridfs-storage/v1/multer-gridfs-storage-tests.ts +++ b/types/multer-gridfs-storage/v1/multer-gridfs-storage-tests.ts @@ -1,4 +1,4 @@ -import * as MulterGridfsStorage from 'multer-gridfs-storage'; +import MulterGridfsStorage = require('multer-gridfs-storage'); import { Grid } from "gridfs-stream"; // Exported interfaces diff --git a/types/multer-gridfs-storage/v1/tsconfig.json b/types/multer-gridfs-storage/v1/tsconfig.json index 8fb06dfd29..00e1091a16 100644 --- a/types/multer-gridfs-storage/v1/tsconfig.json +++ b/types/multer-gridfs-storage/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multer-s3/tsconfig.json b/types/multer-s3/tsconfig.json index 812fd71b21..807cd374a5 100644 --- a/types/multer-s3/tsconfig.json +++ b/types/multer-s3/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multer/multer-tests.ts b/types/multer/multer-tests.ts index 029f5fa0f4..6346b5f7dc 100644 --- a/types/multer/multer-tests.ts +++ b/types/multer/multer-tests.ts @@ -1,5 +1,5 @@ -import * as express from 'express'; -import * as multer from 'multer'; +import express = require('express'); +import multer = require('multer'); const upload = multer({ dest: 'uploads/', diff --git a/types/multer/tsconfig.json b/types/multer/tsconfig.json index 33a047e9dd..b62fe04125 100644 --- a/types/multer/tsconfig.json +++ b/types/multer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multi-typeof/tsconfig.json b/types/multi-typeof/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/multi-typeof/tsconfig.json +++ b/types/multi-typeof/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/multimatch/tsconfig.json b/types/multimatch/tsconfig.json index c7ee9e6f63..98647c67da 100644 --- a/types/multimatch/tsconfig.json +++ b/types/multimatch/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multiparty/tsconfig.json b/types/multiparty/tsconfig.json index 0adadcf9a3..2f73f00ca7 100644 --- a/types/multiparty/tsconfig.json +++ b/types/multiparty/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multiplexjs/tsconfig.json b/types/multiplexjs/tsconfig.json index bad1ec3652..94e2a89169 100644 --- a/types/multiplexjs/tsconfig.json +++ b/types/multiplexjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/multisort/tsconfig.json b/types/multisort/tsconfig.json index d2d76512ef..2602e31746 100644 --- a/types/multisort/tsconfig.json +++ b/types/multisort/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "multisort-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/multistream/tsconfig.json b/types/multistream/tsconfig.json index 3fa5cc7c47..cb9258d5c6 100644 --- a/types/multistream/tsconfig.json +++ b/types/multistream/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "multistream-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/murmurhash-js/tsconfig.json b/types/murmurhash-js/tsconfig.json index bcebcbf18e..290fd09fe3 100644 --- a/types/murmurhash-js/tsconfig.json +++ b/types/murmurhash-js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/murmurhash3js/tsconfig.json b/types/murmurhash3js/tsconfig.json index 3f3a3a6fe3..109bec1b1b 100644 --- a/types/murmurhash3js/tsconfig.json +++ b/types/murmurhash3js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/musicmetadata/musicmetadata-tests.ts b/types/musicmetadata/musicmetadata-tests.ts index 421aec3bc5..c2e70116fb 100644 --- a/types/musicmetadata/musicmetadata-tests.ts +++ b/types/musicmetadata/musicmetadata-tests.ts @@ -1,5 +1,5 @@ import * as fs from "fs"; -import * as mm from "musicmetadata"; +import mm = require("musicmetadata"); mm(fs.createReadStream("hype-train.mp3"), (err: Error, metadata: MM.Metadata) => { if (err) throw err; diff --git a/types/musicmetadata/tsconfig.json b/types/musicmetadata/tsconfig.json index da6158b218..55d870abf7 100644 --- a/types/musicmetadata/tsconfig.json +++ b/types/musicmetadata/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mustache/tsconfig.json b/types/mustache/tsconfig.json index dd50c6f999..c1bde7af8b 100644 --- a/types/mustache/tsconfig.json +++ b/types/mustache/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/mv/tsconfig.json b/types/mv/tsconfig.json index fc51bf757d..2ce04b2cfa 100644 --- a/types/mv/tsconfig.json +++ b/types/mv/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/mysql/tsconfig.json b/types/mysql/tsconfig.json index 1249bcd757..d2a4788d7c 100644 --- a/types/mysql/tsconfig.json +++ b/types/mysql/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "mysql-tests.ts" ] -} +} \ No newline at end of file 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/mz/tsconfig.json b/types/mz/tsconfig.json index f6a2ef5871..bdfa029d8b 100644 --- a/types/mz/tsconfig.json +++ b/types/mz/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "fs.d.ts", diff --git a/types/n3/tsconfig.json b/types/n3/tsconfig.json index 4ba121903d..c7ec1df12b 100644 --- a/types/n3/tsconfig.json +++ b/types/n3/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nano/nano-tests.ts b/types/nano/nano-tests.ts index 4f13e90f43..0556f2b8fe 100644 --- a/types/nano/nano-tests.ts +++ b/types/nano/nano-tests.ts @@ -1,5 +1,5 @@ import * as fs from "fs"; -import * as nano from "nano"; +import nano = require("nano"); /* * Instantiate with configuration object diff --git a/types/nano/tsconfig.json b/types/nano/tsconfig.json index 7586d0b0bf..f0d7a6a4a2 100644 --- a/types/nano/tsconfig.json +++ b/types/nano/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nanoajax/tsconfig.json b/types/nanoajax/tsconfig.json index 0da0980613..ee0559e4ba 100644 --- a/types/nanoajax/tsconfig.json +++ b/types/nanoajax/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nanoid/tsconfig.json b/types/nanoid/tsconfig.json index 0df191829d..6a7acb9122 100644 --- a/types/nanoid/tsconfig.json +++ b/types/nanoid/tsconfig.json @@ -14,6 +14,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "strictFunctionTypes": true }, "files": [ @@ -25,4 +26,4 @@ "random.d.ts", "url.d.ts" ] -} +} \ No newline at end of file diff --git a/types/nanomsg/tsconfig.json b/types/nanomsg/tsconfig.json index e42b4841af..6f1a4347f9 100644 --- a/types/nanomsg/tsconfig.json +++ b/types/nanomsg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nanoscroller/tsconfig.json b/types/nanoscroller/tsconfig.json index 7aeed7ab3d..51d0db097f 100644 --- a/types/nanoscroller/tsconfig.json +++ b/types/nanoscroller/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nanp/tsconfig.json b/types/nanp/tsconfig.json index d873227232..0aae22261b 100644 --- a/types/nanp/tsconfig.json +++ b/types/nanp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nats-hemera/tsconfig.json b/types/nats-hemera/tsconfig.json index 69c6083e56..4238f55a02 100644 --- a/types/nats-hemera/tsconfig.json +++ b/types/nats-hemera/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/natsort/tsconfig.json b/types/natsort/tsconfig.json index a23b1f358e..34d62a95ff 100644 --- a/types/natsort/tsconfig.json +++ b/types/natsort/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/natural-sort/tsconfig.json b/types/natural-sort/tsconfig.json index b592fcdb65..2a06885468 100644 --- a/types/natural-sort/tsconfig.json +++ b/types/natural-sort/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/natural/tsconfig.json b/types/natural/tsconfig.json index c04f83d753..a996ed84dc 100644 --- a/types/natural/tsconfig.json +++ b/types/natural/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/navigation-react/tsconfig.json b/types/navigation-react/tsconfig.json index 75ad101514..ec2d3dabb9 100644 --- a/types/navigation-react/tsconfig.json +++ b/types/navigation-react/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/navigation/tsconfig.json b/types/navigation/tsconfig.json index 8b8e594ec2..fc77d66124 100644 --- a/types/navigation/tsconfig.json +++ b/types/navigation/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 73131a9d72..ebc0ecb8c5 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for navigo 4.0 +// 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 @@ -20,7 +21,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 { /** @@ -36,6 +37,8 @@ declare class Navigo { on(rootHandler: RouteHandler, hooks?: NavigoHooks): Navigo; + off(location: string, handler: RouteHandler): void; + notFound(handler: ((query: string) => void), hooks?: NavigoHooks): void; navigate(path: string, absolute?: boolean): void; @@ -44,6 +47,8 @@ declare class Navigo { generate(path: string, params?: any): string; + getLinkPath(link: any): any; + resolve(currentURL?: string): boolean; link(path: string): string; @@ -52,9 +57,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..b3094c053f 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,12 @@ router.pause(); router.navigate('/en/products'); 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( '/user/edit', () => { diff --git a/types/navigo/tsconfig.json b/types/navigo/tsconfig.json index c43965d118..670c3e99fb 100644 --- a/types/navigo/tsconfig.json +++ b/types/navigo/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nblas/tsconfig.json b/types/nblas/tsconfig.json index 9da3a941dd..6d5a0a0b0b 100644 --- a/types/nblas/tsconfig.json +++ b/types/nblas/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/nconf/tsconfig.json b/types/nconf/tsconfig.json index 134b7a4fb9..2d213b4bc2 100644 --- a/types/nconf/tsconfig.json +++ b/types/nconf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ncp/tsconfig.json b/types/ncp/tsconfig.json index ad2247a6c9..cd3215ff35 100644 --- a/types/ncp/tsconfig.json +++ b/types/ncp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ndarray/tsconfig.json b/types/ndarray/tsconfig.json index 9f2c134f3d..cfaf8d710e 100644 --- a/types/ndarray/tsconfig.json +++ b/types/ndarray/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nearley/tsconfig.json b/types/nearley/tsconfig.json index bce8ee061a..d2ad939fb7 100644 --- a/types/nearley/tsconfig.json +++ b/types/nearley/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nedb-logger/tsconfig.json b/types/nedb-logger/tsconfig.json index 857cf7bb11..33e65ee249 100644 --- a/types/nedb-logger/tsconfig.json +++ b/types/nedb-logger/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nedb/tsconfig.json b/types/nedb/tsconfig.json index 220dc976e1..71be3fc3dc 100644 --- a/types/nedb/tsconfig.json +++ b/types/nedb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/needle/needle-tests.ts b/types/needle/needle-tests.ts index e8f2efee20..a216b1f686 100644 --- a/types/needle/needle-tests.ts +++ b/types/needle/needle-tests.ts @@ -1,4 +1,4 @@ -import * as needle from "needle"; +import needle = require("needle"); import * as fs from "fs"; function Usage() { diff --git a/types/needle/tsconfig.json b/types/needle/tsconfig.json index b0f67719ed..13fb81e8b3 100644 --- a/types/needle/tsconfig.json +++ b/types/needle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/needle/v0/tsconfig.json b/types/needle/v0/tsconfig.json index 3ea9ca7f93..0cc54647f9 100644 --- a/types/needle/v0/tsconfig.json +++ b/types/needle/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/needle/v1/tsconfig.json b/types/needle/v1/tsconfig.json index 7918dc3952..9e199dda15 100644 --- a/types/needle/v1/tsconfig.json +++ b/types/needle/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/negotiator/tsconfig.json b/types/negotiator/tsconfig.json index 89c06ad77a..83e42b29aa 100644 --- a/types/negotiator/tsconfig.json +++ b/types/negotiator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/neo4j/tsconfig.json b/types/neo4j/tsconfig.json index fa1c26ea60..24d94b0134 100644 --- a/types/neo4j/tsconfig.json +++ b/types/neo4j/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nes/tsconfig.json b/types/nes/tsconfig.json index 374b67b515..f9e07170b3 100644 --- a/types/nes/tsconfig.json +++ b/types/nes/tsconfig.json @@ -14,10 +14,13 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -36,4 +39,4 @@ "test/subscriptions-client.ts", "test/subscriptions-server.ts" ] -} +} \ No newline at end of file diff --git a/types/net-keepalive/tsconfig.json b/types/net-keepalive/tsconfig.json index 38736fd181..937edbecfb 100644 --- a/types/net-keepalive/tsconfig.json +++ b/types/net-keepalive/tsconfig.json @@ -1,21 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es5" - ], - "baseUrl": "../", - "typeRoots": ["../"], - "types": [], - "forceConsistentCasingInFileNames": true, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "noEmit": true - }, - "files": [ - "index.d.ts", - "net-keepalive-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "net-keepalive-tests.ts" + ] } \ No newline at end of file diff --git a/types/netmask/tsconfig.json b/types/netmask/tsconfig.json index 8666e91a29..db74d19edf 100644 --- a/types/netmask/tsconfig.json +++ b/types/netmask/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/new-relic-browser/index.d.ts b/types/new-relic-browser/index.d.ts new file mode 100644 index 0000000000..0064ee4ad2 --- /dev/null +++ b/types/new-relic-browser/index.d.ts @@ -0,0 +1,207 @@ +// Type definitions for NewRelicBrowser 0.1072 +// Project: https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api +// Definitions by: Rene Hamburger , Piotr Kubisa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare const newrelic: NewRelic.Browser; + +declare namespace NewRelic { + interface Browser { + /** + * Adds a unique name and ID to identify releases with multiple JavaScript bundles on the same page. + * + * @param releaseName A short description of the component; for example, the name of a project, + * application, file, or library. + * @param releaseId The ID or version of this release; for example, a version number, build number + * from your CI environment, GitHub SHA, GUID, or a hash of the contents. Since New Relic converts this + * value into a string, you can also use null or undefined if necessary + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/addRelease + */ + addRelease(releaseName: string, releaseId: string): void; + + /** + * Reports a Browser PageAction event to Insights along with a name and attributes. + * + * @param name Name or category of the action. Reports to Insights as the actionName attribute. + * @param attributes JSON object with one or more key/value pairs. + * The key will report to Insights as its own PageAction attribute with the specified values. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/addPageAction + */ + addPageAction(name: string, attributes: { [key: string]: string }): void; + + /** + * Adds a JavaScript object with a custom name, start time, etc. to an in-progress session trace. + * + * @param eventObject If you are sending the same event object to New Relic Insights as a + * PageAction, omit the TYPE attribute. If included, it will override the event type and cause the + * PageAction event to be sent incorrectly. Instead, use the NAME attribute for event information. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/add-to-trace + */ + addToTrace(eventObject: EventObject): void; + + /** + * Records an additional time point as "finished" in a session trace, and sends the event to Insights. + * + * @param timestamp Defaults to the current time of the call. If used, this marks the time that + * the page is "finished" according to your own criteria. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/finished + */ + finished(timestamp?: number): void; + + /** + * Identifies a browser error without disrupting your app's operations. + * + * @param Provide a meaningful error message that you can use when analyzing data on + * New Relic Browser's JavaScript errors page. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/noticeError + */ + noticeError(error: any): void; + + /** + * Adds a user-defined attribute name and value to subsequent events on the page. + * + * @param name Name of the attribute. Appears as column in the PageView event. + * It will also appear as a column in the PageAction event if you are using it. + * @param value Value of the attribute. Appears as the value in the named attribute column in the + * PageView event. It will appear as a column in the PageAction event if you are using it. Custom attribute + * values cannot be complex objects, only simple types such as strings and numbers. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/setCustomAttribute + */ + setCustomAttribute(name: string, value: string): void; + + /** + * Allows selective ignoring of known errors that the Browser agent captures. + * + * @param filterCallback The callback will be called with each error, so it is not + * specific to one error. `err` will usually be an error object, but it can be other data types. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/setErrorHandler + */ + setErrorHandler(filterCallback: (err: any) => boolean): void; + + /** + * Groups page views to help URL structure or to capture the URL's routing information. + * + * @param name Name of the page you want to use when viewing it in New Relic Browser or Insights. + * @param host Default is http://custom.transaction. Typically set host to your site's domain URI. + * To further group these custom transactions, provide a custom host. Otherwise, the page views will be + * assigned the default domain custom.transaction. Segments within the name must be explicitly added to + * the Whitelist segments in your URL whitelist settings if they do not already appear. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/setPageViewName + */ + setPageViewName(name: string, host?: string): void; + + /** + * Returns a new API object that is bound to the current SPA interaction. + * + * @returns This method returns an API object that is bound to a specific BrowserInteraction + * event. Each time this method is called for the same BrowserInteraction, a new object is created, but it still + * references the same interaction. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/interaction-browser-spa-api + */ + interaction(): BrowserInteraction; + + /** + * Gives SPA routes more accurate names than default names. Monitors specific routes rather than by default + * grouping. + * + * @param name Current route name for the page. Route names passed to setCurrentRouteName() can + * be any string, but they should represent a routing pattern rather than a specific resource. For example, + * use /users/:id rather than /users/123. If null, exits out of the route change requirement and returns to + * the default naming strategy. + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-set-current-route-name + */ + setCurrentRouteName(name: string): void; + } + + interface EventObject { + /** Event name */ + name: string; + /** Start time in ms since epoch */ + start: number; + /** End time in ms since epoch. Defaults to same as start resulting in trace object with a duration of zero. */ + end?: number; + /** Origin of event */ + origin?: string; + /** Event type */ + type?: string; + } + + interface BrowserInteraction { + /** + * Times sub-components of a SPA interaction separately, including wait time and JS execution time. + * + * @param name This will be used as the name of the tracer. If you do not include a name, + * New Relic Browser does not add a node to the interaction tree. The callback time will be + * attributed to the parent node. + * @returns This method ends the async time. It calls (and times) the callback that was passed into createTracer(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-create-tracer + */ + createTracer(name: string, syncCallback?: () => void): () => void; + + /** + * Ends the New Relic SPA interaction at the current time. + * + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-end + */ + end(): BrowserInteraction; + + /** + * Stores values across the current SPA interaction asynchronously in New Relic Browser. + * + * @param callback A function that accepts the interaction context object + * as its only argument. + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-get-context + */ + getContext(callback: (contextObject: any) => void): BrowserInteraction; + + /** + * Overrides other SPA save() calls; ignores an interaction so it is not saved or sent to New Relic. + * + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-ignore-browser + */ + ignore(): BrowserInteraction; + + /** + * Adds custom attributes for SPA interactions to the end of an event. It is called when the interaction + * has finished. You can invoke methods to modify the interaction, but methods that have asynchronous + * side effects will not have an effect. + * + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-on-end + */ + onEnd(callback: (contextObject: any) => void): BrowserInteraction; + + /** + * Ensures a SPA browser interaction will be saved when it ends. + * + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-save + */ + save(): BrowserInteraction; + + /** + * Adds a custom SPA attribute only to the current interaction in New Relic Browser. + * + * @param key Used as the attribute name on the BrowserInteraction event. + * @param Used as the attribute value on the BrowserInteraction event. This can be a + * string, number, boolean, or object. If it is an object, New Relic serializes it to a JSON string. + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-set-attribute + */ + setAttribute(key: string, value: any): BrowserInteraction; + + /** + * Sets the name and trigger of a SPA's browser interaction that is not a route change or URL change. + * + * @param name If null, the name will be set using the targetGroupedUrl attribute. + * If not null, this will set the browserInteractionName attribute in the BrowserInteraction event. + * @param trigger If not null, this will set the TRIGGER attribute on the BrowserInteraction event. + * @returns This method returns the same API object created by interaction(). + * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-set-name + */ + setName(name: string, trigger?: string): BrowserInteraction; + } +} diff --git a/types/new-relic-browser/new-relic-browser-tests.ts b/types/new-relic-browser/new-relic-browser-tests.ts new file mode 100644 index 0000000000..b9f75b142d --- /dev/null +++ b/types/new-relic-browser/new-relic-browser-tests.ts @@ -0,0 +1,87 @@ +// The following tests are largely taken straight from the examples at https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api + +// --- NewRelic.Browser methods ---------------------------------------------- + +// addRelease() +newrelic.addRelease('checkout page', 'a818994'); + +// addPageAction() +newrelic.addPageAction('copy-text-button', { result: 'success' }); + +// addToTrace() +newrelic.addToTrace({ + name: 'Event Name', + start: 1417044274239, + end: 1417044274252, + origin: 'Origin of event', + type: 'What type of event was this' +}); +newrelic.addToTrace({ + name: 'Event Name', + start: 1417044274239 +}); + +// finished() +newrelic.finished(); + +// noticeError() +try { + JSON.parse('{ "bar"'); +} catch (err) { + newrelic.noticeError(err); +} +newrelic.noticeError(new Error('bar')); + +// setCustomAttribute() +newrelic.setCustomAttribute('nodeId', '123'); + +// setErrorHandler() +newrelic.setErrorHandler((err) => { + if (err.message !== 'foo') { + return true; + } else { + return false; + } +}); + +// setPageViewName() +newrelic.setPageViewName('/login', 'https://www.myapp.com'); + +// setCurrentRouteName() +newrelic.setCurrentRouteName('/users/:id'); + +// --- NewRelic.BrowserInteraction methods ----------------------------------- + +// createTracer() +newrelic + .interaction() + .createTracer('customSegment', () => { })(); + +// end() +newrelic.interaction().end(); + +// getContext(), setAttribute() +const interaction = newrelic.interaction(); +interaction.getContext(ctx => { + if (ctx.productId) { + interaction.setAttribute('productId', ctx.productId); + } +}); + +// ignore() +newrelic.interaction().ignore(); + +// onEnd(), setAttribute() +newrelic.interaction().onEnd(ctx => { + interaction.setAttribute( + 'averageChartLoadTime', + ctx.totalChartLoadTime / ctx.chartLoadCount + ); +}); + +// setName(), setAttribute(), save() +newrelic.interaction() + .setName('loadNextPage') + .setAttribute('username', 'userName') + .setAttribute('userId', 123) + .save(); diff --git a/types/new-relic-browser/tsconfig.json b/types/new-relic-browser/tsconfig.json new file mode 100644 index 0000000000..ab3b384d26 --- /dev/null +++ b/types/new-relic-browser/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "new-relic-browser-tests.ts" + ] +} \ No newline at end of file diff --git a/types/new-relic-browser/tslint.json b/types/new-relic-browser/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/new-relic-browser/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/nexpect/tsconfig.json b/types/nexpect/tsconfig.json index d73f78e043..712c1fb7b4 100644 --- a/types/nexpect/tsconfig.json +++ b/types/nexpect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/next-redux-wrapper/tsconfig.json b/types/next-redux-wrapper/tsconfig.json index 7cfafdcb96..3108e45df1 100644 --- a/types/next-redux-wrapper/tsconfig.json +++ b/types/next-redux-wrapper/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/next/tsconfig.json b/types/next/tsconfig.json index 05e0b4e7ad..850e09cb80 100644 --- a/types/next/tsconfig.json +++ b/types/next/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-command/tsconfig.json b/types/ng-command/tsconfig.json index f64e284ecb..be46dfcb9b 100644 --- a/types/ng-command/tsconfig.json +++ b/types/ng-command/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-cordova/tsconfig.json b/types/ng-cordova/tsconfig.json index d0885bd15f..0572c04f8b 100644 --- a/types/ng-cordova/tsconfig.json +++ b/types/ng-cordova/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-dialog/tsconfig.json b/types/ng-dialog/tsconfig.json index 91539585a7..187992997a 100644 --- a/types/ng-dialog/tsconfig.json +++ b/types/ng-dialog/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-facebook/tsconfig.json b/types/ng-facebook/tsconfig.json index dc239cbe5a..701a75e7e9 100644 --- a/types/ng-facebook/tsconfig.json +++ b/types/ng-facebook/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-file-upload/tsconfig.json b/types/ng-file-upload/tsconfig.json index b08385c840..4cc1ff73fa 100644 --- a/types/ng-file-upload/tsconfig.json +++ b/types/ng-file-upload/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-flow/tsconfig.json b/types/ng-flow/tsconfig.json index 47d56906c5..f10dd6c6a1 100644 --- a/types/ng-flow/tsconfig.json +++ b/types/ng-flow/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-grid/tsconfig.json b/types/ng-grid/tsconfig.json index 5fcf2d1373..84bb17f123 100644 --- a/types/ng-grid/tsconfig.json +++ b/types/ng-grid/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-i18next/tsconfig.json b/types/ng-i18next/tsconfig.json index bf666912a5..038677906d 100644 --- a/types/ng-i18next/tsconfig.json +++ b/types/ng-i18next/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-notify/tsconfig.json b/types/ng-notify/tsconfig.json index c8cf3b029a..28342f01d7 100644 --- a/types/ng-notify/tsconfig.json +++ b/types/ng-notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ng-stomp/tsconfig.json b/types/ng-stomp/tsconfig.json index 151a99eb53..2f1e898136 100644 --- a/types/ng-stomp/tsconfig.json +++ b/types/ng-stomp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngbootbox/tsconfig.json b/types/ngbootbox/tsconfig.json index a5e7d7d878..e4abac771c 100644 --- a/types/ngbootbox/tsconfig.json +++ b/types/ngbootbox/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngeohash/tsconfig.json b/types/ngeohash/tsconfig.json index 7f248102e6..81b220b62e 100644 --- a/types/ngeohash/tsconfig.json +++ b/types/ngeohash/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngkookies/tsconfig.json b/types/ngkookies/tsconfig.json index 79178992a5..889586869b 100644 --- a/types/ngkookies/tsconfig.json +++ b/types/ngkookies/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngmap/tsconfig.json b/types/ngmap/tsconfig.json index 0427e8a338..1fe1544f80 100644 --- a/types/ngmap/tsconfig.json +++ b/types/ngmap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngprogress-lite/tsconfig.json b/types/ngprogress-lite/tsconfig.json index 5e8b28fdb2..9e54886818 100644 --- a/types/ngprogress-lite/tsconfig.json +++ b/types/ngprogress-lite/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngprogress/tsconfig.json b/types/ngprogress/tsconfig.json index 237f5f5962..2a4888f759 100644 --- a/types/ngprogress/tsconfig.json +++ b/types/ngprogress/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngreact/tsconfig.json b/types/ngreact/tsconfig.json index 39325499dd..e8f4365a16 100644 --- a/types/ngreact/tsconfig.json +++ b/types/ngreact/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "jsx": "react" }, "files": [ diff --git a/types/ngstorage/tsconfig.json b/types/ngstorage/tsconfig.json index 5bdb5efc09..dad284112c 100644 --- a/types/ngstorage/tsconfig.json +++ b/types/ngstorage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngtoaster/tsconfig.json b/types/ngtoaster/tsconfig.json index 5bc6882baf..b1b426ad7b 100644 --- a/types/ngtoaster/tsconfig.json +++ b/types/ngtoaster/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ngwysiwyg/tsconfig.json b/types/ngwysiwyg/tsconfig.json index 4292c2cff6..b780ce798a 100644 --- a/types/ngwysiwyg/tsconfig.json +++ b/types/ngwysiwyg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nightmare/tsconfig.json b/types/nightmare/tsconfig.json index 4bce8306fd..a2e7b85879 100644 --- a/types/nightmare/tsconfig.json +++ b/types/nightmare/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nightwatch/tsconfig.json b/types/nightwatch/tsconfig.json index 4b080c6048..e08524ac5c 100644 --- a/types/nightwatch/tsconfig.json +++ b/types/nightwatch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/noble/tsconfig.json b/types/noble/tsconfig.json index 3539eef12c..6ecc97642a 100644 --- a/types/noble/tsconfig.json +++ b/types/noble/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nock/nock-tests.ts b/types/nock/nock-tests.ts index e81e3fd096..44397db941 100644 --- a/types/nock/nock-tests.ts +++ b/types/nock/nock-tests.ts @@ -1,6 +1,4 @@ - - -import * as nock from 'nock'; +import nock = require('nock'); import * as fs from 'fs'; var scope: nock.Scope; diff --git a/types/nock/tsconfig.json b/types/nock/tsconfig.json index 30c4ce3aa7..fbd88d8e06 100644 --- a/types/nock/tsconfig.json +++ b/types/nock/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodal/tsconfig.json b/types/nodal/tsconfig.json index 29407ab0a0..e386a34bd5 100644 --- a/types/nodal/tsconfig.json +++ b/types/nodal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-7z/tsconfig.json b/types/node-7z/tsconfig.json index 87c09a2635..31275e1a7b 100644 --- a/types/node-7z/tsconfig.json +++ b/types/node-7z/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-array-ext/tsconfig.json b/types/node-array-ext/tsconfig.json index b7713bacb2..54ad436976 100644 --- a/types/node-array-ext/tsconfig.json +++ b/types/node-array-ext/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-cache/tsconfig.json b/types/node-cache/tsconfig.json index e024dba82d..0d05a8b958 100644 --- a/types/node-cache/tsconfig.json +++ b/types/node-cache/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-calendar/tsconfig.json b/types/node-calendar/tsconfig.json index f70d2de8ee..ddb256ca4b 100644 --- a/types/node-calendar/tsconfig.json +++ b/types/node-calendar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-cleanup/tsconfig.json b/types/node-cleanup/tsconfig.json index 0b50b3555b..eab90ee9cc 100644 --- a/types/node-cleanup/tsconfig.json +++ b/types/node-cleanup/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-common-errors/tsconfig.json b/types/node-common-errors/tsconfig.json index a862893b87..361e724698 100644 --- a/types/node-common-errors/tsconfig.json +++ b/types/node-common-errors/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-config-manager/tsconfig.json b/types/node-config-manager/tsconfig.json index c308808722..91a3ae8510 100644 --- a/types/node-config-manager/tsconfig.json +++ b/types/node-config-manager/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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..5269f6d3a1 --- /dev/null +++ b/types/node-cron/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "strictNullChecks": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "strictFunctionTypes": true, + "noUnusedParameters": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "node-cron-tests.ts" + ] +} \ No newline at end of file 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" +} diff --git a/types/node-dir/tsconfig.json b/types/node-dir/tsconfig.json index b8e68860af..cdbe51bb62 100644 --- a/types/node-dir/tsconfig.json +++ b/types/node-dir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-dogstatsd/tsconfig.json b/types/node-dogstatsd/tsconfig.json index 98d50c65f8..b6f2407301 100644 --- a/types/node-dogstatsd/tsconfig.json +++ b/types/node-dogstatsd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-emoji/tsconfig.json b/types/node-emoji/tsconfig.json index 448cf4351c..09552ed78b 100644 --- a/types/node-emoji/tsconfig.json +++ b/types/node-emoji/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-fetch/tsconfig.json b/types/node-fetch/tsconfig.json index 98a8d56ff1..b68e127c1f 100644 --- a/types/node-fetch/tsconfig.json +++ b/types/node-fetch/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-fibers/tsconfig.json b/types/node-fibers/tsconfig.json index a646c67d7f..1f8e0571ac 100644 --- a/types/node-fibers/tsconfig.json +++ b/types/node-fibers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-forge/index.d.ts b/types/node-forge/index.d.ts index a5d3f078fe..2784d95fa3 100644 --- a/types/node-forge/index.d.ts +++ b/types/node-forge/index.d.ts @@ -14,7 +14,7 @@ declare module "node-forge" { type Utf8 = string; type OID = string; - namespace pem { + namespace pem { interface EncodeOptions { maxline?: number; @@ -32,7 +32,7 @@ declare module "node-forge" { function encode(msg: ObjectPEM, options?: EncodeOptions): string; function decode(str: string): ObjectPEM[]; } - + namespace pki { type PEM = string; @@ -79,10 +79,11 @@ declare module "node-forge" { interface CertificateField extends CertificateFieldOptions { valueConstructed?: boolean; valueTagClass?: asn1.Class; - value?: any[]; + value?: any[] | string; extensions?: any[]; } + interface Certificate { version: number; serialNumber: string; @@ -107,11 +108,61 @@ declare module "node-forge" { extensions: any[]; publicKey: any; md: any; + /** + * Sets the subject of this certificate. + * + * @param attrs the array of subject attributes to use. + * @param uniqueId an optional a unique ID to use. + */ + setSubject(attrs: CertificateField[], uniqueId?: string): void; + /** + * Sets the subject of this certificate. + * + * @param attrs the array of subject attributes to use. + * @param uniqueId an optional a unique ID to use. + */ + setIssuer(attrs: CertificateField[], uniqueId?: string): void; + /** + * Sets the extensions of this certificate. + * + * @param exts the array of extensions to use. + */ + setExtensions(exts: any[]): void; + /** + * Gets an extension by its name or id. + * + * @param options the name to use or an object with: + * name the name to use. + * id the id to use. + * + * @return the extension or null if not found. + */ + getExtension(options: string | {name: string;} | {id: number;}): {} | undefined; + + /** + * Signs this certificate using the given private key. + * + * @param key the private key to sign with. + * @param md the message digest object to use (defaults to forge.md.sha1). + */ + sign(key: pki.Key, md: md.MessageDigest): void; + /** + * Attempts verify the signature on the passed certificate using this + * certificate's public key. + * + * @param child the certificate to verify. + * + * @return true if verified, false if not. + */ + verify(child: Certificate): boolean; + } function certificateFromAsn1(obj: asn1.Asn1, computeHash?: boolean): Certificate; function decryptRsaPrivateKey(pem: PEM, passphrase?: string): Key; + + function createCertificate(): Certificate; } namespace ssh { diff --git a/types/node-forge/node-forge-tests.ts b/types/node-forge/node-forge-tests.ts index 63ccca6c70..29b8267714 100644 --- a/types/node-forge/node-forge-tests.ts +++ b/types/node-forge/node-forge-tests.ts @@ -1,4 +1,4 @@ -import * as forge from "node-forge"; +import * as forge from 'node-forge'; let keypair = forge.pki.rsa.generateKeyPair({ bits: 512 }); let privateKeyPem = forge.pki.privateKeyToPem(keypair.privateKey); @@ -8,19 +8,23 @@ let x: string = forge.ssh.privateKeyToOpenSSH(key); let pemKey: forge.pki.PEM = publicKeyPem; let publicKeyRsa = forge.pki.publicKeyFromPem(pemKey); let privateKeyRsa = forge.pki.privateKeyFromPem(privateKeyPem); +let cert = forge.pki.createCertificate(); { let subjectPublicKeyInfo = forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.OID, false, - forge.asn1.oidToDer(forge.pki.oids['rsaEncryption']).getBytes(), + forge.asn1.create( + forge.asn1.Class.UNIVERSAL, + forge.asn1.Type.OID, + false, + forge.asn1.oidToDer(forge.pki.oids['rsaEncryption']).getBytes() ), - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.NULL, false, ''), + forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.NULL, false, '') ]), forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.BITSTRING, false, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.SEQUENCE, true, [ forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []), - forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []), + forge.asn1.create(forge.asn1.Class.UNIVERSAL, forge.asn1.Type.INTEGER, false, []) ]) ]) ]); @@ -52,12 +56,14 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin src = new Uint8Array(2); encode = forge.util.binary.hex.encode(src); decode = forge.util.binary.hex.decode(encode); - if (encode !== '0000' || src.byteLength !== decode.byteLength) throw Error('forge.util.binary.hex.encode / decode fail'); + if (encode !== '0000' || src.byteLength !== decode.byteLength) + throw Error('forge.util.binary.hex.encode / decode fail'); src = new Uint8Array(2); encode = forge.util.binary.base64.encode(src); decode = forge.util.binary.base64.decode(encode); - if (encode !== 'AAA=' || src.byteLength !== decode.byteLength) throw Error('forge.util.binary.base64.encode / decode fail'); + if (encode !== 'AAA=' || src.byteLength !== decode.byteLength) + throw Error('forge.util.binary.base64.encode / decode fail'); src = new Uint8Array(10); encode = forge.util.binary.raw.encode(src); @@ -97,7 +103,6 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin if (hex.length !== 40) throw Error('forge.md.MessageDigest.update / digest fail'); } - { let md: forge.md.MessageDigest; let hex: string; @@ -110,26 +115,74 @@ if (forge.util.fillString('1', 5) !== '11111') throw Error('forge.util.fillStrin } { - let payload = { "asd": "asd" } - let cipher = forge.cipher.createCipher( - "3DES-ECB", - forge.util.createBuffer(key, "raw") - ); + let payload = { asd: 'asd' }; + let cipher = forge.cipher.createCipher('3DES-ECB', forge.util.createBuffer(key, 'raw')); cipher.start(); - cipher.update(forge.util.createBuffer(JSON.stringify(payload), "raw")); + cipher.update(forge.util.createBuffer(JSON.stringify(payload), 'raw')); cipher.finish(); let encrypted = cipher.output; let token = forge.util.encode64(encrypted.getBytes()); - let decipher = forge.cipher.createDecipher( - "3DES-ECB", - forge.util.createBuffer(key, "raw") - ); + let decipher = forge.cipher.createDecipher('3DES-ECB', forge.util.createBuffer(key, 'raw')); decipher.start(); - decipher.update(forge.util.createBuffer(forge.util.decode64(token), "raw")); + decipher.update(forge.util.createBuffer(forge.util.decode64(token), 'raw')); decipher.finish(); let decrypted = decipher.output as forge.util.ByteStringBuffer; let content = JSON.parse(forge.util.encodeUtf8(decrypted.getBytes())); if (content.asd == payload.asd) throw Error('forge.cipher.createCipher failed'); -} \ No newline at end of file +} + +{ + cert.publicKey = keypair.publicKey; + cert.serialNumber = new Date().getTime() + ''; + cert.validity.notBefore = new Date(); + cert.validity.notAfter = new Date(); + cert.validity.notAfter.setFullYear(cert.validity.notAfter.getFullYear() + 20); + const attrs = [ + { + name: 'commonName', + value: 'x22x22' + }, + { + name: 'countryName', + value: 'GitHub' + }, + { + shortName: 'ST', + value: 'GitHub' + }, + { + name: 'localityName', + value: 'GitHub' + }, + { + name: 'organizationName', + value: 'x22x22' + }, + { + shortName: 'OU', + value: 'https://github.com/x22x22' + } + ]; + cert.setSubject(attrs); + cert.setIssuer(attrs); + cert.setExtensions([ + { + name: 'basicConstraints', + critical: true, + cA: true + }, + { + name: 'keyUsage', + critical: true, + keyCertSign: true + }, + { + name: 'subjectKeyIdentifier' + } + ]); + + // self-sign certificate + cert.sign(keypair.privateKey, forge.md.sha256.create()); +} diff --git a/types/node-forge/tsconfig.json b/types/node-forge/tsconfig.json index 8864280abf..fb3691ebef 100644 --- a/types/node-forge/tsconfig.json +++ b/types/node-forge/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-gcm/tsconfig.json b/types/node-gcm/tsconfig.json index f68df952f2..594e89999c 100644 --- a/types/node-gcm/tsconfig.json +++ b/types/node-gcm/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-geocoder/node-geocoder-tests.ts b/types/node-geocoder/node-geocoder-tests.ts index 33ed4b3036..bb554d03ba 100644 --- a/types/node-geocoder/node-geocoder-tests.ts +++ b/types/node-geocoder/node-geocoder-tests.ts @@ -1,4 +1,4 @@ -import * as NodeGeocoder from 'node-geocoder'; +import NodeGeocoder = require('node-geocoder'); const geocoder = NodeGeocoder({ provider: 'google', diff --git a/types/node-geocoder/tsconfig.json b/types/node-geocoder/tsconfig.json index 8076dc932c..0ad4af9d61 100644 --- a/types/node-geocoder/tsconfig.json +++ b/types/node-geocoder/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-getopt/tsconfig.json b/types/node-getopt/tsconfig.json index 757df0d365..399c277a9c 100644 --- a/types/node-getopt/tsconfig.json +++ b/types/node-getopt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-hid/tsconfig.json b/types/node-hid/tsconfig.json index 3dce09c22b..65590474cb 100644 --- a/types/node-hid/tsconfig.json +++ b/types/node-hid/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-horseman/tsconfig.json b/types/node-horseman/tsconfig.json index 5490648512..a29f0ceb09 100644 --- a/types/node-horseman/tsconfig.json +++ b/types/node-horseman/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "node-horseman-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/node-hue-api/tsconfig.json b/types/node-hue-api/tsconfig.json index 6edecf355c..0310c9fb67 100644 --- a/types/node-hue-api/tsconfig.json +++ b/types/node-hue-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-int64/tsconfig.json b/types/node-int64/tsconfig.json index b7911dd7a2..361f4eb4e2 100644 --- a/types/node-int64/tsconfig.json +++ b/types/node-int64/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-ipc/tsconfig.json b/types/node-ipc/tsconfig.json index d8a28a8334..f3a0189b05 100644 --- a/types/node-ipc/tsconfig.json +++ b/types/node-ipc/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-jsfl-runner/tsconfig.json b/types/node-jsfl-runner/tsconfig.json index eb2c2d7fe9..f4353811a9 100644 --- a/types/node-jsfl-runner/tsconfig.json +++ b/types/node-jsfl-runner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-json-db/tsconfig.json b/types/node-json-db/tsconfig.json index 1372add5aa..dfd45628f8 100644 --- a/types/node-json-db/tsconfig.json +++ b/types/node-json-db/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-mysql-wrapper/tsconfig.json b/types/node-mysql-wrapper/tsconfig.json index 7e12021cdc..d49a9c6e0b 100644 --- a/types/node-mysql-wrapper/tsconfig.json +++ b/types/node-mysql-wrapper/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-notifier/tsconfig.json b/types/node-notifier/tsconfig.json index 97b9bb617e..bab1531cf7 100644 --- a/types/node-notifier/tsconfig.json +++ b/types/node-notifier/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-persist/tsconfig.json b/types/node-persist/tsconfig.json index bcc3c3f2f9..e0b20bbdc4 100644 --- a/types/node-persist/tsconfig.json +++ b/types/node-persist/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-polyglot/tsconfig.json b/types/node-polyglot/tsconfig.json index ebf34971af..8927b0008b 100644 --- a/types/node-polyglot/tsconfig.json +++ b/types/node-polyglot/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-powershell/node-powershell-tests.ts b/types/node-powershell/node-powershell-tests.ts index a60f9db331..186d0bd68e 100644 --- a/types/node-powershell/node-powershell-tests.ts +++ b/types/node-powershell/node-powershell-tests.ts @@ -1,4 +1,4 @@ -import * as nodePowershell from 'node-powershell'; +import nodePowershell = require('node-powershell'); var options: nodePowershell.ShellOptions = { debugMsg: true diff --git a/types/node-powershell/tsconfig.json b/types/node-powershell/tsconfig.json index d24dc26304..2d2fc6f999 100644 --- a/types/node-powershell/tsconfig.json +++ b/types/node-powershell/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-ral/tsconfig.json b/types/node-ral/tsconfig.json index 13eec57091..de24642d5f 100644 --- a/types/node-ral/tsconfig.json +++ b/types/node-ral/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-red/tsconfig.json b/types/node-red/tsconfig.json index e92fbbd930..2330c83cff 100644 --- a/types/node-red/tsconfig.json +++ b/types/node-red/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-rsa/node-rsa-tests.ts b/types/node-rsa/node-rsa-tests.ts index e210d5b68d..0f8defacbd 100644 --- a/types/node-rsa/node-rsa-tests.ts +++ b/types/node-rsa/node-rsa-tests.ts @@ -1,4 +1,4 @@ -import * as NodeRSA from 'node-rsa'; +import NodeRSA = require('node-rsa'); const key = new NodeRSA({ b: 512 }); diff --git a/types/node-rsa/tsconfig.json b/types/node-rsa/tsconfig.json index 662a3c6b6f..e1a294df26 100644 --- a/types/node-rsa/tsconfig.json +++ b/types/node-rsa/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-sass-middleware/node-sass-middleware-tests.ts b/types/node-sass-middleware/node-sass-middleware-tests.ts index bfc755a424..34820155ed 100644 --- a/types/node-sass-middleware/node-sass-middleware-tests.ts +++ b/types/node-sass-middleware/node-sass-middleware-tests.ts @@ -1,6 +1,5 @@ - -import * as express from "express"; -import * as sassMiddleware from "node-sass-middleware"; +import express = require("express"); +import sassMiddleware = require("node-sass-middleware"); import * as path from "path"; var app = express(); app.use(sassMiddleware({ diff --git a/types/node-sass-middleware/tsconfig.json b/types/node-sass-middleware/tsconfig.json index f1c2b3a530..930a88b720 100644 --- a/types/node-sass-middleware/tsconfig.json +++ b/types/node-sass-middleware/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-sass/tsconfig.json b/types/node-sass/tsconfig.json index a1e4cdb079..4ee0b96bb1 100644 --- a/types/node-sass/tsconfig.json +++ b/types/node-sass/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-schedule/tsconfig.json b/types/node-schedule/tsconfig.json index 7ff95758d0..37ff002d0e 100644 --- a/types/node-schedule/tsconfig.json +++ b/types/node-schedule/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-slack/tsconfig.json b/types/node-slack/tsconfig.json index b32803599a..db7ad8d561 100644 --- a/types/node-slack/tsconfig.json +++ b/types/node-slack/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-snap7/tsconfig.json b/types/node-snap7/tsconfig.json index c78bc5a83f..70d02cbaab 100644 --- a/types/node-snap7/tsconfig.json +++ b/types/node-snap7/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-sprite-generator/node-sprite-generator-tests.ts b/types/node-sprite-generator/node-sprite-generator-tests.ts index 23309cea6d..7490d84865 100644 --- a/types/node-sprite-generator/node-sprite-generator-tests.ts +++ b/types/node-sprite-generator/node-sprite-generator-tests.ts @@ -1,5 +1,5 @@ -import * as nsg from 'node-sprite-generator'; -import * as express from 'express'; +import nsg = require('node-sprite-generator'); +import express = require('express'); const app = express(); app.use(nsg.middleware({ diff --git a/types/node-sprite-generator/tsconfig.json b/types/node-sprite-generator/tsconfig.json index 1a1abcf56b..cfd0f3ecb0 100644 --- a/types/node-sprite-generator/tsconfig.json +++ b/types/node-sprite-generator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-static/tsconfig.json b/types/node-static/tsconfig.json index 57a6d79f15..b6034feeaf 100644 --- a/types/node-static/tsconfig.json +++ b/types/node-static/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-statsd/tsconfig.json b/types/node-statsd/tsconfig.json index a4f7cdba75..dea7e59d6c 100644 --- a/types/node-statsd/tsconfig.json +++ b/types/node-statsd/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-telegram-bot-api/tsconfig.json b/types/node-telegram-bot-api/tsconfig.json index bb33d5e9b5..62f52d6383 100644 --- a/types/node-telegram-bot-api/tsconfig.json +++ b/types/node-telegram-bot-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-uuid/tsconfig.json b/types/node-uuid/tsconfig.json index 52dc8180a0..f5491454e9 100644 --- a/types/node-uuid/tsconfig.json +++ b/types/node-uuid/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-validator/tsconfig.json b/types/node-validator/tsconfig.json index eb98203673..693678cdf3 100644 --- a/types/node-validator/tsconfig.json +++ b/types/node-validator/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-vault/node-vault-tests.ts b/types/node-vault/node-vault-tests.ts index d6d85980a1..6ce23bd4cd 100644 --- a/types/node-vault/node-vault-tests.ts +++ b/types/node-vault/node-vault-tests.ts @@ -1,4 +1,4 @@ -import * as nv from "node-vault"; +import nv = require("node-vault"); // Test code came from the sample code in README of the module. const options = { diff --git a/types/node-vault/tsconfig.json b/types/node-vault/tsconfig.json index d2875ffa4a..db340a253a 100644 --- a/types/node-vault/tsconfig.json +++ b/types/node-vault/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-wit/tsconfig.json b/types/node-wit/tsconfig.json index 4c183185fe..0f38fba2fb 100644 --- a/types/node-wit/tsconfig.json +++ b/types/node-wit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-xmpp-client/tsconfig.json b/types/node-xmpp-client/tsconfig.json index 35471e38d2..da73c1f290 100644 --- a/types/node-xmpp-client/tsconfig.json +++ b/types/node-xmpp-client/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-xmpp-core/tsconfig.json b/types/node-xmpp-core/tsconfig.json index 65e37ab467..aab7c340f4 100644 --- a/types/node-xmpp-core/tsconfig.json +++ b/types/node-xmpp-core/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node-zookeeper-client/tsconfig.json b/types/node-zookeeper-client/tsconfig.json index 0182035432..89a844e122 100644 --- a/types/node-zookeeper-client/tsconfig.json +++ b/types/node-zookeeper-client/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 8f4e6cf636..b4ad9812f1 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node.js 9.3.x +// Type definitions for Node.js 9.4.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped @@ -118,12 +118,17 @@ interface NodeRequireFunction { } interface NodeRequire extends NodeRequireFunction { - resolve(id: string): string; + resolve: RequireResolve; cache: any; extensions: NodeExtensions; main: NodeModule | undefined; } +interface RequireResolve { + (id: string, options?: { paths?: string[]; }): string; + paths(request: string): string[] | null; +} + interface NodeExtensions { '.js': (m: NodeModule, filename: string) => any; '.json': (m: NodeModule, filename: string) => any; @@ -410,6 +415,7 @@ declare namespace NodeJS { setMaxListeners(n: number): this; getMaxListeners(): number; listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; emit(event: string | symbol, ...args: any[]): boolean; listenerCount(type: string | symbol): number; // Added in Node 6... @@ -520,6 +526,7 @@ declare namespace NodeJS { export interface WriteStream extends Socket { readonly writableHighWaterMark: number; + readonly writableLength: number; columns?: number; rows?: number; _write(chunk: any, encoding: string, callback: Function): void; @@ -532,6 +539,7 @@ declare namespace NodeJS { } export interface ReadStream extends Socket { readonly readableHighWaterMark: number; + readonly readableLength: number; isRaw?: boolean; setRawMode?(mode: boolean): void; _read(size: number): void; @@ -916,6 +924,7 @@ declare module "events" { setMaxListeners(n: number): this; getMaxListeners(): number; listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; emit(event: string | symbol, ...args: any[]): boolean; eventNames(): Array; listenerCount(type: string | symbol): number; @@ -1466,27 +1475,28 @@ declare module "zlib" { export function createInflateRaw(options?: ZlibOptions): InflateRaw; export function createUnzip(options?: ZlibOptions): Unzip; - export function deflate(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function deflate(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function deflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function deflateRaw(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function deflateRaw(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function deflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function gzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function gzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function gzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function gunzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function gunzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function gunzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function inflate(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function inflate(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function inflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function inflateRaw(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function inflateRaw(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function inflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer; - export function unzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void; - export function unzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; - export function unzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer; + type InputType = string | Buffer | DataView | ArrayBuffer /* | TypedArray */; + export function deflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function deflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gunzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function unzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function unzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function unzipSync(buf: InputType, options?: ZlibOptions): Buffer; export namespace constants { // Allowed flush values. @@ -3711,7 +3721,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readdir(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: Array) => void): void; + export function readdir(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[] | Buffer[]) => void): void; /** * Asynchronous readdir(3) - read a directory. @@ -3740,7 +3750,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise>; + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; } /** @@ -3762,7 +3772,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readdirSync(path: PathLike, options?: { encoding?: string | null } | string | null): Array; + export function readdirSync(path: PathLike, options?: { encoding?: string | null } | string | null): string[] | Buffer[]; /** * Asynchronous close(2) - close a file descriptor. @@ -5304,7 +5314,8 @@ declare module "stream" { export class Readable extends Stream implements NodeJS.ReadableStream { readable: boolean; - readableHighWaterMark: number; + readonly readableHighWaterMark: number; + readonly readableLength: number; constructor(opts?: ReadableOptions); _read(size: number): void; read(size?: number): any; @@ -5329,7 +5340,6 @@ declare module "stream" { * 5. error */ addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; addListener(event: "close", listener: () => void): this; addListener(event: "data", listener: (chunk: Buffer | string) => void): this; addListener(event: "end", listener: () => void): this; @@ -5392,6 +5402,7 @@ declare module "stream" { export class Writable extends Stream implements NodeJS.WritableStream { writable: boolean; readonly writableHighWaterMark: number; + readonly writableLength: number; constructor(opts?: WritableOptions); _write(chunk: any, encoding: string, callback: (err?: Error) => void): void; _writev?(chunks: Array<{chunk: any, encoding: string}>, callback: (err?: Error) => void): void; @@ -5484,6 +5495,7 @@ declare module "stream" { export class Duplex extends Readable implements Writable { writable: boolean; readonly writableHighWaterMark: number; + readonly writableLength: number; constructor(opts?: DuplexOptions); _write(chunk: any, encoding: string, callback: (err?: Error) => void): void; _writev?(chunks: Array<{chunk: any, encoding: string}>, callback: (err?: Error) => void): void; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index dccde2db47..24fde87ddd 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import events2 = require("events"); @@ -235,6 +235,25 @@ namespace fs_tests { }); } + { + let listS: string[]; + listS = fs.readdirSync('path'); + listS = fs.readdirSync('path', { encoding: 'utf8' }); + listS = fs.readdirSync('path', { encoding: null }); + listS = fs.readdirSync('path', { encoding: undefined }); + listS = fs.readdirSync('path', 'utf8'); + listS = fs.readdirSync('path', null); + listS = fs.readdirSync('path', undefined); + + let listB: Buffer[]; + listB = fs.readdirSync('path', { encoding: 'buffer' }); + listB = fs.readdirSync("path", 'buffer'); + + let enc = 'buffer'; + fs.readdirSync('path', { encoding: enc }); // $ExpectType string[] | Buffer[] + fs.readdirSync('path', { }); // $ExpectType string[] | Buffer[] + } + { fs.mkdtemp('/tmp/foo-', (err, folder) => { console.log(folder); diff --git a/types/node/tsconfig.json b/types/node/tsconfig.json index 9f4317b9f4..16836a1483 100644 --- a/types/node/tsconfig.json +++ b/types/node/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/node/v0/node-tests.ts b/types/node/v0/node-tests.ts index 8e2443b360..d8e0a40699 100644 --- a/types/node/v0/node-tests.ts +++ b/types/node/v0/node-tests.ts @@ -1,5 +1,4 @@ - -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import * as zlib from "zlib"; diff --git a/types/node/v0/tsconfig.json b/types/node/v0/tsconfig.json index a4a370b7a7..b3bde5e9c4 100644 --- a/types/node/v0/tsconfig.json +++ b/types/node/v0/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node/v4/node-tests.ts b/types/node/v4/node-tests.ts index 2bb28ce779..e60b578ccf 100644 --- a/types/node/v4/node-tests.ts +++ b/types/node/v4/node-tests.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import * as zlib from "zlib"; diff --git a/types/node/v4/tsconfig.json b/types/node/v4/tsconfig.json index c89540145a..c5b84e1c76 100644 --- a/types/node/v4/tsconfig.json +++ b/types/node/v4/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index 5cbe7ab3dc..dd49ad6003 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -5,6 +5,7 @@ // Wilco Bakker // Thomas Bouldin // Sebastian Silbermann +// Alorel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /************************************************ @@ -2595,8 +2596,51 @@ declare module "fs" { * @returns Returns the created folder path. */ export function mkdtempSync(prefix: string): string; - export function readdir(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; - export function readdirSync(path: string | Buffer): string[]; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: string | Buffer, options: { encoding: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: string | Buffer, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, files: Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: string | Buffer, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[] | Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. + */ + export function readdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: string | Buffer, options?: { encoding: BufferEncoding | null } | BufferEncoding | null): string[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: string | Buffer, options: { encoding: "buffer" } | "buffer"): Buffer[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: string | Buffer, options?: { encoding?: string | null } | string | null): string[] | Buffer[]; export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; export function closeSync(fd: number): void; export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; @@ -3605,7 +3649,6 @@ declare module "stream" { * 5. error **/ addListener(event: string, listener: Function): this; - addListener(event: string, listener: Function): this; addListener(event: "close", listener: () => void): this; addListener(event: "data", listener: (chunk: Buffer | string) => void): this; addListener(event: "end", listener: () => void): this; diff --git a/types/node/v6/node-tests.ts b/types/node/v6/node-tests.ts index 34a62bf88d..cd363c708c 100644 --- a/types/node/v6/node-tests.ts +++ b/types/node/v6/node-tests.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import events2 = require("events"); @@ -218,6 +218,25 @@ namespace fs_tests { fs.readFile('testfile', { flag: 'r' }, (err, data) => buffer = data); } + { + fs.readdir('foo', (err: any, files: string[]) => {}) + fs.readdir('foo', 'utf8', (err: any, files: string[]) => {}); + fs.readdir('foo', {encoding: 'utf8'}, (err: any, files: string[]) => {}); + fs.readdir('foo', 'buffer', (err: any, files: Buffer[]) => {}); + fs.readdir('foo', {encoding: 'buffer'}, (err: any, files: Buffer[]) => {}); + + let fsStringOut: string[] = fs.readdirSync('utf8'); + fsStringOut = fs.readdirSync('foo', 'utf8'); + fsStringOut = fs.readdirSync('foo', {encoding: 'utf8'}); + + let fsBufferOut: Buffer[] = fs.readdirSync('utf8', 'buffer'); + fsBufferOut = fs.readdirSync('foo', {encoding: 'buffer'}); + + let enc = 'buffer'; + fs.readdirSync('path', { encoding: enc }); // $ExpectType string[] | Buffer[] + fs.readdirSync('path', { }); // $ExpectType string[] | Buffer[] + } + { var errno: number; fs.readFile('testfile', (err, data) => { diff --git a/types/node/v6/tsconfig.json b/types/node/v6/tsconfig.json index 8fc9488eac..452983f88b 100644 --- a/types/node/v6/tsconfig.json +++ b/types/node/v6/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/node/v7/index.d.ts b/types/node/v7/index.d.ts index 038c4a6f58..93bc842cb4 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -3754,7 +3754,6 @@ declare module "stream" { * 5. error **/ addListener(event: string, listener: Function): this; - addListener(event: string, listener: Function): this; addListener(event: "close", listener: () => void): this; addListener(event: "data", listener: (chunk: Buffer | string) => void): this; addListener(event: "end", listener: () => void): this; diff --git a/types/node/v7/node-tests.ts b/types/node/v7/node-tests.ts index a2f25db8ec..0240dcc120 100644 --- a/types/node/v7/node-tests.ts +++ b/types/node/v7/node-tests.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import events2 = require("events"); diff --git a/types/node/v7/tsconfig.json b/types/node/v7/tsconfig.json index c5badcdaa5..23318008ca 100644 --- a/types/node/v7/tsconfig.json +++ b/types/node/v7/tsconfig.json @@ -23,6 +23,7 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 18ba96575d..43b8f74ff5 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node.js 8.5.x +// Type definitions for Node.js 8.9.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped @@ -116,12 +116,17 @@ interface NodeRequireFunction { } interface NodeRequire extends NodeRequireFunction { - resolve(id: string): string; + resolve: RequireResolve; cache: any; extensions: NodeExtensions; main: NodeModule | undefined; } +interface RequireResolve { + (id: string, options?: { paths?: string[]; }): string; + paths(request: string): string[] | null; +} + interface NodeExtensions { '.js': (m: NodeModule, filename: string) => any; '.json': (m: NodeModule, filename: string) => any; @@ -3693,7 +3698,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readdir(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: Array) => void): void; + export function readdir(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[] | Buffer[]) => void): void; /** * Asynchronous readdir(3) - read a directory. @@ -3722,7 +3727,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise>; + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; } /** @@ -3744,7 +3749,7 @@ declare module "fs" { * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. */ - export function readdirSync(path: PathLike, options?: { encoding?: string | null } | string | null): Array; + export function readdirSync(path: PathLike, options?: { encoding?: string | null } | string | null): string[] | Buffer[]; /** * Asynchronous close(2) - close a file descriptor. @@ -5310,7 +5315,6 @@ declare module "stream" { * 5. error */ addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: string, listener: (...args: any[]) => void): this; addListener(event: "close", listener: () => void): this; addListener(event: "data", listener: (chunk: Buffer | string) => void): this; addListener(event: "end", listener: () => void): this; diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index 8f4c7f9850..74d4c5c222 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import assert = require("assert"); import * as fs from "fs"; import * as events from "events"; import events2 = require("events"); @@ -235,6 +235,25 @@ namespace fs_tests { }); } + { + let listS: string[]; + listS = fs.readdirSync('path'); + listS = fs.readdirSync('path', { encoding: 'utf8' }); + listS = fs.readdirSync('path', { encoding: null }); + listS = fs.readdirSync('path', { encoding: undefined }); + listS = fs.readdirSync('path', 'utf8'); + listS = fs.readdirSync('path', null); + listS = fs.readdirSync('path', undefined); + + let listB: Buffer[]; + listB = fs.readdirSync('path', { encoding: 'buffer' }); + listB = fs.readdirSync("path", 'buffer'); + + let enc = 'buffer'; + fs.readdirSync('path', { encoding: enc }); // $ExpectType string[] | Buffer[] + fs.readdirSync('path', { }); // $ExpectType string[] | Buffer[] + } + { fs.mkdtemp('/tmp/foo-', (err, folder) => { console.log(folder); diff --git a/types/node/v8/tsconfig.json b/types/node/v8/tsconfig.json index 3f4614bef4..ea093ad4a3 100644 --- a/types/node/v8/tsconfig.json +++ b/types/node/v8/tsconfig.json @@ -24,6 +24,7 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } -} +} \ No newline at end of file diff --git a/types/node_redis/tsconfig.json b/types/node_redis/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/node_redis/tsconfig.json +++ b/types/node_redis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/nodegit/tsconfig.json b/types/nodegit/tsconfig.json index e097a77133..6f425f13a1 100644 --- a/types/nodegit/tsconfig.json +++ b/types/nodegit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "annotated-commit.d.ts", @@ -119,4 +120,4 @@ "tree-update.d.ts", "tree.d.ts" ] -} +} \ No newline at end of file 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/nodemailer-direct-transport/tsconfig.json b/types/nodemailer-direct-transport/tsconfig.json index a86a4a088a..98320cc735 100644 --- a/types/nodemailer-direct-transport/tsconfig.json +++ b/types/nodemailer-direct-transport/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-mailgun-transport/tsconfig.json b/types/nodemailer-mailgun-transport/tsconfig.json index 4098e7a2d4..e5d64d4305 100644 --- a/types/nodemailer-mailgun-transport/tsconfig.json +++ b/types/nodemailer-mailgun-transport/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-pickup-transport/tsconfig.json b/types/nodemailer-pickup-transport/tsconfig.json index 913453977e..5c029de666 100644 --- a/types/nodemailer-pickup-transport/tsconfig.json +++ b/types/nodemailer-pickup-transport/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-ses-transport/nodemailer-ses-transport-tests.ts b/types/nodemailer-ses-transport/nodemailer-ses-transport-tests.ts index 393091816d..271dc6cf41 100644 --- a/types/nodemailer-ses-transport/nodemailer-ses-transport-tests.ts +++ b/types/nodemailer-ses-transport/nodemailer-ses-transport-tests.ts @@ -1,6 +1,6 @@ import * as AWS from "aws-sdk"; import * as nodemailer from "nodemailer"; -import * as sesTransport from 'nodemailer-ses-transport'; +import sesTransport = require('nodemailer-ses-transport'); const opts: sesTransport.SesOptions = { SES: new AWS.SES(), diff --git a/types/nodemailer-ses-transport/tsconfig.json b/types/nodemailer-ses-transport/tsconfig.json index bdaffbb222..db905153d0 100644 --- a/types/nodemailer-ses-transport/tsconfig.json +++ b/types/nodemailer-ses-transport/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-smtp-pool/tsconfig.json b/types/nodemailer-smtp-pool/tsconfig.json index 63a47e4ce7..ed28a80cfd 100644 --- a/types/nodemailer-smtp-pool/tsconfig.json +++ b/types/nodemailer-smtp-pool/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-smtp-transport/tsconfig.json b/types/nodemailer-smtp-transport/tsconfig.json index 4bce06278d..5a3c396e6f 100644 --- a/types/nodemailer-smtp-transport/tsconfig.json +++ b/types/nodemailer-smtp-transport/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer-stub-transport/tsconfig.json b/types/nodemailer-stub-transport/tsconfig.json index c8fed1b487..52b6f50f53 100644 --- a/types/nodemailer-stub-transport/tsconfig.json +++ b/types/nodemailer-stub-transport/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer/lib/mailer/index.d.ts b/types/nodemailer/lib/mailer/index.d.ts index f08c2d085d..bd9dd7ba8d 100644 --- a/types/nodemailer/lib/mailer/index.d.ts +++ b/types/nodemailer/lib/mailer/index.d.ts @@ -3,7 +3,7 @@ import { EventEmitter } from 'events'; import { Socket } from 'net'; import { Readable } from 'stream'; -import { URL } from 'url'; +import { Url } from 'url'; import { SentMessageInfo, Transport, TransportOptions } from '../..'; import * as shared from '../shared'; @@ -34,7 +34,7 @@ declare namespace Mail { /** String, Buffer or a Stream contents for the attachmentent */ content?: string | Buffer | Readable; /** path to a file or an URL (data uris are allowed as well) if you want to stream the file instead of including it (better for larger attachments) */ - path?: string | URL; + path?: string | Url; } interface Attachment extends AttachmentLike { @@ -175,11 +175,11 @@ declare class Mail extends EventEmitter { setupProxy(proxyUrl: string): void; set(key: 'oauth2_provision_cb', value: (user: string, renew: boolean, callback: (err: Error | null, accessToken?: string, expires?: number) => void) => void): Map; - set(key: 'proxy_handler_http' | 'proxy_handler_https' | 'proxy_handler_socks' | 'proxy_handler_socks5' | 'proxy_handler_socks4' | 'proxy_handler_socks4a', value: (proxy: URL, options: TransportOptions, callback: (err: Error | null, socketOptions?: { connection: Socket }) => void) => void): Map; + set(key: 'proxy_handler_http' | 'proxy_handler_https' | 'proxy_handler_socks' | 'proxy_handler_socks5' | 'proxy_handler_socks4' | 'proxy_handler_socks4a', value: (proxy: Url, options: TransportOptions, callback: (err: Error | null, socketOptions?: { connection: Socket }) => void) => void): Map; set(key: string, value: any): Map; get(key: 'oauth2_provision_cb'): (user: string, renew: boolean, callback: (err: Error | null, accessToken: string, expires: number) => void) => void; - get(key: 'proxy_handler_http' | 'proxy_handler_https' | 'proxy_handler_socks' | 'proxy_handler_socks5' | 'proxy_handler_socks4' | 'proxy_handler_socks4a'): (proxy: URL, options: TransportOptions, callback: (err: Error | null, socketOptions: { connection: Socket }) => void) => void; + get(key: 'proxy_handler_http' | 'proxy_handler_https' | 'proxy_handler_socks' | 'proxy_handler_socks5' | 'proxy_handler_socks4' | 'proxy_handler_socks4a'): (proxy: Url, options: TransportOptions, callback: (err: Error | null, socketOptions: { connection: Socket }) => void) => void; get(key: string): any; addListener(event: 'error', listener: (err: Error) => void): this; diff --git a/types/nodemailer/tsconfig.json b/types/nodemailer/tsconfig.json index f2c1ffbbe8..e01403bac1 100644 --- a/types/nodemailer/tsconfig.json +++ b/types/nodemailer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodemailer/v3/tsconfig.json b/types/nodemailer/v3/tsconfig.json index 4ebef6b8cf..72c13e5afd 100644 --- a/types/nodemailer/v3/tsconfig.json +++ b/types/nodemailer/v3/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nodeunit/tsconfig.json b/types/nodeunit/tsconfig.json index 3d52af1d14..8500b806f3 100644 --- a/types/nodeunit/tsconfig.json +++ b/types/nodeunit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/noisejs/tsconfig.json b/types/noisejs/tsconfig.json index 43e5b37e38..cab62ac0cd 100644 --- a/types/noisejs/tsconfig.json +++ b/types/noisejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nomnom/tsconfig.json b/types/nomnom/tsconfig.json index 0c5b757ced..e67f844431 100644 --- a/types/nomnom/tsconfig.json +++ b/types/nomnom/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nopt/tsconfig.json b/types/nopt/tsconfig.json index 0dc537c0c8..8c962d58a5 100644 --- a/types/nopt/tsconfig.json +++ b/types/nopt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/normalize-package-data/tsconfig.json b/types/normalize-package-data/tsconfig.json index 0e79738d04..95a0703f81 100644 --- a/types/normalize-package-data/tsconfig.json +++ b/types/normalize-package-data/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "normalize-package-data-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/normalize-url/tsconfig.json b/types/normalize-url/tsconfig.json index 1626fe81b7..59d52868c4 100644 --- a/types/normalize-url/tsconfig.json +++ b/types/normalize-url/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/notie/tsconfig.json b/types/notie/tsconfig.json index 0ab631c147..3ee5ae8275 100644 --- a/types/notie/tsconfig.json +++ b/types/notie/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/notify/tsconfig.json b/types/notify/tsconfig.json index a6957993f9..2543739912 100644 --- a/types/notify/tsconfig.json +++ b/types/notify/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/notifyjs-browser/tsconfig.json b/types/notifyjs-browser/tsconfig.json index 53861036b0..e4aae3115f 100644 --- a/types/notifyjs-browser/tsconfig.json +++ b/types/notifyjs-browser/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/notifyjs/tsconfig.json b/types/notifyjs/tsconfig.json index 0652ac5cfc..9c2928de69 100644 --- a/types/notifyjs/tsconfig.json +++ b/types/notifyjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/notyf/tsconfig.json b/types/notyf/tsconfig.json index 9cf78d162a..ac2fa96aad 100644 --- a/types/notyf/tsconfig.json +++ b/types/notyf/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "notyf-tests.ts" ] -} +} \ No newline at end of file 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 diff --git a/types/nouislider/tsconfig.json b/types/nouislider/tsconfig.json index dd6994a4dd..43253dfc79 100644 --- a/types/nouislider/tsconfig.json +++ b/types/nouislider/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/v7/tsconfig.json b/types/nouislider/v7/tsconfig.json index d24f6c55b0..c38ff9e541 100644 --- a/types/nouislider/v7/tsconfig.json +++ b/types/nouislider/v7/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nouislider/v8/tsconfig.json b/types/nouislider/v8/tsconfig.json index 6dfd2ac510..d0b146bb70 100644 --- a/types/nouislider/v8/tsconfig.json +++ b/types/nouislider/v8/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/tsconfig.json b/types/novnc-core/tsconfig.json index 3aed33120e..93eff8a1e4 100644 --- a/types/novnc-core/tsconfig.json +++ b/types/novnc-core/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/npm-package-arg/tsconfig.json b/types/npm-package-arg/tsconfig.json index 1eea7a98ae..7cc49c7366 100644 --- a/types/npm-package-arg/tsconfig.json +++ b/types/npm-package-arg/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/npm/tsconfig.json b/types/npm/tsconfig.json index 01aebadc3e..8f15ee25cf 100644 --- a/types/npm/tsconfig.json +++ b/types/npm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nprogress/tsconfig.json b/types/nprogress/tsconfig.json index bd50ab2e1f..e8c393e92c 100644 --- a/types/nprogress/tsconfig.json +++ b/types/nprogress/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ns-api/tsconfig.json b/types/ns-api/tsconfig.json index 6918e1e567..7569d8c5fa 100644 --- a/types/ns-api/tsconfig.json +++ b/types/ns-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nslog/tsconfig.json b/types/nslog/tsconfig.json index 6cd009f29d..a285b4a578 100644 --- a/types/nslog/tsconfig.json +++ b/types/nslog/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nsqjs/tsconfig.json b/types/nsqjs/tsconfig.json index 6681afbdb9..5a96224386 100644 --- a/types/nsqjs/tsconfig.json +++ b/types/nsqjs/tsconfig.json @@ -15,10 +15,10 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "strictFunctionTypes": true + "esModuleInterop": true }, "files": [ "index.d.ts", "nsqjs-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/number-is-nan/tsconfig.json b/types/number-is-nan/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/number-is-nan/tsconfig.json +++ b/types/number-is-nan/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/number-to-words/tsconfig.json b/types/number-to-words/tsconfig.json index 49b562b085..c14a5e19f2 100644 --- a/types/number-to-words/tsconfig.json +++ b/types/number-to-words/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/numeral/tsconfig.json b/types/numeral/tsconfig.json index 332485f391..e47443e0f5 100644 --- a/types/numeral/tsconfig.json +++ b/types/numeral/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/numjs/tsconfig.json b/types/numjs/tsconfig.json index f76db6c4ca..7b5455900f 100644 --- a/types/numjs/tsconfig.json +++ b/types/numjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nunjucks-date/tsconfig.json b/types/nunjucks-date/tsconfig.json index c5851d125c..a4174f7bc8 100644 --- a/types/nunjucks-date/tsconfig.json +++ b/types/nunjucks-date/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nunjucks/tsconfig.json b/types/nunjucks/tsconfig.json index 5824ce2f1f..70ac043ff8 100644 --- a/types/nunjucks/tsconfig.json +++ b/types/nunjucks/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "nunjucks-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/nvd3/tsconfig.json b/types/nvd3/tsconfig.json index a2aa830e00..910a98d99c 100644 --- a/types/nvd3/tsconfig.json +++ b/types/nvd3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nw.gui/tsconfig.json b/types/nw.gui/tsconfig.json index ec66284c38..0570b20e56 100644 --- a/types/nw.gui/tsconfig.json +++ b/types/nw.gui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/nw.js/tsconfig.json b/types/nw.js/tsconfig.json index 047aa3c15a..035330976b 100644 --- a/types/nw.js/tsconfig.json +++ b/types/nw.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/o.js/tsconfig.json b/types/o.js/tsconfig.json index a3159265ee..536d5abe8c 100644 --- a/types/o.js/tsconfig.json +++ b/types/o.js/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oauth.js/tsconfig.json b/types/oauth.js/tsconfig.json index 39891ddb92..2b9b599818 100644 --- a/types/oauth.js/tsconfig.json +++ b/types/oauth.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oauth2-server/index.d.ts b/types/oauth2-server/index.d.ts index a423f48a58..06b6fbadb0 100644 --- a/types/oauth2-server/index.d.ts +++ b/types/oauth2-server/index.d.ts @@ -5,7 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -import { Request, RequestHandler } from "express"; +import Express = require("express"); /** * Represents an OAuth2 server instance. diff --git a/types/oauth2-server/oauth2-server-tests.ts b/types/oauth2-server/oauth2-server-tests.ts index be8fa83705..faf9976873 100644 --- a/types/oauth2-server/oauth2-server-tests.ts +++ b/types/oauth2-server/oauth2-server-tests.ts @@ -1,5 +1,5 @@ -import * as express from "express"; -import * as OAuth2Server from "oauth2-server"; +import express = require("express"); +import OAuth2Server = require("oauth2-server"); const oauth2Model: OAuth2Server.AuthorizationCodeModel = { getClient: async (clientId: string, clientSecret: string): Promise => { diff --git a/types/oauth2-server/tsconfig.json b/types/oauth2-server/tsconfig.json index b245965239..ee86fffc4f 100644 --- a/types/oauth2-server/tsconfig.json +++ b/types/oauth2-server/tsconfig.json @@ -15,6 +15,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "target": "es6" }, "files": [ diff --git a/types/oauth2orize/tsconfig.json b/types/oauth2orize/tsconfig.json index 7903eeb77f..f2a562ac68 100644 --- a/types/oauth2orize/tsconfig.json +++ b/types/oauth2orize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/obelisk.js/tsconfig.json b/types/obelisk.js/tsconfig.json index f95e82cb80..3005f5052f 100644 --- a/types/obelisk.js/tsconfig.json +++ b/types/obelisk.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-assign/tsconfig.json b/types/object-assign/tsconfig.json index f00a78b509..14dd544d25 100644 --- a/types/object-assign/tsconfig.json +++ b/types/object-assign/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-diff/tsconfig.json b/types/object-diff/tsconfig.json index 3fdf287fcf..d49649e67a 100644 --- a/types/object-diff/tsconfig.json +++ b/types/object-diff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-hash/index.d.ts b/types/object-hash/index.d.ts index c6b16df950..4da49c262c 100644 --- a/types/object-hash/index.d.ts +++ b/types/object-hash/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for object-hash v1.1.8 +// Type definitions for object-hash v1.2.0 // Project: https://github.com/puleos/object-hash // Definitions by: Michael Zabka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -18,6 +18,7 @@ declare namespace ObjectHash { respectFunctionNames?: boolean; unorderedArrays?: boolean; unorderedSets?: boolean; + excludeKeys?: (key: string) => boolean; } interface HashTableItem { diff --git a/types/object-hash/tsconfig.json b/types/object-hash/tsconfig.json index 7f1eb2a0f1..fe16726761 100644 --- a/types/object-hash/tsconfig.json +++ b/types/object-hash/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-inspect/tsconfig.json b/types/object-inspect/tsconfig.json index 1f167ba039..bcdc9ceafa 100644 --- a/types/object-inspect/tsconfig.json +++ b/types/object-inspect/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "object-inspect-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/object-map/tsconfig.json b/types/object-map/tsconfig.json index 88256eb7f9..b395a58165 100644 --- a/types/object-map/tsconfig.json +++ b/types/object-map/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-path/tsconfig.json b/types/object-path/tsconfig.json index 14192cc5b0..776b12f2ed 100644 --- a/types/object-path/tsconfig.json +++ b/types/object-path/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/object-refs/tsconfig.json b/types/object-refs/tsconfig.json index 3d9337cf0a..0fa906064e 100644 --- a/types/object-refs/tsconfig.json +++ b/types/object-refs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oblo-util/tsconfig.json b/types/oblo-util/tsconfig.json index c424a7fff8..9d878f810c 100644 --- a/types/oblo-util/tsconfig.json +++ b/types/oblo-util/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oboe/tsconfig.json b/types/oboe/tsconfig.json index 1c02019149..08c0ffd5df 100644 --- a/types/oboe/tsconfig.json +++ b/types/oboe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/observe-js/tsconfig.json b/types/observe-js/tsconfig.json index 23b2a5106e..19dbac24df 100644 --- a/types/observe-js/tsconfig.json +++ b/types/observe-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oclazyload/tsconfig.json b/types/oclazyload/tsconfig.json index 3ada1d6bee..c3be409f70 100644 --- a/types/oclazyload/tsconfig.json +++ b/types/oclazyload/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/odata/tsconfig.json b/types/odata/tsconfig.json index d7ea224b4e..635168e418 100644 --- a/types/odata/tsconfig.json +++ b/types/odata/tsconfig.json @@ -20,7 +20,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ofe/tsconfig.json b/types/ofe/tsconfig.json index dbd94babca..13f2ecddb1 100644 --- a/types/ofe/tsconfig.json +++ b/types/ofe/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/office-js/tsconfig.json b/types/office-js/tsconfig.json index 28a0881837..45e8292315 100644 --- a/types/office-js/tsconfig.json +++ b/types/office-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/offline-js/tsconfig.json b/types/offline-js/tsconfig.json index e7d567565c..63c0c3d772 100644 --- a/types/offline-js/tsconfig.json +++ b/types/offline-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oibackoff/tsconfig.json b/types/oibackoff/tsconfig.json index d1f4fd90d8..bf94e5b8a8 100644 --- a/types/oibackoff/tsconfig.json +++ b/types/oibackoff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oidc-token-manager/tsconfig.json b/types/oidc-token-manager/tsconfig.json index 9a1d07adb6..0069da49f5 100644 --- a/types/oidc-token-manager/tsconfig.json +++ b/types/oidc-token-manager/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ol/tsconfig.json b/types/ol/tsconfig.json index b307225e58..4c7846cda7 100644 --- a/types/ol/tsconfig.json +++ b/types/ol/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", @@ -173,4 +174,4 @@ "vectortile/index.d.ts", "view/index.d.ts" ] -} +} \ No newline at end of file diff --git a/types/on-finished/tsconfig.json b/types/on-finished/tsconfig.json index 14e726f8c4..7e49b150bb 100644 --- a/types/on-finished/tsconfig.json +++ b/types/on-finished/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/on-headers/tsconfig.json b/types/on-headers/tsconfig.json index a0e5fc13dd..25c2e3c8d5 100644 --- a/types/on-headers/tsconfig.json +++ b/types/on-headers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/once/tsconfig.json b/types/once/tsconfig.json index e6b9784107..67de4d3961 100644 --- a/types/once/tsconfig.json +++ b/types/once/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/onesignal-cordova-plugin/tsconfig.json b/types/onesignal-cordova-plugin/tsconfig.json index bcee47426f..ce255e192d 100644 --- a/types/onesignal-cordova-plugin/tsconfig.json +++ b/types/onesignal-cordova-plugin/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "onesignal-cordova-plugin-tests.ts" ] -} +} \ No newline at end of file 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/onetime/tsconfig.json b/types/onetime/tsconfig.json index 84d3da86b8..f283f14841 100644 --- a/types/onetime/tsconfig.json +++ b/types/onetime/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oniguruma/tsconfig.json b/types/oniguruma/tsconfig.json index b807c6e5de..28d398ed22 100644 --- a/types/oniguruma/tsconfig.json +++ b/types/oniguruma/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/onoff/tsconfig.json b/types/onoff/tsconfig.json index cbe0820a5a..ae7322e35a 100644 --- a/types/onoff/tsconfig.json +++ b/types/onoff/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/open/tsconfig.json b/types/open/tsconfig.json index 1395893dcb..62cd144b3b 100644 --- a/types/open/tsconfig.json +++ b/types/open/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/opener/tsconfig.json b/types/opener/tsconfig.json index 8f8b166751..fd2c277637 100644 --- a/types/opener/tsconfig.json +++ b/types/opener/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openfin/tsconfig.json b/types/openfin/tsconfig.json index fd3199ceb7..48d26affcc 100644 --- a/types/openfin/tsconfig.json +++ b/types/openfin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openfin/v15/tsconfig.json b/types/openfin/v15/tsconfig.json index 103e765e43..17537fec00 100644 --- a/types/openfin/v15/tsconfig.json +++ b/types/openfin/v15/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openfin/v16/tsconfig.json b/types/openfin/v16/tsconfig.json index cfb0b2d238..f6d5d45a8a 100644 --- a/types/openfin/v16/tsconfig.json +++ b/types/openfin/v16/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openjscad/tsconfig.json b/types/openjscad/tsconfig.json index 971a3ee55a..44ef0db880 100644 --- a/types/openjscad/tsconfig.json +++ b/types/openjscad/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openlayers/index.d.ts b/types/openlayers/index.d.ts index c2e7ab1530..c217a6d873 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; } @@ -14615,6 +14618,7 @@ declare module olx { maxZoom?: number; duration?: number; easing?: ((t: number) => number); + callback?: olx.animation.AnimateCallback; } } diff --git a/types/openlayers/openlayers-tests.ts b/types/openlayers/openlayers-tests.ts index 666b7b746f..4353f48960 100644 --- a/types/openlayers/openlayers-tests.ts +++ b/types/openlayers/openlayers-tests.ts @@ -399,6 +399,10 @@ let view: ol.View = new ol.View({ voidValue = view.setMaxZoom(numberValue); voidValue = view.setMinZoom(numberValue); +voidValue = view.fit(simpleGeometry); +voidValue = view.fit(extent); +voidValue = view.fit(extent, {callback: () => {}}); +voidValue = view.fit(extent, {callback: (animationCompleted: boolean) => {}}); // // ol.layer.Base diff --git a/types/openlayers/tsconfig.json b/types/openlayers/tsconfig.json index 5b45cb31b9..3bc277ecae 100644 --- a/types/openlayers/tsconfig.json +++ b/types/openlayers/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openlayers/v2/tsconfig.json b/types/openlayers/v2/tsconfig.json index 67c0f29fd4..3725c17b1f 100644 --- a/types/openlayers/v2/tsconfig.json +++ b/types/openlayers/v2/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/openlayers/v3/tsconfig.json b/types/openlayers/v3/tsconfig.json index 052323b232..40f3d72c1a 100644 --- a/types/openlayers/v3/tsconfig.json +++ b/types/openlayers/v3/tsconfig.json @@ -20,7 +20,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openpgp/tsconfig.json b/types/openpgp/tsconfig.json index 8ed156faf3..0d89f5cddd 100644 --- a/types/openpgp/tsconfig.json +++ b/types/openpgp/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openstack-wrapper/tsconfig.json b/types/openstack-wrapper/tsconfig.json index f6fa4b227b..42501aaebd 100644 --- a/types/openstack-wrapper/tsconfig.json +++ b/types/openstack-wrapper/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/opentok/tsconfig.json b/types/opentok/tsconfig.json index 0e035c2a4c..867816c287 100644 --- a/types/opentok/tsconfig.json +++ b/types/opentok/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/opentype.js/tsconfig.json b/types/opentype.js/tsconfig.json index ae36366993..20de3c612b 100644 --- a/types/opentype.js/tsconfig.json +++ b/types/opentype.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/openui5/tsconfig.json b/types/openui5/tsconfig.json index e61a38f38c..406a9171dd 100644 --- a/types/openui5/tsconfig.json +++ b/types/openui5/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/opn/tsconfig.json b/types/opn/tsconfig.json index 2a51fff8ca..dc544741ee 100644 --- a/types/opn/tsconfig.json +++ b/types/opn/tsconfig.json @@ -1,16 +1,24 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": ["index.d.ts", "opn-tests.ts"] -} + "files": [ + "index.d.ts", + "opn-tests.ts" + ] +} \ No newline at end of file diff --git a/types/optics-agent/optics-agent-tests.ts b/types/optics-agent/optics-agent-tests.ts index 2135c810d4..22b9b479e9 100644 --- a/types/optics-agent/optics-agent-tests.ts +++ b/types/optics-agent/optics-agent-tests.ts @@ -9,9 +9,9 @@ import OpticsAgent, { Agent, } from 'optics-agent'; import { GraphQLSchema } from 'graphql'; -import * as express from 'express'; +import express = require('express'); import * as hapi from 'hapi'; -import * as KoaServer from 'koa'; +import KoaServer = require('koa'); const configOptions: Options = { apiKey: "", diff --git a/types/optics-agent/tsconfig.json b/types/optics-agent/tsconfig.json index e7dbc8958b..adb6fdbba4 100644 --- a/types/optics-agent/tsconfig.json +++ b/types/optics-agent/tsconfig.json @@ -14,13 +14,16 @@ ], "types": [], "paths": { - "boom": ["boom/v4"] + "boom": [ + "boom/v4" + ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "optics-agent-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/optimist/tsconfig.json b/types/optimist/tsconfig.json index da5b6d43c7..f16b4b49e4 100644 --- a/types/optimist/tsconfig.json +++ b/types/optimist/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts b/types/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts index 74cf685649..0dd1531313 100644 --- a/types/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts +++ b/types/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts @@ -1,4 +1,4 @@ -import * as OptimizeCssAssets from 'optimize-css-assets-webpack-plugin'; +import OptimizeCssAssets = require('optimize-css-assets-webpack-plugin'); const ocap: OptimizeCssAssets = new OptimizeCssAssets({ assetNameRegExp: /\.min\.css$/, diff --git a/types/optimize-css-assets-webpack-plugin/tsconfig.json b/types/optimize-css-assets-webpack-plugin/tsconfig.json index bb2c39172f..5420b382e4 100644 --- a/types/optimize-css-assets-webpack-plugin/tsconfig.json +++ b/types/optimize-css-assets-webpack-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ora/tsconfig.json b/types/ora/tsconfig.json index 4092876efe..2480951ab5 100644 --- a/types/ora/tsconfig.json +++ b/types/ora/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/ora/v0/tsconfig.json b/types/ora/v0/tsconfig.json index b614f6cbc4..d8ac13a91d 100644 --- a/types/ora/v0/tsconfig.json +++ b/types/ora/v0/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/oracledb/tsconfig.json b/types/oracledb/tsconfig.json index 2e6eeb9b95..7a878379cd 100644 --- a/types/oracledb/tsconfig.json +++ b/types/oracledb/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/orchestrator/tsconfig.json b/types/orchestrator/tsconfig.json index 3cfb6b0cdb..1da510b3ca 100644 --- a/types/orchestrator/tsconfig.json +++ b/types/orchestrator/tsconfig.json @@ -15,7 +15,8 @@ "strictNullChecks": false, "strictFunctionTypes": true, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/orderedmap/tsconfig.json b/types/orderedmap/tsconfig.json index d8428d94cc..5ab20ebbc3 100644 --- a/types/orderedmap/tsconfig.json +++ b/types/orderedmap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/orientjs/orientjs-tests.ts b/types/orientjs/orientjs-tests.ts index ec083b84e3..9b11968058 100644 --- a/types/orientjs/orientjs-tests.ts +++ b/types/orientjs/orientjs-tests.ts @@ -1,4 +1,4 @@ -import * as orientjs from 'orientjs'; +import orientjs = require('orientjs'); const dbserver = orientjs({ host: 'localhost', diff --git a/types/orientjs/tsconfig.json b/types/orientjs/tsconfig.json index 87bfdfd2a8..a8418ce64b 100644 --- a/types/orientjs/tsconfig.json +++ b/types/orientjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/os-homedir/tsconfig.json b/types/os-homedir/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/os-homedir/tsconfig.json +++ b/types/os-homedir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/os-locale/tsconfig.json b/types/os-locale/tsconfig.json index fbf08733cf..6e168a01ce 100644 --- a/types/os-locale/tsconfig.json +++ b/types/os-locale/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/os-locale/v1/tsconfig.json b/types/os-locale/v1/tsconfig.json index acb67ee603..c53210a218 100644 --- a/types/os-locale/v1/tsconfig.json +++ b/types/os-locale/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/os-name/tsconfig.json b/types/os-name/tsconfig.json index f48355e962..9220809237 100644 --- a/types/os-name/tsconfig.json +++ b/types/os-name/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/os-tmpdir/tsconfig.json b/types/os-tmpdir/tsconfig.json index abf333c6bf..3d2df78db9 100644 --- a/types/os-tmpdir/tsconfig.json +++ b/types/os-tmpdir/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/osmosis/tsconfig.json b/types/osmosis/tsconfig.json index 9627f6d5fe..f5eb196c89 100644 --- a/types/osmosis/tsconfig.json +++ b/types/osmosis/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/osmtogeojson/tsconfig.json b/types/osmtogeojson/tsconfig.json index c50e45768c..e708a2429b 100644 --- a/types/osmtogeojson/tsconfig.json +++ b/types/osmtogeojson/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/osrm/osrm-tests.ts b/types/osrm/osrm-tests.ts index fd53363dd7..513e8c1fd2 100644 --- a/types/osrm/osrm-tests.ts +++ b/types/osrm/osrm-tests.ts @@ -1,5 +1,5 @@ import * as fs from 'fs'; -import * as OSRM from 'osrm'; +import OSRM = require('osrm'); // Access to Types from namespace const tile: OSRM.Tile = [0, 0, 0]; diff --git a/types/osrm/tsconfig.json b/types/osrm/tsconfig.json index 8a581c7423..3ebd7db8b3 100644 --- a/types/osrm/tsconfig.json +++ b/types/osrm/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/otplib/tsconfig.json b/types/otplib/tsconfig.json index cfb2b07081..2b3c420d67 100644 --- a/types/otplib/tsconfig.json +++ b/types/otplib/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "otplib-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/owasp-password-strength-test/tsconfig.json b/types/owasp-password-strength-test/tsconfig.json index 0206d30034..d10909118e 100644 --- a/types/owasp-password-strength-test/tsconfig.json +++ b/types/owasp-password-strength-test/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "owasp-password-strength-test-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/owl.carousel/tsconfig.json b/types/owl.carousel/tsconfig.json index 4205eff11f..fb9f9f4f6e 100644 --- a/types/owl.carousel/tsconfig.json +++ b/types/owl.carousel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/owlcarousel/tsconfig.json b/types/owlcarousel/tsconfig.json index 4438ba88ae..db23d47838 100644 --- a/types/owlcarousel/tsconfig.json +++ b/types/owlcarousel/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-all/tsconfig.json b/types/p-all/tsconfig.json index 5cc346c4e3..5d706ed217 100644 --- a/types/p-all/tsconfig.json +++ b/types/p-all/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-any/tsconfig.json b/types/p-any/tsconfig.json index 67d983361a..56f19a51e5 100644 --- a/types/p-any/tsconfig.json +++ b/types/p-any/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-cancelable/tsconfig.json b/types/p-cancelable/tsconfig.json index 504511081d..eb9e9b9b33 100644 --- a/types/p-cancelable/tsconfig.json +++ b/types/p-cancelable/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-debounce/tsconfig.json b/types/p-debounce/tsconfig.json index 4de0f115d8..d8f3a41d21 100644 --- a/types/p-debounce/tsconfig.json +++ b/types/p-debounce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-defer/tsconfig.json b/types/p-defer/tsconfig.json index 06eb650dbe..d48a07b169 100644 --- a/types/p-defer/tsconfig.json +++ b/types/p-defer/tsconfig.json @@ -16,7 +16,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-do-whilst/tsconfig.json b/types/p-do-whilst/tsconfig.json index 87392769da..fa551d6727 100644 --- a/types/p-do-whilst/tsconfig.json +++ b/types/p-do-whilst/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-each-series/tsconfig.json b/types/p-each-series/tsconfig.json index e8cd900d05..d62549d651 100644 --- a/types/p-each-series/tsconfig.json +++ b/types/p-each-series/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-event/tsconfig.json b/types/p-event/tsconfig.json index 0e047aa84b..8d282c8736 100644 --- a/types/p-event/tsconfig.json +++ b/types/p-event/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-every/tsconfig.json b/types/p-every/tsconfig.json index 979927093f..87b3f1c968 100644 --- a/types/p-every/tsconfig.json +++ b/types/p-every/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-lazy/tsconfig.json b/types/p-lazy/tsconfig.json index 73b2e31142..24a3174936 100644 --- a/types/p-lazy/tsconfig.json +++ b/types/p-lazy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-limit/index.d.ts b/types/p-limit/index.d.ts index a10fd05e1e..416622298b 100644 --- a/types/p-limit/index.d.ts +++ b/types/p-limit/index.d.ts @@ -7,4 +7,4 @@ declare namespace pLimit {} export = pLimit; -declare function pLimit(concurrency: number): (fn: () => PromiseLike) => Promise; +declare function pLimit(concurrency: number): (fn: () => PromiseLike) => Promise; diff --git a/types/p-limit/p-limit-tests.ts b/types/p-limit/p-limit-tests.ts index 6e50894802..e04b895e87 100644 --- a/types/p-limit/p-limit-tests.ts +++ b/types/p-limit/p-limit-tests.ts @@ -1,6 +1,6 @@ import pLimit = require('p-limit'); -const limit = pLimit(1); +const limit = pLimit(1); const input = [ limit(() => Promise.resolve('foo')), diff --git a/types/p-limit/tsconfig.json b/types/p-limit/tsconfig.json index 4634bf6300..e438eda453 100644 --- a/types/p-limit/tsconfig.json +++ b/types/p-limit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-loading/tsconfig.json b/types/p-loading/tsconfig.json index 3aeb261695..fa6843d54f 100644 --- a/types/p-loading/tsconfig.json +++ b/types/p-loading/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "p-loading-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/p-locate/tsconfig.json b/types/p-locate/tsconfig.json index 1f3e8a7711..794031a75b 100644 --- a/types/p-locate/tsconfig.json +++ b/types/p-locate/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-log/tsconfig.json b/types/p-log/tsconfig.json index 891d94fce3..1d875c64b1 100644 --- a/types/p-log/tsconfig.json +++ b/types/p-log/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-map-series/tsconfig.json b/types/p-map-series/tsconfig.json index b06e222983..6594c24661 100644 --- a/types/p-map-series/tsconfig.json +++ b/types/p-map-series/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-map/tsconfig.json b/types/p-map/tsconfig.json index ed62309b29..d156c77951 100644 --- a/types/p-map/tsconfig.json +++ b/types/p-map/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-one/tsconfig.json b/types/p-one/tsconfig.json index 27a6a05ac7..525393d638 100644 --- a/types/p-one/tsconfig.json +++ b/types/p-one/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-props/tsconfig.json b/types/p-props/tsconfig.json index 8ef73ae141..56998f169a 100644 --- a/types/p-props/tsconfig.json +++ b/types/p-props/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-queue/index.d.ts b/types/p-queue/index.d.ts index a3d4608bce..568de0ca1d 100644 --- a/types/p-queue/index.d.ts +++ b/types/p-queue/index.d.ts @@ -8,25 +8,68 @@ 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. + */ 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. + */ 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>; diff --git a/types/p-queue/tsconfig.json b/types/p-queue/tsconfig.json index b3dd5e5314..dd19b0083f 100644 --- a/types/p-queue/tsconfig.json +++ b/types/p-queue/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-reduce/tsconfig.json b/types/p-reduce/tsconfig.json index d06d04e5e7..2debc8d66f 100644 --- a/types/p-reduce/tsconfig.json +++ b/types/p-reduce/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-reflect/tsconfig.json b/types/p-reflect/tsconfig.json index 0bd514215f..b7c6dc1702 100644 --- a/types/p-reflect/tsconfig.json +++ b/types/p-reflect/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-retry/tsconfig.json b/types/p-retry/tsconfig.json index 8bd6ddd6b5..21687875fa 100644 --- a/types/p-retry/tsconfig.json +++ b/types/p-retry/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-series/tsconfig.json b/types/p-series/tsconfig.json index 7ac0ed4d4c..45a2be71c5 100644 --- a/types/p-series/tsconfig.json +++ b/types/p-series/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-settle/tsconfig.json b/types/p-settle/tsconfig.json index ba288104e0..1e8220467f 100644 --- a/types/p-settle/tsconfig.json +++ b/types/p-settle/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-some/tsconfig.json b/types/p-some/tsconfig.json index d8bca7e13a..d6e4b1b63e 100644 --- a/types/p-some/tsconfig.json +++ b/types/p-some/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-tap/tsconfig.json b/types/p-tap/tsconfig.json index 1d4042647f..ed4f136d0b 100644 --- a/types/p-tap/tsconfig.json +++ b/types/p-tap/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-throttle/tsconfig.json b/types/p-throttle/tsconfig.json index 81852e4d18..f30c9ed4e3 100644 --- a/types/p-throttle/tsconfig.json +++ b/types/p-throttle/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-timeout/tsconfig.json b/types/p-timeout/tsconfig.json index d16042504a..40bb9b3b8b 100644 --- a/types/p-timeout/tsconfig.json +++ b/types/p-timeout/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-try/tsconfig.json b/types/p-try/tsconfig.json index b8ca67f073..7cd170e0da 100644 --- a/types/p-try/tsconfig.json +++ b/types/p-try/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-wait-for/tsconfig.json b/types/p-wait-for/tsconfig.json index 7df0af64a1..e3e3bb7597 100644 --- a/types/p-wait-for/tsconfig.json +++ b/types/p-wait-for/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p-whilst/tsconfig.json b/types/p-whilst/tsconfig.json index 3309a228fc..8fd1bb42ba 100644 --- a/types/p-whilst/tsconfig.json +++ b/types/p-whilst/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/p2/tsconfig.json b/types/p2/tsconfig.json index c40f2ddd89..576a91b7c6 100644 --- a/types/p2/tsconfig.json +++ b/types/p2/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/package-json/tsconfig.json b/types/package-json/tsconfig.json index 52c1adb7d3..c033223c6d 100644 --- a/types/package-json/tsconfig.json +++ b/types/package-json/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "package-json-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/packery/tsconfig.json b/types/packery/tsconfig.json index 85c7e3ae6a..3e17d32ee6 100644 --- a/types/packery/tsconfig.json +++ b/types/packery/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pad/tsconfig.json b/types/pad/tsconfig.json index 6a6ef6d4c7..fd8ce70400 100644 --- a/types/pad/tsconfig.json +++ b/types/pad/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/page-icon/page-icon-tests.ts b/types/page-icon/page-icon-tests.ts index 4a6bc8c2b6..2b2873dae1 100644 --- a/types/page-icon/page-icon-tests.ts +++ b/types/page-icon/page-icon-tests.ts @@ -1,4 +1,4 @@ -import * as pageIcon from "page-icon"; +import pageIcon = require("page-icon"); const siteUrl = "https://www.facebook.com/"; pageIcon(siteUrl) diff --git a/types/page-icon/tsconfig.json b/types/page-icon/tsconfig.json index f5dc72cbcd..143c1b0232 100644 --- a/types/page-icon/tsconfig.json +++ b/types/page-icon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/page/tsconfig.json b/types/page/tsconfig.json index 3a774901be..f3ffce244f 100644 --- a/types/page/tsconfig.json +++ b/types/page/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/paho-mqtt/tsconfig.json b/types/paho-mqtt/tsconfig.json index 7e9a7ce4e6..f08ccecb7a 100644 --- a/types/paho-mqtt/tsconfig.json +++ b/types/paho-mqtt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pako/tsconfig.json b/types/pako/tsconfig.json index 011a39c83c..b1e866a0a9 100644 --- a/types/pako/tsconfig.json +++ b/types/pako/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pangu/tsconfig.json b/types/pangu/tsconfig.json index a1084b5b06..83ce22a7b2 100644 --- a/types/pangu/tsconfig.json +++ b/types/pangu/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pangu-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/papaparse/tsconfig.json b/types/papaparse/tsconfig.json index 1684012a56..80238273d7 100644 --- a/types/papaparse/tsconfig.json +++ b/types/papaparse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 64d961ed10..3f57526a19 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. @@ -1308,12 +1308,12 @@ declare module paper { * The function to be called when the mouse button is pushed down on the item. The function receives a MouseEvent object which contains information about the mouse event. */ onMouseDown: (event: MouseEvent) => void; - + /** * The function to be called when the mouse position changes while the mouse is being dragged. The function receives a MouseEvent object which contains information about the mouse event. */ onMouseDrag: (event: MouseEvent) => void; - + /** * The function to be called when the mouse button is released over the item. * The function receives a MouseEvent object which contains information about the mouse event. @@ -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?: { insert?: boolean, deep?: boolean }): 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. @@ -3235,6 +3237,16 @@ declare module paper { * Deselects all selected items in the project. */ deselectAll(): void; + + /** + * Adds the specified layer at the end of the this project’s layers list. + */ + addLayer(layer: Layer): Layer; + + /** + * Inserts the specified layer at the specified index in this project’s layers list. + */ + insertLayer(index: number, layer: Layer): Layer; /** * Perform a hit-test on the items contained within the project at the location of the specified point. @@ -3535,7 +3547,7 @@ declare module paper { * @param highlight [optional] - */ constructor(color: Gradient, origin: Point, destination: Point, highlight?: Point); - + /** * Creates a RGB Color object. * @param hex - the RGB color in hex, i.e. #000000 @@ -3769,6 +3781,48 @@ declare module paper { */ onResize: (event: Event) => void; + /** + * The function to be called when the mouse button is pushed down on the item. The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseDown: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse position changes while the mouse is being dragged. The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseDrag: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse button is released over the item. + * The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseUp: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse clicks on the item. The function receives a MouseEvent object which contains information about the mouse event. + */ + onClick: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse double clicks on the item. The function receives a MouseEvent object which contains information about the mouse event. + */ + onDoubleClick: (event: MouseEvent) => void; + + /** + * The function to be called repeatedly when the mouse moves on top of the item. The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseMove: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse moves over the item. This function will only be called again, once the mouse moved outside of the item first. The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseEnter: (event: MouseEvent) => void; + + /** + * The function to be called when the mouse moves out of the item. + * The function receives a MouseEvent object which contains information about the mouse event. + */ + onMouseLeave: (event: MouseEvent) => void; + /** * Removes this view from the project and frees the associated element. */ diff --git a/types/paper/tsconfig.json b/types/paper/tsconfig.json index ba81ca6cf0..6f21980e93 100644 --- a/types/paper/tsconfig.json +++ b/types/paper/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/paralleljs/tsconfig.json b/types/paralleljs/tsconfig.json index 0cea925bbd..d074b65fd1 100644 --- a/types/paralleljs/tsconfig.json +++ b/types/paralleljs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parent-package-json/tsconfig.json b/types/parent-package-json/tsconfig.json index 33d474c851..b07b7e1918 100644 --- a/types/parent-package-json/tsconfig.json +++ b/types/parent-package-json/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "parent-package-json-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/parse-git-config/tsconfig.json b/types/parse-git-config/tsconfig.json index 5295cbc1ee..ec4ea443ed 100644 --- a/types/parse-git-config/tsconfig.json +++ b/types/parse-git-config/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-glob/tsconfig.json b/types/parse-glob/tsconfig.json index 0f620fa4e7..62c72fdf23 100644 --- a/types/parse-glob/tsconfig.json +++ b/types/parse-glob/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-json/tsconfig.json b/types/parse-json/tsconfig.json index 448f6787ba..153bd71944 100644 --- a/types/parse-json/tsconfig.json +++ b/types/parse-json/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "parse-json-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/parse-link-header/tsconfig.json b/types/parse-link-header/tsconfig.json index 82b1addcbd..7156e907bc 100644 --- a/types/parse-link-header/tsconfig.json +++ b/types/parse-link-header/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-mockdb/tsconfig.json b/types/parse-mockdb/tsconfig.json index 47ec90a997..9990f2ee1e 100644 --- a/types/parse-mockdb/tsconfig.json +++ b/types/parse-mockdb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-ms/tsconfig.json b/types/parse-ms/tsconfig.json index 3fecf7615f..28c9a4810e 100644 --- a/types/parse-ms/tsconfig.json +++ b/types/parse-ms/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "parse-ms-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/parse-torrent-file/parse-torrent-file-tests.ts b/types/parse-torrent-file/parse-torrent-file-tests.ts index a981c0bc81..43b8c7d0fd 100644 --- a/types/parse-torrent-file/parse-torrent-file-tests.ts +++ b/types/parse-torrent-file/parse-torrent-file-tests.ts @@ -1,4 +1,4 @@ -import * as parseTorrentFile from 'parse-torrent-file'; +import parseTorrentFile = require('parse-torrent-file'); import * as fs from 'fs'; const torrent = fs.readFileSync(__filename); diff --git a/types/parse-torrent-file/tsconfig.json b/types/parse-torrent-file/tsconfig.json index dcd42f04f0..bce67a0d57 100644 --- a/types/parse-torrent-file/tsconfig.json +++ b/types/parse-torrent-file/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-torrent/index.d.ts b/types/parse-torrent/index.d.ts index c6bd901976..9b410759a3 100644 --- a/types/parse-torrent/index.d.ts +++ b/types/parse-torrent/index.d.ts @@ -5,7 +5,7 @@ /// -import * as MagnetUri from 'magnet-uri'; +import MagnetUri = require('magnet-uri'); import * as ParseTorrentFile from 'parse-torrent-file'; declare const ParseTorrent: ParseTorrent.ParseTorrent; diff --git a/types/parse-torrent/parse-torrent-tests.ts b/types/parse-torrent/parse-torrent-tests.ts index 24d00dbe98..c2676ff080 100644 --- a/types/parse-torrent/parse-torrent-tests.ts +++ b/types/parse-torrent/parse-torrent-tests.ts @@ -1,4 +1,4 @@ -import * as parseTorrent from 'parse-torrent'; +import parseTorrent = require('parse-torrent'); import * as fs from 'fs'; // info hash (as a hex string) diff --git a/types/parse-torrent/tsconfig.json b/types/parse-torrent/tsconfig.json index 1a2750195a..f82d5a8bfc 100644 --- a/types/parse-torrent/tsconfig.json +++ b/types/parse-torrent/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse-unit/tsconfig.json b/types/parse-unit/tsconfig.json index 081dcee45d..3257f3b69e 100644 --- a/types/parse-unit/tsconfig.json +++ b/types/parse-unit/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parse/tsconfig.json b/types/parse/tsconfig.json index 53ec60085d..8e41c1dede 100644 --- a/types/parse/tsconfig.json +++ b/types/parse/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", 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/parseurl/tsconfig.json b/types/parseurl/tsconfig.json index f47e85f978..4f7ce9cbac 100644 --- a/types/parseurl/tsconfig.json +++ b/types/parseurl/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/parsimmon/tsconfig.json b/types/parsimmon/tsconfig.json index 676b349a37..6e85d7e3ca 100644 --- a/types/parsimmon/tsconfig.json +++ b/types/parsimmon/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "parsimmon-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/passport-anonymous/tsconfig.json b/types/passport-anonymous/tsconfig.json index 1d8859e706..b667acd694 100644 --- a/types/passport-anonymous/tsconfig.json +++ b/types/passport-anonymous/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-beam/tsconfig.json b/types/passport-beam/tsconfig.json index 7b3fc8e513..bb65e62fbc 100644 --- a/types/passport-beam/tsconfig.json +++ b/types/passport-beam/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-discord/tsconfig.json b/types/passport-discord/tsconfig.json index 38a8051fb9..dcb1ac3502 100644 --- a/types/passport-discord/tsconfig.json +++ b/types/passport-discord/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-facebook-token/passport-facebook-token-tests.ts b/types/passport-facebook-token/passport-facebook-token-tests.ts index c926748286..1539118879 100644 --- a/types/passport-facebook-token/passport-facebook-token-tests.ts +++ b/types/passport-facebook-token/passport-facebook-token-tests.ts @@ -1,6 +1,6 @@ import * as express from 'express'; import * as passport from 'passport'; -import * as PassportFacebookToken from 'passport-facebook-token'; +import PassportFacebookToken = require('passport-facebook-token'); const User = { findOrCreate(id: string, provider: string, callback: (err: any, user: any) => void): void { diff --git a/types/passport-facebook-token/tsconfig.json b/types/passport-facebook-token/tsconfig.json index e1d020177a..2b877f282b 100644 --- a/types/passport-facebook-token/tsconfig.json +++ b/types/passport-facebook-token/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-facebook/tsconfig.json b/types/passport-facebook/tsconfig.json index dcc610efec..9153763af2 100644 --- a/types/passport-facebook/tsconfig.json +++ b/types/passport-facebook/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-github/tsconfig.json b/types/passport-github/tsconfig.json index 0e7ac43e0e..deac088de3 100644 --- a/types/passport-github/tsconfig.json +++ b/types/passport-github/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-github2/tsconfig.json b/types/passport-github2/tsconfig.json index ae03d3bb32..ec58c6f1da 100644 --- a/types/passport-github2/tsconfig.json +++ b/types/passport-github2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-google-oauth/tsconfig.json b/types/passport-google-oauth/tsconfig.json index 7f3b315c07..ef36d15b4a 100644 --- a/types/passport-google-oauth/tsconfig.json +++ b/types/passport-google-oauth/tsconfig.json @@ -1,16 +1,24 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": ["../"], + "typeRoots": [ + "../" + ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, - "files": ["index.d.ts", "passport-google-oauth-tests.ts"] -} + "files": [ + "index.d.ts", + "passport-google-oauth-tests.ts" + ] +} \ No newline at end of file diff --git a/types/passport-google-oauth2/tsconfig.json b/types/passport-google-oauth2/tsconfig.json index ee60531f41..7c144ffdff 100644 --- a/types/passport-google-oauth2/tsconfig.json +++ b/types/passport-google-oauth2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-http-bearer/tsconfig.json b/types/passport-http-bearer/tsconfig.json index b6033075ab..6ae99f8758 100644 --- a/types/passport-http-bearer/tsconfig.json +++ b/types/passport-http-bearer/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-http/index.d.ts b/types/passport-http/index.d.ts index e9a66964ea..458e5f2076 100644 --- a/types/passport-http/index.d.ts +++ b/types/passport-http/index.d.ts @@ -1,60 +1,69 @@ -// Type definitions for passport-http 0.3.0 +// Type definitions for passport-http 0.3 // Project: https://github.com/jaredhanson/passport-http // Definitions by: Christophe Vidal +// Tomek Łaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import passport = require("passport"); import express = require("express"); -interface BasicStrategyOptions { +export interface BasicStrategyOptions { realm?: string; - passReqToCallback?: boolean; + passReqToCallback?: req; } -interface DigestStrategyOptions { +export interface DigestStrategyOptions { realm?: string; - domain?: string | Array; + domain?: string | string[]; opaque?: string; algorithm?: string; - qop?: string | Array; + qop?: string | string[]; } -interface DigestValidateOptions { +export interface DigestValidateOptions { nonce: string; cnonce: string; nc: number; opaque: string; } -interface BasicVerifyFunction { - (username: string, password: string, done: (error: any, user?: any) => void): void; -} +export type BasicVerifyFunction = ( + username: string, + password: string, + done: (error: any, user?: any) => void, +) => any; -interface BasicVerifyFunctionWithRequest { - (req: express.Request, username: string, password: string, done: (error: any, user?: any) => void): void; -} +export type BasicVerifyFunctionWithRequest = ( + req: express.Request, + username: string, + password: string, + done: (error: any, user?: any) => void, +) => any; -interface DigestSecretFunction { - (username: string, done: (error: any, user?: any, password?: any) => void): void; -} +export type DigestSecretFunction = ( + username: string, + done: (error: any, user?: any, password?: any) => void, +) => any; -interface DigestValidateFunction { - (params: DigestValidateOptions, done: (error: any, valid: boolean) => void): void; -} +export type DigestValidateFunction = ( + params: DigestValidateOptions, + done: (error: any, valid: boolean) => void, +) => any; -declare class BasicStrategy implements passport.Strategy { +export class BasicStrategy implements passport.Strategy { constructor(verify: BasicVerifyFunction); - constructor(options: BasicStrategyOptions, verify: BasicVerifyFunction); + constructor(options: BasicStrategyOptions, verify: BasicVerifyFunction); + constructor(options: BasicStrategyOptions, verify: BasicVerifyFunctionWithRequest); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate: (req: express.Request, options?: object) => void; } -declare class DigestStrategy implements passport.Strategy { +export class DigestStrategy implements passport.Strategy { constructor(secret: DigestSecretFunction, validate?: DigestValidateFunction); constructor(options: DigestStrategyOptions, secret: DigestSecretFunction, validate?: DigestValidateFunction); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate: (req: express.Request, options?: object) => void; } diff --git a/types/passport-http/passport-http-tests.ts b/types/passport-http/passport-http-tests.ts index 4a70d30b89..396138b466 100644 --- a/types/passport-http/passport-http-tests.ts +++ b/types/passport-http/passport-http-tests.ts @@ -5,15 +5,15 @@ import passport = require("passport"); import http = require("passport-http"); -interface IUser { +interface UserInterface { username: string; password?: string; } class User { - public password: string; + password: string; - static findOne(user: IUser, callback: (error: Error, user: User) => void): void { + static findOne(user: UserInterface, callback: (error: Error, user: User) => void): void { callback(null, new User()); } } @@ -24,17 +24,19 @@ function validateNonce(nonce: string) { function validateParams(nonce: string, cnonce: string, nc: number, opaque: string) { } -passport.use(new http.BasicStrategy((username: string, password: string, done: any) => { +passport.use(new http.BasicStrategy((username, password, done) => { User.findOne({ - username: username, - password: password, + username, + password, }, (error, user) => { if (error) { - return done(error); + done(error); + return; } if (!user) { - return done(null, false); + done(null, false); + return; } done(null, user); @@ -44,25 +46,25 @@ passport.use(new http.BasicStrategy((username: string, password: string, done: a passport.use(new http.BasicStrategy({ realm: "User", passReqToCallback: true, -}, (username: string, password: string, done: any) => { - User.findOne({ - username: username, - password: password, - }, (error, user) => { - if (error) { - return done(error); - } +}, (req, username, password, done) => { + // with req when needed +})); - if (!user) { - return done(null, false); - } +passport.use(new http.BasicStrategy({ + realm: "User", +}, (username, password, done) => { + // without req by default +})); - done(null, user); - }); +passport.use(new http.BasicStrategy({ + realm: "User", + passReqToCallback: false, +}, (username, password, done) => { + // without req })); passport.use(new http.DigestStrategy((username: string, done: any) => { - User.findOne({username: username}, (error, user) => { + User.findOne({ username }, (error, user) => { if (error) { return done(error); } @@ -76,7 +78,7 @@ passport.use(new http.DigestStrategy((username: string, done: any) => { })); passport.use(new http.DigestStrategy((username: string, done: any) => { - User.findOne({username: username}, (error, user) => { + User.findOne({ username }, (error, user) => { if (error) { return done(error); } @@ -99,7 +101,7 @@ passport.use(new http.DigestStrategy({ algorithm: "MD5", qop: "auth", }, (username: string, done: any) => { - User.findOne({username: username}, (error, user) => { + User.findOne({ username }, (error, user) => { if (error) { return done(error); } @@ -119,7 +121,7 @@ passport.use(new http.DigestStrategy({ algorithm: "MD5", qop: "auth", }, (username: string, done: any) => { - User.findOne({username: username}, (error, user) => { + User.findOne({ username }, (error, user) => { if (error) { return done(error); } diff --git a/types/passport-http/tsconfig.json b/types/passport-http/tsconfig.json index d1a35a3390..e158bcb014 100644 --- a/types/passport-http/tsconfig.json +++ b/types/passport-http/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-http/tslint.json b/types/passport-http/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/passport-http/tslint.json +++ b/types/passport-http/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/passport-jwt/index.d.ts b/types/passport-jwt/index.d.ts index c300276fe2..0a71c4b725 100644 --- a/types/passport-jwt/index.d.ts +++ b/types/passport-jwt/index.d.ts @@ -4,11 +4,13 @@ // Alex Young // David Ng // Carlos Eduardo Scheffer +// Byungjin Kim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import { Strategy as PassportStrategy } from 'passport-strategy'; import {Request} from 'express'; +import { VerifyOptions } from 'jsonwebtoken' export declare class Strategy extends PassportStrategy { constructor(opt: StrategyOptions, verify: VerifyCallback); @@ -24,6 +26,7 @@ export interface StrategyOptions { algorithms?: string[]; ignoreExpiration?: boolean; passReqToCallback?: boolean; + jsonWebTokenOptions?: VerifyOptions; } export interface VerifyCallback { diff --git a/types/passport-jwt/tsconfig.json b/types/passport-jwt/tsconfig.json index 906f33004d..6170656dd1 100644 --- a/types/passport-jwt/tsconfig.json +++ b/types/passport-jwt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-kakao/tsconfig.json b/types/passport-kakao/tsconfig.json index 784cbe32e8..0657b076b8 100644 --- a/types/passport-kakao/tsconfig.json +++ b/types/passport-kakao/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "passport-kakao-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/passport-local-mongoose/passport-local-mongoose-tests.ts b/types/passport-local-mongoose/passport-local-mongoose-tests.ts index 63c82a9913..5058cb88ef 100644 --- a/types/passport-local-mongoose/passport-local-mongoose-tests.ts +++ b/types/passport-local-mongoose/passport-local-mongoose-tests.ts @@ -1,5 +1,3 @@ -/// - /** * Created by Linus Brolin . */ @@ -14,7 +12,7 @@ import { PassportLocalOptions, PassportLocalErrorMessages } from 'mongoose'; -import * as passportLocalMongoose from 'passport-local-mongoose'; +import passportLocalMongoose = require('passport-local-mongoose'); import { Router, Request, Response } from 'express'; import * as passport from 'passport'; diff --git a/types/passport-local-mongoose/tsconfig.json b/types/passport-local-mongoose/tsconfig.json index c0806a2177..6ba09ff095 100644 --- a/types/passport-local-mongoose/tsconfig.json +++ b/types/passport-local-mongoose/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-local/tsconfig.json b/types/passport-local/tsconfig.json index 340ecca02d..fa2f7824d5 100644 --- a/types/passport-local/tsconfig.json +++ b/types/passport-local/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-naver/tsconfig.json b/types/passport-naver/tsconfig.json index 1a8826dcfd..e09b5e2a55 100644 --- a/types/passport-naver/tsconfig.json +++ b/types/passport-naver/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "passport-naver-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/passport-oauth2-client-password/tsconfig.json b/types/passport-oauth2-client-password/tsconfig.json index e7cc4cc177..19cc572681 100644 --- a/types/passport-oauth2-client-password/tsconfig.json +++ b/types/passport-oauth2-client-password/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-oauth2/tsconfig.json b/types/passport-oauth2/tsconfig.json index 5e71cf6328..cc083b7bf7 100644 --- a/types/passport-oauth2/tsconfig.json +++ b/types/passport-oauth2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-saml/tsconfig.json b/types/passport-saml/tsconfig.json index 0809dbbaf7..f7e6b952d4 100644 --- a/types/passport-saml/tsconfig.json +++ b/types/passport-saml/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-steam/tsconfig.json b/types/passport-steam/tsconfig.json index 94a0d709a4..618ce103d0 100644 --- a/types/passport-steam/tsconfig.json +++ b/types/passport-steam/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-strategy/tsconfig.json b/types/passport-strategy/tsconfig.json index b9d033a50e..912569eef3 100644 --- a/types/passport-strategy/tsconfig.json +++ b/types/passport-strategy/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-twitter/tsconfig.json b/types/passport-twitter/tsconfig.json index 4034aa5640..94c7367c2e 100644 --- a/types/passport-twitter/tsconfig.json +++ b/types/passport-twitter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport-unique-token/tsconfig.json b/types/passport-unique-token/tsconfig.json index 405438dd5a..5c70a8debd 100644 --- a/types/passport-unique-token/tsconfig.json +++ b/types/passport-unique-token/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/passport/passport-tests.ts b/types/passport/passport-tests.ts index b6c033b907..58c306964c 100644 --- a/types/passport/passport-tests.ts +++ b/types/passport/passport-tests.ts @@ -1,5 +1,5 @@ import * as passport from 'passport'; -import * as express from 'express'; +import express = require('express'); import 'express-session'; class TestStrategy implements passport.Strategy { diff --git a/types/passport/tsconfig.json b/types/passport/tsconfig.json index 08fe485f60..085a0730d1 100644 --- a/types/passport/tsconfig.json +++ b/types/passport/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/password-hash-and-salt/tsconfig.json b/types/password-hash-and-salt/tsconfig.json index a2a0427f51..4269a10725 100644 --- a/types/password-hash-and-salt/tsconfig.json +++ b/types/password-hash-and-salt/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/password-hash/tsconfig.json b/types/password-hash/tsconfig.json index b0e161a8a2..a0fb6b0e8f 100644 --- a/types/password-hash/tsconfig.json +++ b/types/password-hash/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/path-exists/tsconfig.json b/types/path-exists/tsconfig.json index d9e230ee27..50ce9f3349 100644 --- a/types/path-exists/tsconfig.json +++ b/types/path-exists/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/path-exists/v1/tsconfig.json b/types/path-exists/v1/tsconfig.json index 3a52689e9c..f8059a64b7 100644 --- a/types/path-exists/v1/tsconfig.json +++ b/types/path-exists/v1/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/path-is-absolute/tsconfig.json b/types/path-is-absolute/tsconfig.json index c3b15bff95..63bd03ece3 100644 --- a/types/path-is-absolute/tsconfig.json +++ b/types/path-is-absolute/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/path-parse/path-parse-tests.ts b/types/path-parse/path-parse-tests.ts index da2b63f6b4..a632d768f1 100644 --- a/types/path-parse/path-parse-tests.ts +++ b/types/path-parse/path-parse-tests.ts @@ -1,4 +1,4 @@ -import * as parse from "path-parse"; +import parse = require("path-parse"); const parsed = parse("/foo/bar.img"); const { root, dir, base, ext, name } = parsed; diff --git a/types/path-parse/tsconfig.json b/types/path-parse/tsconfig.json index 9123b62477..e89835c7e5 100644 --- a/types/path-parse/tsconfig.json +++ b/types/path-parse/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pathfinding/tsconfig.json b/types/pathfinding/tsconfig.json index 0428d67daa..76d2cec85c 100644 --- a/types/pathfinding/tsconfig.json +++ b/types/pathfinding/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pathjs/tsconfig.json b/types/pathjs/tsconfig.json index 60a8aba82a..a8c29ed915 100644 --- a/types/pathjs/tsconfig.json +++ b/types/pathjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pathwatcher/tsconfig.json b/types/pathwatcher/tsconfig.json index 41bb35a03c..3c46805477 100644 --- a/types/pathwatcher/tsconfig.json +++ b/types/pathwatcher/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pathwatcher-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/pause/tsconfig.json b/types/pause/tsconfig.json index 76c0af48a3..14acafe4a9 100644 --- a/types/pause/tsconfig.json +++ b/types/pause/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/payment/tsconfig.json b/types/payment/tsconfig.json index 4f1166c44f..499c49ce64 100644 --- a/types/payment/tsconfig.json +++ b/types/payment/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/paypal-cordova-plugin/tsconfig.json b/types/paypal-cordova-plugin/tsconfig.json index 67ee653902..cddf3ab053 100644 --- a/types/paypal-cordova-plugin/tsconfig.json +++ b/types/paypal-cordova-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/paypal-rest-sdk/tsconfig.json b/types/paypal-rest-sdk/tsconfig.json index 4e1922b8ba..4026071a14 100644 --- a/types/paypal-rest-sdk/tsconfig.json +++ b/types/paypal-rest-sdk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pbf/tsconfig.json b/types/pbf/tsconfig.json index b9ec4bce50..c6bd76c88a 100644 --- a/types/pbf/tsconfig.json +++ b/types/pbf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pdfjs-dist/tsconfig.json b/types/pdfjs-dist/tsconfig.json index d189de9f02..17f7d8cfca 100644 --- a/types/pdfjs-dist/tsconfig.json +++ b/types/pdfjs-dist/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pdfkit/tsconfig.json b/types/pdfkit/tsconfig.json index f14037a57f..490ef6e892 100644 --- a/types/pdfkit/tsconfig.json +++ b/types/pdfkit/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pdfobject/tsconfig.json b/types/pdfobject/tsconfig.json index 178c186ae8..dcb101218a 100644 --- a/types/pdfobject/tsconfig.json +++ b/types/pdfobject/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pebblekitjs/tsconfig.json b/types/pebblekitjs/tsconfig.json index e09e806e3b..fb45867efd 100644 --- a/types/pebblekitjs/tsconfig.json +++ b/types/pebblekitjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/peer-dial/peer-dial-tests.ts b/types/peer-dial/peer-dial-tests.ts index cb4238da62..6cc4376458 100644 --- a/types/peer-dial/peer-dial-tests.ts +++ b/types/peer-dial/peer-dial-tests.ts @@ -1,5 +1,5 @@ import { Server, Client, App, AppInfo, CorsOptions, ServerOptions, Delegate, DialDevice, DeviceInfo } from 'peer-dial'; -import * as express from 'express'; +import express = require('express'); class AppImpl implements App { name: string; diff --git a/types/peer-dial/tsconfig.json b/types/peer-dial/tsconfig.json index 4672562aef..f9ec138996 100644 --- a/types/peer-dial/tsconfig.json +++ b/types/peer-dial/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/peerjs/tsconfig.json b/types/peerjs/tsconfig.json index 41e815c2c3..7400e9a78c 100644 --- a/types/peerjs/tsconfig.json +++ b/types/peerjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pegjs/tsconfig.json b/types/pegjs/tsconfig.json index ea5f1cc8e4..49e431cdc2 100644 --- a/types/pegjs/tsconfig.json +++ b/types/pegjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pem/tsconfig.json b/types/pem/tsconfig.json index 509312522f..f7d45f9f7d 100644 --- a/types/pem/tsconfig.json +++ b/types/pem/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/persona/tsconfig.json b/types/persona/tsconfig.json index cadf2878fc..5726175930 100644 --- a/types/persona/tsconfig.json +++ b/types/persona/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pet-finder-api/tsconfig.json b/types/pet-finder-api/tsconfig.json index 66a88e70be..605722a75f 100644 --- a/types/pet-finder-api/tsconfig.json +++ b/types/pet-finder-api/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg-ears/tsconfig.json b/types/pg-ears/tsconfig.json index a98396e776..3a5bd63fe8 100644 --- a/types/pg-ears/tsconfig.json +++ b/types/pg-ears/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg-escape/pg-escape-tests.ts b/types/pg-escape/pg-escape-tests.ts index 36636cf0c2..87d70dbd9f 100644 --- a/types/pg-escape/pg-escape-tests.ts +++ b/types/pg-escape/pg-escape-tests.ts @@ -1,4 +1,4 @@ -import * as escape from 'pg-escape'; +import escape = require('pg-escape'); escape('INSERT INTO %I VALUES(%L)', 'books', "O'Reilly"); escape.string("ab'cd"); diff --git a/types/pg-escape/tsconfig.json b/types/pg-escape/tsconfig.json index b5afa8ea9a..a32fb19012 100644 --- a/types/pg-escape/tsconfig.json +++ b/types/pg-escape/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg-pool/tsconfig.json b/types/pg-pool/tsconfig.json index 5381ba2842..ffc4440460 100644 --- a/types/pg-pool/tsconfig.json +++ b/types/pg-pool/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg-query-stream/pg-query-stream-tests.ts b/types/pg-query-stream/pg-query-stream-tests.ts index 1df78ea648..dbf0b88d0b 100644 --- a/types/pg-query-stream/pg-query-stream-tests.ts +++ b/types/pg-query-stream/pg-query-stream-tests.ts @@ -1,4 +1,4 @@ -import * as QueryStream from 'pg-query-stream'; +import QueryStream = require('pg-query-stream'); import * as pg from 'pg'; const options: QueryStream.Options = { diff --git a/types/pg-query-stream/tsconfig.json b/types/pg-query-stream/tsconfig.json index 8137847846..d6da0a5ff2 100644 --- a/types/pg-query-stream/tsconfig.json +++ b/types/pg-query-stream/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg-types/tsconfig.json b/types/pg-types/tsconfig.json index 1ab38690e5..b8e5677970 100644 --- a/types/pg-types/tsconfig.json +++ b/types/pg-types/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg/tsconfig.json b/types/pg/tsconfig.json index 92ec2db62b..a836da031a 100644 --- a/types/pg/tsconfig.json +++ b/types/pg/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pg/v6/tsconfig.json b/types/pg/v6/tsconfig.json index 4e12c2c891..6f8e496a3a 100644 --- a/types/pg/v6/tsconfig.json +++ b/types/pg/v6/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pgwmodal/tsconfig.json b/types/pgwmodal/tsconfig.json index 5ad4cd4a98..8b0d9007a5 100644 --- a/types/pgwmodal/tsconfig.json +++ b/types/pgwmodal/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phantom/tsconfig.json b/types/phantom/tsconfig.json index 39ae0edc93..db99b55c3e 100644 --- a/types/phantom/tsconfig.json +++ b/types/phantom/tsconfig.json @@ -19,6 +19,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/phantomcss/tsconfig.json b/types/phantomcss/tsconfig.json index cba4e19ecd..f1ed6ac3c6 100644 --- a/types/phantomcss/tsconfig.json +++ b/types/phantomcss/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phantomjs/tsconfig.json b/types/phantomjs/tsconfig.json index 02963e3afd..352332b6c7 100644 --- a/types/phantomjs/tsconfig.json +++ b/types/phantomjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/phoenix/tsconfig.json b/types/phoenix/tsconfig.json index 40bfbb22b6..2ab9a802b8 100644 --- a/types/phoenix/tsconfig.json +++ b/types/phoenix/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phone-formatter/tsconfig.json b/types/phone-formatter/tsconfig.json index 48f951581e..1446ec115e 100644 --- a/types/phone-formatter/tsconfig.json +++ b/types/phone-formatter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phone/tsconfig.json b/types/phone/tsconfig.json index 1890b13a08..bab413270c 100644 --- a/types/phone/tsconfig.json +++ b/types/phone/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phonegap-facebook-plugin/tsconfig.json b/types/phonegap-facebook-plugin/tsconfig.json index 0a1d090d05..9a06dc0e67 100644 --- a/types/phonegap-facebook-plugin/tsconfig.json +++ b/types/phonegap-facebook-plugin/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phonegap-nfc/tsconfig.json b/types/phonegap-nfc/tsconfig.json index 72b1f019d8..3a44f3b88e 100644 --- a/types/phonegap-nfc/tsconfig.json +++ b/types/phonegap-nfc/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phonegap-plugin-barcodescanner/tsconfig.json b/types/phonegap-plugin-barcodescanner/tsconfig.json index ec6d41e488..62862eeea7 100644 --- a/types/phonegap-plugin-barcodescanner/tsconfig.json +++ b/types/phonegap-plugin-barcodescanner/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phonegap/tsconfig.json b/types/phonegap/tsconfig.json index 714111c6e0..e513609ef9 100644 --- a/types/phonegap/tsconfig.json +++ b/types/phonegap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/phonon/tsconfig.json b/types/phonon/tsconfig.json index bbadd8d12a..27fdea2d6f 100644 --- a/types/phonon/tsconfig.json +++ b/types/phonon/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/photonui/tsconfig.json b/types/photonui/tsconfig.json index 7aa685b04b..444824f4f7 100644 --- a/types/photonui/tsconfig.json +++ b/types/photonui/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/photoswipe/tsconfig.json b/types/photoswipe/tsconfig.json index 9e83ea1174..126ce7e39f 100644 --- a/types/photoswipe/tsconfig.json +++ b/types/photoswipe/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/physijs/tsconfig.json b/types/physijs/tsconfig.json index 6d446c60b3..20053336be 100644 --- a/types/physijs/tsconfig.json +++ b/types/physijs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pi-spi/tsconfig.json b/types/pi-spi/tsconfig.json index 0dada24fe6..b2ec839104 100644 --- a/types/pi-spi/tsconfig.json +++ b/types/pi-spi/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pick-weight/tsconfig.json b/types/pick-weight/tsconfig.json index 86f4110d99..2d02a2adef 100644 --- a/types/pick-weight/tsconfig.json +++ b/types/pick-weight/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pickadate/tsconfig.json b/types/pickadate/tsconfig.json index 7b19418034..a96115048d 100644 --- a/types/pickadate/tsconfig.json +++ b/types/pickadate/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/picturefill/tsconfig.json b/types/picturefill/tsconfig.json index 1435f75db0..84ef59b7ce 100644 --- a/types/picturefill/tsconfig.json +++ b/types/picturefill/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pidusage/tsconfig.json b/types/pidusage/tsconfig.json index 256715e11c..25c6d2eddf 100644 --- a/types/pidusage/tsconfig.json +++ b/types/pidusage/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pify/tsconfig.json b/types/pify/tsconfig.json index bf0a1104aa..13826105d6 100644 --- a/types/pify/tsconfig.json +++ b/types/pify/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pigpio/tsconfig.json b/types/pigpio/tsconfig.json index e5b61af015..7358a555c4 100644 --- a/types/pigpio/tsconfig.json +++ b/types/pigpio/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pikaday-time/tsconfig.json b/types/pikaday-time/tsconfig.json index bf96d27d1a..198426c4ce 100644 --- a/types/pikaday-time/tsconfig.json +++ b/types/pikaday-time/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pikaday/tsconfig.json b/types/pikaday/tsconfig.json index 3c936ab905..e127c57ad1 100644 --- a/types/pikaday/tsconfig.json +++ b/types/pikaday/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pinkyswear/tsconfig.json b/types/pinkyswear/tsconfig.json index c815468eb3..8e67838864 100644 --- a/types/pinkyswear/tsconfig.json +++ b/types/pinkyswear/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pino-multi-stream/pino-multi-stream-tests.ts b/types/pino-multi-stream/pino-multi-stream-tests.ts index d9d0899256..dc48ed3bd4 100644 --- a/types/pino-multi-stream/pino-multi-stream-tests.ts +++ b/types/pino-multi-stream/pino-multi-stream-tests.ts @@ -1,6 +1,6 @@ import * as fs from 'fs'; -import * as pino from 'pino'; -import * as pinoms from 'pino-multi-stream'; +import pino = require('pino'); +import pinoms = require('pino-multi-stream'); const streams: pinoms.Streams = [ { stream: process.stdout }, // an "info" level destination stream diff --git a/types/pino-multi-stream/tsconfig.json b/types/pino-multi-stream/tsconfig.json index 7a060abb2e..a421b036f3 100644 --- a/types/pino-multi-stream/tsconfig.json +++ b/types/pino-multi-stream/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pino-multi-stream-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/pino/tsconfig.json b/types/pino/tsconfig.json index 78c8106f18..46cfc15004 100644 --- a/types/pino/tsconfig.json +++ b/types/pino/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pino/v3/tsconfig.json b/types/pino/v3/tsconfig.json index cc1e05b0f1..ed2f81e7b8 100644 --- a/types/pino/v3/tsconfig.json +++ b/types/pino/v3/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pinterest-sdk/tsconfig.json b/types/pinterest-sdk/tsconfig.json index 17bc0c1135..1665ad68fc 100644 --- a/types/pinterest-sdk/tsconfig.json +++ b/types/pinterest-sdk/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pinyin/tsconfig.json b/types/pinyin/tsconfig.json index 2fc91705ca..1f1295881d 100644 --- a/types/pinyin/tsconfig.json +++ b/types/pinyin/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/piwik-tracker/tsconfig.json b/types/piwik-tracker/tsconfig.json index 5f3f92ee94..a66212950b 100644 --- a/types/piwik-tracker/tsconfig.json +++ b/types/piwik-tracker/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pixelmatch/tsconfig.json b/types/pixelmatch/tsconfig.json index 02115e3fdc..f922c8c0b3 100644 --- a/types/pixelmatch/tsconfig.json +++ b/types/pixelmatch/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pixelmatch-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/pixi.js/index.d.ts b/types/pixi.js/index.d.ts index b053b46790..6d7dfaf351 100644 --- a/types/pixi.js/index.d.ts +++ b/types/pixi.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Pixi.js 4.6 +// Type definitions for Pixi.js 4.7 // Project: https://github.com/pixijs/pixi.js/tree/dev // Definitions by: clark-stevenson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -63,6 +63,7 @@ declare namespace PIXI { let PRECISION: string; let UPLOADS_PER_FRAME: number; let CAN_UPLOAD_SAME_BUFFER: boolean; + let MESH_CANVAS_PADDING: number; } ////////////////////////////////////////////////////////////////////////////// @@ -208,6 +209,7 @@ declare namespace PIXI { renderer: PIXI.WebGLRenderer | PIXI.CanvasRenderer; stage: Container; ticker: ticker.Ticker; + loader: loaders.Loader; readonly screen: Rectangle; stop(): void; @@ -497,6 +499,7 @@ declare namespace PIXI { drawCircle(x: number, y: number, radius: number): Graphics; drawEllipse(x: number, y: number, width: number, height: number): Graphics; drawPolygon(path: number[] | Point[] | Polygon): Graphics; + drawStar(x: number, y: number, points: number, radius: number, innerRadius: number, rotation?: number): Graphics; clear(): Graphics; isFastRect(): boolean; protected _renderCanvas(renderer: CanvasRenderer): void; @@ -1737,7 +1740,9 @@ declare namespace PIXI { // shader - class Shader extends glCore.GLShader { } + class Shader extends glCore.GLShader { + constructor(gl: WebGLRenderingContext, vertexSrc: string | string[], fragmentSrc: string | string[], attributeLocations?: { [key: string]: number }, precision?: string); + } ////////////////////////////////////////////////////////////////////////////// ////////////////////////////EXTRACT/////////////////////////////////////////// @@ -2163,7 +2168,7 @@ declare namespace PIXI { // pixi loader extends // https://github.com/englercj/resource-loader/ - // 2.0.9 + // 2.1.1 class MiniSignalBinding { //tslint:disable-next-line:ban-types forbidden-types @@ -2251,6 +2256,8 @@ declare namespace PIXI { onStart: MiniSignal; onComplete: MiniSignal; + concurrency: number; + add(...params: any[]): this; //tslint:disable-next-line:ban-types forbidden-types add(name: string, url: string, options?: LoaderOptions, cb?: Function): this; @@ -2268,6 +2275,7 @@ declare namespace PIXI { protected _prepareUrl(url: string): string; //tslint:disable-next-line:ban-types forbidden-types protected _loadResource(resource: Resource, dequeue: Function): void; + protected _onStart(): void; protected _onComplete(): void; protected _onLoad(resource: Resource): void; @@ -2523,7 +2531,11 @@ declare namespace PIXI { ////////////////////////////////////////////////////////////////////////////// namespace particles { interface ParticleContainerProperties { + /** + * DEPRECIATED - Use `vertices` + */ scale?: boolean; + vertices?: boolean; position?: boolean; rotation?: boolean; uvs?: boolean; @@ -2531,7 +2543,7 @@ declare namespace PIXI { alpha?: boolean; } class ParticleContainer extends Container { - constructor(maxSize?: number, properties?: ParticleContainerProperties, batchSize?: number, autoSize?: boolean); + constructor(maxSize?: number, properties?: ParticleContainerProperties, batchSize?: number, autoResize?: boolean); protected _tint: number; protected tintRgb: number | any[]; tint: number; diff --git a/types/pixi.js/tsconfig.json b/types/pixi.js/tsconfig.json index 742fa02137..76ed9779cf 100644 --- a/types/pixi.js/tsconfig.json +++ b/types/pixi.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pkg-dir/tsconfig.json b/types/pkg-dir/tsconfig.json index 2701860736..496ac52b2b 100644 --- a/types/pkg-dir/tsconfig.json +++ b/types/pkg-dir/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pkg-dir-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/pkijs/tsconfig.json b/types/pkijs/tsconfig.json index 2a4d04ec08..885bd7a0d8 100644 --- a/types/pkijs/tsconfig.json +++ b/types/pkijs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/platform/tsconfig.json b/types/platform/tsconfig.json index 95084ee11c..be37a03253 100644 --- a/types/platform/tsconfig.json +++ b/types/platform/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/playcanvas/tsconfig.json b/types/playcanvas/tsconfig.json index a2a2c895a0..2eb564bd87 100644 --- a/types/playcanvas/tsconfig.json +++ b/types/playcanvas/tsconfig.json @@ -15,10 +15,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "playcanvas-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/playerframework/tsconfig.json b/types/playerframework/tsconfig.json index 56c01ef247..984c1f5ae4 100644 --- a/types/playerframework/tsconfig.json +++ b/types/playerframework/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pleasejs/tsconfig.json b/types/pleasejs/tsconfig.json index 94046488fe..57104ee53b 100644 --- a/types/pleasejs/tsconfig.json +++ b/types/pleasejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/plotly.js/tsconfig.json b/types/plotly.js/tsconfig.json index dd21321c49..6d2562291f 100644 --- a/types/plotly.js/tsconfig.json +++ b/types/plotly.js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/plugapi/tsconfig.json b/types/plugapi/tsconfig.json index e0f04186ed..2e234835bd 100644 --- a/types/plugapi/tsconfig.json +++ b/types/plugapi/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/plugin-error/tsconfig.json b/types/plugin-error/tsconfig.json index ee9cd8e61f..a8d393375f 100644 --- a/types/plugin-error/tsconfig.json +++ b/types/plugin-error/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "plugin-error-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/plupload/tsconfig.json b/types/plupload/tsconfig.json index fc46738339..01f211f578 100644 --- a/types/plupload/tsconfig.json +++ b/types/plupload/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pluralize/tsconfig.json b/types/pluralize/tsconfig.json index 112ed18147..4c8f0ed41e 100644 --- a/types/pluralize/tsconfig.json +++ b/types/pluralize/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/png-async/tsconfig.json b/types/png-async/tsconfig.json index 181b899496..96cc95167c 100644 --- a/types/png-async/tsconfig.json +++ b/types/png-async/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pngjs/tsconfig.json b/types/pngjs/tsconfig.json index 4a2c2d47fd..229283a536 100644 --- a/types/pngjs/tsconfig.json +++ b/types/pngjs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pngjs2/tsconfig.json b/types/pngjs2/tsconfig.json index cbefc10524..07948ed5e6 100644 --- a/types/pngjs2/tsconfig.json +++ b/types/pngjs2/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/podcast/tsconfig.json b/types/podcast/tsconfig.json index 8e4c29f1e9..7e348b4913 100644 --- a/types/podcast/tsconfig.json +++ b/types/podcast/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/podium/tsconfig.json b/types/podium/tsconfig.json index a383a8d04c..d7580cd819 100644 --- a/types/podium/tsconfig.json +++ b/types/podium/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/point-in-polygon/tsconfig.json b/types/point-in-polygon/tsconfig.json index a17d220c7e..12a529f109 100644 --- a/types/point-in-polygon/tsconfig.json +++ b/types/point-in-polygon/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/polylabel/tsconfig.json b/types/polylabel/tsconfig.json index a9f8f55e42..b101936e68 100644 --- a/types/polylabel/tsconfig.json +++ b/types/polylabel/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/polyline/tsconfig.json b/types/polyline/tsconfig.json index 267af0e29a..032d5b9180 100644 --- a/types/polyline/tsconfig.json +++ b/types/polyline/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/polymer-ts/tsconfig.json b/types/polymer-ts/tsconfig.json index 67ef43b3be..48b262e0c8 100644 --- a/types/polymer-ts/tsconfig.json +++ b/types/polymer-ts/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/polymer/tsconfig.json b/types/polymer/tsconfig.json index 172edc052b..4b79861705 100644 --- a/types/polymer/tsconfig.json +++ b/types/polymer/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/popcorn/tsconfig.json b/types/popcorn/tsconfig.json index fa1c069762..b4076b50e2 100644 --- a/types/popcorn/tsconfig.json +++ b/types/popcorn/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/portscanner/tsconfig.json b/types/portscanner/tsconfig.json index 0a2ba9f13b..6e71168863 100644 --- a/types/portscanner/tsconfig.json +++ b/types/portscanner/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/postal/tsconfig.json b/types/postal/tsconfig.json index 69e3362d73..d9b73de77d 100644 --- a/types/postal/tsconfig.json +++ b/types/postal/tsconfig.json @@ -18,6 +18,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true } } \ No newline at end of file diff --git a/types/postal/v0/tsconfig.json b/types/postal/v0/tsconfig.json index 207cc2f60b..417249bc92 100644 --- a/types/postal/v0/tsconfig.json +++ b/types/postal/v0/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/postmark/tsconfig.json b/types/postmark/tsconfig.json index 86df19a17f..aa22026f4e 100644 --- a/types/postmark/tsconfig.json +++ b/types/postmark/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouch-redux-middleware/tsconfig.json b/types/pouch-redux-middleware/tsconfig.json index f9cf608a5e..46f40a7938 100644 --- a/types/pouch-redux-middleware/tsconfig.json +++ b/types/pouch-redux-middleware/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-fruitdown/tsconfig.json b/types/pouchdb-adapter-fruitdown/tsconfig.json index c3357ce2d2..3a95c3d2aa 100644 --- a/types/pouchdb-adapter-fruitdown/tsconfig.json +++ b/types/pouchdb-adapter-fruitdown/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-http/tsconfig.json b/types/pouchdb-adapter-http/tsconfig.json index dd66d20097..43d474c91b 100644 --- a/types/pouchdb-adapter-http/tsconfig.json +++ b/types/pouchdb-adapter-http/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-idb/tsconfig.json b/types/pouchdb-adapter-idb/tsconfig.json index ce5edaa36c..bb163bf1ad 100644 --- a/types/pouchdb-adapter-idb/tsconfig.json +++ b/types/pouchdb-adapter-idb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-leveldb/tsconfig.json b/types/pouchdb-adapter-leveldb/tsconfig.json index 4c3ceef40c..1a145b0469 100644 --- a/types/pouchdb-adapter-leveldb/tsconfig.json +++ b/types/pouchdb-adapter-leveldb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-localstorage/tsconfig.json b/types/pouchdb-adapter-localstorage/tsconfig.json index b5c18c4a9f..cdd0d4a974 100644 --- a/types/pouchdb-adapter-localstorage/tsconfig.json +++ b/types/pouchdb-adapter-localstorage/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-memory/tsconfig.json b/types/pouchdb-adapter-memory/tsconfig.json index 0bf83e3b74..09c2bc23ce 100644 --- a/types/pouchdb-adapter-memory/tsconfig.json +++ b/types/pouchdb-adapter-memory/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-node-websql/tsconfig.json b/types/pouchdb-adapter-node-websql/tsconfig.json index a154ce42e3..85265196b1 100644 --- a/types/pouchdb-adapter-node-websql/tsconfig.json +++ b/types/pouchdb-adapter-node-websql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-adapter-websql/tsconfig.json b/types/pouchdb-adapter-websql/tsconfig.json index a4dd9848fc..1b70d6ae7a 100644 --- a/types/pouchdb-adapter-websql/tsconfig.json +++ b/types/pouchdb-adapter-websql/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-browser/tsconfig.json b/types/pouchdb-browser/tsconfig.json index 892bc704d0..2689817b3b 100644 --- a/types/pouchdb-browser/tsconfig.json +++ b/types/pouchdb-browser/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-core/tsconfig.json b/types/pouchdb-core/tsconfig.json index 61dd8ca4d1..53b2e522d3 100644 --- a/types/pouchdb-core/tsconfig.json +++ b/types/pouchdb-core/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-find/tsconfig.json b/types/pouchdb-find/tsconfig.json index 3db7946c2a..633e57958e 100644 --- a/types/pouchdb-find/tsconfig.json +++ b/types/pouchdb-find/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-http/tsconfig.json b/types/pouchdb-http/tsconfig.json index 0e67095870..a4e8be6142 100644 --- a/types/pouchdb-http/tsconfig.json +++ b/types/pouchdb-http/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-mapreduce/tsconfig.json b/types/pouchdb-mapreduce/tsconfig.json index 1af053e93b..0ee8aba915 100644 --- a/types/pouchdb-mapreduce/tsconfig.json +++ b/types/pouchdb-mapreduce/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-node/tsconfig.json b/types/pouchdb-node/tsconfig.json index c1304343b6..bfce778e16 100644 --- a/types/pouchdb-node/tsconfig.json +++ b/types/pouchdb-node/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-replication/tsconfig.json b/types/pouchdb-replication/tsconfig.json index 6a64902380..d4646381cc 100644 --- a/types/pouchdb-replication/tsconfig.json +++ b/types/pouchdb-replication/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb-upsert/tsconfig.json b/types/pouchdb-upsert/tsconfig.json index ff5dc47e0c..99c7fc25b8 100644 --- a/types/pouchdb-upsert/tsconfig.json +++ b/types/pouchdb-upsert/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pouchdb/tsconfig.json b/types/pouchdb/tsconfig.json index 6894fb45dc..0b932bc155 100644 --- a/types/pouchdb/tsconfig.json +++ b/types/pouchdb/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/power-assert-formatter/tsconfig.json b/types/power-assert-formatter/tsconfig.json index 93cc04326a..838e3eb3bc 100644 --- a/types/power-assert-formatter/tsconfig.json +++ b/types/power-assert-formatter/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/power-assert/tsconfig.json b/types/power-assert/tsconfig.json index 9093028de3..f4eb6ee125 100644 --- a/types/power-assert/tsconfig.json +++ b/types/power-assert/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/precise/tsconfig.json b/types/precise/tsconfig.json index e400470ee5..0ad3319223 100644 --- a/types/precise/tsconfig.json +++ b/types/precise/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/precond/tsconfig.json b/types/precond/tsconfig.json index 8158d9149d..376f45bf15 100644 --- a/types/precond/tsconfig.json +++ b/types/precond/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/preloadjs/tsconfig.json b/types/preloadjs/tsconfig.json index 82e6284376..bbed57fc93 100644 --- a/types/preloadjs/tsconfig.json +++ b/types/preloadjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts" diff --git a/types/prelude-ls/tsconfig.json b/types/prelude-ls/tsconfig.json index 7c846df940..79cee0c5db 100644 --- a/types/prelude-ls/tsconfig.json +++ b/types/prelude-ls/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prettier/tsconfig.json b/types/prettier/tsconfig.json index c3ff9609e6..b4fe5b746c 100644 --- a/types/prettier/tsconfig.json +++ b/types/prettier/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pretty-bytes/tsconfig.json b/types/pretty-bytes/tsconfig.json index fd11c640b4..deec7037a2 100644 --- a/types/pretty-bytes/tsconfig.json +++ b/types/pretty-bytes/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pretty-format/tsconfig.json b/types/pretty-format/tsconfig.json index b51d58bdbb..0c54a65fd4 100644 --- a/types/pretty-format/tsconfig.json +++ b/types/pretty-format/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pretty-ms/tsconfig.json b/types/pretty-ms/tsconfig.json index da88b941c7..42961708ac 100644 --- a/types/pretty-ms/tsconfig.json +++ b/types/pretty-ms/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prettyjson/tsconfig.json b/types/prettyjson/tsconfig.json index 8169c27bba..c344cc2742 100644 --- a/types/prettyjson/tsconfig.json +++ b/types/prettyjson/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/printf/tsconfig.json b/types/printf/tsconfig.json index 620efed257..19c87443f7 100644 --- a/types/printf/tsconfig.json +++ b/types/printf/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/priorityqueuejs/tsconfig.json b/types/priorityqueuejs/tsconfig.json index 565b6f8339..93882d576f 100644 --- a/types/priorityqueuejs/tsconfig.json +++ b/types/priorityqueuejs/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prismjs/tsconfig.json b/types/prismjs/tsconfig.json index c5385df0ce..03ba8fadf4 100644 --- a/types/prismjs/tsconfig.json +++ b/types/prismjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/private-ip/tsconfig.json b/types/private-ip/tsconfig.json index 33e37f45f5..5a0e21cf48 100644 --- a/types/private-ip/tsconfig.json +++ b/types/private-ip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/procfs-stats/tsconfig.json b/types/procfs-stats/tsconfig.json index 92d82b595d..8a501b61b3 100644 --- a/types/procfs-stats/tsconfig.json +++ b/types/procfs-stats/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/progress/tsconfig.json b/types/progress/tsconfig.json index 8621f46a57..65e98d96ce 100644 --- a/types/progress/tsconfig.json +++ b/types/progress/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/progressbar/tsconfig.json b/types/progressbar/tsconfig.json index b541482303..7aef8bf887 100644 --- a/types/progressbar/tsconfig.json +++ b/types/progressbar/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/progressjs/tsconfig.json b/types/progressjs/tsconfig.json index 371d303dae..fc6f9032d4 100644 --- a/types/progressjs/tsconfig.json +++ b/types/progressjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/proj4/tsconfig.json b/types/proj4/tsconfig.json index a55659d52c..1ab5dd3aca 100644 --- a/types/proj4/tsconfig.json +++ b/types/proj4/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/proj4leaflet/tsconfig.json b/types/proj4leaflet/tsconfig.json index 697b96a93a..71ce31477e 100644 --- a/types/proj4leaflet/tsconfig.json +++ b/types/proj4leaflet/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/project-oxford/tsconfig.json b/types/project-oxford/tsconfig.json index 4dbec7201d..8fc5270b59 100644 --- a/types/project-oxford/tsconfig.json +++ b/types/project-oxford/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promise-dag/tsconfig.json b/types/promise-dag/tsconfig.json index c98c23daeb..a67918464c 100644 --- a/types/promise-dag/tsconfig.json +++ b/types/promise-dag/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promise-pg/tsconfig.json b/types/promise-pg/tsconfig.json index 33ce665884..3738fbe7d4 100644 --- a/types/promise-pg/tsconfig.json +++ b/types/promise-pg/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promise-polyfill/tsconfig.json b/types/promise-polyfill/tsconfig.json index 7fc4ac5f7b..eeae37f208 100644 --- a/types/promise-polyfill/tsconfig.json +++ b/types/promise-polyfill/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promise-pool/tsconfig.json b/types/promise-pool/tsconfig.json index 98ab2ed31d..1dee50ec2c 100644 --- a/types/promise-pool/tsconfig.json +++ b/types/promise-pool/tsconfig.json @@ -19,7 +19,8 @@ }, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promise-queue/index.d.ts b/types/promise-queue/index.d.ts new file mode 100644 index 0000000000..efeaf04909 --- /dev/null +++ b/types/promise-queue/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for promise-queue 2.2 +// Project: https://github.com/azproduction/promise-queue +// Definitions by: Lachlan Stuart +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = PromiseQueue; + +declare class PromiseQueue { + /** + * + * @param maxPendingPromises [Infinity] Number of promises that can run at once. + * @param maxQueuedPromises [Infinity] Number of promises generators that can be in the queue at once. + * `add()` will return a rejected promise if this limit would be exceeded. + * @param options [{}] See QueueOptions + */ + constructor(maxPendingPromises?: number, maxQueuedPromises?: number, options?: PromiseQueue.QueueOptions); + + /** + * Enqueue a promise generator. When the number of running promises is less than `maxPendingPromises`, + * this function will be called and the returned promise will be held as a running promise until it + * rejects or resolves. + * + * @throws If the global `Promise` is undefined and `Queue.configure` hasn't been called. + * @param promiseGenerator A function that returns a promise when called. + * @returns A promise that forwards the resolution/rejection of the promise returned by `promiseGenerator`, + * or immediately rejects if `maxQueuedPromise` is exceeded. + */ + add(promiseGenerator: () => Promise): Promise; + + /** + * Returns the number of promiseGenerators waiting in queue. + */ + getPendingLength(): number; + + /** + * Returns the number of in-flight promises + */ + getQueueLength(): number; + + /** + * Set which promise constructor to use for the value returned by PromiseQueue#add. + * If this isn't called, the global `Promise` constructor is used. + * @param GlobalPromise A constructor for Promises + */ + static configure(GlobalPromise: PromiseConstructor): void; +} + +declare namespace PromiseQueue { + interface QueueOptions { + /** + * Callback that is called when the queue is empty and all pending promises have resolved + */ + onEmpty(): void; + } +} diff --git a/types/promise-queue/promise-queue-tests.ts b/types/promise-queue/promise-queue-tests.ts new file mode 100644 index 0000000000..fb3764c98f --- /dev/null +++ b/types/promise-queue/promise-queue-tests.ts @@ -0,0 +1,11 @@ +import * as PromiseQueue from 'promise-queue'; + +PromiseQueue.configure(Promise); + +const queue1 = new PromiseQueue(); +const queue2 = new PromiseQueue(1, 1, {onEmpty: () => null}); + +const queuedPromise: Promise = queue1.add(() => Promise.resolve(123)); + +const running: number = queue1.getPendingLength(); +const inQueue: number = queue1.getQueueLength(); diff --git a/types/promise-queue/tsconfig.json b/types/promise-queue/tsconfig.json new file mode 100644 index 0000000000..ff00e6ae4d --- /dev/null +++ b/types/promise-queue/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "promise-queue-tests.ts" + ] +} \ No newline at end of file diff --git a/types/promise-queue/tslint.json b/types/promise-queue/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/promise-queue/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/promise-retry/tsconfig.json b/types/promise-retry/tsconfig.json index cd598fc1f4..108576d80a 100644 --- a/types/promise-retry/tsconfig.json +++ b/types/promise-retry/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "promise-retry-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/promise.prototype.finally/tsconfig.json b/types/promise.prototype.finally/tsconfig.json index 7562ea9a0e..8624f013f1 100644 --- a/types/promise.prototype.finally/tsconfig.json +++ b/types/promise.prototype.finally/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promised-temp/tsconfig.json b/types/promised-temp/tsconfig.json index 95c3dbb03c..0bd5275fad 100644 --- a/types/promised-temp/tsconfig.json +++ b/types/promised-temp/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promisify-node/tsconfig.json b/types/promisify-node/tsconfig.json index a6cb4941e3..f54f1e857d 100644 --- a/types/promisify-node/tsconfig.json +++ b/types/promisify-node/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promisify-supertest/promisify-supertest-tests.ts b/types/promisify-supertest/promisify-supertest-tests.ts index 7fa6de147d..84f4205534 100644 --- a/types/promisify-supertest/promisify-supertest-tests.ts +++ b/types/promisify-supertest/promisify-supertest-tests.ts @@ -1,6 +1,5 @@ - -import * as request from 'promisify-supertest'; -import * as express from 'express'; +import request = require('promisify-supertest'); +import express = require('express'); let app = express(); diff --git a/types/promisify-supertest/tsconfig.json b/types/promisify-supertest/tsconfig.json index 5c827afe3d..3709bcb2a7 100644 --- a/types/promisify-supertest/tsconfig.json +++ b/types/promisify-supertest/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prompt-sync-history/tsconfig.json b/types/prompt-sync-history/tsconfig.json index eee808c57f..7a8b0e911b 100644 --- a/types/prompt-sync-history/tsconfig.json +++ b/types/prompt-sync-history/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prompt-sync/tsconfig.json b/types/prompt-sync/tsconfig.json index 4e3cc7be7f..ef1a66e7b2 100644 --- a/types/prompt-sync/tsconfig.json +++ b/types/prompt-sync/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/promptly/tsconfig.json b/types/promptly/tsconfig.json index 1743c8cfae..2c4bb2d18f 100644 --- a/types/promptly/tsconfig.json +++ b/types/promptly/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prop-types/tsconfig.json b/types/prop-types/tsconfig.json index fc9e42b6d6..6274310dfb 100644 --- a/types/prop-types/tsconfig.json +++ b/types/prop-types/tsconfig.json @@ -16,6 +16,7 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, "lib": [ "es6" ] diff --git a/types/properties-reader/tsconfig.json b/types/properties-reader/tsconfig.json index 18f69d9755..ac7cfabcca 100644 --- a/types/properties-reader/tsconfig.json +++ b/types/properties-reader/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-collab/tsconfig.json b/types/prosemirror-collab/tsconfig.json index 42b55853a5..9da4d55b1c 100644 --- a/types/prosemirror-collab/tsconfig.json +++ b/types/prosemirror-collab/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-commands/tsconfig.json b/types/prosemirror-commands/tsconfig.json index 0d89f90c3b..8c66702f55 100644 --- a/types/prosemirror-commands/tsconfig.json +++ b/types/prosemirror-commands/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-gapcursor/tsconfig.json b/types/prosemirror-gapcursor/tsconfig.json index 957316926f..81051ed6d5 100644 --- a/types/prosemirror-gapcursor/tsconfig.json +++ b/types/prosemirror-gapcursor/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-history/tsconfig.json b/types/prosemirror-history/tsconfig.json index 011798770e..04d438cbec 100644 --- a/types/prosemirror-history/tsconfig.json +++ b/types/prosemirror-history/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-inputrules/tsconfig.json b/types/prosemirror-inputrules/tsconfig.json index bb5e0cc19b..1a2521fb30 100644 --- a/types/prosemirror-inputrules/tsconfig.json +++ b/types/prosemirror-inputrules/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-keymap/tsconfig.json b/types/prosemirror-keymap/tsconfig.json index 266a148c55..f4a0154e83 100644 --- a/types/prosemirror-keymap/tsconfig.json +++ b/types/prosemirror-keymap/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-markdown/tsconfig.json b/types/prosemirror-markdown/tsconfig.json index 1fe943489c..b4c5979ef2 100644 --- a/types/prosemirror-markdown/tsconfig.json +++ b/types/prosemirror-markdown/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-menu/tsconfig.json b/types/prosemirror-menu/tsconfig.json index 3f43e1e2eb..312b620e50 100644 --- a/types/prosemirror-menu/tsconfig.json +++ b/types/prosemirror-menu/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-model/index.d.ts b/types/prosemirror-model/index.d.ts index 47741b200e..153358e3c6 100644 --- a/types/prosemirror-model/index.d.ts +++ b/types/prosemirror-model/index.d.ts @@ -832,7 +832,7 @@ export class ResolvedPos { * its parent node or its parent node isn't a textblock (in which * case no marks should be preserved). */ - marksAcross(): Mark[] | null | void; + marksAcross($end: ResolvedPos): Mark[] | null | void; /** * The depth up to which this position and the given (non-resolved) * position share the same parent nodes. diff --git a/types/prosemirror-model/tsconfig.json b/types/prosemirror-model/tsconfig.json index 6ae1c43b0c..0818485734 100644 --- a/types/prosemirror-model/tsconfig.json +++ b/types/prosemirror-model/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-schema-basic/tsconfig.json b/types/prosemirror-schema-basic/tsconfig.json index 44a2b36f28..b14e21e203 100644 --- a/types/prosemirror-schema-basic/tsconfig.json +++ b/types/prosemirror-schema-basic/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-schema-list/tsconfig.json b/types/prosemirror-schema-list/tsconfig.json index 3bc76fb24f..6a2f8c5c7e 100644 --- a/types/prosemirror-schema-list/tsconfig.json +++ b/types/prosemirror-schema-list/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-state/tsconfig.json b/types/prosemirror-state/tsconfig.json index 31354bc4ba..b9eb8cebbb 100644 --- a/types/prosemirror-state/tsconfig.json +++ b/types/prosemirror-state/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-tables/tsconfig.json b/types/prosemirror-tables/tsconfig.json index 956d15d5b9..6039b257f6 100644 --- a/types/prosemirror-tables/tsconfig.json +++ b/types/prosemirror-tables/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-transform/tsconfig.json b/types/prosemirror-transform/tsconfig.json index c5799c88a6..b38cbe15db 100644 --- a/types/prosemirror-transform/tsconfig.json +++ b/types/prosemirror-transform/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/prosemirror-view/tsconfig.json b/types/prosemirror-view/tsconfig.json index 80349461cb..27ca267974 100644 --- a/types/prosemirror-view/tsconfig.json +++ b/types/prosemirror-view/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/protractor-browser-logs/tsconfig.json b/types/protractor-browser-logs/tsconfig.json index f0cfe8c279..3609f79a73 100644 --- a/types/protractor-browser-logs/tsconfig.json +++ b/types/protractor-browser-logs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/protractor-helpers/tsconfig.json b/types/protractor-helpers/tsconfig.json index 6a0cde55eb..011710d5ec 100644 --- a/types/protractor-helpers/tsconfig.json +++ b/types/protractor-helpers/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/protractor-http-mock/tsconfig.json b/types/protractor-http-mock/tsconfig.json index be5b803a40..e901bf0729 100644 --- a/types/protractor-http-mock/tsconfig.json +++ b/types/protractor-http-mock/tsconfig.json @@ -19,7 +19,8 @@ ] }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/provinces/tsconfig.json b/types/provinces/tsconfig.json index d08b599b71..afb8986660 100644 --- a/types/provinces/tsconfig.json +++ b/types/provinces/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "provinces-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/proxy-addr/tsconfig.json b/types/proxy-addr/tsconfig.json index 2fa7369df3..809cf3d0b6 100644 --- a/types/proxy-addr/tsconfig.json +++ b/types/proxy-addr/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/proxyquire/tsconfig.json b/types/proxyquire/tsconfig.json index 91f5321dca..d3a8d9b5d4 100644 --- a/types/proxyquire/tsconfig.json +++ b/types/proxyquire/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pty.js/index.d.ts b/types/pty.js/index.d.ts index 5a58f4b9fb..88c2615a82 100644 --- a/types/pty.js/index.d.ts +++ b/types/pty.js/index.d.ts @@ -18,10 +18,9 @@ interface TerminalOptions { gid?: number; } -import stream = require('stream'); import net = require('net'); -export declare class Terminal implements stream.Stream { +export declare class Terminal { /** Read-only name of the terminal. */ name: string; /** Read-only number of columns in the terminal. */ @@ -69,9 +68,9 @@ export declare class Terminal implements stream.Stream { resume(): void; setEncoding(encoding: string): void; /** - * Closes the master end of the pseudo-terminal, and attempts to kill the spawned process - * associated with the slave end of the pseudo-terminal (but only if [[pid]] is not null). - */ + * Closes the master end of the pseudo-terminal, and attempts to kill the spawned process + * associated with the slave end of the pseudo-terminal (but only if [[pid]] is not null). + */ destroy(): void; // NodeJS Stream interface @@ -85,21 +84,15 @@ export declare class Terminal implements stream.Stream { once(event: string, listener: Function): this; removeListener(event: string, listener: Function): this; removeAllListeners(event?: string): this; - // NOTE: this method is not actually defined in pty.js - setMaxListeners(n: number): this; - getMaxListeners(): number; listeners(event: string): Function[]; emit(event: string, ...args: any[]): boolean; - listenerCount(type: string): number; - prependListener(event: string, listener: Function): this; - prependOnceListener(event: string, listener: Function): this; eventNames(): string[]; } /** * Creates a new pseudo-terminal, spawns a child process, and associates it with the slave -* end of the pseudo-terminal. -*/ + * end of the pseudo-terminal. + */ export declare function createTerminal(file?: string, args?: string[], opt?: TerminalOptions): Terminal; /** Alias for [[createTerminal]]. */ export declare function fork(file?: string, args?: string[], opt?: TerminalOptions): Terminal; diff --git a/types/pty.js/tsconfig.json b/types/pty.js/tsconfig.json index bea732e24f..1484657577 100644 --- a/types/pty.js/tsconfig.json +++ b/types/pty.js/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/public-ip/tsconfig.json b/types/public-ip/tsconfig.json index 272171128a..57230ba254 100644 --- a/types/public-ip/tsconfig.json +++ b/types/public-ip/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pubnub/index.d.ts b/types/pubnub/index.d.ts index 3ad70755a0..8337acfbe4 100644 --- a/types/pubnub/index.d.ts +++ b/types/pubnub/index.d.ts @@ -1,12 +1,22 @@ // Type definitions for pubnub 4.0 // Project: https://github.com/pubnub/javascript -// Definitions by: bitbankinc , rollymaduk +// Definitions by: bitbankinc , rollymaduk , vitosamson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // @see https://www.pubnub.com/docs/web-javascript/api-reference-configuration declare class Pubnub { constructor(config: Pubnub.PubnubConfig); + static CATEGORIES: Pubnub.Categories; + + static OPERATIONS: Pubnub.Operations; + + static generateUUID(): string; + + setUUID(uuid: string): void; + + getUUID(): string; + setAuthKey(authKey: string): void; setFilterExpression(filterExpression: string): void; @@ -15,7 +25,7 @@ declare class Pubnub { publish( params: Pubnub.PublishParameters, - callback: (status: any, response: Pubnub.PublishResponse) => void + callback: (status: Pubnub.PublishStatus, response: Pubnub.PublishResponse) => void ): void; publish( @@ -24,7 +34,7 @@ declare class Pubnub { fire( params: Pubnub.FireParameters, - callback: (status: any, response: Pubnub.PublishResponse) => void + callback: (status: Pubnub.PublishStatus, response: Pubnub.PublishResponse) => void ): void; fire( @@ -45,7 +55,7 @@ declare class Pubnub { hereNow( params: Pubnub.HereNowParameters, - callback: (status: any, response: Pubnub.HereNowResponse) => void + callback: (status: Pubnub.HereNowStatus, response: Pubnub.HereNowResponse) => void ): void; hereNow( @@ -53,9 +63,31 @@ declare class Pubnub { ): Promise; whereNow( - params: {uuid: string}, + params: Pubnub.WhereNowParameters, callback: (status: Pubnub.WhereNowStatus, response: Pubnub.WhereNowResponse) => void ): void; + + whereNow( + params: Pubnub.WhereNowParameters + ): Promise; + + getState( + params: Pubnub.GetStateParameters, + callback: (status: Pubnub.GetStateStatus, state: Pubnub.GetStateResponse) => void + ): void; + + getState( + params: Pubnub.GetStateParameters + ): Promise; + + setState( + params: Pubnub.SetStateParameters, + callback: (status: Pubnub.SetStateStatus, state: Pubnub.SetStateResponse) => void + ): void; + + setState( + params: Pubnub.SetStateParameters + ): Promise; } declare namespace Pubnub { @@ -83,15 +115,30 @@ declare namespace Pubnub { secretKey?: string; } - interface PubnubData { - actualChannel: string; + interface MessageEvent { channel: string; + subscription: string; + timetoken: string; message: any; + publisher: string; + + /** + * @deprecated + */ + actualChannel: string; + + /** + * @deprecated + */ + subscribedChannel: string; } + // PubnubData was renamed to MessageEvent, keep old name for backwards compatibility + type PubnubData = MessageEvent; + interface StatusEvent { - category: string; - operation: string; + category: string; // see Pubnub.Categories + operation: string; // see Pubnub.Operations affectedChannels: string[]; subscribedChannels: string[]; affectedChannelGroups: string[]; @@ -99,6 +146,26 @@ declare namespace Pubnub { currentTimetoken: number | string; } + interface PresenceEvent { + action: 'join' | 'leave' | 'state-change' | 'timeout'; + channel: string; + occupancy: number; + state?: any; + subscription: string; + timestamp: number; + timetoken: string; + uuid: string; + + /** + * @deprecated + */ + actualChannel: string; + /** + * @deprecated + */ + subscribedChannel: string; + } + // publish interface PublishParameters { message: any; @@ -113,6 +180,13 @@ declare namespace Pubnub { timetoken: number; } + interface PublishStatus { + operation: string; // see Pubnub.Operations + category: string; // see Pubnub.Categories; + error: boolean; + errorData: Error; + } + // fire interface FireParameters { message: any; @@ -137,9 +211,9 @@ declare namespace Pubnub { // addListener interface ListenerParameters { - status?: (statusEvent: StatusEvent) => void; - message?: (data: PubnubData) => void; - presence?: (presenceEvent: any) => void; + status?(statusEvent: StatusEvent): void; + message?(messageEvent: MessageEvent): void; + presence?(presenceEvent: PresenceEvent): void; } // hereNow @@ -153,10 +227,29 @@ declare namespace Pubnub { interface HereNowResponse { totalChannels: number; totalOccupancy: number; - channels: {[channel: string]: any}; + channels: { + [channel: string]: { + name: string; + occupancy: number; + occupants: Array<{ + uuid: string; + state?: any; + }>; + }; + }; + } + + interface HereNowStatus { + error: boolean; + operation: string; // see Pubnub.Operations; + statusCode: number; } // whereNow + interface WhereNowParameters { + uuid?: string; + } + interface WhereNowStatus { error: boolean; operation: string; @@ -174,12 +267,71 @@ declare namespace Pubnub { state?: any; } + interface SetStateStatus { + error: boolean; + operation: string; + statusCode: number; + } + + interface SetStateResponse { + state: any; + } + // getState interface GetStateParameters { uuid?: string; channels?: string[]; channelGroups?: string[]; } + + interface GetStateStatus { + error: boolean; + operation: string; + statusCode: number; + } + + interface GetStateResponse { + channels: { + [channel: string]: any; + }; + } + + interface Categories { + PNNetworkUpCategory: string; + PNNetworkDownCategory: string; + PNNetworkIssuesCategory: string; + PNTimeoutCategory: string; + PNBadRequestCategory: string; + PNAccessDeniedCategory: string; + PNUnknownCategory: string; + PNReconnectedCategory: string; + PNConnectedCategory: string; + PNRequestMessageCountExceededCategory: string; + } + + interface Operations { + PNTimeOperation: string; + PNHistoryOperation: string; + PNDeleteMessagesOperation: string; + PNFetchMessagesOperation: string; + PNSubscribeOperation: string; + PNUnsubscribeOperation: string; + PNPublishOperation: string; + PNPushNotificationEnabledChannelsOperation: string; + PNRemoveAllPushNotificationsOperation: string; + PNWhereNowOperation: string; + PNSetStateOperation: string; + PNHereNowOperation: string; + PNGetStateOperation: string; + PNHeartbeatOperation: string; + PNChannelGroupsOperation: string; + PNRemoveGroupOperation: string; + PNChannelsForGroupOperation: string; + PNAddChannelsToGroupOperation: string; + PNRemoveChannelsFromGroupOperation: string; + PNAccessManagerGrant: string; + PNAccessManagerAudit: string; + } } -export default Pubnub; +export = Pubnub; diff --git a/types/pubnub/pubnub-tests.ts b/types/pubnub/pubnub-tests.ts index 291fc035fe..63bd206cde 100644 --- a/types/pubnub/pubnub-tests.ts +++ b/types/pubnub/pubnub-tests.ts @@ -1,4 +1,4 @@ -import Pubnub from 'pubnub'; +import * as Pubnub from 'pubnub'; const console = { log: (params: any) => {} @@ -36,8 +36,10 @@ pubnub.subscribe({channels: ['channel-1']}); pubnub.addListener({ status: statusEvent => { - if (statusEvent.category === "PNConnectedCategory") { + if (statusEvent.category === Pubnub.CATEGORIES.PNConnectedCategory) { console.log(statusEvent.category); + } else if (statusEvent.operation === Pubnub.OPERATIONS.PNAccessManagerAudit) { + console.log(statusEvent.operation); } }, message: message => { @@ -49,3 +51,38 @@ pubnub.addListener({ }); pubnub.unsubscribe({channels: ['channel-1']}); + +pubnub.unsubscribeAll(); + +pubnub.setUUID(Pubnub.generateUUID()); +const uuid = pubnub.getUUID(); + +pubnub.whereNow({ uuid: '' }, (status, res) => { + if (!status.error) { + console.log(res.channels[0]); + } +}); + +pubnub.whereNow({ uuid: '' }).then(res => { + console.log(res.channels[1]); +}); + +pubnub.getState({ uuid: '' }, (status, res) => { + if (!status.error) { + console.log(res.channels[0]); + } +}); + +pubnub.getState({ uuid: '' }).then(res => { + console.log(res.channels[1]); +}); + +pubnub.setState({ channels: [] }, (status, res) => { + if (!status.error) { + console.log(res.state); + } +}); + +pubnub.setState({ channels: [] }).then(res => { + console.log(res.state); +}); diff --git a/types/pubnub/tsconfig.json b/types/pubnub/tsconfig.json index fab1a92335..b8a4d1d681 100644 --- a/types/pubnub/tsconfig.json +++ b/types/pubnub/tsconfig.json @@ -1,23 +1,24 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "pubnub-tests.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "pubnub-tests.ts" + ] +} \ No newline at end of file diff --git a/types/pubsub-js/tsconfig.json b/types/pubsub-js/tsconfig.json index bccf35e64b..a83540e471 100644 --- a/types/pubsub-js/tsconfig.json +++ b/types/pubsub-js/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pug/tsconfig.json b/types/pug/tsconfig.json index efae8f261c..1d456b72d9 100644 --- a/types/pug/tsconfig.json +++ b/types/pug/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pulltorefreshjs/tsconfig.json b/types/pulltorefreshjs/tsconfig.json index 000858aefb..f20918e9b2 100644 --- a/types/pulltorefreshjs/tsconfig.json +++ b/types/pulltorefreshjs/tsconfig.json @@ -15,7 +15,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pump/pump-tests.ts b/types/pump/pump-tests.ts index 0c8e91b2c0..cf3393de21 100644 --- a/types/pump/pump-tests.ts +++ b/types/pump/pump-tests.ts @@ -1,4 +1,4 @@ -import * as pump from 'pump'; +import pump = require('pump'); import { createReadStream, createWriteStream } from 'fs'; import { Transform } from 'stream'; diff --git a/types/pump/tsconfig.json b/types/pump/tsconfig.json index 64e36bc754..e10b3daf90 100644 --- a/types/pump/tsconfig.json +++ b/types/pump/tsconfig.json @@ -14,7 +14,8 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/pupa/tsconfig.json b/types/pupa/tsconfig.json index 3800bab180..d4d761ce00 100644 --- a/types/pupa/tsconfig.json +++ b/types/pupa/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "pupa-tests.ts" ] -} +} \ No newline at end of file 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 `