From b4fc6f27dc2bcf91c31d536539fe4f48becd18d1 Mon Sep 17 00:00:00 2001 From: Alexey Svetliakov Date: Mon, 9 Jan 2017 05:24:31 +0100 Subject: [PATCH 01/87] Jest update --- jest/index.d.ts | 68 +++++++++++++++++++++++++++++++++++---- jest/jest-tests.ts | 79 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 140 insertions(+), 7 deletions(-) diff --git a/jest/index.d.ts b/jest/index.d.ts index fda6c66404..6e3d5381a8 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for Jest 16.0.0 +// Type definitions for Jest 18.0.0 // Project: http://facebook.github.io/jest/ -// Definitions by: Asana , Ivo Stratev , jwbay +// Definitions by: Asana , Ivo Stratev , jwbay , Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 declare var beforeAll: jest.Lifecycle; declare var beforeEach: jest.Lifecycle; @@ -16,7 +17,7 @@ declare var xit: jest.It; declare var test: jest.It; declare var xtest: jest.It; -declare function expect(actual: any): jest.Matchers; +declare const expect: jest.Expect; interface NodeRequire { /** Returns the actual module instead of a mock, bypassing all checks on whether the module should receive a mock implementation or not. */ @@ -31,8 +32,10 @@ declare namespace jest { function autoMockOff(): typeof jest; /** Enables automatic mocking in the module loader. */ function autoMockOn(): typeof jest; - /** Clears the mock.calls and mock.instances properties of all mocks. Equivalent to calling .mockClear() on every mocked function. */ + /** @deprecated */ function clearAllMocks(): typeof jest; + /** Clears the mock.calls and mock.instances properties of all mocks. Equivalent to calling .mockClear() on every mocked function. */ + function resetAllMocks(): typeof jest; /** Removes any pending timers from the timer system. If any timers have been scheduled, they will be cleared and will never have the opportunity to execute in the future. */ function clearAllTimers(): typeof jest; /** Indicates that the module system should never return a mocked version of the specified module, including all of the specificied module's dependencies. */ @@ -111,6 +114,41 @@ declare namespace jest { skip: Describe; } + interface MatcherUtils { + readonly isNot: boolean; + utils: { + readonly EXPECTED_COLOR: string; + readonly RECEIVED_COLOR: string; + ensureActualIsNumber(actual: any, matcherName?: string): void; + ensureExpectedIsNumber(actual: any, matcherName?: string): void; + ensureNoExpected(actual: any, matcherName?: string): void; + ensureNumbers(actual: any, expected: any, matcherName?: string): void; + /** get the type of a value with handling the edge cases like `typeof []` and `typeof null` */ + getType(value: any): string; + matcherHint(matcherName: string, received?: string, expected?: string, options?: { secondArgument?: string, isDirectExpectCall?: boolean }): string; + pluralize(word: string, count: number): string; + printExpected(value: any): string; + printReceived(value: any): string; + printWithType(name: string, received: any, print: (value: any) => string): string; + stringify(object: {}, maxDepth?: number): string; + } + } + + interface ExpectExtendMap { + [key: string]: (this: MatcherUtils, received: any, actual: any) => { message: () => string, pass: boolean }; + } + + interface Expect { + (actual: any): Matchers; + anything(): void; + any(cs: any): void; + arrayContaining(arr: any[]): void; + assertions(num: number): void; + extend(obj: ExpectExtendMap): void; + objectContaining(obj: {}): void; + stringMatching(str: string | RegExp): void; + } + interface Matchers { not: Matchers; lastCalledWith(...args: any[]): void; @@ -135,9 +173,11 @@ declare namespace jest { toHaveBeenCalledTimes(expected: number): boolean; toHaveBeenCalledWith(...params: any[]): boolean; toHaveBeenLastCalledWith(...params: any[]): boolean; + toHaveLength(expected: number): void; + toHaveProperty(propertyPath: string, value?: any): void; toMatch(expected: string | RegExp): void; toMatchObject(expected: {}): void; - toMatchSnapshot(): void; + toMatchSnapshot(snapshotName?: string): void; toThrow(): void; toThrowError(error?: string | Constructable | RegExp): void; toThrowErrorMatchingSnapshot(): void; @@ -147,9 +187,25 @@ declare namespace jest { new (...args: any[]): any } - interface Mock extends Function { + interface Mock extends Function, MockInstance { new (): T; (...args: any[]): any; + } + + /** + * Wrap module with mock definitions + * @example + * jest.mock("../api"); + * import { Api } from "../api"; + * + * const myApi: jest.Mocked = new Api() as any; + * myApi.myApiMethod.mockImplementation(() => "test"); + */ + type Mocked = T & { + [P in keyof T]: T[P] & MockInstance; + } & MockInstance; + + interface MockInstance { mock: MockContext; mockClear(): void; mockImplementation(fn: Function): Mock; diff --git a/jest/jest-tests.ts b/jest/jest-tests.ts index 913a671fa1..e1f8fb120f 100644 --- a/jest/jest-tests.ts +++ b/jest/jest-tests.ts @@ -171,6 +171,60 @@ describe('toThrow API', function () { }); }); +describe('Assymetric matchers', function () { + it('works', function () { + expect({ + timestamp: 1480807810388, + text: 'Some text content, but we care only about *this part*' + }).toEqual({ + timestamp: expect.any(Number), + text: expect.stringMatching('*this part*') + }); + + const callback = jest.fn(); + expect(callback).toEqual(expect.any(Function)); + callback(5, "test"); + expect(callback).toBeCalledWith(expect.any(Number), expect.any(String)) + const obj = { + items: [1] + }; + expect(obj).toEqual(expect.objectContaining({ + items: expect.arrayContaining([ + expect.any(Number) + ]) + })); + + expect.assertions(4); + }); +}); + +describe('Extending extend', function () { + it('works', function () { + expect.extend({ + toBeNumber(received: any, actual: any) { + const pass = received === actual; + const message = + () => `expected ${received} ${pass ? 'not ' : ''} to be ${actual}`; + return { message, pass }; + }, + toBeTest(received: any, actual: any) { + this.utils.ensureNoExpected(received); + this.utils.ensureActualIsNumber(received); + this.utils.ensureExpectedIsNumber(actual); + this.utils.ensureNumbers(received, actual); + + return { + message: () => ` + ${this.utils.getType(received).toLowerCase()} \n\n + ${this.utils.matcherHint(".not.toBe")} ${this.utils.printExpected(actual)} ${this.utils.printReceived(received)}\n\n + `, + pass: true + }; + } + }); + }); +}); + describe('missing tests', function () { it('creates closures', function () { class Closure { @@ -208,7 +262,7 @@ describe('missing tests', function () { expect(getFruits()).toContain('Orange'); mock.mockReturnValueOnce(['Apple', 'Plum']); expect(mock()).not.toContain('Orange'); - const myBeverage: any = {delicious: true, sour: false}; + const myBeverage: any = {delicious: true, sour: false}; expect(myBeverage).toContainEqual({delicious: true, sour: false}); mock.mockReturnValue([]); //Deprecated: Use jest.fn(() => value) instead. mock.mockClear(); @@ -248,6 +302,10 @@ describe('toMatchSnapshot', function () { it('compares snapshots', function () { expect({ type: 'a', props: { href: 'https://www.facebook.com/' }, children: [ 'Facebook' ] }).toMatchSnapshot(); }); + + it('can give name to snapshot', function () { + expect({ type: 'a', props: { href: 'https://www.facebook.com/' }, children: [ 'Facebook' ] }).toMatchSnapshot('given name'); + }); }); describe('toThrowErrorMatchingSnapshot', function () { @@ -367,3 +425,22 @@ describe('strictNullChecks', function () { done(); }) }); + +interface TestApi { + testProp: boolean; + testMethod(a: number): void; +} + +describe("Mocked type", function () { + it("Works", function () { + const mock: jest.Mocked = jest.fn(() => ({ + testProp: true, + testMethod1: jest.fn(), + testMethod2: jest.fn() + })) as any; + mock.testProp; + mock.testMethod.mockImplementation(() => "test"); + mock.testMethod(5); + mock.mockClear(); + }); +}); From f2581e2b98d07073207ab3e5685dc44c5435ca32 Mon Sep 17 00:00:00 2001 From: Alexey Svetliakov Date: Mon, 9 Jan 2017 06:59:08 +0100 Subject: [PATCH 02/87] Added one more example for jest.Mocked --- jest/index.d.ts | 5 +++++ jest/jest-tests.ts | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/jest/index.d.ts b/jest/index.d.ts index 6e3d5381a8..2f246f2bfe 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -200,6 +200,11 @@ declare namespace jest { * * const myApi: jest.Mocked = new Api() as any; * myApi.myApiMethod.mockImplementation(() => "test"); + * + * jest.mock("./func"); + * const myFuncMock: jest.Mocked = require("./func"); + * myFuncMock.mockImplementation(() => 5); + * myFuncMock(); */ type Mocked = T & { [P in keyof T]: T[P] & MockInstance; diff --git a/jest/jest-tests.ts b/jest/jest-tests.ts index e1f8fb120f..f2866d1689 100644 --- a/jest/jest-tests.ts +++ b/jest/jest-tests.ts @@ -431,6 +431,8 @@ interface TestApi { testMethod(a: number): void; } +declare function mockedFunc(a: number): string; + describe("Mocked type", function () { it("Works", function () { const mock: jest.Mocked = jest.fn(() => ({ @@ -442,5 +444,9 @@ describe("Mocked type", function () { mock.testMethod.mockImplementation(() => "test"); mock.testMethod(5); mock.mockClear(); + + const funcMock: jest.Mocked = require("./mockedFunc"); + funcMock.mockImplementation(() => "test"); + funcMock(5).toUpperCase(); }); }); From 3e757ce66287de54c45ecb30945c869ce7ad9809 Mon Sep 17 00:00:00 2001 From: Alexey Svetliakov Date: Mon, 9 Jan 2017 20:26:28 +0100 Subject: [PATCH 03/87] Infer type for jest.fn() for subtypes of object --- jest/index.d.ts | 1 + jest/jest-tests.ts | 43 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/jest/index.d.ts b/jest/index.d.ts index 2f246f2bfe..e81a08c1ca 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -49,6 +49,7 @@ declare namespace jest { /** Enables automatic mocking in the module loader. */ function enableAutomock(): typeof jest; /** Creates a mock function. Optionally takes a mock implementation. */ + function fn(implementation: (...args: any[]) => T): Mock; function fn(implementation?: Function): Mock; /** Use the automatic mocking system to generate a mocked version of the given module. */ function genMockFromModule(moduleName: string): T; diff --git a/jest/jest-tests.ts b/jest/jest-tests.ts index f2866d1689..c42df8fef4 100644 --- a/jest/jest-tests.ts +++ b/jest/jest-tests.ts @@ -433,20 +433,53 @@ interface TestApi { declare function mockedFunc(a: number): string; -describe("Mocked type", function () { - it("Works", function () { +describe('Mocked type', function () { + it('Works', function () { const mock: jest.Mocked = jest.fn(() => ({ testProp: true, testMethod1: jest.fn(), testMethod2: jest.fn() })) as any; mock.testProp; - mock.testMethod.mockImplementation(() => "test"); + mock.testMethod.mockImplementation(() => 'test'); mock.testMethod(5); mock.mockClear(); - const funcMock: jest.Mocked = require("./mockedFunc"); - funcMock.mockImplementation(() => "test"); + const funcMock: jest.Mocked = require('./mockedFunc'); + funcMock.mockImplementation(() => 'test'); funcMock(5).toUpperCase(); }); }); + +describe('Mocks', function () { + it('jest.fn() without args is a function type', function () { + const test = jest.fn(); + test(); + new test(); + test.mock.instances[0]; + test.mockImplementation(() => { }); + }); + + it('jest.fn() with returned object infers type', function () { + const testMock = jest.fn(() => ({ a: 5, test: jest.fn() })); + + testMock(5, 5, 'a'); + testMock.mockImplementation(() => { }); + testMock.caller; + + const ins = new testMock(); + ins.a; + ins.test(); + ins.test.mockImplementation(() => 5); + ins.test.mock.calls; + + const anotherMock = jest.fn(() => { + const api: Partial = { + testMethod: jest.fn() + }; + return api; + }); + const anotherIns: jest.Mocked = new anotherMock() as any; + anotherIns.testMethod.mockImplementation(() => 1); + }); +}); From 654c2b4e117145df33183ebb67a9f9938e2937e6 Mon Sep 17 00:00:00 2001 From: Alexey Svetliakov Date: Wed, 11 Jan 2017 06:36:08 +0100 Subject: [PATCH 04/87] Fix Mocked type --- jest/index.d.ts | 7 +------ jest/jest-tests.ts | 18 +++++------------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/jest/index.d.ts b/jest/index.d.ts index e81a08c1ca..020376004b 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -201,15 +201,10 @@ declare namespace jest { * * const myApi: jest.Mocked = new Api() as any; * myApi.myApiMethod.mockImplementation(() => "test"); - * - * jest.mock("./func"); - * const myFuncMock: jest.Mocked = require("./func"); - * myFuncMock.mockImplementation(() => 5); - * myFuncMock(); */ type Mocked = T & { [P in keyof T]: T[P] & MockInstance; - } & MockInstance; + }; interface MockInstance { mock: MockContext; diff --git a/jest/jest-tests.ts b/jest/jest-tests.ts index c42df8fef4..d2fcd6d007 100644 --- a/jest/jest-tests.ts +++ b/jest/jest-tests.ts @@ -426,28 +426,20 @@ describe('strictNullChecks', function () { }) }); -interface TestApi { +class TestApi { + constructor() { }; testProp: boolean; - testMethod(a: number): void; + testMethod(a: number): string { return ""; } } declare function mockedFunc(a: number): string; describe('Mocked type', function () { it('Works', function () { - const mock: jest.Mocked = jest.fn(() => ({ - testProp: true, - testMethod1: jest.fn(), - testMethod2: jest.fn() - })) as any; + const mock: jest.Mocked = new TestApi() as any; mock.testProp; mock.testMethod.mockImplementation(() => 'test'); - mock.testMethod(5); - mock.mockClear(); - - const funcMock: jest.Mocked = require('./mockedFunc'); - funcMock.mockImplementation(() => 'test'); - funcMock(5).toUpperCase(); + mock.testMethod(5).toUpperCase(); }); }); From 004db1e2c6dd5795264b2e98e67f0a579f44d42d Mon Sep 17 00:00:00 2001 From: Alexey Svetliakov Date: Fri, 13 Jan 2017 05:09:16 +0100 Subject: [PATCH 05/87] Added mockReset() --- jest/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jest/index.d.ts b/jest/index.d.ts index 020376004b..acfe70a0f6 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -209,6 +209,7 @@ declare namespace jest { interface MockInstance { mock: MockContext; mockClear(): void; + mockReset(): void; mockImplementation(fn: Function): Mock; mockImplementationOnce(fn: Function): Mock; mockReturnThis(): Mock; From 65701d7b2b3d60b309a7acd2fda6c10d2a77aec1 Mon Sep 17 00:00:00 2001 From: Pablo Moleri Date: Wed, 18 Jan 2017 14:03:23 -0300 Subject: [PATCH 06/87] Fix getLocation return type Also renamed GeoLocation type because it was being merged with Location type. --- webdriverio/index.d.ts | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/webdriverio/index.d.ts b/webdriverio/index.d.ts index fbc6925fa9..f033ec2bfc 100644 --- a/webdriverio/index.d.ts +++ b/webdriverio/index.d.ts @@ -352,36 +352,37 @@ declare namespace WebdriverIO { ): Client

; getHTML

(includeSelectorTag: boolean): Client

; - getLocation(selector?: string): Size; - getLocation(selector: string, axis: string): number; - getLocation(axis: string): number; + getLocation(selector?: string): Location; + getLocation(selector: string, axis: Axis): number; + getLocation(axis: Axis): number; getLocation

(selector?: string): Client

; getLocation

( selector: string, - axis: string + axis: Axis ): Client

; - getLocation

(axis: string): Client

; + getLocation

(axis: Axis): Client

; - getLocationInView(selector: string): Size; - getLocationInView(selector: string): Size[]; - getLocationInView(): Size; - getLocationInView(): Size[]; + getLocationInView(selector: string): Location; + getLocationInView(selector: string): Location[]; + getLocationInView(): Location; + getLocationInView(): Location[]; getLocationInView( selector: string, - axis: string + axis: Axis ): number; getLocationInView( selector: string, - axis: string + axis: Axis ): number[]; - getLocationInView(axis: string): number; - getLocationInView(axis: string): number[]; + getLocationInView(axis: Axis): number; + getLocationInView(axis: Axis): number[]; getLocationInView

(selector?: string): Client

; getLocationInView

( selector: string, - axis: string + axis: Axis ): Client

; - getLocationInView

(axis: string): Client

; + getLocationInView

(axis: Axis): Client

; + getSource(): Client; getSource

(): Client

; @@ -428,7 +429,7 @@ declare namespace WebdriverIO { value: any; } - export interface Location { + export interface GeoLocation { latitude: number; longitude: number; altitude: number; @@ -983,6 +984,8 @@ declare namespace WebdriverIO { switchTab

(windowHandle?: string): Client

; } + export type Axis = "x" | "y"; + export interface Options { protocol: string; waitforTimeout: number; From fac57d46263790b607f28881422aa9aac55d750c Mon Sep 17 00:00:00 2001 From: Jonathan Jayet Date: Thu, 19 Jan 2017 16:00:50 +0100 Subject: [PATCH 07/87] Fix a small issue withing the multer typing --- multer/index.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/multer/index.d.ts b/multer/index.d.ts index 2437f498db..1e388f7630 100644 --- a/multer/index.d.ts +++ b/multer/index.d.ts @@ -48,22 +48,22 @@ declare namespace multer { /** 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: Express.Request, file: Express.Multer.File, callback: (error: Error, 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: Express.Request, file: Express.Multer.File, callback: (error: Error, filename: string) => void) => void; + filename?: (req: Express.Request, file: Express.Multer.File, callback: (error?: Error, 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 */ - single(): express.RequestHandler; - /** Accept a single file with the name fieldname. The single file will be stored in req.file. */ - single(fieldame: string): express.RequestHandler; - /** 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 */ - array(): express.RequestHandler; - /** 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(fieldame: string, maxCount?: number): express.RequestHandler; - /** Accept a mix of files, specified by fields. An object with arrays of files will be stored in req.files. */ - fields(fields: Field[]): express.RequestHandler; - /** 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 */ - any(): express.RequestHandler; + /** 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 */ + single(): express.RequestHandler; + /** Accept a single file with the name fieldname. The single file will be stored in req.file. */ + single(fieldame: string): express.RequestHandler; + /** 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 */ + array(): express.RequestHandler; + /** 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(fieldame: string, maxCount?: number): express.RequestHandler; + /** Accept a mix of files, specified by fields. An object with arrays of files will be stored in req.files. */ + fields(fields: Field[]): express.RequestHandler; + /** 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 */ + any(): express.RequestHandler; } } From c779cebd7f18a885b1e956020d884438c1e5566e Mon Sep 17 00:00:00 2001 From: Jonathan Jayet Date: Thu, 19 Jan 2017 16:07:39 +0100 Subject: [PATCH 08/87] Better typing yet --- multer/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multer/index.d.ts b/multer/index.d.ts index 1e388f7630..53fdcd7add 100644 --- a/multer/index.d.ts +++ b/multer/index.d.ts @@ -48,7 +48,7 @@ declare namespace multer { /** 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: Express.Request, file: Express.Multer.File, callback: (error: Error, 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: Express.Request, file: Express.Multer.File, callback: (error?: Error, filename?: string) => void) => void; + filename?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, filename: string) => void) => void; } interface Instance { From e76c78bd71ea47bb417a853950844b9b320b86f9 Mon Sep 17 00:00:00 2001 From: Sergei Dorogin Date: Thu, 19 Jan 2017 21:26:35 +0300 Subject: [PATCH 09/87] jquery.fileupload added JQueryFileUploadXhr.headers field --- jquery.fileupload/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jquery.fileupload/index.d.ts b/jquery.fileupload/index.d.ts index 8eba9853b2..54ebb89c5c 100644 --- a/jquery.fileupload/index.d.ts +++ b/jquery.fileupload/index.d.ts @@ -284,6 +284,7 @@ interface JQueryFileUploadXhr { jqXHR: JQueryXHR; result: any; textStatus: string; + headers: {[key: string]: any}; } interface JQueryFileUploadFilesObject { From 567657e3fab839bdeb535ea23c6593cbc8ce7588 Mon Sep 17 00:00:00 2001 From: Kir Dergachev Date: Thu, 19 Jan 2017 15:29:50 +0300 Subject: [PATCH 10/87] Added types for SIP.js --- SIP.js/SIP.js-tests.ts | 99 ++++++++++++ SIP.js/index.d.ts | 354 +++++++++++++++++++++++++++++++++++++++++ SIP.js/tsconfig.json | 23 +++ SIP.js/tslint.json | 1 + 4 files changed, 477 insertions(+) create mode 100644 SIP.js/SIP.js-tests.ts create mode 100644 SIP.js/index.d.ts create mode 100644 SIP.js/tsconfig.json create mode 100644 SIP.js/tslint.json diff --git a/SIP.js/SIP.js-tests.ts b/SIP.js/SIP.js-tests.ts new file mode 100644 index 0000000000..f688fe67ae --- /dev/null +++ b/SIP.js/SIP.js-tests.ts @@ -0,0 +1,99 @@ +import SIP = require("./index"); + +let ua: SIP.UA = new SIP.UA(); + +const mediaHandler = (session: SIP.Session, options: SIP.WebRTC.Options) => new SIP.WebRTC.MediaHandler(); +const logConnector = (level: string, category: string, label: string, content: string) => null; + +const uaWithConfig: SIP.UA = new SIP.UA({ + uri: "wss://uri", + wsServers: ["s1", "s2"], + allowLegacyNotifications: true, + authenticationFactory: mediaHandler, + authorizationUser: "user", + autostart: true, + connectionRecoveryMaxInterval: 1, + connectionRecoveryMinInterval: 1, + displayName: "name", + hackCleanJitsiSdpImageattr: true, + hackStripTcp: true, + hackIpInContact: true, + hackViaTcp: true, + hackWssInTransport: true, + iceCheckingTimeout: 1, + instanceId: "id", + log: { + builtinEnabled: true, + level: 1, + connector: logConnector + }, + mediaHandlerFactory: mediaHandler, + noAnswerTimeout: 1, + password: "", + register: true, + registerExpires: 1, + registrarServer: "sip:registrar.mydomain.com", + rel100: "", + replaces: "", + stunServers: ["", ""], + turnServers: [ + { + password: "", + username: "", + urls: ["", ""] + } + ], + usePreloadedRoute: true, + userAgentString: "", + wsServerMaxReconnection: 1, + wsServerReconnectionTimeout: 1 +}); + +ua.start(); +ua.stop(); + +ua.register(); +ua = ua.register({ extraHeaders: [""] }); + +ua.unregister() +ua.unregister({ extraHeaders: [""], all: true }); + +const isConnected: boolean = ua.isConnected(); +const isRegistered: boolean = ua.isRegistered(); + +const message: SIP.Message = ua.message("", "", { contentType: "" }); + +ua.subscribe("", "", { expires: 1, extraHeaders: [""]}); +const subscription: SIP.Subscription = ua.subscribe(new SIP.URI(), "", { expires: 1, extraHeaders: [""]}); + +let session = ua.invite("", new HTMLVideoElement()); + +const inviteOptions: SIP.InviteOptions = { + media: { + constraints: { audio: true, video: false }, + stream: new MediaStream(), + render: { remote: new Element(), local: new Element() }, + }, + anonymous: true, + rel100: "", + inviteWithoutSdp: true, + RTCConstraints: new RTCPeerConnection() +} + +session = ua.invite("", inviteOptions); + +ua.on('connected', (args: SIP.UA.EventArgs.ConnectedArgs) => {}); +ua.on('disconnected', () => {}); +ua.on('registered', () => {}); +ua.on('unregistered', (args: SIP.UA.EventArgs.UnregisteredArgs) => {}); +ua.on('registrationFailed', (args: SIP.UA.EventArgs.RegistrationFailedArgs) => {}); +ua.on('invite', (session: SIP.Session) => { + session.on('progress', (response) => { + }); + session.on('accepted', (response) => { + }); + session.on('rejected', (response) => { + }); + +}); +ua.on('message', (message: SIP.Message) => {}); diff --git a/SIP.js/index.d.ts b/SIP.js/index.d.ts new file mode 100644 index 0000000000..0eaabb9b48 --- /dev/null +++ b/SIP.js/index.d.ts @@ -0,0 +1,354 @@ +// Type definitions for SIP.js v0.7.6 +// Project: https://sipjs.com/ +// Definitions by: Kir Dergachev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = SIP; + +declare namespace SIP { + + class URI { + constructor( + scheme?: string, + user?: string, + host?: string, + port?: number, + parameters?: string[], + headers?: string[]); + + scheme?: string; + user?: string; + host?: string; + port?: number; + + setParam(key: string, value?: string): void; + getParam(key: string): string; + hasParam(key: string): string; + deleteParam(key: string): string; + clearParams(): void; + setHeader(name: string, value: string): void; + getHeader(name: string): string[]; + hasHeader(name: string): boolean; + deleteHeader(name: string): string[]; + clearHeaders(): void; + clone(): URI; + toString(): string; + + static parse(uri: string): URI; + } + + namespace UA.EventArgs { + interface ConnectedArgs { attempts: number } + interface UnregisteredArgs { response: string; cause: string; } + interface RegistrationFailedArgs extends UnregisteredArgs { } + } + + class UA { + constructor(configuration?: ConfigurationParameters); + start(): void; + stop(): void; + register(options?: ExtraHeadersOptions): UA; + unregister(options?: UnregisterOptions): void; + isRegistered(): boolean; + isConnected(): boolean; + message(target: string | URI, body: string, options?: MessageOptions): Message; + subscribe(target: string | URI, event: string, options?: SubscribeOptions): Subscription; + invite(target: string | URI, options?: InviteOptions): Session; + invite(target: string | URI, element?: HTMLAudioElement | HTMLVideoElement): Session; + request(method: string, target: string | URI, options?: RequestOptions): ClientContext; + + on(name: 'connected', callback: (args: UA.EventArgs.ConnectedArgs) => void): void; + on(name: 'disconnected' | 'registered', callback: () => void): void; + on(name: 'unregistered', callback: (args: UA.EventArgs.UnregisteredArgs) => void): void; + on(name: 'registrationFailed', callback: (args: UA.EventArgs.RegistrationFailedArgs) => void): void; + on(name: 'invite', callback: (session: Session) => void): void; + on(name: 'message', callback: (message: Message) => void): void; + } + + namespace UA.C { + class supported { + REQUIRED: string; + SUPPORTED: string; + UNSUPPORTED: string; + } + + class causes { + INVALID_TARGET: string; + CONNECTION_ERROR: string; + REQUEST_TIMEOUT: string; + SIP_FAILURE_CODE: string; + } + } + + class Session { + startTime?: Date; + endTime?: Date; + ua?: UA; + method?: string; + mediaHandler?: WebRTC.MediaHandler; + request?: IncomingRequest | OutgoingRequest; + localIdentity?: NameAddrHeader; + remoteIdentity?: NameAddrHeader; + data: ClientContext | ServerContext; + + dtmf(tone: string | number, options?: Session.DtmfOptions): Session; + terminate(options?: Session.CommonOptions): Session; + bye(options?: Session.CommonOptions): Session; + getLocalStreams(): MediaStream[]; + getRemoteStreams(): MediaStream[]; + refer(target: string | Session, options?: ExtraHeadersOptions): Session; + mute(options?: ExtraHeadersOptions): void; + unmute(options?: ExtraHeadersOptions): void; + cancel(options?: Session.CommonOptions): void; + progress(options?: Session.ProgressOptions): void; + accept(options?: Session.AcceptOptions): void; + reject(options?: Session.CommonOptions): void; + reply(options?: Session.CommonOptions): void; + followRefer(callback: Function): void; + + on(name: 'progress', callback: (response: IncomingResponse) => void): void; + on(name: 'accepted', callback: (data: { code: number, response: IncomingResponse }) => void): void; + on(name: 'rejected', callback: (response: IncomingResponse, cause: string) => void): void; + on(name: 'failed', callback: (response: IncomingResponse, cause: string) => void): void; + on(name: 'terminated', callback: (message: IncomingResponse, cause: string) => void): void; + on(name: 'refer', callback: (request: IncomingRequest) => void): void; + on(name: 'cancel', callback: () => void): void; + on(name: 'replaced', callback: (newSession: Session) => void): void; + on(name: 'dtmf', callback: (request: IncomingRequest, dtmf: Session.DTMF) => void): void; + on(name: 'muted', callback: (data: Session.Muted) => void): void; + on(name: 'unmuted', callback: (data: Session.Muted) => void): void; + on(name: 'bye', callback: (request: IncomingRequest) => void): void; + } + + namespace Session { + interface DtmfOptions extends ExtraHeadersOptions { + duration?: number; + interToneGap?: number; + } + + interface CommonOptions extends ExtraHeadersOptions { + status_code?: number; + reason_phrase?: string; + body?: string; + } + + interface ProgressOptions extends ExtraHeadersOptions { + rel100?: boolean; + media?: MediaConstraints; + } + + interface AcceptOptions { + RTCConstraints?: RTCPeerConnection; + media?: MediaOptions; + } + + interface DTMF { + } + + interface Muted { + audio?: boolean; + video?: boolean + } + } + + interface RenderHint { + remote?: Element; + local?: Element + } + + interface MediaConstraints { + audio: boolean; + video: boolean; + } + + interface TurnServer { + urls?: string | string[]; + username?: string; + password?: string; + } + + namespace WebRTC { + + interface Options { + stunServers?: string | string[]; + turnServers?: TurnServer | TurnServer[]; + RTCConstraints?: RTCPeerConnection; + } + + type MediaHandlerFactory = (session: Session, options: Options) => MediaHandler; + + class MediaHandler { + getLocalStreams(): MediaStream[]; + getRemoteStreams(): MediaStream[]; + render(renderHint: RenderHint): void; + + on(name: 'userMediaRequest', callback: (constraints: MediaConstraints) => void): void; + on(name: 'userMedia', callback: (stream: MediaStream) => void): void; + on(name: 'userMediaFailed', callback: (error: string) => void): void; + on(name: 'iceGathering', callback: () => void): void; + on(name: 'iceCandidate', callback: (candidate: RTCIceCandidate) => void): void; + on(name: 'iceGatheringComplete', callback: () => void): void; + on(name: 'iceConnection', callback: () => void): void; + on(name: 'iceConnectionChecking', callback: () => void): void; + on(name: 'iceConnectionConnected', callback: () => void): void; + on(name: 'iceConnectionCompleted', callback: () => void): void; + on(name: 'iceConnectionFailed', callback: () => void): void; + on(name: 'iceConnectionDisconnected', callback: () => void): void; + on(name: 'iceConnectionClosed', callback: () => void): void; + on(name: 'getDescription', callback: (sdpWrapper: { type: string, sdp: string }) => void): void; + on(name: 'setDescription', callback: (sdpWrapper: { type: string, sdp: string }) => void): void; + on(name: 'dataChannel', callback: () => void): void; + on(name: 'addStream', callback: (stream: MediaStream) => void): void; + } + } + + /* Parameters */ + interface ConfigurationParameters { + uri?: string; + wsServers?: string | string[] | { ws_uri: string; weigth: number }[]; + allowLegacyNotifications?: boolean; + authenticationFactory?: WebRTC.MediaHandlerFactory; + authorizationUser?: string; + autostart?: boolean; + connectionRecoveryMaxInterval?: number; + connectionRecoveryMinInterval?: number; + displayName?: string; + hackCleanJitsiSdpImageattr?: boolean; + hackStripTcp?: boolean; + hackIpInContact?: boolean; + hackViaTcp?: boolean; + hackWssInTransport?: boolean; + iceCheckingTimeout?: number; + instanceId?: string; + log?: { + builtinEnabled?: boolean; + level?: number | string; + connector?: (level: string, category: string, label: string, content: string) => void; + }; + mediaHandlerFactory?: WebRTC.MediaHandlerFactory; + noAnswerTimeout?: number; + password?: string; + register?: boolean; + registerExpires?: number; + registrarServer?: string; + rel100?: string; + replaces?: string; + stunServers?: string | string[]; + traceSip?: boolean; + turnServers?: TurnServer | TurnServer[]; + usePreloadedRoute?: boolean; + userAgentString?: string; + wsServerMaxReconnection?: number; + wsServerReconnectionTimeout?: number; + } + + /* Options */ + interface ExtraHeadersOptions { + extraHeaders?: string[]; + } + + interface UnregisterOptions extends ExtraHeadersOptions { + all?: boolean; + } + + interface MessageOptions extends ExtraHeadersOptions { + contentType?: string; + } + + interface SubscribeOptions extends ExtraHeadersOptions { + expires?: number; + } + + interface MediaOptions { + constraints?: MediaConstraints; + stream?: MediaStream; + render?: RenderHint; + } + + interface InviteOptions extends ExtraHeadersOptions { + media?: MediaOptions; + anonymous?: boolean; + rel100?: string; + inviteWithoutSdp?: boolean; + RTCConstraints?: RTCPeerConnection; + } + + interface RequestOptions extends ExtraHeadersOptions { + body?: string; + } + + /* Contexts */ + interface Message extends ClientContext { + body: string; + } + + interface Subscription extends ClientContext { + id: string; + state: string; + event: string; + dialog: string; + timers: Object; + errorCodes: number[]; + subscribe(): Subscription; + unsubscribe(): void; + close(): void; + } + + /* Context */ + interface Context { + ua: UA; + method: string; + request: OutgoingRequest; + localIdentity: NameAddrHeader; + remoteIdentity: NameAddrHeader; + data: {}; + + on(name: 'progress', callback: (response: IncomingMessage, cause: string) => void): void; + on(name: 'accepted', callback: (response: IncomingMessage, cause: string) => void): void; + on(name: 'rejected', callback: (response: IncomingMessage, cause: string) => void): void; + on(name: 'failed', callback: (response: IncomingMessage, cause: string) => void): void; + on(name: 'notify', callback: (request: IncomingRequest) => void): void; + } + + interface ClientContext extends Context { + cancel(options?: { status_code?: number, reason_phrase?: string }): ClientContext; + } + + interface ServerContext extends Context { + progress(options?: Session.ProgressOptions): void; + accept(options?: Session.AcceptOptions): void; + reject(options?: Session.CommonOptions): void; + reply(options?: Session.CommonOptions): void; + } + + /* Request */ + interface Request extends Context { + } + + interface IncomingRequest extends Request { + } + + interface OutgoingRequest extends Request { + } + + interface IncomingResponse extends Request { + } + + interface IncomingMessage extends Request { + } + + /* Header */ + class NameAddrHeader { + constructor(uri: string | URI, displayName: string, parameters: { key: string, value: string }[]); + + uri: string | URI; + displayName: string; + + setParam(key: string, value?: string): void; + getParam(key: string): string; + deleteParam(key: string): string; + clearParams(): void; + + static parse(name_addr_header: string): NameAddrHeader; + } +} diff --git a/SIP.js/tsconfig.json b/SIP.js/tsconfig.json new file mode 100644 index 0000000000..93cce57ffb --- /dev/null +++ b/SIP.js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": ["webrtc"], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "SIP.js-tests.ts" + ] +} diff --git a/SIP.js/tslint.json b/SIP.js/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/SIP.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 3de4a245bdc0dab48b91b51c3937391d04ef2902 Mon Sep 17 00:00:00 2001 From: Kir Dergachev Date: Fri, 20 Jan 2017 12:14:28 +0300 Subject: [PATCH 11/87] Fixed package case --- {SIP.js => sip.js}/index.d.ts | 0 SIP.js/SIP.js-tests.ts => sip.js/sip.js-tests.ts | 0 {SIP.js => sip.js}/tsconfig.json | 2 +- {SIP.js => sip.js}/tslint.json | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename {SIP.js => sip.js}/index.d.ts (100%) rename SIP.js/SIP.js-tests.ts => sip.js/sip.js-tests.ts (100%) rename {SIP.js => sip.js}/tsconfig.json (94%) rename {SIP.js => sip.js}/tslint.json (100%) diff --git a/SIP.js/index.d.ts b/sip.js/index.d.ts similarity index 100% rename from SIP.js/index.d.ts rename to sip.js/index.d.ts diff --git a/SIP.js/SIP.js-tests.ts b/sip.js/sip.js-tests.ts similarity index 100% rename from SIP.js/SIP.js-tests.ts rename to sip.js/sip.js-tests.ts diff --git a/SIP.js/tsconfig.json b/sip.js/tsconfig.json similarity index 94% rename from SIP.js/tsconfig.json rename to sip.js/tsconfig.json index 93cce57ffb..8c84c6273e 100644 --- a/SIP.js/tsconfig.json +++ b/sip.js/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "SIP.js-tests.ts" + "sip.js-tests.ts" ] } diff --git a/SIP.js/tslint.json b/sip.js/tslint.json similarity index 100% rename from SIP.js/tslint.json rename to sip.js/tslint.json From f0f803116b25f321fca2755a4e6c96129e6c4a7a Mon Sep 17 00:00:00 2001 From: Kir Dergachev Date: Fri, 20 Jan 2017 12:52:59 +0300 Subject: [PATCH 12/87] Move references from tsconfig --- sip.js/index.d.ts | 2 ++ sip.js/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sip.js/index.d.ts b/sip.js/index.d.ts index 0eaabb9b48..3af04495c9 100644 --- a/sip.js/index.d.ts +++ b/sip.js/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Kir Dergachev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + export = SIP; declare namespace SIP { diff --git a/sip.js/tsconfig.json b/sip.js/tsconfig.json index 8c84c6273e..b6532e5674 100644 --- a/sip.js/tsconfig.json +++ b/sip.js/tsconfig.json @@ -12,7 +12,7 @@ "typeRoots": [ "../" ], - "types": ["webrtc"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, From cb6ec66ca995549337896b3e38dc79a097b50c08 Mon Sep 17 00:00:00 2001 From: Kir Dergachev Date: Fri, 20 Jan 2017 13:22:30 +0300 Subject: [PATCH 13/87] Fix lint error --- sip.js/index.d.ts | 48 ++++++++++++++-------------------------------- sip.js/tslint.json | 7 ++++++- 2 files changed, 20 insertions(+), 35 deletions(-) diff --git a/sip.js/index.d.ts b/sip.js/index.d.ts index 3af04495c9..8c7a297613 100644 --- a/sip.js/index.d.ts +++ b/sip.js/index.d.ts @@ -40,7 +40,7 @@ declare namespace SIP { } namespace UA.EventArgs { - interface ConnectedArgs { attempts: number } + interface ConnectedArgs { attempts: number; } interface UnregisteredArgs { response: string; cause: string; } interface RegistrationFailedArgs extends UnregisteredArgs { } } @@ -55,8 +55,7 @@ declare namespace SIP { isConnected(): boolean; message(target: string | URI, body: string, options?: MessageOptions): Message; subscribe(target: string | URI, event: string, options?: SubscribeOptions): Subscription; - invite(target: string | URI, options?: InviteOptions): Session; - invite(target: string | URI, element?: HTMLAudioElement | HTMLVideoElement): Session; + invite(target: string | URI, element?: InviteOptions | HTMLAudioElement | HTMLVideoElement): Session; request(method: string, target: string | URI, options?: RequestOptions): ClientContext; on(name: 'connected', callback: (args: UA.EventArgs.ConnectedArgs) => void): void; @@ -110,16 +109,13 @@ declare namespace SIP { on(name: 'progress', callback: (response: IncomingResponse) => void): void; on(name: 'accepted', callback: (data: { code: number, response: IncomingResponse }) => void): void; - on(name: 'rejected', callback: (response: IncomingResponse, cause: string) => void): void; - on(name: 'failed', callback: (response: IncomingResponse, cause: string) => void): void; + on(name: 'failed' | 'rejected', callback: (response: IncomingResponse, cause: string) => void): void; on(name: 'terminated', callback: (message: IncomingResponse, cause: string) => void): void; - on(name: 'refer', callback: (request: IncomingRequest) => void): void; on(name: 'cancel', callback: () => void): void; on(name: 'replaced', callback: (newSession: Session) => void): void; on(name: 'dtmf', callback: (request: IncomingRequest, dtmf: Session.DTMF) => void): void; - on(name: 'muted', callback: (data: Session.Muted) => void): void; - on(name: 'unmuted', callback: (data: Session.Muted) => void): void; - on(name: 'bye', callback: (request: IncomingRequest) => void): void; + on(name: 'muted' | 'unmuted', callback: (data: Session.Muted) => void): void; + on(name: 'refer' | 'bye', callback: (request: IncomingRequest) => void): void; } namespace Session { @@ -144,18 +140,17 @@ declare namespace SIP { media?: MediaOptions; } - interface DTMF { - } + interface DTMF extends Object {} interface Muted { audio?: boolean; - video?: boolean + video?: boolean; } } interface RenderHint { remote?: Element; - local?: Element + local?: Element; } interface MediaConstraints { @@ -185,29 +180,18 @@ declare namespace SIP { render(renderHint: RenderHint): void; on(name: 'userMediaRequest', callback: (constraints: MediaConstraints) => void): void; - on(name: 'userMedia', callback: (stream: MediaStream) => void): void; + on(name: 'addStream' | 'userMedia', callback: (stream: MediaStream) => void): void; on(name: 'userMediaFailed', callback: (error: string) => void): void; - on(name: 'iceGathering', callback: () => void): void; on(name: 'iceCandidate', callback: (candidate: RTCIceCandidate) => void): void; - on(name: 'iceGatheringComplete', callback: () => void): void; - on(name: 'iceConnection', callback: () => void): void; - on(name: 'iceConnectionChecking', callback: () => void): void; - on(name: 'iceConnectionConnected', callback: () => void): void; - on(name: 'iceConnectionCompleted', callback: () => void): void; - on(name: 'iceConnectionFailed', callback: () => void): void; - on(name: 'iceConnectionDisconnected', callback: () => void): void; - on(name: 'iceConnectionClosed', callback: () => void): void; - on(name: 'getDescription', callback: (sdpWrapper: { type: string, sdp: string }) => void): void; - on(name: 'setDescription', callback: (sdpWrapper: { type: string, sdp: string }) => void): void; - on(name: 'dataChannel', callback: () => void): void; - on(name: 'addStream', callback: (stream: MediaStream) => void): void; + on(name: 'iceGathering' | 'iceGatheringComplete' | 'iceConnection' | 'iceConnectionChecking' | 'iceConnectionConnected' | 'iceConnectionCompleted' | 'iceConnectionFailed' | 'iceConnectionDisconnected' | 'iceConnectionClosed', callback: () => void): void; + on(name: 'dataChannel' | 'getDescription' | 'setDescription', callback: (sdpWrapper: { type: string, sdp: string }) => void): void; } } /* Parameters */ interface ConfigurationParameters { uri?: string; - wsServers?: string | string[] | { ws_uri: string; weigth: number }[]; + wsServers?: string | string[] | Array<{ ws_uri: string; weigth: number }>; allowLegacyNotifications?: boolean; authenticationFactory?: WebRTC.MediaHandlerFactory; authorizationUser?: string; @@ -304,11 +288,7 @@ declare namespace SIP { localIdentity: NameAddrHeader; remoteIdentity: NameAddrHeader; data: {}; - - on(name: 'progress', callback: (response: IncomingMessage, cause: string) => void): void; - on(name: 'accepted', callback: (response: IncomingMessage, cause: string) => void): void; - on(name: 'rejected', callback: (response: IncomingMessage, cause: string) => void): void; - on(name: 'failed', callback: (response: IncomingMessage, cause: string) => void): void; + on(name: 'progress' | 'accepted' | 'rejected' | 'failed', callback: (response: IncomingMessage, cause: string) => void): void; on(name: 'notify', callback: (request: IncomingRequest) => void): void; } @@ -341,7 +321,7 @@ declare namespace SIP { /* Header */ class NameAddrHeader { - constructor(uri: string | URI, displayName: string, parameters: { key: string, value: string }[]); + constructor(uri: string | URI, displayName: string, parameters: Array<{ key: string, value: string }>); uri: string | URI; displayName: string; diff --git a/sip.js/tslint.json b/sip.js/tslint.json index 377cc837d4..105f5736e6 100644 --- a/sip.js/tslint.json +++ b/sip.js/tslint.json @@ -1 +1,6 @@ -{ "extends": "../tslint.json" } +{ + "extends": "../tslint.json", + "rules": { + "no-empty-interface": false + } +} From 2cc1c6e25dc4fd757dc98503f985678ebf4a21ef Mon Sep 17 00:00:00 2001 From: Kir Dergachev Date: Fri, 20 Jan 2017 13:58:52 +0300 Subject: [PATCH 14/87] Fix type definition test errors --- sip.js/index.d.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sip.js/index.d.ts b/sip.js/index.d.ts index 8c7a297613..a8d2b3c8db 100644 --- a/sip.js/index.d.ts +++ b/sip.js/index.d.ts @@ -1,13 +1,11 @@ -// Type definitions for SIP.js v0.7.6 +// Type definitions for SIP.js 0.7 // Project: https://sipjs.com/ // Definitions by: Kir Dergachev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -export = SIP; - -declare namespace SIP { +export declare namespace SIP { class URI { constructor( @@ -105,7 +103,7 @@ declare namespace SIP { accept(options?: Session.AcceptOptions): void; reject(options?: Session.CommonOptions): void; reply(options?: Session.CommonOptions): void; - followRefer(callback: Function): void; + followRefer(callback: () => void): void; on(name: 'progress', callback: (response: IncomingResponse) => void): void; on(name: 'accepted', callback: (data: { code: number, response: IncomingResponse }) => void): void; @@ -273,7 +271,7 @@ declare namespace SIP { state: string; event: string; dialog: string; - timers: Object; + timers: {}; errorCodes: number[]; subscribe(): Subscription; unsubscribe(): void; From 1c753b2c69e2df6a45a06cdfa2568a30f7d655ba Mon Sep 17 00:00:00 2001 From: Kir Dergachev Date: Fri, 20 Jan 2017 14:40:08 +0300 Subject: [PATCH 15/87] Fix tslint errors, configure rules --- sip.js/index.d.ts | 10 ++++++---- sip.js/tslint.json | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sip.js/index.d.ts b/sip.js/index.d.ts index a8d2b3c8db..942a0d22b3 100644 --- a/sip.js/index.d.ts +++ b/sip.js/index.d.ts @@ -1,11 +1,13 @@ -// Type definitions for SIP.js 0.7 -// Project: https://sipjs.com/ -// Definitions by: Kir Dergachev +// Type definitions for sip.js 0.7 +// Project: http://sipjs.com +// Definitions by: Kir Dergachev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -export declare namespace SIP { +export = SIP; + +declare namespace SIP { class URI { constructor( diff --git a/sip.js/tslint.json b/sip.js/tslint.json index 105f5736e6..c78c443ad2 100644 --- a/sip.js/tslint.json +++ b/sip.js/tslint.json @@ -1,6 +1,7 @@ { "extends": "../tslint.json", "rules": { - "no-empty-interface": false + "no-empty-interface": false, + "export-just-namespace": false } } From d2be90a50693461d0e2e4dd20c3d578533a779db Mon Sep 17 00:00:00 2001 From: mkollers Date: Mon, 23 Jan 2017 10:26:59 +0100 Subject: [PATCH 16/87] added group to Node http://visjs.org/docs/network/nodes.html# --- vis/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/vis/index.d.ts b/vis/index.d.ts index 92b6ea6a08..3ee00ba03a 100644 --- a/vis/index.d.ts +++ b/vis/index.d.ts @@ -1497,6 +1497,7 @@ export interface Data { } export interface Node { + group?: string; id?: IdType; label?: string; x?: number; From 39772baa2c32da872c8482088c784eb497e303c0 Mon Sep 17 00:00:00 2001 From: SamSchelfhout Date: Mon, 23 Jan 2017 10:37:00 +0100 Subject: [PATCH 17/87] Update index.d.ts to support ajaxTransport Update index.d.ts to jQuery.ajaxTransport(). See https://api.jquery.com/jQuery.ajaxTransport/ --- jquery/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jquery/index.d.ts b/jquery/index.d.ts index e0bf072983..3a785530aa 100644 --- a/jquery/index.d.ts +++ b/jquery/index.d.ts @@ -786,6 +786,15 @@ interface JQueryStatic { */ ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + /** + * Creates an object that handles the actual transmission of Ajax data. + * + * @param dataType A string identifying the data type to use. + * @param handler A handler to return the new transport object to use with the data type provided in the first argument. + * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} + */ + ajaxTransport(dataType: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + ajaxSettings: JQueryAjaxSettings; /** From ff113b3b1cfb2b7c98e2efd6e10ddb04d43bc031 Mon Sep 17 00:00:00 2001 From: darlin Date: Mon, 23 Jan 2017 20:14:41 +0800 Subject: [PATCH 18/87] add sub module export --- crypto-js/index.d.ts | 237 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 234 insertions(+), 3 deletions(-) diff --git a/crypto-js/index.d.ts b/crypto-js/index.d.ts index 5fdf193254..a2c0ee381d 100644 --- a/crypto-js/index.d.ts +++ b/crypto-js/index.d.ts @@ -3,9 +3,6 @@ // Definitions by: Michael Zabka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export = CryptoJS; -export as namespace CryptoJS; - declare var CryptoJS: CryptoJS.Hashes; declare namespace CryptoJS { type Hash = (message: string, key?: string, ...options: any[]) => string; @@ -113,5 +110,239 @@ declare namespace CryptoJS { NoPadding: Padding; }; } + } +declare module "crypto-js" { + var CryptoJS: CryptoJS.Hashes; + export = CryptoJS; +} + +/* --------------------------------- */ +declare module "crypto-js/core" { + var core: any; + export = core; +} + +declare module "crypto-js/x64-core" { + var x64: any; + export = x64; +} + +declare module "crypto-js/lib-typedarrays" { + var libWordArray: any; + export = libWordArray; +} + +/* --------------------------------- */ +declare module "crypto-js/md5" { + var MD5: CryptoJS.Hash; + export = MD5; +} + +declare module "crypto-js/sha1" { + var SHA1: CryptoJS.Hash; + export = SHA1; +} + +declare module "crypto-js/sha256" { + var SHA256: CryptoJS.Hash; + export = SHA256; +} + +declare module "crypto-js/sha224" { + var SHA224: CryptoJS.Hash; + export = SHA224; +} + +declare module "crypto-js/sha512" { + var SHA512: CryptoJS.Hash; + export = SHA512; +} + +declare module "crypto-js/sha384" { + var SHA384: CryptoJS.Hash; + export = SHA384; +} + +declare module "crypto-js/sha3" { + var SHA3: CryptoJS.Hash; + export = SHA3; +} + +declare module "crypto-js/ripemd160" { + var RIPEMD160: CryptoJS.Hash; + export = RIPEMD160; +} + +/* --------------------------------- */ +declare module "crypto-js/hmac-md5" { + var HmacMD5: CryptoJS.Hash; + export = HmacMD5; +} + +declare module "crypto-js/hmac-sha1" { + var HmacSHA1: CryptoJS.Hash; + export = HmacSHA1; +} + +declare module "crypto-js/hmac-sha256" { + var HmacSHA256: CryptoJS.Hash; + export = HmacSHA256; +} + +declare module "crypto-js/hmac-sha224" { + var HmacSHA224: CryptoJS.Hash; + export = HmacSHA224; +} + +declare module "crypto-js/hmac-sha512" { + var HmacSHA512: CryptoJS.Hash; + export = HmacSHA512; +} + +declare module "crypto-js/hmac-sha384" { + var HmacSHA384: CryptoJS.Hash; + export = HmacSHA384; +} + +declare module "crypto-js/hmac-sha3" { + var HmacSHA3: CryptoJS.Hash; + export = HmacSHA3; +} + +declare module "crypto-js/hmac-ripemd160" { + var HmacRIPEMD160: CryptoJS.Hash; + export = HmacRIPEMD160; +} + +/* --------------------------------- */ +declare module "crypto-js/pbkdf2" { + var PBKDF2: CryptoJS.Hash; + export = PBKDF2; +} + +/* --------------------------------- */ +declare module "crypto-js/aes" { + var AES: CryptoJS.Cipher; + export = AES; +} + +declare module "crypto-js/tripledes" { + var TripleDES: CryptoJS.Cipher; + export = TripleDES; +} + +declare module "crypto-js/rc4" { + var RC4: CryptoJS.Cipher; + export = RC4; +} + +declare module "crypto-js/rabbit" { + var Rabbit: CryptoJS.Cipher; + export = Rabbit; +} + +declare module "crypto-js/rabbit-legacy" { + var RabbitLegacy: CryptoJS.Cipher; + export = RabbitLegacy; +} + +declare module "crypto-js/evpkdf" { + var EvpKDF: CryptoJS.Cipher; + export = EvpKDF; +} + +/* --------------------------------- */ +declare module "crypto-js/format-openssl" { + var FormatOpenssl: any; + export = FormatOpenssl; +} + +declare module "crypto-js/format-hex" { + var FormatHex: any; + export = FormatHex; +} + +/* --------------------------------- */ +declare module "crypto-js/enc-latin1" { + var encLatin1: CryptoJS.Encoder; + export = encLatin1; +} + +declare module "crypto-js/enc-utf8" { + var encUtf8: CryptoJS.Encoder; + export = encUtf8; +} + +declare module "crypto-js/enc-hex" { + var encHex: CryptoJS.Encoder; + export = encHex; +} + +declare module "crypto-js/enc-utf16" { + var encUtf16: CryptoJS.Encoder; + export = encUtf16; +} + +declare module "crypto-js/enc-base64" { + var encBase64: CryptoJS.Encoder; + export = encBase64; +} + +/* --------------------------------- */ +declare module "crypto-js/mode-cfb" { + var modeCFB: CryptoJS.Mode; + export = modeCFB; +} + +declare module "crypto-js/mode-ctr" { + var modeCTR: CryptoJS.Mode; + export = modeCTR; +} + +declare module "crypto-js/mode-ctr-gladman" { + var modeCTRGladman: CryptoJS.Mode; + export = modeCTRGladman; +} + +declare module "crypto-js/mode-ofb" { + var modeOFB: CryptoJS.Mode; + export = modeOFB; +} + +declare module "crypto-js/mode-ecb" { + var modeECB: CryptoJS.Mode; + export = modeECB; +} + +/* --------------------------------- */ +declare module "crypto-js/pad-pkcs7" { + var padPkcs7: CryptoJS.Padding; + export = padPkcs7; +} + +declare module "crypto-js/pad-ansix923" { + var padAnsiX923: CryptoJS.Padding; + export = padAnsiX923; +} + +declare module "crypto-js/pad-iso10126" { + var padIso10126: CryptoJS.Padding; + export = padIso10126; +} + +declare module "crypto-js/pad-iso97971" { + var padIso97971: CryptoJS.Padding; + export = padIso97971; +} + +declare module "crypto-js/pad-zeropadding" { + var padZeroPadding: CryptoJS.Padding; + export = padZeroPadding; +} + +declare module "crypto-js/pad-nopadding" { + var padNoPadding: CryptoJS.Padding; + export = padNoPadding; +} From 7ba0fa586127729532dbe3aad56f6547385745fd Mon Sep 17 00:00:00 2001 From: darlin Date: Mon, 23 Jan 2017 20:35:35 +0800 Subject: [PATCH 19/87] add typescript module export to suport import * as SimpleMDE from 'simplemde' --- simplemde/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/simplemde/index.d.ts b/simplemde/index.d.ts index 6c199f48a7..eb463ae655 100644 --- a/simplemde/index.d.ts +++ b/simplemde/index.d.ts @@ -127,4 +127,8 @@ declare class SimpleMDE { static toggleFullScreen: (editor: SimpleMDE) => void; static undo: (editor: SimpleMDE) => void; static redo: (editor: SimpleMDE) => void; -} \ No newline at end of file +} + +declare module "simplemde" { + export = SimpleMDE; +} From fc6a9729df46769b7a50cffe4414dc913ba6da28 Mon Sep 17 00:00:00 2001 From: Kir Dergachev Date: Mon, 23 Jan 2017 16:14:33 +0300 Subject: [PATCH 20/87] Fixes errors references. Removes references to webrtc --- sip.js/index.d.ts | 68 ++++++++++++++++++++---------------------- sip.js/sip.js-tests.ts | 36 +++++++++++----------- sip.js/tslint.json | 3 +- 3 files changed, 51 insertions(+), 56 deletions(-) diff --git a/sip.js/index.d.ts b/sip.js/index.d.ts index 942a0d22b3..be01cd3682 100644 --- a/sip.js/index.d.ts +++ b/sip.js/index.d.ts @@ -3,21 +3,23 @@ // Definitions by: Kir Dergachev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +declare interface SIP { + UA: { + new (configuration?: sipjs.ConfigurationParameters): sipjs.UA; + }; + URI: { + new (scheme?: string, user?: string, host?: string, port?: number, parameters?: string[], headers?: string[]): sipjs.URI; + parse(uri: string): sipjs.URI; + }; + NameAddrHeader: { + new (uri: string | sipjs.URI, displayName: string, parameters: Array<{ key: string, value: string }>): sipjs.NameAddrHeader; + parse(name_addr_header: string): sipjs.NameAddrHeader; + }; +} -export = SIP; - -declare namespace SIP { - - class URI { - constructor( - scheme?: string, - user?: string, - host?: string, - port?: number, - parameters?: string[], - headers?: string[]); +declare namespace sipjs { + interface URI { scheme?: string; user?: string; host?: string; @@ -35,8 +37,6 @@ declare namespace SIP { clearHeaders(): void; clone(): URI; toString(): string; - - static parse(uri: string): URI; } namespace UA.EventArgs { @@ -45,8 +45,7 @@ declare namespace SIP { interface RegistrationFailedArgs extends UnregisteredArgs { } } - class UA { - constructor(configuration?: ConfigurationParameters); + interface UA { start(): void; stop(): void; register(options?: ExtraHeadersOptions): UA; @@ -59,7 +58,7 @@ declare namespace SIP { request(method: string, target: string | URI, options?: RequestOptions): ClientContext; on(name: 'connected', callback: (args: UA.EventArgs.ConnectedArgs) => void): void; - on(name: 'disconnected' | 'registered', callback: () => void): void; + on(name: 'disconnected' | 'registered' | string, callback: () => void): void; on(name: 'unregistered', callback: (args: UA.EventArgs.UnregisteredArgs) => void): void; on(name: 'registrationFailed', callback: (args: UA.EventArgs.RegistrationFailedArgs) => void): void; on(name: 'invite', callback: (session: Session) => void): void; @@ -81,7 +80,7 @@ declare namespace SIP { } } - class Session { + interface Session { startTime?: Date; endTime?: Date; ua?: UA; @@ -95,8 +94,8 @@ declare namespace SIP { dtmf(tone: string | number, options?: Session.DtmfOptions): Session; terminate(options?: Session.CommonOptions): Session; bye(options?: Session.CommonOptions): Session; - getLocalStreams(): MediaStream[]; - getRemoteStreams(): MediaStream[]; + getLocalStreams(): any[]; + getRemoteStreams(): any[]; refer(target: string | Session, options?: ExtraHeadersOptions): Session; mute(options?: ExtraHeadersOptions): void; unmute(options?: ExtraHeadersOptions): void; @@ -111,7 +110,7 @@ declare namespace SIP { on(name: 'accepted', callback: (data: { code: number, response: IncomingResponse }) => void): void; on(name: 'failed' | 'rejected', callback: (response: IncomingResponse, cause: string) => void): void; on(name: 'terminated', callback: (message: IncomingResponse, cause: string) => void): void; - on(name: 'cancel', callback: () => void): void; + on(name: 'cancel' | string, callback: () => void): void; on(name: 'replaced', callback: (newSession: Session) => void): void; on(name: 'dtmf', callback: (request: IncomingRequest, dtmf: Session.DTMF) => void): void; on(name: 'muted' | 'unmuted', callback: (data: Session.Muted) => void): void; @@ -136,7 +135,7 @@ declare namespace SIP { } interface AcceptOptions { - RTCConstraints?: RTCPeerConnection; + RTCConstraints?: any; media?: MediaOptions; } @@ -169,21 +168,21 @@ declare namespace SIP { interface Options { stunServers?: string | string[]; turnServers?: TurnServer | TurnServer[]; - RTCConstraints?: RTCPeerConnection; + RTCConstraints?: any; } type MediaHandlerFactory = (session: Session, options: Options) => MediaHandler; class MediaHandler { - getLocalStreams(): MediaStream[]; - getRemoteStreams(): MediaStream[]; + getLocalStreams(): any[]; + getRemoteStreams(): any[]; render(renderHint: RenderHint): void; on(name: 'userMediaRequest', callback: (constraints: MediaConstraints) => void): void; - on(name: 'addStream' | 'userMedia', callback: (stream: MediaStream) => void): void; + on(name: 'addStream' | 'userMedia', callback: (stream: any) => void): void; on(name: 'userMediaFailed', callback: (error: string) => void): void; - on(name: 'iceCandidate', callback: (candidate: RTCIceCandidate) => void): void; - on(name: 'iceGathering' | 'iceGatheringComplete' | 'iceConnection' | 'iceConnectionChecking' | 'iceConnectionConnected' | 'iceConnectionCompleted' | 'iceConnectionFailed' | 'iceConnectionDisconnected' | 'iceConnectionClosed', callback: () => void): void; + on(name: 'iceCandidate', callback: (candidate: any) => void): void; + on(name: 'iceGathering' | 'iceGatheringComplete' | 'iceConnection' | 'iceConnectionChecking' | 'iceConnectionConnected' | 'iceConnectionCompleted' | 'iceConnectionFailed' | 'iceConnectionDisconnected' | 'iceConnectionClosed' | string, callback: () => void): void; on(name: 'dataChannel' | 'getDescription' | 'setDescription', callback: (sdpWrapper: { type: string, sdp: string }) => void): void; } } @@ -247,7 +246,7 @@ declare namespace SIP { interface MediaOptions { constraints?: MediaConstraints; - stream?: MediaStream; + stream?: any; render?: RenderHint; } @@ -256,7 +255,7 @@ declare namespace SIP { anonymous?: boolean; rel100?: string; inviteWithoutSdp?: boolean; - RTCConstraints?: RTCPeerConnection; + RTCConstraints?: any; } interface RequestOptions extends ExtraHeadersOptions { @@ -290,6 +289,7 @@ declare namespace SIP { data: {}; on(name: 'progress' | 'accepted' | 'rejected' | 'failed', callback: (response: IncomingMessage, cause: string) => void): void; on(name: 'notify', callback: (request: IncomingRequest) => void): void; + on(name: string, callback: () => void): void; } interface ClientContext extends Context { @@ -320,9 +320,7 @@ declare namespace SIP { } /* Header */ - class NameAddrHeader { - constructor(uri: string | URI, displayName: string, parameters: Array<{ key: string, value: string }>); - + interface NameAddrHeader { uri: string | URI; displayName: string; @@ -330,7 +328,5 @@ declare namespace SIP { getParam(key: string): string; deleteParam(key: string): string; clearParams(): void; - - static parse(name_addr_header: string): NameAddrHeader; } } diff --git a/sip.js/sip.js-tests.ts b/sip.js/sip.js-tests.ts index f688fe67ae..524caf1827 100644 --- a/sip.js/sip.js-tests.ts +++ b/sip.js/sip.js-tests.ts @@ -1,11 +1,11 @@ -import SIP = require("./index"); +declare var sip: SIP; -let ua: SIP.UA = new SIP.UA(); +let ua: sipjs.UA = new sip.UA(); -const mediaHandler = (session: SIP.Session, options: SIP.WebRTC.Options) => new SIP.WebRTC.MediaHandler(); +const mediaHandler = (session: sipjs.Session, options: sipjs.WebRTC.Options) => new sipjs.WebRTC.MediaHandler(); const logConnector = (level: string, category: string, label: string, content: string) => null; -const uaWithConfig: SIP.UA = new SIP.UA({ +const uaWithConfig: sipjs.UA = new sip.UA({ uri: "wss://uri", wsServers: ["s1", "s2"], allowLegacyNotifications: true, @@ -38,7 +38,7 @@ const uaWithConfig: SIP.UA = new SIP.UA({ stunServers: ["", ""], turnServers: [ { - password: "", + password: "", username: "", urls: ["", ""] } @@ -61,15 +61,15 @@ ua.unregister({ extraHeaders: [""], all: true }); const isConnected: boolean = ua.isConnected(); const isRegistered: boolean = ua.isRegistered(); -const message: SIP.Message = ua.message("", "", { contentType: "" }); +const message: sipjs.Message = ua.message("", "", { contentType: "" }); -ua.subscribe("", "", { expires: 1, extraHeaders: [""]}); -const subscription: SIP.Subscription = ua.subscribe(new SIP.URI(), "", { expires: 1, extraHeaders: [""]}); +ua.subscribe("", "", { expires: 1, extraHeaders: [""] }); +const subscription: sipjs.Subscription = ua.subscribe(new sip.URI(), "", { expires: 1, extraHeaders: [""] }); let session = ua.invite("", new HTMLVideoElement()); -const inviteOptions: SIP.InviteOptions = { - media: { +const inviteOptions: sipjs.InviteOptions = { + media: { constraints: { audio: true, video: false }, stream: new MediaStream(), render: { remote: new Element(), local: new Element() }, @@ -77,17 +77,17 @@ const inviteOptions: SIP.InviteOptions = { anonymous: true, rel100: "", inviteWithoutSdp: true, - RTCConstraints: new RTCPeerConnection() + RTCConstraints: {} } session = ua.invite("", inviteOptions); -ua.on('connected', (args: SIP.UA.EventArgs.ConnectedArgs) => {}); -ua.on('disconnected', () => {}); -ua.on('registered', () => {}); -ua.on('unregistered', (args: SIP.UA.EventArgs.UnregisteredArgs) => {}); -ua.on('registrationFailed', (args: SIP.UA.EventArgs.RegistrationFailedArgs) => {}); -ua.on('invite', (session: SIP.Session) => { +ua.on('connected', (args: sipjs.UA.EventArgs.ConnectedArgs) => { }); +ua.on('disconnected', () => { }); +ua.on('registered', () => { }); +ua.on('unregistered', (args: sipjs.UA.EventArgs.UnregisteredArgs) => { }); +ua.on('registrationFailed', (args: sipjs.UA.EventArgs.RegistrationFailedArgs) => { }); +ua.on('invite', (session: sipjs.Session) => { session.on('progress', (response) => { }); session.on('accepted', (response) => { @@ -96,4 +96,4 @@ ua.on('invite', (session: SIP.Session) => { }); }); -ua.on('message', (message: SIP.Message) => {}); +ua.on('message', (message: sipjs.Message) => { }); diff --git a/sip.js/tslint.json b/sip.js/tslint.json index c78c443ad2..105f5736e6 100644 --- a/sip.js/tslint.json +++ b/sip.js/tslint.json @@ -1,7 +1,6 @@ { "extends": "../tslint.json", "rules": { - "no-empty-interface": false, - "export-just-namespace": false + "no-empty-interface": false } } From 2c380af908a2e6261078153598170b1fd84bd39f Mon Sep 17 00:00:00 2001 From: Sergei Dorogin Date: Tue, 24 Jan 2017 17:44:31 +0300 Subject: [PATCH 21/87] jquery.fileupload added `add` callback signature (was `any`) changed `fail` callback signature (JQueryFileInputOptions => JQueryFileUploadDone) added JQueryFileUploadXhr.errorThrown field --- jquery.fileupload/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jquery.fileupload/index.d.ts b/jquery.fileupload/index.d.ts index 54ebb89c5c..e113d2733c 100644 --- a/jquery.fileupload/index.d.ts +++ b/jquery.fileupload/index.d.ts @@ -198,7 +198,7 @@ interface JQueryFileInputOptions { * handlers using jQuery's Deferred callbacks: * data.submit().done(func).fail(func).always(func); */ - add?: any; + add?: (e: JQueryEventObject, data: JQueryFileInputOptions) => void; // The plugin options are used as settings object for the ajax calls. // The following are jQuery ajax settings required for the file uploads: @@ -228,7 +228,7 @@ interface JQueryFileInputOptions { // Other callbacks: submit?: Function; done?: (e: JQueryEventObject, data: JQueryFileUploadDone) => void; - fail?: (e: JQueryEventObject, data: JQueryFileInputOptions) => void; + fail?: (e: JQueryEventObject, data: JQueryFileUploadDone) => void; always?: (e: JQueryEventObject, data: JQueryFileInputOptions) => void; progressall?: (e: JQueryEventObject, data: JQueryFileUploadProgressAllObject) => void; start?: (e: JQueryEventObject) => void; @@ -284,6 +284,7 @@ interface JQueryFileUploadXhr { jqXHR: JQueryXHR; result: any; textStatus: string; + errorThrown: any; headers: {[key: string]: any}; } From 8698554563f4acdf0942ffe9f74b6cce394f9f10 Mon Sep 17 00:00:00 2001 From: darlin Date: Wed, 25 Jan 2017 10:13:32 +0800 Subject: [PATCH 22/87] use appropriate export --- simplemde/index.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/simplemde/index.d.ts b/simplemde/index.d.ts index eb463ae655..c78d4fb408 100644 --- a/simplemde/index.d.ts +++ b/simplemde/index.d.ts @@ -129,6 +129,5 @@ declare class SimpleMDE { static redo: (editor: SimpleMDE) => void; } -declare module "simplemde" { - export = SimpleMDE; -} +export = SimpleMDE; +export as namespace SimpleMDE; From a6e94fdb0a80fbeacea1786d60cc0a67deaf9d6b Mon Sep 17 00:00:00 2001 From: Shun Date: Tue, 24 Jan 2017 21:54:20 -0800 Subject: [PATCH 23/87] Add module --- forever-monitor/forever-monitor-tests.ts | 0 forever-monitor/index.d.ts | 104 +++++++++++++++++++++++ forever-monitor/tsconfig.json | 20 +++++ forever-monitor/tslint.json | 1 + 4 files changed, 125 insertions(+) create mode 100644 forever-monitor/forever-monitor-tests.ts create mode 100644 forever-monitor/index.d.ts create mode 100644 forever-monitor/tsconfig.json create mode 100644 forever-monitor/tslint.json diff --git a/forever-monitor/forever-monitor-tests.ts b/forever-monitor/forever-monitor-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/forever-monitor/index.d.ts b/forever-monitor/index.d.ts new file mode 100644 index 0000000000..b22905cae2 --- /dev/null +++ b/forever-monitor/index.d.ts @@ -0,0 +1,104 @@ +// Type definitions for forever-monitor 1.7 +// Project: https://github.com/nodejitsu/forever-monitor#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +interface spawnWith { + customFds: number[]; + setsid: boolean; + uid: number; + gid: number; +} + +interface parserArgs { + command: string; + args: string[]; +} + +interface Options { + silent?: boolean; + uid?: "autogen" | string; + pidFile?: string; + max?: number; + killTree?: boolean; + minUptime?: number; + spinSleepTime?: number; + command?: "node" | string; + args?: string[]; + sourceDir?: string; + watch?: boolean; + watchIgnoreDotFiles?: boolean; + watchIgnorePatters?: string[]; + watchDirectory?: string; + spawnWith?: spawnWith; + env?: { [envKey: string]: string; }; + cwd?: string; + logFile?: string; + outFile?: string; + errFile?: string; + parser?: (command: string, args: string[]) => { command: string, args: string[] }; +} + + +export declare class Monitor extends NodeJS.EventEmitter { + + /** + * @param script - Location of the target script to run. + * @param [options] - Configuration for this instance. + */ + constructor(script: string, options?: Options); + + /** + * @description Start the process that this instance is configured for + * @param [restart] - Value indicating whether this is a restart. + */ + public start(restart?: boolean): this; + + /** + * @description Tries to spawn the target Forever child process. + */ + public trySpawn(): boolean; + + /** + * @description Restarts the target script associated with this instance. + */ + public restart(): this; + + /** + * @description Stops the target script associated with this instance. Prevents it from auto-respawning + */ + public stop(): this; + + /** + * @description Kills the ChildProcess object associated with this instance + * @param [forceStop] - Value indicating whether short circuit forever auto-restart + */ + public kill(forceStop?: boolean): this; + + /** + * @description Sends a message to a forked ChildProcess object associated with this instance + */ + public send(msg?: any): this; + + /** + * respond with JSON for this instance + */ + public toString(): string; + + /** + * @param command - Command string to parse + * @param args - Additional default arguments + */ + public parseCommand(command: string, args?: string[]): (false | { command: string, args?: string[]}); +} + +interface forever { + Monitor: Monitor; + start: (script: string, options: Options) => Monitor; + kill: (pid: number, killTree?: boolean, signal?: string, callback?: () => any) => void; + checkProcess: (pid: number) => boolean; + version: string; +} + +export default forever; diff --git a/forever-monitor/tsconfig.json b/forever-monitor/tsconfig.json new file mode 100644 index 0000000000..8c6d4986b5 --- /dev/null +++ b/forever-monitor/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "forever-monitor-tests.ts" + ] +} diff --git a/forever-monitor/tslint.json b/forever-monitor/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/forever-monitor/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 1ca0a1b3f98ad5ce8713543791b97014d5250bd6 Mon Sep 17 00:00:00 2001 From: darlin Date: Wed, 25 Jan 2017 14:26:11 +0800 Subject: [PATCH 24/87] update submodule --- crypto-js/aes/index.d.ts | 3 + crypto-js/core/index.d.ts | 3 + crypto-js/enc-base64/index.d.ts | 4 + crypto-js/enc-hex/index.d.ts | 4 + crypto-js/enc-latin1/index.d.ts | 4 + crypto-js/enc-utf16/index.d.ts | 4 + crypto-js/enc-utf8/index.d.ts | 4 + crypto-js/evpkdf/index.d.ts | 3 + crypto-js/format-hex/index.d.ts | 4 + crypto-js/format-openssl/index.d.ts | 4 + crypto-js/hmac-md5/index.d.ts | 3 + crypto-js/hmac-ripemd160/index.d.ts | 3 + crypto-js/hmac-sha1/index.d.ts | 3 + crypto-js/hmac-sha224/index.d.ts | 3 + crypto-js/hmac-sha256/index.d.ts | 3 + crypto-js/hmac-sha3/index.d.ts | 3 + crypto-js/hmac-sha384/index.d.ts | 3 + crypto-js/hmac-sha512/index.d.ts | 3 + crypto-js/index.d.ts | 237 +------------------------- crypto-js/lib-typedarrays/index.d.ts | 2 + crypto-js/md5/index.d.ts | 3 + crypto-js/mode-cfb/index.d.ts | 4 + crypto-js/mode-ctr-gladman/index.d.ts | 4 + crypto-js/mode-ctr/index.d.ts | 4 + crypto-js/mode-ecb/index.d.ts | 4 + crypto-js/mode-ofb/index.d.ts | 4 + crypto-js/pad-ansix923/index.d.ts | 4 + crypto-js/pad-iso10126/index.d.ts | 4 + crypto-js/pad-iso97971/index.d.ts | 4 + crypto-js/pad-nopadding/index.d.ts | 4 + crypto-js/pad-pkcs7/index.d.ts | 4 + crypto-js/pad-zeropadding/index.d.ts | 4 + crypto-js/pbkdf2/index.d.ts | 3 + crypto-js/rabbit-legacy/index.d.ts | 3 + crypto-js/rabbit/index.d.ts | 3 + crypto-js/rc4/index.d.ts | 3 + crypto-js/ripemd160/index.d.ts | 3 + crypto-js/sha1/index.d.ts | 3 + crypto-js/sha224/index.d.ts | 3 + crypto-js/sha256/index.d.ts | 3 + crypto-js/sha3/index.d.ts | 3 + crypto-js/sha384/index.d.ts | 3 + crypto-js/sha512/index.d.ts | 3 + crypto-js/tripledes/index.d.ts | 3 + crypto-js/x64-core/index.d.ts | 3 + 45 files changed, 152 insertions(+), 234 deletions(-) create mode 100644 crypto-js/aes/index.d.ts create mode 100644 crypto-js/core/index.d.ts create mode 100644 crypto-js/enc-base64/index.d.ts create mode 100644 crypto-js/enc-hex/index.d.ts create mode 100644 crypto-js/enc-latin1/index.d.ts create mode 100644 crypto-js/enc-utf16/index.d.ts create mode 100644 crypto-js/enc-utf8/index.d.ts create mode 100644 crypto-js/evpkdf/index.d.ts create mode 100644 crypto-js/format-hex/index.d.ts create mode 100644 crypto-js/format-openssl/index.d.ts create mode 100644 crypto-js/hmac-md5/index.d.ts create mode 100644 crypto-js/hmac-ripemd160/index.d.ts create mode 100644 crypto-js/hmac-sha1/index.d.ts create mode 100644 crypto-js/hmac-sha224/index.d.ts create mode 100644 crypto-js/hmac-sha256/index.d.ts create mode 100644 crypto-js/hmac-sha3/index.d.ts create mode 100644 crypto-js/hmac-sha384/index.d.ts create mode 100644 crypto-js/hmac-sha512/index.d.ts create mode 100644 crypto-js/lib-typedarrays/index.d.ts create mode 100644 crypto-js/md5/index.d.ts create mode 100644 crypto-js/mode-cfb/index.d.ts create mode 100644 crypto-js/mode-ctr-gladman/index.d.ts create mode 100644 crypto-js/mode-ctr/index.d.ts create mode 100644 crypto-js/mode-ecb/index.d.ts create mode 100644 crypto-js/mode-ofb/index.d.ts create mode 100644 crypto-js/pad-ansix923/index.d.ts create mode 100644 crypto-js/pad-iso10126/index.d.ts create mode 100644 crypto-js/pad-iso97971/index.d.ts create mode 100644 crypto-js/pad-nopadding/index.d.ts create mode 100644 crypto-js/pad-pkcs7/index.d.ts create mode 100644 crypto-js/pad-zeropadding/index.d.ts create mode 100644 crypto-js/pbkdf2/index.d.ts create mode 100644 crypto-js/rabbit-legacy/index.d.ts create mode 100644 crypto-js/rabbit/index.d.ts create mode 100644 crypto-js/rc4/index.d.ts create mode 100644 crypto-js/ripemd160/index.d.ts create mode 100644 crypto-js/sha1/index.d.ts create mode 100644 crypto-js/sha224/index.d.ts create mode 100644 crypto-js/sha256/index.d.ts create mode 100644 crypto-js/sha3/index.d.ts create mode 100644 crypto-js/sha384/index.d.ts create mode 100644 crypto-js/sha512/index.d.ts create mode 100644 crypto-js/tripledes/index.d.ts create mode 100644 crypto-js/x64-core/index.d.ts diff --git a/crypto-js/aes/index.d.ts b/crypto-js/aes/index.d.ts new file mode 100644 index 0000000000..4f435688c5 --- /dev/null +++ b/crypto-js/aes/index.d.ts @@ -0,0 +1,3 @@ +import { AES } from '../index'; + +export = AES; diff --git a/crypto-js/core/index.d.ts b/crypto-js/core/index.d.ts new file mode 100644 index 0000000000..c5d6e00410 --- /dev/null +++ b/crypto-js/core/index.d.ts @@ -0,0 +1,3 @@ +import * as Core from '../index'; + +export = Core; diff --git a/crypto-js/enc-base64/index.d.ts b/crypto-js/enc-base64/index.d.ts new file mode 100644 index 0000000000..55001a7115 --- /dev/null +++ b/crypto-js/enc-base64/index.d.ts @@ -0,0 +1,4 @@ +import { enc } from '../index'; + +declare const Base64: typeof enc.Base64; +export = Base64; diff --git a/crypto-js/enc-hex/index.d.ts b/crypto-js/enc-hex/index.d.ts new file mode 100644 index 0000000000..3718860123 --- /dev/null +++ b/crypto-js/enc-hex/index.d.ts @@ -0,0 +1,4 @@ +import { enc } from '../index'; + +declare const Hex: typeof enc.Hex; +export = Hex; diff --git a/crypto-js/enc-latin1/index.d.ts b/crypto-js/enc-latin1/index.d.ts new file mode 100644 index 0000000000..7f27822daf --- /dev/null +++ b/crypto-js/enc-latin1/index.d.ts @@ -0,0 +1,4 @@ +import { enc } from '../index'; + +declare const Latin1: typeof enc.Latin1; +export = Latin1; diff --git a/crypto-js/enc-utf16/index.d.ts b/crypto-js/enc-utf16/index.d.ts new file mode 100644 index 0000000000..76fa98774a --- /dev/null +++ b/crypto-js/enc-utf16/index.d.ts @@ -0,0 +1,4 @@ +import { enc } from '../index'; + +declare const Utf16: typeof enc.Utf16; +export = Utf16; diff --git a/crypto-js/enc-utf8/index.d.ts b/crypto-js/enc-utf8/index.d.ts new file mode 100644 index 0000000000..828dcb9391 --- /dev/null +++ b/crypto-js/enc-utf8/index.d.ts @@ -0,0 +1,4 @@ +import { enc } from '../index'; + +declare const Utf8: typeof enc.Utf8; +export = Utf8; diff --git a/crypto-js/evpkdf/index.d.ts b/crypto-js/evpkdf/index.d.ts new file mode 100644 index 0000000000..8946b9d3a1 --- /dev/null +++ b/crypto-js/evpkdf/index.d.ts @@ -0,0 +1,3 @@ +import { EvpKDF } from '../index'; + +export = EvpKDF; diff --git a/crypto-js/format-hex/index.d.ts b/crypto-js/format-hex/index.d.ts new file mode 100644 index 0000000000..1b0f573824 --- /dev/null +++ b/crypto-js/format-hex/index.d.ts @@ -0,0 +1,4 @@ +import { format } from '../index'; + +declare const Hex: typeof format.Hex; +export = Hex; diff --git a/crypto-js/format-openssl/index.d.ts b/crypto-js/format-openssl/index.d.ts new file mode 100644 index 0000000000..02c35a3688 --- /dev/null +++ b/crypto-js/format-openssl/index.d.ts @@ -0,0 +1,4 @@ +import { format } from '../index'; + +declare const OpenSSL: typeof format.OpenSSL; +export = OpenSSL; diff --git a/crypto-js/hmac-md5/index.d.ts b/crypto-js/hmac-md5/index.d.ts new file mode 100644 index 0000000000..7240576710 --- /dev/null +++ b/crypto-js/hmac-md5/index.d.ts @@ -0,0 +1,3 @@ +import { HmacMD5 } from '../index'; + +export = HmacMD5; diff --git a/crypto-js/hmac-ripemd160/index.d.ts b/crypto-js/hmac-ripemd160/index.d.ts new file mode 100644 index 0000000000..6c371e9435 --- /dev/null +++ b/crypto-js/hmac-ripemd160/index.d.ts @@ -0,0 +1,3 @@ +import { HmacRIPEMD160 } from '../index'; + +export = HmacRIPEMD160; diff --git a/crypto-js/hmac-sha1/index.d.ts b/crypto-js/hmac-sha1/index.d.ts new file mode 100644 index 0000000000..1995cf87f6 --- /dev/null +++ b/crypto-js/hmac-sha1/index.d.ts @@ -0,0 +1,3 @@ +import { HmacSHA1 } from '../index'; + +export = HmacSHA1; diff --git a/crypto-js/hmac-sha224/index.d.ts b/crypto-js/hmac-sha224/index.d.ts new file mode 100644 index 0000000000..f25334c64c --- /dev/null +++ b/crypto-js/hmac-sha224/index.d.ts @@ -0,0 +1,3 @@ +import { HmacSHA224 } from '../index'; + +export = HmacSHA224; diff --git a/crypto-js/hmac-sha256/index.d.ts b/crypto-js/hmac-sha256/index.d.ts new file mode 100644 index 0000000000..ca1a1ca267 --- /dev/null +++ b/crypto-js/hmac-sha256/index.d.ts @@ -0,0 +1,3 @@ +import { HmacSHA256 } from '../index'; + +export = HmacSHA256; diff --git a/crypto-js/hmac-sha3/index.d.ts b/crypto-js/hmac-sha3/index.d.ts new file mode 100644 index 0000000000..0fa0db9321 --- /dev/null +++ b/crypto-js/hmac-sha3/index.d.ts @@ -0,0 +1,3 @@ +import { HmacSHA3 } from '../index'; + +export = HmacSHA3; diff --git a/crypto-js/hmac-sha384/index.d.ts b/crypto-js/hmac-sha384/index.d.ts new file mode 100644 index 0000000000..2e17420c1b --- /dev/null +++ b/crypto-js/hmac-sha384/index.d.ts @@ -0,0 +1,3 @@ +import { HmacSHA384 } from '../index'; + +export = HmacSHA384; diff --git a/crypto-js/hmac-sha512/index.d.ts b/crypto-js/hmac-sha512/index.d.ts new file mode 100644 index 0000000000..439b2ffd5e --- /dev/null +++ b/crypto-js/hmac-sha512/index.d.ts @@ -0,0 +1,3 @@ +import { HmacSHA512 } from '../index'; + +export = HmacSHA512; diff --git a/crypto-js/index.d.ts b/crypto-js/index.d.ts index a2c0ee381d..a8068161e1 100644 --- a/crypto-js/index.d.ts +++ b/crypto-js/index.d.ts @@ -3,6 +3,9 @@ // Definitions by: Michael Zabka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export = CryptoJS; +export as namespace CryptoJS; + declare var CryptoJS: CryptoJS.Hashes; declare namespace CryptoJS { type Hash = (message: string, key?: string, ...options: any[]) => string; @@ -112,237 +115,3 @@ declare namespace CryptoJS { } } - -declare module "crypto-js" { - var CryptoJS: CryptoJS.Hashes; - export = CryptoJS; -} - -/* --------------------------------- */ -declare module "crypto-js/core" { - var core: any; - export = core; -} - -declare module "crypto-js/x64-core" { - var x64: any; - export = x64; -} - -declare module "crypto-js/lib-typedarrays" { - var libWordArray: any; - export = libWordArray; -} - -/* --------------------------------- */ -declare module "crypto-js/md5" { - var MD5: CryptoJS.Hash; - export = MD5; -} - -declare module "crypto-js/sha1" { - var SHA1: CryptoJS.Hash; - export = SHA1; -} - -declare module "crypto-js/sha256" { - var SHA256: CryptoJS.Hash; - export = SHA256; -} - -declare module "crypto-js/sha224" { - var SHA224: CryptoJS.Hash; - export = SHA224; -} - -declare module "crypto-js/sha512" { - var SHA512: CryptoJS.Hash; - export = SHA512; -} - -declare module "crypto-js/sha384" { - var SHA384: CryptoJS.Hash; - export = SHA384; -} - -declare module "crypto-js/sha3" { - var SHA3: CryptoJS.Hash; - export = SHA3; -} - -declare module "crypto-js/ripemd160" { - var RIPEMD160: CryptoJS.Hash; - export = RIPEMD160; -} - -/* --------------------------------- */ -declare module "crypto-js/hmac-md5" { - var HmacMD5: CryptoJS.Hash; - export = HmacMD5; -} - -declare module "crypto-js/hmac-sha1" { - var HmacSHA1: CryptoJS.Hash; - export = HmacSHA1; -} - -declare module "crypto-js/hmac-sha256" { - var HmacSHA256: CryptoJS.Hash; - export = HmacSHA256; -} - -declare module "crypto-js/hmac-sha224" { - var HmacSHA224: CryptoJS.Hash; - export = HmacSHA224; -} - -declare module "crypto-js/hmac-sha512" { - var HmacSHA512: CryptoJS.Hash; - export = HmacSHA512; -} - -declare module "crypto-js/hmac-sha384" { - var HmacSHA384: CryptoJS.Hash; - export = HmacSHA384; -} - -declare module "crypto-js/hmac-sha3" { - var HmacSHA3: CryptoJS.Hash; - export = HmacSHA3; -} - -declare module "crypto-js/hmac-ripemd160" { - var HmacRIPEMD160: CryptoJS.Hash; - export = HmacRIPEMD160; -} - -/* --------------------------------- */ -declare module "crypto-js/pbkdf2" { - var PBKDF2: CryptoJS.Hash; - export = PBKDF2; -} - -/* --------------------------------- */ -declare module "crypto-js/aes" { - var AES: CryptoJS.Cipher; - export = AES; -} - -declare module "crypto-js/tripledes" { - var TripleDES: CryptoJS.Cipher; - export = TripleDES; -} - -declare module "crypto-js/rc4" { - var RC4: CryptoJS.Cipher; - export = RC4; -} - -declare module "crypto-js/rabbit" { - var Rabbit: CryptoJS.Cipher; - export = Rabbit; -} - -declare module "crypto-js/rabbit-legacy" { - var RabbitLegacy: CryptoJS.Cipher; - export = RabbitLegacy; -} - -declare module "crypto-js/evpkdf" { - var EvpKDF: CryptoJS.Cipher; - export = EvpKDF; -} - -/* --------------------------------- */ -declare module "crypto-js/format-openssl" { - var FormatOpenssl: any; - export = FormatOpenssl; -} - -declare module "crypto-js/format-hex" { - var FormatHex: any; - export = FormatHex; -} - -/* --------------------------------- */ -declare module "crypto-js/enc-latin1" { - var encLatin1: CryptoJS.Encoder; - export = encLatin1; -} - -declare module "crypto-js/enc-utf8" { - var encUtf8: CryptoJS.Encoder; - export = encUtf8; -} - -declare module "crypto-js/enc-hex" { - var encHex: CryptoJS.Encoder; - export = encHex; -} - -declare module "crypto-js/enc-utf16" { - var encUtf16: CryptoJS.Encoder; - export = encUtf16; -} - -declare module "crypto-js/enc-base64" { - var encBase64: CryptoJS.Encoder; - export = encBase64; -} - -/* --------------------------------- */ -declare module "crypto-js/mode-cfb" { - var modeCFB: CryptoJS.Mode; - export = modeCFB; -} - -declare module "crypto-js/mode-ctr" { - var modeCTR: CryptoJS.Mode; - export = modeCTR; -} - -declare module "crypto-js/mode-ctr-gladman" { - var modeCTRGladman: CryptoJS.Mode; - export = modeCTRGladman; -} - -declare module "crypto-js/mode-ofb" { - var modeOFB: CryptoJS.Mode; - export = modeOFB; -} - -declare module "crypto-js/mode-ecb" { - var modeECB: CryptoJS.Mode; - export = modeECB; -} - -/* --------------------------------- */ -declare module "crypto-js/pad-pkcs7" { - var padPkcs7: CryptoJS.Padding; - export = padPkcs7; -} - -declare module "crypto-js/pad-ansix923" { - var padAnsiX923: CryptoJS.Padding; - export = padAnsiX923; -} - -declare module "crypto-js/pad-iso10126" { - var padIso10126: CryptoJS.Padding; - export = padIso10126; -} - -declare module "crypto-js/pad-iso97971" { - var padIso97971: CryptoJS.Padding; - export = padIso97971; -} - -declare module "crypto-js/pad-zeropadding" { - var padZeroPadding: CryptoJS.Padding; - export = padZeroPadding; -} - -declare module "crypto-js/pad-nopadding" { - var padNoPadding: CryptoJS.Padding; - export = padNoPadding; -} diff --git a/crypto-js/lib-typedarrays/index.d.ts b/crypto-js/lib-typedarrays/index.d.ts new file mode 100644 index 0000000000..91c5a7933b --- /dev/null +++ b/crypto-js/lib-typedarrays/index.d.ts @@ -0,0 +1,2 @@ +declare const libWordArray: any; +export = libWordArray; diff --git a/crypto-js/md5/index.d.ts b/crypto-js/md5/index.d.ts new file mode 100644 index 0000000000..faa064511e --- /dev/null +++ b/crypto-js/md5/index.d.ts @@ -0,0 +1,3 @@ +import { MD5 } from '../index'; + +export = MD5; diff --git a/crypto-js/mode-cfb/index.d.ts b/crypto-js/mode-cfb/index.d.ts new file mode 100644 index 0000000000..74c5c6e3d1 --- /dev/null +++ b/crypto-js/mode-cfb/index.d.ts @@ -0,0 +1,4 @@ +import { mode } from '../index'; + +declare const CFB: typeof mode.CFB; +export = CFB; diff --git a/crypto-js/mode-ctr-gladman/index.d.ts b/crypto-js/mode-ctr-gladman/index.d.ts new file mode 100644 index 0000000000..3ca8f8b367 --- /dev/null +++ b/crypto-js/mode-ctr-gladman/index.d.ts @@ -0,0 +1,4 @@ +import { mode } from '../index'; + +declare const CTRGladman: typeof mode.CTRGladman; +export = CTRGladman; diff --git a/crypto-js/mode-ctr/index.d.ts b/crypto-js/mode-ctr/index.d.ts new file mode 100644 index 0000000000..6007a4ca88 --- /dev/null +++ b/crypto-js/mode-ctr/index.d.ts @@ -0,0 +1,4 @@ +import { mode } from '../index'; + +declare const CTR: typeof mode.CTR; +export = CTR; diff --git a/crypto-js/mode-ecb/index.d.ts b/crypto-js/mode-ecb/index.d.ts new file mode 100644 index 0000000000..569d2b2286 --- /dev/null +++ b/crypto-js/mode-ecb/index.d.ts @@ -0,0 +1,4 @@ +import { mode } from '../index'; + +declare const ECB: typeof mode.ECB; +export = ECB; diff --git a/crypto-js/mode-ofb/index.d.ts b/crypto-js/mode-ofb/index.d.ts new file mode 100644 index 0000000000..484406979d --- /dev/null +++ b/crypto-js/mode-ofb/index.d.ts @@ -0,0 +1,4 @@ +import { mode } from '../index'; + +declare const OFB: typeof mode.OFB; +export = OFB; diff --git a/crypto-js/pad-ansix923/index.d.ts b/crypto-js/pad-ansix923/index.d.ts new file mode 100644 index 0000000000..2bb6c2dffb --- /dev/null +++ b/crypto-js/pad-ansix923/index.d.ts @@ -0,0 +1,4 @@ +import { pad } from '../index'; + +declare const AnsiX923: typeof pad.AnsiX923; +export = AnsiX923; diff --git a/crypto-js/pad-iso10126/index.d.ts b/crypto-js/pad-iso10126/index.d.ts new file mode 100644 index 0000000000..6e52e96197 --- /dev/null +++ b/crypto-js/pad-iso10126/index.d.ts @@ -0,0 +1,4 @@ +import { pad } from '../index'; + +declare const Iso10126: typeof pad.Iso10126; +export = Iso10126; diff --git a/crypto-js/pad-iso97971/index.d.ts b/crypto-js/pad-iso97971/index.d.ts new file mode 100644 index 0000000000..0ab1cecbfb --- /dev/null +++ b/crypto-js/pad-iso97971/index.d.ts @@ -0,0 +1,4 @@ +import { pad } from '../index'; + +declare const Iso97971: typeof pad.Iso97971; +export = Iso97971; diff --git a/crypto-js/pad-nopadding/index.d.ts b/crypto-js/pad-nopadding/index.d.ts new file mode 100644 index 0000000000..f71bb2de73 --- /dev/null +++ b/crypto-js/pad-nopadding/index.d.ts @@ -0,0 +1,4 @@ +import { pad } from '../index'; + +declare const NoPadding: typeof pad.NoPadding; +export = NoPadding; diff --git a/crypto-js/pad-pkcs7/index.d.ts b/crypto-js/pad-pkcs7/index.d.ts new file mode 100644 index 0000000000..1b194673a2 --- /dev/null +++ b/crypto-js/pad-pkcs7/index.d.ts @@ -0,0 +1,4 @@ +import { pad } from '../index'; + +declare const Pkcs7: typeof pad.Pkcs7; +export = Pkcs7; diff --git a/crypto-js/pad-zeropadding/index.d.ts b/crypto-js/pad-zeropadding/index.d.ts new file mode 100644 index 0000000000..cf481402ab --- /dev/null +++ b/crypto-js/pad-zeropadding/index.d.ts @@ -0,0 +1,4 @@ +import { pad } from '../index'; + +declare const ZeroPadding: typeof pad.ZeroPadding; +export = ZeroPadding; diff --git a/crypto-js/pbkdf2/index.d.ts b/crypto-js/pbkdf2/index.d.ts new file mode 100644 index 0000000000..e242e6fe05 --- /dev/null +++ b/crypto-js/pbkdf2/index.d.ts @@ -0,0 +1,3 @@ +import { PBKDF2 } from '../index'; + +export = PBKDF2; diff --git a/crypto-js/rabbit-legacy/index.d.ts b/crypto-js/rabbit-legacy/index.d.ts new file mode 100644 index 0000000000..6befe37563 --- /dev/null +++ b/crypto-js/rabbit-legacy/index.d.ts @@ -0,0 +1,3 @@ +import { RabbitLegacy } from '../index'; + +export = RabbitLegacy; diff --git a/crypto-js/rabbit/index.d.ts b/crypto-js/rabbit/index.d.ts new file mode 100644 index 0000000000..f708a6f20b --- /dev/null +++ b/crypto-js/rabbit/index.d.ts @@ -0,0 +1,3 @@ +import { Rabbit } from '../index'; + +export = Rabbit; diff --git a/crypto-js/rc4/index.d.ts b/crypto-js/rc4/index.d.ts new file mode 100644 index 0000000000..38a929f490 --- /dev/null +++ b/crypto-js/rc4/index.d.ts @@ -0,0 +1,3 @@ +import { RC4 } from '../index'; + +export = RC4; diff --git a/crypto-js/ripemd160/index.d.ts b/crypto-js/ripemd160/index.d.ts new file mode 100644 index 0000000000..90e3e770ce --- /dev/null +++ b/crypto-js/ripemd160/index.d.ts @@ -0,0 +1,3 @@ +import { RIPEMD160 } from '../index'; + +export = RIPEMD160; diff --git a/crypto-js/sha1/index.d.ts b/crypto-js/sha1/index.d.ts new file mode 100644 index 0000000000..14fb4d2a6b --- /dev/null +++ b/crypto-js/sha1/index.d.ts @@ -0,0 +1,3 @@ +import { SHA1 } from '../index'; + +export = SHA1; diff --git a/crypto-js/sha224/index.d.ts b/crypto-js/sha224/index.d.ts new file mode 100644 index 0000000000..3ff1ff4596 --- /dev/null +++ b/crypto-js/sha224/index.d.ts @@ -0,0 +1,3 @@ +import { SHA224 } from '../index'; + +export = SHA224; diff --git a/crypto-js/sha256/index.d.ts b/crypto-js/sha256/index.d.ts new file mode 100644 index 0000000000..59781b01f3 --- /dev/null +++ b/crypto-js/sha256/index.d.ts @@ -0,0 +1,3 @@ +import { SHA256 } from '../index'; + +export = SHA256; diff --git a/crypto-js/sha3/index.d.ts b/crypto-js/sha3/index.d.ts new file mode 100644 index 0000000000..241574a711 --- /dev/null +++ b/crypto-js/sha3/index.d.ts @@ -0,0 +1,3 @@ +import { SHA3 } from '../index'; + +export = SHA3; diff --git a/crypto-js/sha384/index.d.ts b/crypto-js/sha384/index.d.ts new file mode 100644 index 0000000000..5bad55498a --- /dev/null +++ b/crypto-js/sha384/index.d.ts @@ -0,0 +1,3 @@ +import { SHA384 } from '../index'; + +export = SHA384; diff --git a/crypto-js/sha512/index.d.ts b/crypto-js/sha512/index.d.ts new file mode 100644 index 0000000000..0f764329e2 --- /dev/null +++ b/crypto-js/sha512/index.d.ts @@ -0,0 +1,3 @@ +import { SHA512 } from '../index'; + +export = SHA512; diff --git a/crypto-js/tripledes/index.d.ts b/crypto-js/tripledes/index.d.ts new file mode 100644 index 0000000000..ea22173d98 --- /dev/null +++ b/crypto-js/tripledes/index.d.ts @@ -0,0 +1,3 @@ +import { TripleDES } from '../index'; + +export = TripleDES; diff --git a/crypto-js/x64-core/index.d.ts b/crypto-js/x64-core/index.d.ts new file mode 100644 index 0000000000..1ef7a67477 --- /dev/null +++ b/crypto-js/x64-core/index.d.ts @@ -0,0 +1,3 @@ +import * as X64Core from '../index'; + +export = X64Core; From 9be29e7b530932ecc1b0165713a1e49936de78a1 Mon Sep 17 00:00:00 2001 From: darlin Date: Wed, 25 Jan 2017 15:10:10 +0800 Subject: [PATCH 25/87] add files in tsconfig --- crypto-js/lib-typedarrays/index.d.ts | 4 +-- crypto-js/tsconfig.json | 48 ++++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/crypto-js/lib-typedarrays/index.d.ts b/crypto-js/lib-typedarrays/index.d.ts index 91c5a7933b..761e38b1cd 100644 --- a/crypto-js/lib-typedarrays/index.d.ts +++ b/crypto-js/lib-typedarrays/index.d.ts @@ -1,2 +1,2 @@ -declare const libWordArray: any; -export = libWordArray; +declare const LibTypedarrays: any; +export = LibTypedarrays; diff --git a/crypto-js/tsconfig.json b/crypto-js/tsconfig.json index 94793c83ae..7fc335c24a 100644 --- a/crypto-js/tsconfig.json +++ b/crypto-js/tsconfig.json @@ -18,6 +18,50 @@ }, "files": [ "index.d.ts", - "crypto-js-tests.ts" + "crypto-js-tests.ts", + "core/index.d.ts", + "x64-core/index.d.ts", + "lib-typedarrays/index.d.ts", + "md5/index.d.ts", + "sha1/index.d.ts", + "sha256/index.d.ts", + "sha224/index.d.ts", + "sha512/index.d.ts", + "sha384/index.d.ts", + "sha3/index.d.ts", + "ripemd160/index.d.ts", + "hmac-md5/index.d.ts", + "hmac-sha1/index.d.ts", + "hmac-sha256/index.d.ts", + "hmac-sha224/index.d.ts", + "hmac-sha512/index.d.ts", + "hmac-sha384/index.d.ts", + "hmac-sha3/index.d.ts", + "hmac-ripemd160/index.d.ts", + "pbkdf2/index.d.ts", + "aes/index.d.ts", + "tripledes/index.d.ts", + "rc4/index.d.ts", + "rabbit/index.d.ts", + "rabbit-legacy/index.d.ts", + "evpkdf/index.d.ts", + "format-openssl/index.d.ts", + "format-hex/index.d.ts", + "enc-latin1/index.d.ts", + "enc-utf8/index.d.ts", + "enc-hex/index.d.ts", + "enc-utf16/index.d.ts", + "enc-base64/index.d.ts", + "mode-cfb/index.d.ts", + "mode-ctr/index.d.ts", + "mode-ctr-gladman/index.d.ts", + "mode-ofb/index.d.ts", + "mode-ecb/index.d.ts", + "pad-pkcs7/index.d.ts", + "pad-ansix923/index.d.ts", + "pad-iso10126/index.d.ts", + "pad-iso97971/index.d.ts", + "pad-zeropadding/index.d.ts", + "pad-nopadding/index.d.ts" ] -} \ No newline at end of file +} From d2febcc480606fab9d8564fd6e2d77f576ae39d7 Mon Sep 17 00:00:00 2001 From: darlin Date: Wed, 25 Jan 2017 16:03:50 +0800 Subject: [PATCH 26/87] add submodule tests --- crypto-js/index.d.ts | 1 - crypto-js/test/submodule-tests.ts | 184 ++++++++++++++++++++++++++++++ crypto-js/tsconfig.json | 1 + 3 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 crypto-js/test/submodule-tests.ts diff --git a/crypto-js/index.d.ts b/crypto-js/index.d.ts index a8068161e1..07a8d18dfc 100644 --- a/crypto-js/index.d.ts +++ b/crypto-js/index.d.ts @@ -113,5 +113,4 @@ declare namespace CryptoJS { NoPadding: Padding; }; } - } diff --git a/crypto-js/test/submodule-tests.ts b/crypto-js/test/submodule-tests.ts new file mode 100644 index 0000000000..0cfd8cd83f --- /dev/null +++ b/crypto-js/test/submodule-tests.ts @@ -0,0 +1,184 @@ +import Core = require('../core'); +import X64Core = require('../x64-core'); +import LibTypedarrays = require('../lib-typedarrays'); +// --- +import MD5 = require('../md5'); +import SHA1 = require('../sha1'); +import SHA256 = require('../sha256'); +import SHA224 = require('../sha224'); +import SHA512 = require('../sha512'); +import SHA384 = require('../sha384'); +import SHA3 = require('../sha3'); +import RIPEMD160 = require('../ripemd160'); +// --- +import HmacMD5 = require('../hmac-md5'); +import HmacSHA1 = require('../hmac-sha1'); +import HmacSHA256 = require('../hmac-sha256'); +import HmacSHA224 = require('../hmac-sha224'); +import HmacSHA512 = require('../hmac-sha512'); +import HmacSHA384 = require('../hmac-sha384'); +import HmacSHA3 = require('../hmac-sha3'); +import HmacRIPEMD160 = require('../hmac-ripemd160'); +// --- +import PBKDF2 = require('../pbkdf2'); +// --- +import AES = require('../aes'); +import TripleDES = require('../tripledes'); +import RC4 = require('../rc4'); +import Rabbit = require('../rabbit'); +import RabbitLegacy = require('../rabbit-legacy'); +import EvpKDF = require('../evpkdf'); +// --- +import FormatOpenSSL = require('../format-openssl'); +import FormatHex = require('../format-hex'); +// --- +import EncLatin1 = require('../enc-latin1'); +import EncUtf8 = require('../enc-utf8'); +import EncHex = require('../enc-hex'); +import EncUtf16 = require('../enc-utf16'); +import EncBase64 = require('../enc-base64'); +// --- +import ModeCFB = require('../mode-cfb'); +import ModeCTR = require('../mode-ctr'); +import ModeCTRGladman = require('../mode-ctr-gladman'); +import ModeOFB = require('../mode-ofb'); +import ModeECB = require('../mode-ecb'); +// --- +import PadPkcs7 = require('../pad-pkcs7'); +import PadAnsiX923 = require('../pad-ansix923'); +import PadIso10126 = require('../pad-iso10126'); +import PadIso97971 = require('../pad-iso97971'); +import PadZeroPadding = require('../pad-zeropadding'); +import PadNoPadding = require('../pad-nopadding'); + +// Hashers +var str: string; +str = MD5('some message'); +str = MD5('some message', 'some key'); + +str = SHA1('some message'); +str = SHA1('some message', 'some key', { any: true }); + +str = FormatOpenSSL('some message'); +str = FormatOpenSSL('some message', 'some key'); + + +// Ciphers +var encrypted: CryptoJS.WordArray; +var decrypted: CryptoJS.DecryptedMessage; + +encrypted = AES.encrypt("Message", "Secret Passphrase"); +decrypted = AES.decrypt(encrypted, "Secret Passphrase"); + +encrypted = Core.DES.encrypt("Message", "Secret Passphrase"); +decrypted = Core.DES.decrypt(encrypted, "Secret Passphrase"); + +encrypted = TripleDES.encrypt("Message", "Secret Passphrase"); +decrypted = TripleDES.decrypt(encrypted, "Secret Passphrase"); + + +encrypted = Rabbit.encrypt("Message", "Secret Passphrase"); +decrypted = Rabbit.decrypt(encrypted, "Secret Passphrase"); + +encrypted = RC4.encrypt("Message", "Secret Passphrase"); +decrypted = RC4.decrypt(encrypted, "Secret Passphrase"); + +encrypted = Core.RC4Drop.encrypt("Message", "Secret Passphrase"); +encrypted = Core.RC4Drop.encrypt("Message", "Secret Passphrase", { drop: 3072 / 4 }); +decrypted = Core.RC4Drop.decrypt(encrypted, "Secret Passphrase", { drop: 3072 / 4 }); + +var key = EncHex.parse('000102030405060708090a0b0c0d0e0f'); +var iv = EncHex.parse('101112131415161718191a1b1c1d1e1f'); +encrypted = AES.encrypt("Message", key, { iv: iv }); + +encrypted = AES.encrypt("Message", "Secret Passphrase", { + mode: ModeCFB, + padding: PadAnsiX923 +}); + + +// The Cipher Output +encrypted = AES.encrypt("Message", "Secret Passphrase"); +alert(encrypted.key); +// 74eb593087a982e2a6f5dded54ecd96d1fd0f3d44a58728cdcd40c55227522223 +alert(encrypted.iv); +// 7781157e2629b094f0e3dd48c4d786115 +alert(encrypted.salt); +// 7a25f9132ec6a8b34 +alert(encrypted.ciphertext); +// 73e54154a15d1beeb509d9e12f1e462a0 +alert(encrypted); +// U2FsdGVkX1+iX5Ey7GqLND5UFUoV0b7rUJ2eEvHkYqA= + +var JsonFormatter = { + stringify: function(cipherParams: any) { + // create json object with ciphertext + var jsonObj: any = { + ct: cipherParams.ciphertext.toString(EncBase64) + }; + // optionally add iv and salt + if (cipherParams.iv) { + jsonObj.iv = cipherParams.iv.toString(); + } + if (cipherParams.salt) { + jsonObj.s = cipherParams.salt.toString(); + } + // stringify json object + return JSON.stringify(jsonObj); + }, + parse: function (jsonStr: any) { + // parse json string + var jsonObj = JSON.parse(jsonStr); + // extract ciphertext from json object, and create cipher params object + var cipherParams = (Core).lib.CipherParams.create({ + ciphertext: EncBase64.parse(jsonObj.ct) + }); + // optionally extract iv and salt + if (jsonObj.iv) { + cipherParams.iv = EncHex.parse(jsonObj.iv); + } + if (jsonObj.s) { + cipherParams.salt = EncHex.parse(jsonObj.s); + } return cipherParams; + } +}; +encrypted = AES.encrypt("Message", "Secret Passphrase", { + format: JsonFormatter +}); +alert(encrypted); +// {"ct":"tZ4MsEnfbcDOwqau68aOrQ==","iv":"8a8c8fd8fe33743d3638737ea4a00698","s":"ba06373c8f57179c"} +decrypted = AES.decrypt(encrypted, "Secret Passphrase", { + format: JsonFormatter +}); +alert(decrypted.toString(EncUtf8)); // Message + + +// Progressive Ciphering +var key = EncHex.parse('000102030405060708090a0b0c0d0e0f'); +var iv = EncHex.parse('101112131415161718191a1b1c1d1e1f'); +var aesEncryptor = Core.algo.AES.createEncryptor(key, { iv: iv }); +var ciphertextPart1 = aesEncryptor.process("Message Part 1"); +var ciphertextPart2 = aesEncryptor.process("Message Part 2"); +var ciphertextPart3 = aesEncryptor.process("Message Part 3"); +var ciphertextPart4 = aesEncryptor.finalize(); +var aesDecryptor = Core.algo.AES.createDecryptor(key, { iv: iv }); +var plaintextPart1 = aesDecryptor.process(ciphertextPart1); +var plaintextPart2 = aesDecryptor.process(ciphertextPart2); +var plaintextPart3 = aesDecryptor.process(ciphertextPart3); +var plaintextPart4 = aesDecryptor.process(ciphertextPart4); +var plaintextPart5 = aesDecryptor.finalize(); + + +// Encoders +var words = EncBase64.parse('SGVsbG8sIFdvcmxkIQ=='); +var base64 = EncBase64.stringify(words); +var words = EncLatin1.parse('Hello, World!'); +var latin1 = EncLatin1.stringify(words); +var words = EncHex.parse('48656c6c6f2c20576f726c6421'); +var hex = EncHex.stringify(words); +var words = EncUtf8.parse('𤭢'); +var utf8 = EncUtf8.stringify(words); +var words = EncUtf16.parse('Hello, World!'); +var utf16 = EncUtf16.stringify(words); +var words = Core.enc.Utf16LE.parse('Hello, World!'); +var utf16 = Core.enc.Utf16LE.stringify(words); diff --git a/crypto-js/tsconfig.json b/crypto-js/tsconfig.json index 7fc335c24a..10865613d3 100644 --- a/crypto-js/tsconfig.json +++ b/crypto-js/tsconfig.json @@ -19,6 +19,7 @@ "files": [ "index.d.ts", "crypto-js-tests.ts", + "test/submodule-tests.ts", "core/index.d.ts", "x64-core/index.d.ts", "lib-typedarrays/index.d.ts", From b2af2d23e5c0ff1f2e74390f6d93752a6631d594 Mon Sep 17 00:00:00 2001 From: Pablo Moleri Date: Wed, 25 Jan 2017 10:29:43 -0300 Subject: [PATCH 27/87] Move getLocation "Axis" overloads before string ones --- webdriverio/index.d.ts | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/webdriverio/index.d.ts b/webdriverio/index.d.ts index f033ec2bfc..b79b17e98d 100644 --- a/webdriverio/index.d.ts +++ b/webdriverio/index.d.ts @@ -352,37 +352,22 @@ declare namespace WebdriverIO { ): Client

; getHTML

(includeSelectorTag: boolean): Client

; - getLocation(selector?: string): Location; - getLocation(selector: string, axis: Axis): number; getLocation(axis: Axis): number; - getLocation

(selector?: string): Client

; - getLocation

( - selector: string, - axis: Axis - ): Client

; getLocation

(axis: Axis): Client

; + getLocation(selector?: string): Location; + getLocation

(selector?: string): Client

; + getLocation(selector: string, axis: Axis): number; + getLocation

(selector: string, axis: Axis): Client

; - getLocationInView(selector: string): Location; - getLocationInView(selector: string): Location[]; - getLocationInView(): Location; - getLocationInView(): Location[]; - getLocationInView( - selector: string, - axis: Axis - ): number; - getLocationInView( - selector: string, - axis: Axis - ): number[]; getLocationInView(axis: Axis): number; getLocationInView(axis: Axis): number[]; - getLocationInView

(selector?: string): Client

; - getLocationInView

( - selector: string, - axis: Axis - ): Client

; getLocationInView

(axis: Axis): Client

; - + getLocationInView(selector?: string): Location; + getLocationInView(selector?: string): Location[]; + getLocationInView

(selector?: string): Client

; + getLocationInView(selector: string, axis: Axis): number; + getLocationInView(selector: string, axis: Axis): number[]; + getLocationInView

(selector: string, axis: Axis): Client

; getSource(): Client; getSource

(): Client

; From 9294d370402f80b83a397cca709897623ca1f1f1 Mon Sep 17 00:00:00 2001 From: "LAWO\\heinigu1" Date: Wed, 25 Jan 2017 15:58:19 +0100 Subject: [PATCH 28/87] Add tv4 --- chai-json-schema/chai-json-schema-tests.ts | 20 +++++++++++++++++--- chai-json-schema/index.d.ts | 5 +++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/chai-json-schema/chai-json-schema-tests.ts b/chai-json-schema/chai-json-schema-tests.ts index 8559d3caae..d0c1234e17 100644 --- a/chai-json-schema/chai-json-schema-tests.ts +++ b/chai-json-schema/chai-json-schema-tests.ts @@ -9,19 +9,19 @@ import ChaiJsonSchema = require('chai-json-schema'); chai.use(ChaiJsonSchema); chai.should(); -let goodApple = { +const goodApple = { skin: 'thin', colors: ['red', 'green', 'yellow'], taste: 10 }; -let badApple = { +const badApple = { colors: ['brown'], taste: 0, worms: 2 }; -let fruitSchema = { +const fruitSchema = { title: 'fresh fruit schema v1', type: 'object', required: ['skin', 'colors', 'taste'], @@ -54,3 +54,17 @@ badApple.should.not.be.jsonSchema(fruitSchema); //tdd style assert.jsonSchema(goodApple, fruitSchema); assert.notJsonSchema(badApple, fruitSchema); + +// tv4 +const schema = { + items: { + type: 'boolean' + } +}; + +const data1 = [true, false]; +const data2 = [true, 123]; + +expect(chai.tv4.validate(data1, schema)).to.be.true; +expect(chai.tv4.validate(data2, schema)).to.be.false; + diff --git a/chai-json-schema/index.d.ts b/chai-json-schema/index.d.ts index e66e2c96af..1498510f9f 100644 --- a/chai-json-schema/index.d.ts +++ b/chai-json-schema/index.d.ts @@ -5,6 +5,7 @@ // // +import tv4 = require('tv4'); declare global { namespace Chai { @@ -16,6 +17,10 @@ declare global { export interface LanguageChains { jsonSchema(schema: any, msg?: string): void; } + + export interface ChaiStatic { + tv4: tv4.TV4; + } } } From 201dab6133daa473861a04631e2e6bc1abe914a8 Mon Sep 17 00:00:00 2001 From: york yao Date: Wed, 25 Jan 2017 23:58:49 +0800 Subject: [PATCH 29/87] add types of node-zookeeper-client --- node-zookeeper-client/index.d.ts | 168 ++++++++++++ .../node-zookeeper-client-tests.ts | 253 ++++++++++++++++++ node-zookeeper-client/tsconfig.json | 22 ++ node-zookeeper-client/tslint.json | 1 + 4 files changed, 444 insertions(+) create mode 100644 node-zookeeper-client/index.d.ts create mode 100644 node-zookeeper-client/node-zookeeper-client-tests.ts create mode 100644 node-zookeeper-client/tsconfig.json create mode 100644 node-zookeeper-client/tslint.json diff --git a/node-zookeeper-client/index.d.ts b/node-zookeeper-client/index.d.ts new file mode 100644 index 0000000000..f405aeffc7 --- /dev/null +++ b/node-zookeeper-client/index.d.ts @@ -0,0 +1,168 @@ +// Type definitions for Jasmine 2.5 +// Project: https://github.com/alexguan/node-zookeeper-client +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as EventEmitter from "events"; + +export class Id { + scheme: string; + id: string; + constructor(scheme: string, id: string); +} + +export class ACL { + perms: number; + id: Id; + constructor(perms: number, id: Id); +} + +export const Permission: { + READ: number, + WRITE: number, + CREATE: number, + DELETE: number, + ADMIN: number, + ALL: number, +}; + +export interface Stat { + czxid: number; + mzxid: number; + ctime: number; + mtime: number; + version: number; + cversion: number; + aversion: number; + ephemeralOwner: number; + dataLength: number; + numChildren: number; + pzxid: number; +} + +export class State { + static DISCONNECTED: State; + static SYNC_CONNECTED: State; + static AUTH_FAILED: State; + static CONNECTED_READ_ONLY: State; + static SASL_AUTHENTICATED: State; + static EXPIRED: State; + + name: string; + code: number; + constructor(name: string, code: number); + toString(): string; +} + +export class Event { + static NODE_CREATED: number; + static NODE_DELETED: number; + static NODE_DATA_CHANGED: number; + static NODE_CHILDREN_CHANGED: number; + type: string; + name: string; + path: string; + constructor(type: string, name: string, path: string); + toString(): string; + getType(): string; + getName(): string; + getPath(): string; +} + +export class Transaction { + create(path: string, dataOrAclsOrmode1?: Buffer | ACL[] | number, dataOrAclsOrmode2?: Buffer | ACL[] | number, dataOrAclsOrmode3?: Buffer | ACL[] | number): this; + setData(path: string, data: Buffer | null, version?: number): this; + check(path: string, version?: number): this; + remove(path: string, version?: number): this; + commit(callback: (error: Error | Exception, results: any) => void): void; +} + +export class Client extends EventEmitter { + connect(): void; + close(): void; + create(path: string, callback: (error: Error | Exception, path: string) => void): void; + create(path: string, dataOrAclsOrmode1: Buffer | ACL[] | number, callback: (error: Error | Exception, path: string) => void): void; + create(path: string, dataOrAclsOrmode1: Buffer | ACL[] | number, dataOrAclsOrmode2: Buffer | ACL[] | number, callback: (error: Error | Exception, path: string) => void): void; + create(path: string, dataOrAclsOrmode1: Buffer | ACL[] | number, dataOrAclsOrmode2: Buffer | ACL[] | number, dataOrAclsOrmode3: Buffer | ACL[] | number, callback: (error: Error | Exception, path: string) => void): void; + remove(path: string, callback: (error: Error | Exception) => void): void; + remove(path: string, version: number, callback: (error: Error | Exception) => void): void; + exists(path: string, callback: (error: Error | Exception, stat: Stat) => void): void; + exists(path: string, watcher: (event: Event) => void, callback: (error: Error | Exception, stat: Stat) => void): void; + getChildren(path: string, callback: (error: Error | Exception, children: string[], stat: Stat) => void): void; + getChildren(path: string, watcher: (event: Event) => void, callback: (error: Error | Exception, children: string[], stat: Stat) => void): void; + getData(path: string, callback: (error: Error | Exception, data: Buffer, stat: Stat) => void): void; + getData(path: string, watcher: (event: Event) => void, callback: (error: Error | Exception, data: Buffer, stat: Stat) => void): void; + setData(path: string, data: Buffer | null, callback: (error: Error | Exception, stat: Stat) => void): void; + setData(path: string, data: Buffer | null, version: number, callback: (error: Error | Exception, stat: Stat) => void): void; + getACL(path: string, callback: (error: Error | Exception, acls: ACL[], stat: Stat) => void): void; + setACL(path: string, acls: ACL[], callback: (error: Error | Exception, stat: Stat) => void): void; + setACL(path: string, acls: ACL[], version: number, callback: (error: Error | Exception, stat: Stat) => void): void; + transaction(): Transaction; + mkdirp(path: string, callback: (error: Error | Exception, path: string) => void): void; + mkdirp(path: string, dataOrAclsOrmode1: Buffer | ACL[] | number, callback: (error: Error | Exception, path: string) => void): void; + mkdirp(path: string, dataOrAclsOrmode1: Buffer | ACL[] | number, dataOrAclsOrmode2: Buffer | ACL[] | number, callback: (error: Error | Exception, path: string) => void): void; + mkdirp(path: string, dataOrAclsOrmode1: Buffer | ACL[] | number, dataOrAclsOrmode2: Buffer | ACL[] | number, dataOrAclsOrmode3: Buffer | ACL[] | number, callback: (error: Error | Exception, path: string) => void): void; + addAuthInfo(scheme: string, auth: Buffer): void; + getState(): State; + getSessionId(): Buffer; + getSessionPassword(): Buffer; + getSessionTimeout(): number; + + on(event: "state", cb: (state: State) => void): this; + on(event: "connected" | "connectedReadOnly" | "disconnected" | "expired" | "authenticationFailed" | string, cb: () => void): this; + + once(event: "state", cb: (state: State) => void): this; + once(event: "connected" | "connectedReadOnly" | "disconnected" | "expired" | "authenticationFailed" | string, cb: () => void): this; + + addListener(event: "state", cb: (state: State) => void): this; + addListener(event: "connected" | "connectedReadOnly" | "disconnected" | "expired" | "authenticationFailed" | string, cb: () => void): this; +} + +export interface Option { + sessionTimeout: number; + spinDelay: number; + retries: number; +} + +export function createClient(connectionString: string, options?: Partial

' + + ' ' + + '
'; + + var displayUser = require.requireActual('../displayUser'); + var $ = require('jquery'); + var fetchCurrentUser = require('../fetchCurrentUser'); + + // Tell the fetchCurrentUser mock function to automatically invoke + // its callback with some data + fetchCurrentUser.mockImplementation(function(cb: Function) { + cb({ + loggedIn: true, + fullName: 'Johnny Cash' + }); + }); + + // Use jquery to emulate a click on our button + $('#button').click(); + + // Assert that the fetchCurrentUser function was called, and that the + // #username span's innter text was updated as we'd it expect. + expect(fetchCurrentUser).toBeCalled(); + expect($('#username').text()).toEqual('Johnny Cash - Logged In'); + }); +}); + +jest.unmock('../CheckboxWithLabel.js'); +describe('CheckboxWithLabel', function() { + it('changes the text after click', function() { + var React = require('react/addons'); + var CheckboxWithLabel = require('../CheckboxWithLabel.js'); + var TestUtils = React.addons.TestUtils; + + // Render a checkbox with label in the document + var checkbox = TestUtils.renderIntoDocument( + CheckboxWithLabel({ + labelOn: "On", + labelOff: "Off" + }) + ); + + // Verify that it's Off by default + var label = TestUtils.findRenderedDOMComponentWithTag( + checkbox, 'label'); + expect(label.getDOMNode().textContent).toEqual('Off'); + + // Simulate a click and verify that it is now On + var input = TestUtils.findRenderedDOMComponentWithTag( + checkbox, 'input'); + TestUtils.Simulate.change(input); + expect(label.getDOMNode().textContent).toEqual('On'); + }); +}); + +jest.runAllTicks(); +xdescribe('Hooks and Suits', function () { + let tested: boolean; + + beforeEach(function () { + tested = false; + }); + + afterEach(function () { + tested = true; + }); + + test('tested', function () { + expect(tested).toBeTruthy(); + expect(tested).not.toBeFalsy(); + }); + + fit('tested', function () { + expect(tested).toBeDefined(); + expect(tested).not.toBeUndefined(); + }); + + xit('expect null to be null', function () { + expect(null).toBeNull(); + }); +}); + +describe('compartion', function () { + var sum: (a: number, b: number) => number = require.requireMock('../sum'); + + it('compares is 7 + 2 greater than 3', function () { + expect(sum(7, 2)).toBeGreaterThan(3); + }); + + it('compares is 2 + 7 greater than or equal to 3', function () { + expect(sum(2, 7)).toBeGreaterThanOrEqual(3); + }); + + it('compares is 3 less than 3 + 4', function () { + expect(3).toBeLessThan(sum(3, 4)); + }); + + it('compares is 3 less than or equal to 4 + 3', function () { + expect(3).toBeLessThanOrEqual(sum(4, 3)); + }); + + it('works sanely with simple decimals', function () { + expect(0.2 + 0.1).toBeCloseTo(0.3, 5); + }); +}); + +describe('toThrow API', function () { + function throwTypeError(): void { + throw new TypeError('toThrow Definition was out of date'); + } + + it('throws', function () { + expect(throwTypeError()).toThrow(); + }); + + it('throws TypeError', function () { + expect(throwTypeError()).toThrowError(TypeError); + }); + + it('throws \'Definition was out of date\'', function () { + expect(throwTypeError()).toThrowError(/Definition was out of date/); + }); + + it('throws \'toThorow Definition was out of date\'', function () { + expect(throwTypeError()).toThrowError('toThrow Definition was out of date'); + }); +}); + +describe('missing tests', function () { + it('creates closures', function () { + class Closure { + private arg: T; + + public constructor(private fn: (arg: T) => void) { + this.fn = fn; + } + + public bind(arg: T): void { + this.arg = arg; + } + + public call(): void { + this.fn(this.arg); + } + } + + type StringClosure = (arg: string) => void; + let spy: jest.Mock = jest.fn(); + let closure: Closure = new Closure(spy); + closure.bind('jest'); + closure.call(); + expect(spy).lastCalledWith('jest'); + expect(spy).toBeCalledWith('jest'); + expect(jest.isMockFunction(spy)).toBeTruthy(); + }); + + it('tests all mising Mocks functionality', function () { + type FruitsGetter = () => Array; + let mock: jest.Mock = jest.fn(); + mock.mockImplementationOnce(() => ['Orange', 'Apple', 'Plum']) + jest.setMock('./../tesks/getFruits', mock); + const getFruits: FruitsGetter = require('./../tesks/getFruits'); + expect(getFruits()).toContain('Orange'); + mock.mockReturnValueOnce(['Apple', 'Plum']); + expect(mock()).not.toContain('Orange'); + const myBeverage: any = {delicious: true, sour: false}; + expect(myBeverage).toContainEqual({delicious: true, sour: false}); + mock.mockReturnValue([]); //Deprecated: Use jest.fn(() => value) instead. + mock.mockClear(); + let thisMock: jest.Mock = jest.fn().mockReturnThis(); + expect(thisMock()).toBe(this); + }); + + it('creates snapshoter', function () { + jest.disableAutomock().mock('./render', () => jest.fn((): string => "{Link to: \"facebook\"}"), { virtual: true }); + const render: () => string = require('./render'); + expect(render()).toMatch(/Link/); + jest.enableAutomock(); + }); + + it('runs only pending timers', function () { + jest.useRealTimers(); + setTimeout(() => expect(1).not.toEqual(0), 3000); + jest.runOnlyPendingTimers().runTimersToTime(300); + }); + + it('runs all timers', function () { + jest.clearAllTimers(); + jest.useFakeTimers(); + setTimeout(() => expect(0).not.toEqual(1), 3000); + jest.runAllTimers(); + }); + + it('cleares cache', function () { + const sum1 = require('../sum'); + jest.resetModules(); + const sum2 = require('../sum'); + expect(sum1).not.toBe(sum2); + }) +}); + +describe('toMatchSnapshot', function () { + it('compares snapshots', function () { + expect({ type: 'a', props: { href: 'https://www.facebook.com/' }, children: [ 'Facebook' ] }).toMatchSnapshot(); + }); +}); + +describe('toThrowErrorMatchingSnapshot', function () { + it('compares snapshots', function () { + expect(() => { throw new Error('descriptiton') }).toThrowErrorMatchingSnapshot(); + }); +}); + +function testInstances() { + var mockFn = jest.fn(); + var a = new mockFn(); + var b = new mockFn(); + + mockFn.mock.instances[0] === a; // true + mockFn.mock.instances[1] === b; // true +} + +function testMockImplementation() { + var mockFn = jest.fn().mockImplementation(function (scalar:number):number { + return 42 + scalar; + }); + + var a = mockFn(0); + var b = mockFn(1); + + a === 42; // true + b === 43; // true + + mockFn.mock.calls[0][0] === 0; // true + mockFn.mock.calls[1][0] === 1; // true +} + +// Test from jest Docs: +describe('genMockFromModule', function () { + // Interfaces: + interface MockFiles { + [index: string]: string; + } + + interface MockedFS { + readdirSync: (dir: string) => string[]; + __setMockFiles: (newMockFiles: MockFiles) => void ; + } + + // ------------------------------------------------------------------------------------ + // FileSummarizer.ts + + const fs = require('fs'); + + function summarizeFilesInDirectorySync(directory: string): string[] { + return fs.readdirSync(directory).map((fileName: string) => ({ + fileName, + directory, + })); + } + + //export default summarizeFilesInDirectorySync; // For sake of compilation + + // ------------------------------------------------------------------------------------ + // __mocks__/fs.js + + const path = require('path'); + + const mockedFS: MockedFS = jest.genMockFromModule('fs'); + + let mockFiles: any = Object.create(null); + function __setMockFiles(newMockFiles: MockFiles): void { + mockFiles = Object.create(null); + for(const file in newMockFiles) { + const dir: string = path.dirname(file); + + if (!mockFiles[dir]) { + mockFiles[dir] = []; + } + mockFiles[dir].push(path.basename(file)); + } + } + + function readdirSync(directoryPath: string): string[] { + return mockFiles[directoryPath] || []; + } + + mockedFS.readdirSync = readdirSync; + mockedFS.__setMockFiles = __setMockFiles; + + //export = mockedFS; // For sake of compilation + // ------------------------------------------------------------------------------------ + // __tests__/FileSummarizer-test.js + + jest.mock('fs'); + + describe('listFilesInDirectorySync', () => { + const MOCK_FILE_INFO: MockFiles = { + '/path/to/file1.js': 'console.log("file1 contents");', + '/path/to/file2.txt': 'file2 contents', + }; + + beforeEach(() => { + // Set up some mocked out file info before each test + (require('fs') as MockedFS).__setMockFiles(MOCK_FILE_INFO); + }); + + it('includes all files in the directory in the summary', () => { + const FileSummarizer: (dir: string) => string[] = require('../FileSummarizer'); + const fileSummary = FileSummarizer('/path/to'); + + expect(fileSummary.length).toBe(2); + }); + }); +}); + +/** + * Pass strictNullChecks + */ +describe('strictNullChecks', function () { + it('does not complain when using done callback', (done) => { + done(); + }) +}); diff --git a/jest/v16/tsconfig.json b/jest/v16/tsconfig.json new file mode 100644 index 0000000000..1bf1d9e78b --- /dev/null +++ b/jest/v16/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": false, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jest-tests.ts" + ] +} From bb0a14e75e57420932e421d4cb0c3a151fc934e6 Mon Sep 17 00:00:00 2001 From: Alexey Svetliakov Date: Thu, 26 Jan 2017 18:17:44 +0100 Subject: [PATCH 45/87] Removed redunant intersection --- jest/index.d.ts | 10 ++++++---- jest/jest-tests.ts | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/jest/index.d.ts b/jest/index.d.ts index acfe70a0f6..6e204db890 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -32,7 +32,9 @@ declare namespace jest { function autoMockOff(): typeof jest; /** Enables automatic mocking in the module loader. */ function autoMockOn(): typeof jest; - /** @deprecated */ + /** + * @deprecated use resetAllMocks instead + */ function clearAllMocks(): typeof jest; /** Clears the mock.calls and mock.instances properties of all mocks. Equivalent to calling .mockClear() on every mocked function. */ function resetAllMocks(): typeof jest; @@ -124,7 +126,7 @@ declare namespace jest { ensureExpectedIsNumber(actual: any, matcherName?: string): void; ensureNoExpected(actual: any, matcherName?: string): void; ensureNumbers(actual: any, expected: any, matcherName?: string): void; - /** get the type of a value with handling the edge cases like `typeof []` and `typeof null` */ + /** get the type of a value with handling of edge cases like `typeof []` and `typeof null` */ getType(value: any): string; matcherHint(matcherName: string, received?: string, expected?: string, options?: { secondArgument?: string, isDirectExpectCall?: boolean }): string; pluralize(word: string, count: number): string; @@ -142,7 +144,7 @@ declare namespace jest { interface Expect { (actual: any): Matchers; anything(): void; - any(cs: any): void; + any(classType: any): void; arrayContaining(arr: any[]): void; assertions(num: number): void; extend(obj: ExpectExtendMap): void; @@ -202,7 +204,7 @@ declare namespace jest { * const myApi: jest.Mocked = new Api() as any; * myApi.myApiMethod.mockImplementation(() => "test"); */ - type Mocked = T & { + type Mocked = { [P in keyof T]: T[P] & MockInstance; }; diff --git a/jest/jest-tests.ts b/jest/jest-tests.ts index d2fcd6d007..0cc6089ca8 100644 --- a/jest/jest-tests.ts +++ b/jest/jest-tests.ts @@ -434,12 +434,16 @@ class TestApi { declare function mockedFunc(a: number): string; +declare function mockedFuncWithApi(api: TestApi): void; + describe('Mocked type', function () { it('Works', function () { const mock: jest.Mocked = new TestApi() as any; mock.testProp; mock.testMethod.mockImplementation(() => 'test'); mock.testMethod(5).toUpperCase(); + + mockedFuncWithApi(mock); }); }); From 1ed54727eb8e2fc93b6719930e5c62b32b938040 Mon Sep 17 00:00:00 2001 From: Alexey Svetliakov Date: Thu, 26 Jan 2017 18:45:28 +0100 Subject: [PATCH 46/87] Fix tsconfig for jest v16 --- jest/v16/tsconfig.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jest/v16/tsconfig.json b/jest/v16/tsconfig.json index 1bf1d9e78b..9d7a7f6921 100644 --- a/jest/v16/tsconfig.json +++ b/jest/v16/tsconfig.json @@ -8,10 +8,14 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": true, - "baseUrl": "../", + "baseUrl": "../../", "typeRoots": [ - "../" + "../../" ], + "paths": { + "jest": ["jest/v16"], + "jest/*": ["jest/v16"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true From 2ad8a85892d92943d6262bc59ec667fc16bd5d8d Mon Sep 17 00:00:00 2001 From: Alexey Svetliakov Date: Thu, 26 Jan 2017 18:46:02 +0100 Subject: [PATCH 47/87] Wildcard in path --- jest/v16/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest/v16/tsconfig.json b/jest/v16/tsconfig.json index 9d7a7f6921..2e023e1205 100644 --- a/jest/v16/tsconfig.json +++ b/jest/v16/tsconfig.json @@ -14,7 +14,7 @@ ], "paths": { "jest": ["jest/v16"], - "jest/*": ["jest/v16"] + "jest/*": ["jest/v16/*"] }, "types": [], "noEmit": true, From 576836745347dc13351fdb0233c956b273e1aec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Elgaard=20Larsen?= Date: Thu, 26 Jan 2017 19:01:52 +0100 Subject: [PATCH 48/87] html-to-text: wordwrap option can be false/null According to documentation, the "wordwrap" option can be either a number, false, or null. --- html-to-text/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html-to-text/index.d.ts b/html-to-text/index.d.ts index ce02e4bfe5..406908a6ce 100644 --- a/html-to-text/index.d.ts +++ b/html-to-text/index.d.ts @@ -39,7 +39,7 @@ interface HtmlToTextOptions { * Defines after how many chars a line break should follow in p elements. * Set to null or false to disable word-wrapping. Default: 80 */ - wordwrap?: number; + wordwrap?: number | false | null; /** * Allows to select certain tables by the class or id attribute from the HTML From 66d3bd4a3cf9a31165485ea590d94aa0971facac Mon Sep 17 00:00:00 2001 From: Jacob Baskin Date: Thu, 26 Jan 2017 14:32:36 -0500 Subject: [PATCH 49/87] Add typings for moment-round --- moment-round/index.d.ts | 14 ++++++++++++++ moment-round/moment-round-tests.ts | 8 ++++++++ moment-round/tsconfig.json | 20 ++++++++++++++++++++ moment-round/tslint.json | 1 + 4 files changed, 43 insertions(+) create mode 100644 moment-round/index.d.ts create mode 100644 moment-round/moment-round-tests.ts create mode 100644 moment-round/tsconfig.json create mode 100644 moment-round/tslint.json diff --git a/moment-round/index.d.ts b/moment-round/index.d.ts new file mode 100644 index 0000000000..e68181ac34 --- /dev/null +++ b/moment-round/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for moment-round 1.0 +// Project: https://github.com/WebDevTmas/moment-round +// Definitions by: Jacob Baskin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as moment from 'moment'; + +declare module 'moment' { + interface Moment { + round(precision: number, key: string, direction: 'round' | 'ceil' | 'floor'): Moment; + ceil(precision: number, key: string): Moment; + floor(precision: number, key: string): Moment; + } +} diff --git a/moment-round/moment-round-tests.ts b/moment-round/moment-round-tests.ts new file mode 100644 index 0000000000..6925966365 --- /dev/null +++ b/moment-round/moment-round-tests.ts @@ -0,0 +1,8 @@ +import * as moment from 'moment'; + +var m = new moment(); // 2015-06-18 15:30:19 +moment.round(5, 'seconds'); // 2015-06-18 15:30:20 +moment.ceil(3, 'minutes'); // 2015-06-18 15:33:00 +moment.floor(16, 'hours'); // 2015-06-18 00:00:00 +moment.ceil(21, 'hours'); // 2015-06-18 21:00:00 +moment.ceil(20, 'hours'); // 2015-06-19 00:00:00 diff --git a/moment-round/tsconfig.json b/moment-round/tsconfig.json new file mode 100644 index 0000000000..7054df992f --- /dev/null +++ b/moment-round/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "moment-round-tests.ts" + ] +} diff --git a/moment-round/tslint.json b/moment-round/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/moment-round/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From f4a5b2bfb5d35876d87b9484762926f9e8c571a5 Mon Sep 17 00:00:00 2001 From: Jacob Baskin Date: Thu, 26 Jan 2017 14:36:39 -0500 Subject: [PATCH 50/87] Add 'export = moment' --- moment-round/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/moment-round/index.d.ts b/moment-round/index.d.ts index e68181ac34..8e6ac65cf5 100644 --- a/moment-round/index.d.ts +++ b/moment-round/index.d.ts @@ -5,6 +5,8 @@ import * as moment from 'moment'; +export = moment; + declare module 'moment' { interface Moment { round(precision: number, key: string, direction: 'round' | 'ceil' | 'floor'): Moment; From fab0c1b8dd929e38bc58f569149a34b153eec477 Mon Sep 17 00:00:00 2001 From: Jacob Baskin Date: Thu, 26 Jan 2017 14:43:58 -0500 Subject: [PATCH 51/87] Fix moment-round typings --- moment-round/index.d.ts | 2 +- moment-round/moment-round-tests.ts | 12 ++++++------ moment-round/package.json | 5 +++++ 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 moment-round/package.json diff --git a/moment-round/index.d.ts b/moment-round/index.d.ts index 8e6ac65cf5..441cec3f6f 100644 --- a/moment-round/index.d.ts +++ b/moment-round/index.d.ts @@ -9,7 +9,7 @@ export = moment; declare module 'moment' { interface Moment { - round(precision: number, key: string, direction: 'round' | 'ceil' | 'floor'): Moment; + round(precision: number, key: string, direction?: 'round' | 'ceil' | 'floor'): Moment; ceil(precision: number, key: string): Moment; floor(precision: number, key: string): Moment; } diff --git a/moment-round/moment-round-tests.ts b/moment-round/moment-round-tests.ts index 6925966365..063e3cbea4 100644 --- a/moment-round/moment-round-tests.ts +++ b/moment-round/moment-round-tests.ts @@ -1,8 +1,8 @@ import * as moment from 'moment'; -var m = new moment(); // 2015-06-18 15:30:19 -moment.round(5, 'seconds'); // 2015-06-18 15:30:20 -moment.ceil(3, 'minutes'); // 2015-06-18 15:33:00 -moment.floor(16, 'hours'); // 2015-06-18 00:00:00 -moment.ceil(21, 'hours'); // 2015-06-18 21:00:00 -moment.ceil(20, 'hours'); // 2015-06-19 00:00:00 +var m = moment(); +m.round(5, 'seconds'); +m.ceil(3, 'minutes'); +m.floor(16, 'hours'); +m.ceil(21, 'hours'); +m.ceil(20, 'hours'); diff --git a/moment-round/package.json b/moment-round/package.json new file mode 100644 index 0000000000..4c6d24a445 --- /dev/null +++ b/moment-round/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "moment": ">=2.14.0" + } +} \ No newline at end of file From c305081cf1e3d850559e146763f2cd34b4e0a080 Mon Sep 17 00:00:00 2001 From: Ben Herila Date: Thu, 26 Jan 2017 14:00:30 -0800 Subject: [PATCH 52/87] Update credit-card-type to support latest prefixPattern and exactPattern --- credit-card-type/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/credit-card-type/index.d.ts b/credit-card-type/index.d.ts index 59886b5e60..8625e5e5f8 100644 --- a/credit-card-type/index.d.ts +++ b/credit-card-type/index.d.ts @@ -10,7 +10,8 @@ declare namespace creditCardType { interface CreditCardTypeInfo { niceType?: string type?: CardBrand - pattern?: RegExp + prefixPattern?: RegExp + exactPattern?: RegExp gaps?: Array lengths?: Array code?: { From 81730dfd225b778bfd0f0a7e1524899a372ad37c Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Thu, 26 Jan 2017 16:36:27 -0800 Subject: [PATCH 53/87] Fix #11566 allows SFC to return null --- react/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/react/index.d.ts b/react/index.d.ts index 8bf7bb21af..6f88127305 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -201,7 +201,7 @@ declare namespace React { type SFC

= StatelessComponent

; interface StatelessComponent

{ - (props: P & { children?: ReactNode }, context?: any): ReactElement; + (props: P & { children?: ReactNode }, context?: any): ReactElement | null; propTypes?: ValidationMap

; contextTypes?: ValidationMap; defaultProps?: P; @@ -2620,7 +2620,9 @@ declare namespace React { declare global { namespace JSX { - interface Element extends React.ReactElement { } + interface JSXElement extends React.ReactElement { } + type Element = JSXElement | null; + interface ElementClass extends React.Component { render(): JSX.Element | null; } From 2a505f885e5dbe105a847e52733692aab7934e90 Mon Sep 17 00:00:00 2001 From: Stephen Lautier Date: Fri, 27 Jan 2017 02:31:43 +0100 Subject: [PATCH 54/87] Added definitions for node-waves --- node-waves/index.d.ts | 67 ++++++++++++++++++++++++++++++++++ node-waves/node-waves-tests.ts | 10 +++++ node-waves/tsconfig.json | 20 ++++++++++ node-waves/tslint.json | 1 + 4 files changed, 98 insertions(+) create mode 100644 node-waves/index.d.ts create mode 100644 node-waves/node-waves-tests.ts create mode 100644 node-waves/tsconfig.json create mode 100644 node-waves/tslint.json diff --git a/node-waves/index.d.ts b/node-waves/index.d.ts new file mode 100644 index 0000000000..2dc1f8f129 --- /dev/null +++ b/node-waves/index.d.ts @@ -0,0 +1,67 @@ +// Type definitions for node-waves 0.7 +// Project: http://fian.my.id/Waves +// Definitions by: Stephen Lautier +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type ElementTarget = string | Element | Element[]; + +export interface WavesConfig { + /** + * Determines how long the waves effect duration (in milliseconds). + * + */ + duration?: number; + + /** + * Delay amount to show waves effect on touch and hide the effect if user scrolls. + * Set to 0 to disable delay (in milliseconds). + * + */ + delay?: number; +} + +export interface RippleOptions { + + /** + * Specify how long to wait between starting and stopping the ripple. + * + */ + wait?: number | null; + + /** + * Specify the position inside the element. + * + */ + position?: { + x: number; + y: number; + } | null +} + +/** + * Initializes waves with an optional config. + */ +export function init(config?: WavesConfig): void; + +/** + * Attach ripple effect by adding `.waves-effect` to HTML element. + * Make sure you call `init` to activate the ripple. + * + * @param {ElementTarget} elements elements to target. + * @param {(string | string[])} [classes] classes to add. + */ +export function attach(elements: ElementTarget, classes?: string | string[]): void; + +/** + * Creates a ripple effect in HTML element programmatically. + * @param {ElementTarget} elements elements to target (must have `.waves-effect` already applied, ideally via `attach`). + * @param {RippleOptions} [options] specify how long to wait between starting and stopping the ripple, and it's position inside the element. + */ +export function ripple(elements: ElementTarget, options?: RippleOptions): void; + +/** + * Removes all ripples from inside an element immediately. + * + * @param {ElementTarget} elements elements to remove ripples from. + */ +export function calm(elements: ElementTarget): void; diff --git a/node-waves/node-waves-tests.ts b/node-waves/node-waves-tests.ts new file mode 100644 index 0000000000..adfb59703a --- /dev/null +++ b/node-waves/node-waves-tests.ts @@ -0,0 +1,10 @@ + +import { init, ripple, attach, calm } from "node-waves"; + +init({ delay: 300 }); + +attach("button", "waves-light"); + +ripple(".box", { wait: null }); + +calm(".box"); diff --git a/node-waves/tsconfig.json b/node-waves/tsconfig.json new file mode 100644 index 0000000000..c069824144 --- /dev/null +++ b/node-waves/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "node-waves-tests.ts" + ] +} diff --git a/node-waves/tslint.json b/node-waves/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/node-waves/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From ac7c3dd3a1edabe9eceb98c4bc07a4562ac9b2fd Mon Sep 17 00:00:00 2001 From: Stephen Lautier Date: Fri, 27 Jan 2017 02:34:37 +0100 Subject: [PATCH 55/87] fix lint issue --- node-waves/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-waves/index.d.ts b/node-waves/index.d.ts index 2dc1f8f129..ce5c63da2e 100644 --- a/node-waves/index.d.ts +++ b/node-waves/index.d.ts @@ -35,7 +35,7 @@ export interface RippleOptions { position?: { x: number; y: number; - } | null + } | null; } /** From 42851a78ec22ffffc1c326178fb8880acf400472 Mon Sep 17 00:00:00 2001 From: Shun Date: Thu, 26 Jan 2017 20:13:31 -0800 Subject: [PATCH 56/87] Change typing structure to namespace basis --- forever-monitor/index.d.ts | 184 ++++++++++++++++++------------------- 1 file changed, 88 insertions(+), 96 deletions(-) diff --git a/forever-monitor/index.d.ts b/forever-monitor/index.d.ts index 58c32ec5e6..d59c446f1a 100644 --- a/forever-monitor/index.d.ts +++ b/forever-monitor/index.d.ts @@ -4,101 +4,93 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -interface spawnWith { - customFds: number[]; - setsid: boolean; - uid: number; - gid: number; +declare namespace forever { + export interface SpawnWith { + customFds: number[]; + setsid: boolean; + uid: number; + gid: number; + } + + export interface Options { + silent?: boolean; + uid?: string; + pidFile?: string; + max?: number; + killTree?: boolean; + minUptime?: number; + spinSleepTime?: number; + command?: string; + args?: string[]; + sourceDir?: string; + watch?: boolean; + watchIgnoreDotFiles?: boolean; + watchIgnorePatters?: string[]; + watchDirectory?: string; + spawnWith?: SpawnWith; + env?: { [envKey: string]: string; }; + cwd?: string; + logFile?: string; + outFile?: string; + errFile?: string; + parser?: (command: string, args: string[]) => { command: string, args: string[] }; + } + + export function start(script: string, options: Options): Monitor; + export function kill(pid: number, killTree?: boolean, signal?: string, callback?: () => any): void; + export function checkProcess(pid: number): boolean; + export const version: string; + export class Monitor extends NodeJS.EventEmitter { + + /** + * @param script - Location of the target script to run. + * @param [options] - Configuration for this instance. + */ + constructor(script: string, options?: Options); + + /** + * @description Start the process that this instance is configured for + * @param [restart] - Value indicating whether this is a restart. + */ + start(restart?: boolean): this; + + /** + * @description Tries to spawn the target Forever child process. + */ + trySpawn(): boolean; + + /** + * @description Restarts the target script associated with this instance. + */ + restart(): this; + + /** + * @description Stops the target script associated with this instance. Prevents it from auto-respawning + */ + stop(): this; + + /** + * @description Kills the ChildProcess object associated with this instance + * @param [forceStop] - Value indicating whether short circuit forever auto-restart + */ + kill(forceStop?: boolean): this; + + /** + * @description Sends a message to a forked ChildProcess object associated with this instance + */ + send(msg?: any): this; + + /** + * respond with JSON for this instance + */ + toString(): string; + + /** + * @param command - Command string to parse + * @param args - Additional default arguments + */ + parseCommand(command: string, args?: string[]): (false | { command: string, args?: string[]}); + } } -interface parserArgs { - command: string; - args: string[]; -} - -interface Options { - silent?: boolean; - uid?: "autogen" | string; - pidFile?: string; - max?: number; - killTree?: boolean; - minUptime?: number; - spinSleepTime?: number; - command?: "node" | string; - args?: string[]; - sourceDir?: string; - watch?: boolean; - watchIgnoreDotFiles?: boolean; - watchIgnorePatters?: string[]; - watchDirectory?: string; - spawnWith?: spawnWith; - env?: { [envKey: string]: string; }; - cwd?: string; - logFile?: string; - outFile?: string; - errFile?: string; - parser?: (command: string, args: string[]) => { command: string, args: string[] }; -} - - -export declare class Monitor extends NodeJS.EventEmitter { - - /** - * @param script - Location of the target script to run. - * @param [options] - Configuration for this instance. - */ - constructor(script: string, options?: Options); - - /** - * @description Start the process that this instance is configured for - * @param [restart] - Value indicating whether this is a restart. - */ - start(restart?: boolean): this; - - /** - * @description Tries to spawn the target Forever child process. - */ - trySpawn(): boolean; - - /** - * @description Restarts the target script associated with this instance. - */ - restart(): this; - - /** - * @description Stops the target script associated with this instance. Prevents it from auto-respawning - */ - stop(): this; - - /** - * @description Kills the ChildProcess object associated with this instance - * @param [forceStop] - Value indicating whether short circuit forever auto-restart - */ - kill(forceStop?: boolean): this; - - /** - * @description Sends a message to a forked ChildProcess object associated with this instance - */ - send(msg?: any): this; - - /** - * respond with JSON for this instance - */ - toString(): string; - - /** - * @param command - Command string to parse - * @param args - Additional default arguments - */ - parseCommand(command: string, args?: string[]): (false | { command: string, args?: string[]}); -} - -interface forever { - Monitor: Monitor; - start: (script: string, options: Options) => Monitor; - kill: (pid: number, killTree?: boolean, signal?: string, callback?: () => any) => void; - checkProcess: (pid: number) => boolean; - version: string; -} - -export default forever; +export = forever; From c4b29bb2d0b789804b802729621b94b5bd928e3c Mon Sep 17 00:00:00 2001 From: Paul Isache Date: Fri, 27 Jan 2017 08:20:31 +0200 Subject: [PATCH 57/87] Pino - move interface inside the namespace --- pino/index.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pino/index.d.ts b/pino/index.d.ts index 8d2b687f0b..6273d2fc65 100644 --- a/pino/index.d.ts +++ b/pino/index.d.ts @@ -10,24 +10,24 @@ import stream = require('stream'); declare function P(optionsOrStream?: P.LoggerOptions | stream.Writable | stream.Duplex | stream.Transform): P.Logger; declare function P(options: P.LoggerOptions, stream: stream.Writable | stream.Duplex | stream.Transform): P.Logger; -interface IPinoLog { - pid: number - hostname: string - level: number - time: string - msg: string - v: number -} - declare namespace P { - function pretty(opts?: {timeTransOnly?: boolean, levelFirst?: boolean, formatter?: (log: IPinoLog) => string}): stream.Transform; + function pretty(opts?: { timeTransOnly?: boolean, levelFirst?: boolean, formatter?: (log: IPinoLog) => string }): stream.Transform; type Level = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent'; interface Headers { [header: string]: string; } + interface IPinoLog { + pid: number + hostname: string + level: number + time: string + msg: string + v: number + } + interface LevelLabelsToValues { [level: string]: number; } From ba6a418311d7ea62117f9c3317cdcfce8022e318 Mon Sep 17 00:00:00 2001 From: Paul Isache Date: Fri, 27 Jan 2017 08:49:48 +0200 Subject: [PATCH 58/87] Steed - declare namespace and modify tests --- steed/index.d.ts | 79 +++++++++++++------------- steed/steed-tests.ts | 129 +++++++++++++++++-------------------------- 2 files changed, 92 insertions(+), 116 deletions(-) diff --git a/steed/index.d.ts b/steed/index.d.ts index f88669e92c..ba4b199999 100644 --- a/steed/index.d.ts +++ b/steed/index.d.ts @@ -3,48 +3,49 @@ // Definitions by: Paul Isache // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -interface Dictionary { [key: string]: T; } -interface ErrorCallback { (err?: T): void; } -interface SteedResultCallback { (err: E, result: T): void; } -interface SteedResultArrayCallback { (err: E, results: T[]): void; } -interface SteedResultObjectCallback { (err: E, results: Dictionary): void; } +declare namespace steed { + interface Dictionary { [key: string]: T; } + interface ErrorCallback { (err?: T): void; } -interface SteedWorker { (task: T, callback: ErrorCallback): void; } -interface SteedIterator { (item: T, callback: ErrorCallback): void; } -interface SteedResultIterator { (item: T, callback: SteedResultCallback): void; } -interface SteedFunction { (callback: (err?: E, result?: T) => void): void; } + interface SteedResultCallback { (err: E, result: T): void; } + interface SteedResultArrayCallback { (err: E, results: T[]): void; } + interface SteedResultObjectCallback { (err: E, results: Dictionary): void; } -interface SteedQueue { - push(task: T | T[], callback?: ErrorCallback | SteedResultCallback): void; - unshift(task: T | T[], callback?: ErrorCallback): void; - pause(): void; - resume(): void; - idle(): boolean; - length(): number; - kill(): void; - concurrency: number; - drain: () => any; - empty: () => any; - saturated: () => any; + interface SteedWorker { (task: T, callback: ErrorCallback): void; } + interface SteedIterator { (item: T, callback: ErrorCallback): void; } + interface SteedResultIterator { (item: T, callback: SteedResultCallback): void; } + interface SteedFunction { (callback: (err?: E, result?: T) => void): void; } + + interface SteedQueue { + push(task: T | T[], callback?: ErrorCallback | SteedResultCallback): void; + unshift(task: T | T[], callback?: ErrorCallback): void; + pause(): void; + resume(): void; + idle(): boolean; + length(): number; + kill(): void; + concurrency: number; + drain: () => any; + empty: () => any; + saturated: () => any; + } + + interface Steed { + parallel(tasks: Array>, callback?: SteedResultArrayCallback): void; + parallel(tasks: Dictionary>, callback?: SteedResultObjectCallback): void; + series(tasks: Array>, callback?: SteedResultArrayCallback): void; + series(tasks: Dictionary>, callback?: SteedResultObjectCallback): void; + waterfall(tasks: Function[], callback?: SteedResultCallback): void; + each(arr: T[] | Dictionary, iterator: SteedIterator, callback?: ErrorCallback): void; + eachSeries: typeof steed.each; + map(arr: T[] | Dictionary, iterator: SteedResultIterator, callback?: SteedResultArrayCallback): void; + mapSeries: typeof steed.map; + queue(worker: SteedWorker, concurrency?: number): SteedQueue; + queue(worker: SteedResultIterator, concurrency?: number): SteedQueue; + } } -interface Steed { - parallel(tasks: Array>, callback?: SteedResultArrayCallback): void; - parallel(tasks: Dictionary>, callback?: SteedResultObjectCallback): void; - series(tasks: Array>, callback?: SteedResultArrayCallback): void; - series(tasks: Dictionary>, callback?: SteedResultObjectCallback): void; - waterfall(tasks: Function[], callback?: SteedResultCallback): void; - each(arr: T[] | Dictionary, iterator: SteedIterator, callback?: ErrorCallback): void; - eachSeries: typeof steed.each; - map(arr: T[] | Dictionary, iterator: SteedResultIterator, callback?: SteedResultArrayCallback): void; - mapSeries: typeof steed.map; - queue(worker: SteedWorker, concurrency?: number): SteedQueue; - queue(worker: SteedResultIterator, concurrency?: number): SteedQueue; -} +declare const steed: steed.Steed; -declare const steed: Steed; - -declare module "steed" { - export = steed; -} +export = steed; diff --git a/steed/steed-tests.ts b/steed/steed-tests.ts index 729e59472f..685654cc52 100644 --- a/steed/steed-tests.ts +++ b/steed/steed-tests.ts @@ -1,19 +1,14 @@ /// -import fs = require("fs"); -import process = require("process"); +import steed = require('steed') declare var path: { - exists: (path: string, callback?: (err: Error, exists: boolean) => any) => void; + exists: (path: string, callback?: (error: Error, exists: boolean) => any) => void; }; -function funcStringCbErrBoolean(v:string, cb:(err:Error,res:boolean) => void) {} +function funcStringCbErrBoolean(v: string, cb: (error: Error, res: boolean) => void) { } function callback() { } -steed.map(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); -steed.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); - - steed.parallel([ function () { }, function () { } @@ -25,16 +20,16 @@ steed.series([ ]); var data: any[] = []; -function steedProcess(item: any, callback: (err: Error, result: any) => void) { } -steed.map(data, steedProcess, function (err, results) { +function steedProcess(item: any, callback: (error: Error, result: any) => void) { } +steed.map(data, steedProcess, function (error, results) { console.log(results); }); var openFiles = ['file1', 'file2']; -var saveFile = function (file:string,cb:(err:Error)=>void) { } -steed.each(openFiles, saveFile, function (err:Error) { }); -steed.eachSeries(openFiles, saveFile, function (err:Error) { }); +var saveFile = function (file: string, cb: (error: Error) => void) { } +steed.each(openFiles, saveFile, function (error: Error) { }); +steed.eachSeries(openFiles, saveFile, function (error: Error) { }); // Control Flow // @@ -46,9 +41,9 @@ steed.series([ callback(undefined, 'two'); }, ], -function (err, results) { }); + function (error, results) { }); -steed.series([ +steed.series([ function (callback) { callback(undefined, 'one'); }, @@ -56,7 +51,7 @@ steed.series([ callback(undefined, 'two'); }, ], -function (err, results) { }); + function (error, results) { }); steed.series({ one: function (callback) { @@ -70,9 +65,9 @@ steed.series({ }, 100); }, }, -function (err, results) { }); + function (error, results) { }); -steed.series({ +steed.series({ one: function (callback) { setTimeout(function () { callback(undefined, 1); @@ -84,7 +79,7 @@ steed.series({ }, 100); }, }, -function (err, results) { }); + function (error, results) { }); steed.parallel([ function (callback) { @@ -98,9 +93,9 @@ steed.parallel([ }, 100); }, ], -function (err, results) { }); + function (error, results) { }); -steed.parallel([ +steed.parallel([ function (callback) { setTimeout(function () { callback(undefined, 'one'); @@ -112,7 +107,7 @@ steed.parallel([ }, 100); }, ], -function (err, results) { }); + function (error, results) { }); steed.parallel({ @@ -127,9 +122,9 @@ steed.parallel({ }, 100); }, }, -function (err, results) { }); + function (error, results) { }); -steed.parallel({ +steed.parallel({ one: function (callback) { setTimeout(function () { callback(undefined, 1); @@ -141,7 +136,7 @@ steed.parallel({ }, 100); }, }, - function (err, results) { }); + function (error, results) { }); function whileFn(callback: any) { count++; @@ -161,10 +156,10 @@ steed.waterfall([ function (arg1: any, callback: any) { callback(null, 'done'); } -], function (err, result) { }); +], function (error, result) { }); -var q = steed.queue(function (task: any, callback: () => void) { +var q = steed.queue(function (task: any, callback: () => void) { console.log('hello ' + task.name); callback(); }, 2); @@ -180,7 +175,7 @@ q.push({ name: 'bar' }, function (err) { console.log('finished processing bar'); }); -q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { +q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (error: Error) { console.log('finished processing bar'); }); @@ -190,22 +185,22 @@ q.unshift({ name: 'bar' }, function (err) { console.log('finished processing bar'); }); -q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { +q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (error: Error) { console.log('finished processing bar'); }); -var qLength : number = q.length(); -var qIsIdle : boolean = q.idle(); +var qLength: number = q.length(); +var qIsIdle: boolean = q.idle(); -q.saturated = function() { +q.saturated = function () { console.log('queue is saturated.'); } -q.empty = function() { +q.empty = function () { console.log('queue is empty.'); } -q.drain = function() { +q.drain = function () { console.log('queue was drained.'); } @@ -214,7 +209,7 @@ q.resume(); q.kill(); // tests for strongly typed tasks -var q2 = steed.queue(function (task: string, callback: () => void) { +var q2 = steed.queue(function (task: string, callback: () => void) { console.log('Task: ' + task); callback(); }, 1); @@ -225,7 +220,7 @@ q2.push('task2', function (error) { console.log('Finished tasks'); }); -q2.push(['task3', 'task4', 'task5'], function (error) { +q2.push(['task3', 'task4', 'task5'], function (error: Error) { console.log('Finished tasks'); }); @@ -235,49 +230,29 @@ q2.unshift('task2', function (error) { console.log('Finished tasks'); }); -q2.unshift(['task3', 'task4', 'task5'], function (error) { +q2.unshift(['task3', 'task4', 'task5'], function (error: Error) { console.log('Finished tasks'); }); - -// var aq = steed.queue(function (level: number, callback: (error : Error, newLevel: number) => void) { -// console.log('hello ' + level); -// callback(null, level+1); -// }); -// -// aq.push(1, function (err : Error, newLevel : number) { -// console.log('finished processing bar' + newLevel); -// }); - - steed.parallel([ - function (callback: ( err:Error, val:string ) => void ) { }, + function (callback: (error: Error, val: string) => void) { }, function (callback) { } ], -function (err:Error,results:Array) { - steed.series([ - function (callback) { }, - function email_link(callback) { } - ]); -}); - -steed.parallel([ - function (callback) { - fs.writeFile('testfile1', 'test1', callback); - }, - function (callback) { - fs.writeFile('testfile2', 'test2', callback); - }, -]); + function (error: Error, results: Array) { + steed.series([ + function (callback) { }, + function email_link(callback) { } + ]); + }); // each -steed.each({ +steed.each({ "a": 1, "b": 2 -}, function(val: number, next: ErrorCallback): void { +}, function (val: number, next: steed.ErrorCallback): void { - setTimeout(function(): void { + setTimeout(function (): void { console.log(`steed.each: ${val}`); @@ -285,7 +260,7 @@ steed.each({ }, 500); -}, function(err?: Error): void { +}, function (err?: Error): void { console.log("steed.each: done."); @@ -294,9 +269,9 @@ steed.each({ steed.eachSeries({ "a": 1, "b": 2 -}, function(val: number, next: ErrorCallback): void { +}, function (val: number, next: steed.ErrorCallback): void { - setTimeout(function(): void { + setTimeout(function (): void { console.log(`steed.eachSeries: ${val}`); @@ -304,7 +279,7 @@ steed.eachSeries({ }, 500); -}, function(err?: Error): void { +}, function (err?: Error): void { console.log("steed.eachSeries: done."); @@ -316,9 +291,9 @@ steed.map({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: SteedResultCallback): void { +}, function (val: number, next: steed.SteedResultCallback): void { - setTimeout(function(): void { + setTimeout(function (): void { console.log(`steed.map: ${val}`); @@ -326,7 +301,7 @@ steed.map({ }, 500); -}, function(err: Error, results: string[]): void { +}, function (error: Error, results: string[]): void { console.log("steed.map: done with results", results); @@ -336,9 +311,9 @@ steed.mapSeries({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: SteedResultCallback): void { +}, function (val: number, next: steed.SteedResultCallback): void { - setTimeout(function(): void { + setTimeout(function (): void { console.log(`steed.mapSeries: ${val}`); @@ -346,7 +321,7 @@ steed.mapSeries({ }, 500); -}, function(err: Error, results: string[]): void { +}, function (error: Error, results: string[]): void { console.log("steed.mapSeries: done with results", results); From 0bbcfcfffca381dd8c02d7f932f7f8bdbf600752 Mon Sep 17 00:00:00 2001 From: Sheeo Date: Fri, 27 Jan 2017 08:48:50 +0100 Subject: [PATCH 59/87] Add _.conforms and _.conformsTo --- lodash/index.d.ts | 32 ++++++++++++++++++++++++++++++-- lodash/lodash-tests.ts | 12 ++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/lodash/index.d.ts b/lodash/index.d.ts index 678e0c58b9..95d6a83c8e 100644 --- a/lodash/index.d.ts +++ b/lodash/index.d.ts @@ -68,7 +68,7 @@ added 23 array methods: - [x] _.xorBy - [x] _.xorWith -added 18 lang methods: +added 20 lang methods: - [x] _.cloneDeepWith - [x] _.cloneWith - [x] _.eq @@ -87,6 +87,8 @@ added 18 lang methods: - [x] _.toNumber - [x] _.toSafeInteger - [x] _.toString +- [X] _.conforms +- [X] _.conformsTo added 13 object methods: - [x] _.assignIn @@ -225,7 +227,6 @@ Methods: - [ ] _.split - [ ] _.cond -- [ ] _.conforms - [ ] _.nthArg - [ ] _.over - [ ] _.overEvery @@ -11432,6 +11433,33 @@ declare namespace _ { ): LoDashExplicitObjectWrapper; } + /** + * 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): (Target: 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; + } + //_.eq interface LoDashStatic { /** diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index c1a5ca3e64..7d4d22d387 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -6488,6 +6488,18 @@ namespace TestCloneWith { } } +// _.conforms +namespace TestConforms { + let result: boolean = _.conforms({foo: (v: string) => false})({foo: "foo"}); + let result2: boolean = _.conforms({})({foo: "foo"}); +} + +// _.conformsTo +namespace TestConformsTo { + let result: boolean = _.conformsTo({foo: "foo"}, {foo: (v: string) => false}); + let result2: boolean = _.conformsTo({}, {foo: (v: string) => false}); +} + // _.eq namespace TestEq { let customizer: (value: any, other: any, indexOrKey?: number|string) => boolean; From 12ab6e01e85adab2621fffd79d35ba2216425d39 Mon Sep 17 00:00:00 2001 From: Sheeo Date: Fri, 27 Jan 2017 09:03:37 +0100 Subject: [PATCH 60/87] Use TypeScript Version 2.1 --- lodash/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lodash/index.d.ts b/lodash/index.d.ts index 95d6a83c8e..04341a94a8 100644 --- a/lodash/index.d.ts +++ b/lodash/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /** ### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog) From f0962440962a9f4b50e4669be5f0af5cae6dc34d Mon Sep 17 00:00:00 2001 From: akim95 Date: Fri, 27 Jan 2017 16:55:38 +0800 Subject: [PATCH 61/87] added type definitions for express-mysql-session 1.2 --- .../express-mysql-session-tests.ts | 13 ++ express-mysql-session/index.d.ts | 136 ++++++++++++++++++ express-mysql-session/tsconfig.json | 20 +++ express-mysql-session/tslint.json | 1 + 4 files changed, 170 insertions(+) create mode 100644 express-mysql-session/express-mysql-session-tests.ts create mode 100644 express-mysql-session/index.d.ts create mode 100644 express-mysql-session/tsconfig.json create mode 100644 express-mysql-session/tslint.json diff --git a/express-mysql-session/express-mysql-session-tests.ts b/express-mysql-session/express-mysql-session-tests.ts new file mode 100644 index 0000000000..b69486dd8d --- /dev/null +++ b/express-mysql-session/express-mysql-session-tests.ts @@ -0,0 +1,13 @@ +import MySQLStore = require('express-mysql-session'); + +const options = { + host: 'localhost', + port: 3306, + user: 'root', + password: '', + database: 'session_test' +}; + +const sessionStore = new MySQLStore(options); + +sessionStore.close(); diff --git a/express-mysql-session/index.d.ts b/express-mysql-session/index.d.ts new file mode 100644 index 0000000000..0e86b9b077 --- /dev/null +++ b/express-mysql-session/index.d.ts @@ -0,0 +1,136 @@ +// Type definitions for express-mysql-session 1.2 +// Project: https://github.com/chill117/express-mysql-session#readme +// Definitions by: Akim95 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = MySQLStore; + +declare namespace MySQLStore { + interface Options { + host?: string; + port?: number; + user?: string; + password?: string; + database?: string; + checkExpirationInterval?: number; + expiration?: number; + createDatabaseTable?: boolean; + connectionLimit?: number; + schema?: Schema; + } + interface Schema { + tableName: string; + columnNames: ColumnNames; + } + interface ColumnNames { + session_id: string; + expires: string; + data: string; + } +} + +declare class MySQLStore { + + /** + * @param {MySQLStore.Options} options + * @param {any} connection? + * @param {(error:any)=>void} callback? + */ + constructor(options: MySQLStore.Options, connection?: any, callback?: (error: any) => void); + + /** + * @returns void + */ + setDefaultOptions(): void; + + /** + * @param {(error:any)=>void} callback? + * @returns void + */ + createDatabaseTable(callback?: (error: any) => void): void; + + /** + * @param {string} sessionId + * @param {(error:any,session:any)=>void} callback? + * @returns void + */ + get(sessionId: string, callback?: (error: any, session: any) => void): void; + + /** + * @param {string} sessionId + * @param {any} data + * @param {(error:any)=>void} callback? + * @returns void + */ + set(sessionId: string, data: any, callback?: (error: any) => void): void; + + /** + * @param {string} sessionId + * @param {any} data + * @param {(error:any)=>void} callback? + * @returns void + */ + touch(sessionId: string, data: any, callback?: (error: any) => void): void; + + /** + * @param {string} sessionId + * @param {(error:any)=>void} callback? + * @returns void + */ + destroy(sessionId: string, callback?: (error: any) => void): void; + + /** + * @param {(error:any,count:any)=>void} callback? + * @returns void + */ + length(callback?: (error: any, count: any) => void): void; + + /** + * @param {(error:any)=>void} callback? + * @returns void + */ + clear(callback?: (error: any) => void): void; + + /** + * @param {(error:any)=>void} callback? + * @returns void + */ + clearExpiredSessions(callback?: (error: any) => void): void; + + /** + * @param {number} interval + * @returns void + */ + setExpirationInterval(interval: number): void; + + /** + * @returns void + */ + clearExpirationInterval(): void; + + /** + * @param {()=>void} callback? + * @returns void + */ + close(callback?: () => void): void; + + /** + * @param {any} object + * @param {any} defaultValues + * @param {any} options? + * @returns void + */ + default(object: any, defaultValues: any, options?: any): void; + + /** + * @param {any} object + * @returns void + */ + clone(object: any): void; + + /** + * @param {any} value + * @returns void + */ + isObject(value: any): void; +} diff --git a/express-mysql-session/tsconfig.json b/express-mysql-session/tsconfig.json new file mode 100644 index 0000000000..5af8734c24 --- /dev/null +++ b/express-mysql-session/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-mysql-session-tests.ts" + ] +} diff --git a/express-mysql-session/tslint.json b/express-mysql-session/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/express-mysql-session/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 30cecf0452820e606efb8bdc5d058cf4ba8d1612 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Fri, 27 Jan 2017 10:42:03 +0100 Subject: [PATCH 62/87] Add Types for comment-json --- comment-json/comment-json-tests.ts | 16 ++++++++++++++++ comment-json/index.d.ts | 8 ++++++++ comment-json/tsconfig.json | 20 ++++++++++++++++++++ comment-json/tslint.json | 1 + 4 files changed, 45 insertions(+) create mode 100644 comment-json/comment-json-tests.ts create mode 100644 comment-json/index.d.ts create mode 100644 comment-json/tsconfig.json create mode 100644 comment-json/tslint.json diff --git a/comment-json/comment-json-tests.ts b/comment-json/comment-json-tests.ts new file mode 100644 index 0000000000..af91ff422f --- /dev/null +++ b/comment-json/comment-json-tests.ts @@ -0,0 +1,16 @@ +import * as commentJson from 'comment-json'; + +const result = commentJson.parse(` +/** + block comment at the top + */ +// comment at the top +{ + // comment for a + // comment line 2 for a + /* block comment */ + "a": 1 // comment at right +} +// comment at the bottom +`); +const str = commentJson.stringify(result); diff --git a/comment-json/index.d.ts b/comment-json/index.d.ts new file mode 100644 index 0000000000..9c2652f34e --- /dev/null +++ b/comment-json/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for comment-json 1.1 +// Project: https://github.com/kaelzhang/node-comment-json +// Definitions by: Jason Dent +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type Reviver = (k: number | string, v: any) => any; +export function parse(json: string, reviver?: Reviver, removes_comments?: boolean): any; +export function stringify(value: any, replacer?: any, space?: string | number): string; diff --git a/comment-json/tsconfig.json b/comment-json/tsconfig.json new file mode 100644 index 0000000000..342694cbb3 --- /dev/null +++ b/comment-json/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "comment-json-tests.ts" + ] +} diff --git a/comment-json/tslint.json b/comment-json/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/comment-json/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 2d3c9f8fa6b9814ea1219f8bc8f165db52e357ec Mon Sep 17 00:00:00 2001 From: Patricio Zavolinsky Date: Fri, 27 Jan 2017 10:26:01 +0000 Subject: [PATCH 63/87] react-input-mask and react-native-scrollable-tab-view: fix linter issues (trailing whitespace) --- react-input-mask/index.d.ts | 2 +- react-native-scrollable-tab-view/index.d.ts | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/react-input-mask/index.d.ts b/react-input-mask/index.d.ts index 6fc8c6008f..c6acce5858 100644 --- a/react-input-mask/index.d.ts +++ b/react-input-mask/index.d.ts @@ -13,7 +13,7 @@ declare namespace reactInputMask { * * `9`: `0-9` * * `a`: `A-Z, a-z` * * `\*`: `A-Z, a-z, 0-9` - * + * * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings. For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}` */ mask: string; diff --git a/react-native-scrollable-tab-view/index.d.ts b/react-native-scrollable-tab-view/index.d.ts index 2f22f1bcf4..9287ede79d 100644 --- a/react-native-scrollable-tab-view/index.d.ts +++ b/react-native-scrollable-tab-view/index.d.ts @@ -37,9 +37,9 @@ export interface renderTabBarProperties { interface ScrollableTabViewProperties extends React.Props { /** - * tabBarPosition (String) Defaults to "top". + * tabBarPosition (String) Defaults to "top". * "bottom" to position the tab bar below content. - * "overlayTop" or "overlayBottom" for a semitransparent tab bar that overlays content. Custom + * "overlayTop" or "overlayBottom" for a semitransparent tab bar that overlays content. Custom * tab bars must consume a style prop on their outer element to support this feature: style={this.props.style}. */ tabBarPosition?: 'top' | 'bottom' | 'overlayTop' | 'overlayBottom'; @@ -50,27 +50,27 @@ interface ScrollableTabViewProperties extends React.Props { initialPage?: number; /** - * (Integer) - set selected tab(can be buggy see + * (Integer) - set selected tab(can be buggy see * https://github.com/skv-headless/react-native-scrollable-tab-view/issues/126 */ page?: number; /** - * onChangeTab (Function) - function to call when tab changes, should accept 1 argument which is - * an Object containing two keys: i: the index of the tab that is selected, ref: the ref of the + * onChangeTab (Function) - function to call when tab changes, should accept 1 argument which is + * an Object containing two keys: i: the index of the tab that is selected, ref: the ref of the * tab that is selected */ onChangeTab?: (value: onChangeTabProperties) => void; /** - * onScroll (Function) - function to call when the pages are sliding, + * onScroll (Function) - function to call when the pages are sliding, * should accept 1 argument which is an Float number representing the page position in the slide frame. */ onScroll?: (value: number) => void; /** * renderTabBar (Function:ReactComponent) - accept 1 argument props and should return a component - * to use as the tab bar. The component has goToPage, tabs, activeTab and ref added to the props, + * to use as the tab bar. The component has goToPage, tabs, activeTab and ref added to the props, * and should implement setAnimationValue to be able to animate itself along with the tab content. * You can manually pass the props to the TabBar component. */ @@ -82,7 +82,7 @@ interface ScrollableTabViewProperties extends React.Props { style?: ViewStyle; /** - * contentProps (Object) - props that are applied to root ScrollView/ViewPagerAndroid. + * contentProps (Object) - props that are applied to root ScrollView/ViewPagerAndroid. * Note that overriding defaults set by the library may break functionality; see the source for details. */ contentProps?: React.ScrollViewProperties; @@ -98,7 +98,7 @@ interface ScrollableTabViewProperties extends React.Props { locked?: boolean; /** - * prerenderingSiblingsNumber (Integer) - pre-render nearby # sibling, Infinity === render all + * prerenderingSiblingsNumber (Integer) - pre-render nearby # sibling, Infinity === render all * the siblings, default to 0 === render current page. */ prerenderingSiblingsNumber?: number; From 70a11f0ffe423cdaf4d777ae8a6c375c94b09516 Mon Sep 17 00:00:00 2001 From: Paul Isache Date: Fri, 27 Jan 2017 16:02:57 +0200 Subject: [PATCH 64/87] Pino - update Logger Options and add levelVal --- pino/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pino/index.d.ts b/pino/index.d.ts index 6273d2fc65..a9c4b949e2 100644 --- a/pino/index.d.ts +++ b/pino/index.d.ts @@ -59,7 +59,8 @@ declare namespace P { extreme?: boolean; // enables logging, defaults to true. enabled?: boolean; - level?: Level; + level?: Level | string; + levelVal?: number; } interface Pino { From d9f74ddaa65574050f8d7e71503a91cef9f165c2 Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Wed, 25 Jan 2017 11:31:32 +0200 Subject: [PATCH 65/87] angular: added tslint validation to the folder; made the code compliant to tslint --- angular-gridster/index.d.ts | 8 +- angular/angular-component-router.d.ts | 4 +- angular/angular-tests.ts | 448 +++++++++++++------------- angular/index.d.ts | 91 +++--- angular/tslint.json | 20 ++ 5 files changed, 294 insertions(+), 277 deletions(-) create mode 100644 angular/tslint.json diff --git a/angular-gridster/index.d.ts b/angular-gridster/index.d.ts index de60d6377b..fc0e990d41 100644 --- a/angular-gridster/index.d.ts +++ b/angular-gridster/index.d.ts @@ -32,7 +32,7 @@ declare module "angular" { // width of grid columns. "auto" will divide the width of the grid evenly among the columns colWidth?: string; - // height of grid rows. 'match' will make it the same as the column width, a numeric value will be interpreted as pixels, + // height of grid rows. 'match' will make it the same as the column width, a numeric value will be interpreted as pixels, // '/2' is half the column width, '*5' is five times the column width, etc. rowHeight?: string; @@ -84,7 +84,7 @@ declare module "angular" { // options to pass to resizable handler resizable?: { - // whether the items are resizable + // whether the items are resizable enabled?: boolean; // location of the resize handles @@ -104,7 +104,7 @@ declare module "angular" { // options to pass to draggable handler draggable?: { - // whether the items are resizable + // whether the items are resizable enabled?: boolean; // Distance in pixels from the edge of the viewport after which the viewport should scroll, relative to pointer @@ -142,4 +142,4 @@ declare module "angular" { col: number; } } -} \ No newline at end of file +} diff --git a/angular/angular-component-router.d.ts b/angular/angular-component-router.d.ts index 99ae821c72..92458331d6 100644 --- a/angular/angular-component-router.d.ts +++ b/angular/angular-component-router.d.ts @@ -1,9 +1,9 @@ +/* tslint:disable:dt-header variable-name */ // Type definitions for Angular JS 1.5 component router // Project: http://angularjs.org // Definitions by: David Reher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - declare namespace angular { /** * `Instruction` is a tree of {@link ComponentInstruction}s with all the information needed @@ -263,7 +263,7 @@ declare namespace angular { /** * Subscribe to URL updates from the router */ - subscribe(onNext: (value: any) => void): Object; + subscribe(onNext: (value: any) => void): {}; /** * Removes the contents of this router's outlet and all descendant outlets diff --git a/angular/angular-tests.ts b/angular/angular-tests.ts index c6ee7c7a00..1a4841ab8c 100644 --- a/angular/angular-tests.ts +++ b/angular/angular-tests.ts @@ -1,4 +1,3 @@ - // issue: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/369 // https://github.com/witoldsz/angular-http-auth/blob/master/src/angular-http-auth.js /** @@ -7,12 +6,14 @@ * License: MIT */ +/* tslint:disable:no-empty no-shadowed-variable */ + class AuthService { /** * Holds all the requests which failed due to 401 response, * so they can be re-requested in future, once login is completed. */ - buffer: { config: ng.IRequestConfig; deferred: ng.IDeferred; }[] = []; + buffer: Array<{ config: ng.IRequestConfig; deferred: ng.IDeferred; }> = []; /** * Required by HTTP interceptor. @@ -20,34 +21,35 @@ class AuthService { */ pushToBuffer = function(config: ng.IRequestConfig, deferred: ng.IDeferred) { this.buffer.push({ - config: config, - deferred: deferred + config, + deferred }); - } + }; $get = [ - '$rootScope', '$injector', function($rootScope: ng.IScope, $injector: ng.auto.IInjectorService) { - var $http: ng.IHttpService; //initialized later because of circular dependency problem + '$rootScope', '$injector', function($rootScope: ng.IScope, $injector: ng.auto.IInjectorService) { + let $http: ng.IHttpService; //initialized later because of circular dependency problem function retry(config: ng.IRequestConfig, deferred: ng.IDeferred) { $http = $http || $injector.get('$http'); - $http(config).then(function (response) { + $http(config).then(function(response) { deferred.resolve(response); }); } function retryAll() { - for (var i = 0; i < this.buffer.length; ++i) { - retry(this.buffer[i].config, this.buffer[i].deferred); + for (const request of this.buffer) { + retry(request.config, request.deferred); } + this.buffer = []; } return { - loginConfirmed: function () { + loginConfirmed() { $rootScope.$broadcast('event:auth-loginConfirmed'); retryAll(); } - } - } + }; + } as any ]; } @@ -59,20 +61,20 @@ angular.module('http-auth-interceptor', []) * $http interceptor. * On 401 response - it stores the request and broadcasts 'event:angular-auth-loginRequired'. */ - .config(['$httpProvider', 'authServiceProvider', function ($httpProvider: ng.IHttpProvider, authServiceProvider: any) { + .config(['$httpProvider', 'authServiceProvider', function($httpProvider: ng.IHttpProvider, authServiceProvider: any) { - $httpProvider.defaults.headers.common = {'Authorization': 'Bearer token'}; + $httpProvider.defaults.headers.common = {Authorization: 'Bearer token'}; $httpProvider.defaults.headers.get['Authorization'] = 'Bearer token'; - $httpProvider.defaults.headers.post['Authorization'] = function (config:ng.IRequestConfig):string { return 'Bearer token'; } + $httpProvider.defaults.headers.post['Authorization'] = function(config: ng.IRequestConfig): string { return 'Bearer token'; }; - var interceptor = ['$rootScope', '$q', function ($rootScope: ng.IScope, $q: ng.IQService) { + const interceptor = ['$rootScope', '$q', function($rootScope: ng.IScope, $q: ng.IQService) { function success(response: ng.IHttpPromiseCallbackArg) { return response; } function error(response: ng.IHttpPromiseCallbackArg) { if (response.status === 401) { - var deferred = $q.defer(); + const deferred = $q.defer(); authServiceProvider.pushToBuffer(response.config, deferred); $rootScope.$broadcast('event:auth-loginRequired'); return deferred.promise; @@ -81,14 +83,13 @@ angular.module('http-auth-interceptor', []) return $q.reject(response); } - return function (promise: ng.IHttpPromise) { + return function(promise: ng.IHttpPromise) { return promise.then(success, error); - } + }; - }]; + } as any]; $httpProvider.interceptors.push(interceptor); - }]); - + } as any]); namespace HttpAndRegularPromiseTests { interface Person { @@ -96,7 +97,7 @@ namespace HttpAndRegularPromiseTests { lastName: string; } - interface ExpectedResponse extends Person { } + type ExpectedResponse = Person; interface SomeControllerScope extends ng.IScope { person: Person; @@ -106,13 +107,13 @@ namespace HttpAndRegularPromiseTests { nothing?: string; } - var someController: Function = ($scope: SomeControllerScope, $http: ng.IHttpService, $q: ng.IQService) => { - $http.get("http://somewhere/some/resource") + function someController($scope: SomeControllerScope, $http: ng.IHttpService, $q: ng.IQService) { + $http.get('http://somewhere/some/resource') .success((data: ExpectedResponse) => { $scope.person = data; }); - $http.get("http://somewhere/some/resource") + $http.get('http://somewhere/some/resource') .then((response: ng.IHttpPromiseCallbackArg) => { // typing lost, so something like // var i: number = response.data @@ -120,7 +121,7 @@ namespace HttpAndRegularPromiseTests { $scope.person = response.data; }); - $http.get("http://somewhere/some/resource") + $http.get('http://somewhere/some/resource') .then((response: ng.IHttpPromiseCallbackArg) => { // typing lost, so something like // var i: number = response.data @@ -128,47 +129,48 @@ namespace HttpAndRegularPromiseTests { $scope.person = response.data; }); - var aPromise: ng.IPromise = $q.when({ firstName: "Jack", lastName: "Sparrow" }); + const aPromise: ng.IPromise = $q.when({ firstName: 'Jack', lastName: 'Sparrow' }); aPromise.then((person: Person) => { $scope.person = person; }); - var bPromise: ng.IPromise = $q.when(42); + const bPromise: ng.IPromise = $q.when(42); bPromise.then((answer: number) => { $scope.theAnswer = answer; }); - var cPromise: ng.IPromise = $q.when(["a", "b", "c"]); + const cPromise: ng.IPromise = $q.when(['a', 'b', 'c']); cPromise.then((letters: string[]) => { $scope.letters = letters; }); // When $q.when is passed an IPromise, it returns an IPromise - var dPromise: ng.IPromise = $q.when($q.when("ALBATROSS!")); + const dPromise: ng.IPromise = $q.when($q.when('ALBATROSS!')); dPromise.then((snack: string) => { $scope.snack = snack; }); // $q.when may be called without arguments - var ePromise: ng.IPromise = $q.when(); + const ePromise: ng.IPromise = $q.when(); ePromise.then(() => { - $scope.nothing = "really nothing"; + $scope.nothing = 'really nothing'; }); } - // Test that we can pass around a type-checked success/error Promise Callback - var anotherController: Function = ($scope: SomeControllerScope, $http: - ng.IHttpService, $q: ng.IQService) => { - - var buildFooData: Function = () => 42; - - var doFoo: Function = (callback: ng.IHttpPromiseCallback) => { - $http.get('/foo', buildFooData()) - .success(callback); + // Test that we can pass around a type-checked success/error Promise Callback + function anotherController($scope: SomeControllerScope, $http: ng.IHttpService, $q: ng.IQService) { + function buildFooData(): ng.IRequestShortcutConfig { + return {}; } - doFoo((data: any) => console.log(data)); - } + function doFoo(callback: ng.IHttpPromiseCallback) { + $http + .get('/foo', buildFooData()) + .success(callback); + }; + + doFoo((data: any) => console.log(data)); + }; } // Test for AngularJS Syntax @@ -178,9 +180,9 @@ namespace My.Namespace { } // IModule Registering Test -var mod = angular.module('tests', []); -mod.controller('name', function ($scope: ng.IScope) { }); -mod.controller('name', ['$scope', function ($scope: ng.IScope) { }]); +let mod = angular.module('tests', []); +mod.controller('name', function($scope: ng.IScope) { }); +mod.controller('name', ['$scope', function($scope: ng.IScope) { }]); mod.controller('name', class { // Uncommenting the next line should lead to a type error because this signature isn't compatible // with the signature of the `$onChanges` hook: @@ -188,7 +190,7 @@ mod.controller('name', class { }); mod.controller({ MyCtrl: class{}, - MyCtrl2: function() {}, + MyCtrl2: function() {}, // tslint:disable-line:object-literal-shorthand MyCtrl3: ['$fooService', function($fooService: any) { }] }); mod.directive('myDirectiveA', ($rootScope: ng.IRootScopeService) => { @@ -201,7 +203,7 @@ mod.directive('myDirectiveA', ($rootScope: ng.IRootScopeService) => { scope.$watch(() => foo, () => el.text(foo)); }; }); -mod.directive('myDirectiveB', ['$rootScope', function ($rootScope: ng.IRootScopeService) { +mod.directive('myDirectiveB', ['$rootScope', function($rootScope: ng.IRootScopeService) { return { link(scope, el, attrs) { el.click(e => { @@ -218,38 +220,37 @@ mod.directive({ template: 'my-bar-dir.tpl.html' })] }); -mod.factory('name', function ($scope: ng.IScope) { }) -mod.factory('name', ['$scope', function ($scope: ng.IScope) { }]) +mod.factory('name', function($scope: ng.IScope) { }); +mod.factory('name', ['$scope', function($scope: ng.IScope) { }]); mod.factory({ - name1: function (foo: any) { }, - name2: ['foo', function (foo: any) { }] + name1: function(foo: any) { }, // tslint:disable-line:object-literal-shorthand + name2: ['foo', function(foo: any) { }] }); -mod.filter('name', function ($scope: ng.IScope) { }) -mod.filter('name', ['$scope', function ($scope: ng.IScope) { }]) +mod.filter('name', function($scope: ng.IScope) { }); +mod.filter('name', ['$scope', function($scope: ng.IScope) { }]); mod.filter({ - name1: function (foo: any) { }, - name2: ['foo', function (foo: any) { }] + name1: function(foo: any) { }, // tslint:disable-line:object-literal-shorthand + name2: ['foo', function(foo: any) { }] }); -mod.provider('name', function ($scope: ng.IScope) { return { $get: () => { } } }) +mod.provider('name', function($scope: ng.IScope) { return { $get: () => { } }; }); mod.provider('name', TestProvider); -mod.provider('name', ['$scope', function ($scope: ng.IScope) { }]) +mod.provider('name', ['$scope', function($scope: ng.IScope) { } as any]); mod.provider(My.Namespace); -mod.service('name', function ($scope: ng.IScope) { }) -mod.service('name', ['$scope', function ($scope: ng.IScope) { }]) +mod.service('name', function($scope: ng.IScope) { }); +mod.service('name', ['$scope', function($scope: ng.IScope) { } as any]); mod.service({ MyCtrl: class{}, - MyCtrl2: function() {}, + MyCtrl2: function() {}, // tslint:disable-line:object-literal-shorthand MyCtrl3: ['$fooService', function($fooService: any) { }] }); mod.constant('name', 23); -mod.constant('name', "23"); +mod.constant('name', '23'); mod.constant(My.Namespace); mod.value('name', 23); -mod.value('name', "23"); +mod.value('name', '23'); mod.value(My.Namespace); -mod.decorator('name', function($scope:ng.IScope){ }); -mod.decorator('name', ['$scope', function($scope: ng.IScope){ }]); - +mod.decorator('name', function($scope: ng.IScope) {}); +mod.decorator('name', ['$scope', function($scope: ng.IScope) {} as any]); class TestProvider implements ng.IServiceProvider { constructor(private $scope: ng.IScope) { @@ -261,23 +262,23 @@ class TestProvider implements ng.IServiceProvider { // QProvider tests angular.module('qprovider-test', []) - .config(['$qProvider', function ($qProvider: ng.IQProvider) { + .config(['$qProvider', function($qProvider: ng.IQProvider) { const provider: ng.IQProvider = $qProvider.errorOnUnhandledRejections(false); const currentValue: boolean = $qProvider.errorOnUnhandledRejections(); }]); // Promise signature tests -var foo: ng.IPromise; +let foo: ng.IPromise; foo.then((x) => { // x is inferred to be a number - return "asdf"; + return 'asdf'; }).then((x) => { // x is inferred to be string - x.length; + const len = x.length; return 123; }).then((x) => { // x is infered to be a number - x.toFixed(); + const fixed = x.toFixed(); return; }).then((x) => { // x is infered to be void @@ -336,15 +337,14 @@ namespace TestQ { result = $q.all([promiseAny, promiseAny]); } { - let result: angular.IPromise<{[id: string]: any;}>; + let result: angular.IPromise<{[id: string]: any; }>; result = $q.all({a: promiseAny, b: promiseAny}); } { - let result: angular.IPromise<{a: number; b: string;}>; - result = $q.all<{a: number; b: string;}>({a: promiseAny, b: promiseAny}); + let result: angular.IPromise<{a: number; b: string; }>; + result = $q.all<{a: number; b: string; }>({a: promiseAny, b: promiseAny}); } - // $q.defer { let result: angular.IDeferred; @@ -397,11 +397,10 @@ namespace TestQ { } } - -var httpFoo: ng.IHttpPromise; +let httpFoo: ng.IHttpPromise; httpFoo.then((x) => { // When returning a promise the generic type must be inferred. - var innerPromise : ng.IPromise; + var innerPromise: ng.IPromise; return innerPromise; }).then((x) => { // must still be number. @@ -409,13 +408,12 @@ httpFoo.then((x) => { }); httpFoo.success((data, status, headers, config) => { - var h = headers("test"); + const h = headers('test'); h.charAt(0); - var hs = headers(); - hs["content-type"].charAt(1); + const hs = headers(); + hs['content-type'].charAt(1); }); - // Deferred signature tests namespace TestDeferred { var any: any; @@ -432,8 +430,8 @@ namespace TestDeferred { // deferred.resolve { let result: void; - result = deferred.resolve(); - result = deferred.resolve(tResult); + result = deferred.resolve() as void; + result = deferred.resolve(tResult) as void; } // deferred.reject @@ -458,7 +456,7 @@ namespace TestDeferred { } namespace TestInjector { - let $injector: angular.auto.IInjectorService; + var $injector: angular.auto.IInjectorService; $injector.strictDi = true; @@ -466,10 +464,9 @@ namespace TestInjector { $injector.annotate(() => {}, true); } - // Promise signature tests namespace TestPromise { - var result: any; + let result: any; var any: any; interface TResult { @@ -494,63 +491,61 @@ namespace TestPromise { var promise: angular.IPromise; // promise.then - result = >promise.then((result) => any); - result = >promise.then((result) => any, (any) => any); - result = >promise.then((result) => any, (any) => any, (any) => any); + result = promise.then((result) => any) as angular.IPromise; + result = promise.then((result) => any, (any) => any) as angular.IPromise; + result = promise.then((result) => any, (any) => any, (any) => any) as angular.IPromise; - result = >promise.then((result) => result); - result = >promise.then((result) => result, (any) => any); - result = >promise.then((result) => result, (any) => any, (any) => any); - result = >promise.then((result) => tresultPromise); - result = >promise.then((result) => tresultPromise, (any) => any); - result = >promise.then((result) => tresultPromise, (any) => any, (any) => any); - result = >>promise.then((result) => tresultHttpPromise); - result = >>promise.then((result) => tresultHttpPromise, (any) => any); - result = >>promise.then((result) => tresultHttpPromise, (any) => any, (any) => any); + result = promise.then((result) => result) as angular.IPromise; + result = promise.then((result) => result, (any) => any) as angular.IPromise; + result = promise.then((result) => result, (any) => any, (any) => any) as angular.IPromise; + result = promise.then((result) => tresultPromise) as angular.IPromise; + result = promise.then((result) => tresultPromise, (any) => any) as angular.IPromise; + result = promise.then((result) => tresultPromise, (any) => any, (any) => any) as angular.IPromise; + result = promise.then((result) => tresultHttpPromise) as angular.IPromise>; + result = promise.then((result) => tresultHttpPromise, (any) => any) as angular.IPromise>; + result = promise.then((result) => tresultHttpPromise, (any) => any, (any) => any) as angular.IPromise>; - result = >promise.then((result) => tother); - result = >promise.then((result) => tother, (any) => any); - result = >promise.then((result) => tother, (any) => any, (any) => any); - result = >promise.then((result) => totherPromise); - result = >promise.then((result) => totherPromise, (any) => any); - result = >promise.then((result) => totherPromise, (any) => any, (any) => any); - result = >>promise.then((result) => totherHttpPromise); - result = >>promise.then((result) => totherHttpPromise, (any) => any); - result = >>promise.then((result) => totherHttpPromise, (any) => any, (any) => any); + result = promise.then((result) => tother) as angular.IPromise; + result = promise.then((result) => tother, (any) => any) as angular.IPromise; + result = promise.then((result) => tother, (any) => any, (any) => any) as angular.IPromise; + result = promise.then((result) => totherPromise) as angular.IPromise; + result = promise.then((result) => totherPromise, (any) => any) as angular.IPromise; + result = promise.then((result) => totherPromise, (any) => any, (any) => any) as angular.IPromise; + result = promise.then((result) => totherHttpPromise) as angular.IPromise>; + result = promise.then((result) => totherHttpPromise, (any) => any) as angular.IPromise>; + result = promise.then((result) => totherHttpPromise, (any) => any, (any) => any) as angular.IPromise>; // promise.catch - result = >promise.catch((err) => any); - result = >promise.catch((err) => tresult); - result = >promise.catch((err) => tresultPromise); - result = >>promise.catch((err) => tresultHttpPromise); - result = >promise.catch((err) => tother); - result = >promise.catch((err) => totherPromise); - result = >>promise.catch((err) => totherHttpPromise); + result = promise.catch((err) => any) as angular.IPromise; + result = promise.catch((err) => tresult) as angular.IPromise; + result = promise.catch((err) => tresultPromise) as angular.IPromise; + result = promise.catch((err) => tresultHttpPromise) as angular.IPromise>; + result = promise.catch((err) => tother) as angular.IPromise; + result = promise.catch((err) => totherPromise) as angular.IPromise; + result = promise.catch((err) => totherHttpPromise) as angular.IPromise>; // promise.finally - result = >promise.finally(() => any); - result = >promise.finally(() => tresult); - result = >promise.finally(() => tother); + result = promise.finally(() => any) as angular.IPromise; + result = promise.finally(() => tresult) as angular.IPromise; + result = promise.finally(() => tother) as angular.IPromise; } - function test_angular_forEach() { - var values: { [key: string]: string } = { name: 'misko', gender: 'male' }; - var log: string[] = []; - angular.forEach(values, function (value, key) { + const values: { [key: string]: string } = { name: 'misko', gender: 'male' }; + const log: string[] = []; + angular.forEach(values, function(value, key) { this.push(key + ': ' + value); }, log); //expect(log).toEqual(['name: misko', 'gender: male']); } // angular.element() tests -var element = angular.element("div.myApp"); -var scope: ng.IScope = element.scope(); -var isolateScope: ng.IScope = element.isolateScope(); +let element = angular.element('div.myApp'); +let scope: ng.IScope = element.scope(); +let isolateScope: ng.IScope = element.isolateScope(); isolateScope = element.find('div.foo').isolateScope(); isolateScope = element.children().isolateScope(); - // $timeout signature tests namespace TestTimeout { interface TResult { @@ -590,25 +585,24 @@ namespace TestTimeout { } } - -function test_IAttributes(attributes: ng.IAttributes){ +function test_IAttributes(attributes: ng.IAttributes) { return attributes; } test_IAttributes({ - $normalize: function (classVal){ return "foo" }, - $addClass: function (classVal){}, - $removeClass: function(classVal){}, - $updateClass: function(newClass, oldClass){}, - $set: function(key, value){}, - $observe: function(name: any, fn: any){ + $normalize(classVal) { return 'foo'; }, + $addClass(classVal) {}, + $removeClass(classVal) {}, + $updateClass(newClass, oldClass) {}, + $set(key, value) {}, + $observe(name: any, fn: any) { return fn; }, $attr: {} }); class SampleDirective implements ng.IDirective { - public restrict = 'A'; + restrict = 'A'; name = 'doh'; compile(templateElement: ng.IAugmentedJQuery) { @@ -617,7 +611,7 @@ class SampleDirective implements ng.IDirective { }; } - static instance():ng.IDirective { + static instance(): ng.IDirective { return new SampleDirective(); } @@ -627,7 +621,7 @@ class SampleDirective implements ng.IDirective { } class SampleDirective2 implements ng.IDirective { - public restrict = 'EAC'; + restrict = 'EAC'; compile(templateElement: ng.IAugmentedJQuery) { return { @@ -635,7 +629,7 @@ class SampleDirective2 implements ng.IDirective { }; } - static instance():ng.IDirective { + static instance(): ng.IDirective { return new SampleDirective2(); } @@ -654,7 +648,7 @@ angular.module('AnotherSampleDirective', []).directive('myDirective', ['$interpo $interpolate('', true)(scope); $interpolate('', true, 'html')(scope); $interpolate('', true, 'html', true)(scope); - var defer = $q.defer(); + const defer = $q.defer(); defer.reject(); defer.resolve(); defer.promise.then(function(d) { @@ -670,7 +664,7 @@ angular.module('AnotherSampleDirective', []).directive('myDirective', ['$interpo .finally((): any => { return null; }); - var promise = new $q((resolve) => { + let promise = new $q((resolve) => { resolve(); }); @@ -785,25 +779,25 @@ angular.module('docsTimeDirective', []) .directive('myCurrentTime', ['$interval', 'dateFilter', function($interval: any, dateFilter: any) { return { - link: function(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs:ng.IAttributes) { - var format: any, + link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes) { + let format: any, timeoutId: any; function updateTime() { element.text(dateFilter(new Date(), format)); } - scope.$watch(attrs['myCurrentTime'], function (value: any) { + scope.$watch(attrs['myCurrentTime'], function(value: any) { format = value; updateTime(); }); - element.on('$destroy', function () { + element.on('$destroy', function() { $interval.cancel(timeoutId); }); // start the UI update process; save the timeoutId for canceling - timeoutId = $interval(function () { + timeoutId = $interval(function() { updateTime(); // update DOM }, 1000); } @@ -832,19 +826,18 @@ angular.module('docsTransclusionExample', []) transclude: true, scope: {}, templateUrl: 'my-dialog.html', - link: function (scope: ng.IScope, element: ng.IAugmentedJQuery) { + link(scope: ng.IScope, element: ng.IAugmentedJQuery) { scope['name'] = 'Jeff'; } }; }); - angular.module('docsIsoFnBindExample', []) .controller('Controller', ['$scope', '$timeout', function($scope: any, $timeout: any) { $scope.name = 'Tobias'; - $scope.hideDialog = function () { + $scope.hideDialog = function() { $scope.dialogIsHidden = true; - $timeout(function () { + $timeout(function() { $scope.dialogIsHidden = false; }, 2000); }; @@ -854,7 +847,7 @@ angular.module('docsIsoFnBindExample', []) restrict: 'E', transclude: true, scope: { - 'close': '&onClose' + close: '&onClose' }, templateUrl: 'my-dialog-close.html' }; @@ -863,7 +856,7 @@ angular.module('docsIsoFnBindExample', []) angular.module('dragModule', []) .directive('myDraggable', ['$document', function($document: any) { return function(scope: any, element: any, attr: any) { - var startX = 0, startY = 0, x = 0, y = 0; + let startX = 0, startY = 0, x = 0, y = 0; element.css({ position: 'relative', @@ -903,8 +896,8 @@ angular.module('docsTabsExample', []) restrict: 'E', transclude: true, scope: {}, - controller: function($scope: ng.IScope) { - var panes: any = $scope['panes'] = []; + controller($scope: ng.IScope) { + const panes: any = $scope['panes'] = []; $scope['select'] = function(pane: any) { angular.forEach(panes, function(pane: any) { @@ -931,7 +924,7 @@ angular.module('docsTabsExample', []) scope: { title: '@' }, - link: function(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, tabsCtrl: any) { + link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, tabsCtrl: any) { tabsCtrl.addPane(scope); }, templateUrl: 'my-pane.html' @@ -945,7 +938,7 @@ angular.module('multiSlotTranscludeExample', []) button: 'button', list: 'ul', }, - link: function(scope, element, attrs, ctrl, transclude) { + link(scope, element, attrs, ctrl, transclude) { // without scope transclude().appendTo(element); transclude(clone => clone.appendTo(element)); @@ -960,52 +953,52 @@ angular.module('multiSlotTranscludeExample', []) angular.module('componentExample', []) .component('counter', { - require: {'ctrl': '^ctrl'}, + require: {ctrl: '^ctrl'}, bindings: { count: '=' }, controller: 'CounterCtrl', controllerAs: 'counterCtrl', - template: function () { + template() { return ''; }, transclude: { - 'el': 'target' + el: 'target' } }) .component('anotherCounter', { - controller: function(){}, + controller() {}, require: { - 'parent': '^parentCtrl' + parent: '^parentCtrl' }, template: '', transclude: true }); -interface copyExampleUser { +interface ICopyExampleUser { name?: string; email?: string; gender?: string; } -interface copyExampleScope { +interface ICopyExampleScope { - user: copyExampleUser; - master: copyExampleUser; - update: (copyExampleUser: copyExampleUser) => any; + user: ICopyExampleUser; + master: ICopyExampleUser; + update: (copyExampleUser: ICopyExampleUser) => any; reset: () => any; } angular.module('copyExample', []) - .controller('ExampleController', ['$scope', function ($scope: copyExampleScope) { + .controller('ExampleController', ['$scope', function($scope: ICopyExampleScope) { $scope.master = { }; - $scope.update = function (user) { + $scope.update = function(user) { // Example with 1 argument $scope.master = angular.copy(user); }; - $scope.reset = function () { + $scope.reset = function() { // Example with 2 arguments angular.copy($scope.master, $scope.user); }; @@ -1022,9 +1015,14 @@ namespace locationTests { */ // given url http://example.com/#/some/path?foo=bar&baz=xoxo - var searchObject = $location.search(); + const searchObject = $location.search(); // => {foo: 'bar', baz: 'xoxo'} + function assert(condition: boolean) { + if (!condition) { + throw new Error(); + } + } // set foo to 'yipee' $location.search('foo', 'yipee'); @@ -1041,29 +1039,29 @@ namespace locationTests { // in browser with HTML5 history support: // open http://example.com/#!/a -> rewrite to http://example.com/a // (replacing the http://example.com/#!/a history record) - $location.path() == '/a' + assert($location.path() === '/a'); $location.path('/foo'); - $location.absUrl() == 'http://example.com/foo' + assert($location.absUrl() === 'http://example.com/foo'); - $location.search() == {} + assert($location.search() === {}); $location.search({ a: 'b', c: true }); - $location.absUrl() == 'http://example.com/foo?a=b&c' + assert($location.absUrl() === 'http://example.com/foo?a=b&c'); $location.path('/new').search('x=y'); - $location.url() == 'new?x=y' - $location.absUrl() == 'http://example.com/new?x=y' + assert($location.url() === 'new?x=y'); + assert($location.absUrl() === 'http://example.com/new?x=y'); // in browser without html5 history support: // open http://example.com/new?x=y -> redirect to http://example.com/#!/new?x=y // (again replacing the http://example.com/new?x=y history item) - $location.path() == '/new' - $location.search() == { x: 'y' } + assert($location.path() === '/new'); + assert($location.search() === { x: 'y' }); $location.path('/foo/bar'); - $location.path() == '/foo/bar' - $location.url() == '/foo/bar?x=y' - $location.absUrl() == 'http://example.com/#!/foo/bar?x=y' + assert($location.path() === '/foo/bar'); + assert($location.url() === '/foo/bar?x=y'); + assert($location.absUrl() === 'http://example.com/#!/foo/bar?x=y'); } // NgModelController @@ -1074,7 +1072,7 @@ function NgModelControllerTyping() { // See https://docs.angularjs.org/api/ng/type/ngModel.NgModelController#$validators ngModel.$validators['validCharacters'] = function(modelValue, viewValue) { - var value = modelValue || viewValue; + const value = modelValue || viewValue; return /[0-9]+/.test(value) && /[a-z]+/.test(value) && /[A-Z]+/.test(value) && @@ -1082,7 +1080,7 @@ function NgModelControllerTyping() { }; ngModel.$asyncValidators['uniqueUsername'] = function(modelValue, viewValue) { - var value = modelValue || viewValue; + const value = modelValue || viewValue; return $http.get('/api/users/' + value). then(function resolved() { return $q.reject('exists'); @@ -1092,67 +1090,67 @@ function NgModelControllerTyping() { }; } -var $filter: angular.IFilterService; +let $filter: angular.IFilterService; function testFilter() { var items: string[]; - $filter("filter")(items, "test"); - $filter("filter")(items, {name: "test"}); - $filter("filter")(items, (val, index, array) => { + $filter('filter')(items, 'test'); + $filter('filter')(items, {name: 'test'}); + $filter('filter')(items, (val, index, array) => { return true; }); - $filter("filter")(items, (val, index, array) => { + $filter('filter')(items, (val, index, array) => { return true; }, (actual, expected) => { - return actual == expected; + return actual === expected; }); } function testCurrency() { - $filter("currency")(126); - $filter("currency")(126, "$", 2); + $filter('currency')(126); + $filter('currency')(126, '$', 2); } function testNumber() { - $filter("number")(167); - $filter("number")(167, 2); + $filter('number')(167); + $filter('number')(167, 2); } function testDate() { - $filter("date")(new Date()); - $filter("date")(new Date(), 'yyyyMMdd'); - $filter("date")(new Date(), 'yyyyMMdd', '+0430'); + $filter('date')(new Date()); + $filter('date')(new Date(), 'yyyyMMdd'); + $filter('date')(new Date(), 'yyyyMMdd', '+0430'); } function testJson() { - var json: string = $filter("json")({test:true}, 2); + const json: string = $filter('json')({test: true}, 2); } function testLowercase() { - var lower: string = $filter("lowercase")('test'); + const lower: string = $filter('lowercase')('test'); } function testUppercase() { - var lower: string = $filter("uppercase")('test'); + const lower: string = $filter('uppercase')('test'); } function testLimitTo() { - var limitTo = $filter("limitTo"); - var filtered: number[] = $filter("limitTo")([1,2,3], 5); - filtered = $filter("limitTo")([1,2,3], 5, 2); + const limitTo = $filter('limitTo'); + let filtered: number[] = $filter('limitTo')([1, 2, 3], 5); + filtered = $filter('limitTo')([1, 2, 3], 5, 2); - var filteredString: string = $filter("limitTo")("124", 4); - filteredString = $filter("limitTo")(124, 4); + let filteredString: string = $filter('limitTo')('124', 4); + filteredString = $filter('limitTo')(124, 4); } function testOrderBy() { - var filtered: number[] = $filter("orderBy")([1,2,3], "test"); - filtered = $filter("orderBy")([1,2,3], "test", true); - filtered = $filter("orderBy")([1,2,3], ['prop1', 'prop2']); - filtered = $filter("orderBy")([1,2,3], (val: number) => 1); - var filtered2: string[] = $filter("orderBy")(["1","2","3"], (val: string) => 1); - filtered2 = $filter("orderBy")(["1","2","3"], [ + let filtered: number[] = $filter('orderBy')([1, 2, 3], 'test'); + filtered = $filter('orderBy')([1, 2, 3], 'test', true); + filtered = $filter('orderBy')([1, 2, 3], ['prop1', 'prop2']); + filtered = $filter('orderBy')([1, 2, 3], (val: number) => 1); + let filtered2: string[] = $filter('orderBy')(['1', '2', '3'], (val: string) => 1); + filtered2 = $filter('orderBy')(['1', '2', '3'], [ (val: string) => 1, (val: string) => 2 ]); @@ -1160,28 +1158,26 @@ function testOrderBy() { function testDynamicFilter() { // Test with separate variables - var dateFilter = $filter("date"); - var myDate = new Date(); - dateFilter(myDate , "EEE, MMM d"); + const dateFilter = $filter('date'); + const myDate = new Date(); + dateFilter(myDate , 'EEE, MMM d'); // Test with dynamic name - var filterName = 'date'; - var dynDateFilter = $filter(filterName); + const filterName = 'date'; + const dynDateFilter = $filter(filterName); dynDateFilter(new Date()); } -interface MyCustomFilter { - (value: string): string; -} +type MyCustomFilter = (value: string) => string; function testCustomFilter() { - var filterCustom = $filter('custom'); - var filtered: string = filterCustom("test"); + const filterCustom = $filter('custom'); + const filtered: string = filterCustom('test'); } function parseTyping() { var $parse: angular.IParseService; - var compiledExp = $parse('a.b.c'); + const compiledExp = $parse('a.b.c'); if (compiledExp.constant) { return compiledExp({}); } else if (compiledExp.literal) { @@ -1191,8 +1187,8 @@ function parseTyping() { function parseWithParams() { var $parse: angular.IParseService; - var compiledExp = $parse('a.b.c', () => null); - var compiledExp = $parse('a.b.c', null, false); + const compiledExp1 = $parse('a.b.c', () => null); + const compiledExp2 = $parse('a.b.c', null, false); } function doBootstrap(element: Element | JQuery, mode: string): ng.auto.IInjectorService { @@ -1211,8 +1207,8 @@ function doBootstrap(element: Element | JQuery, mode: string): ng.auto.IInjector } function testIHttpParamSerializerJQLikeProvider() { - let serializer: angular.IHttpParamSerializer; + var serializer: angular.IHttpParamSerializer; serializer({ - a: "b" + a: 'b' }); } diff --git a/angular/index.d.ts b/angular/index.d.ts index f3f9fc87a6..3f094f3185 100644 --- a/angular/index.d.ts +++ b/angular/index.d.ts @@ -27,7 +27,7 @@ import ng = angular; /////////////////////////////////////////////////////////////////////////////// declare namespace angular { - type Injectable = T | (string | T)[]; + type Injectable = T | Array; // not directly implemented, but ensures that constructed class implements $get interface IServiceProviderClass { @@ -64,7 +64,7 @@ declare namespace angular { * @param config an object for defining configuration options for the application. The following keys are supported: * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: string|Element|JQuery|Document, modules?: (string|Function|any[])[], config?: IAngularBootstrapConfig): auto.IInjectorService; + bootstrap(element: string|Element|JQuery|Document, modules?: Array, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Creates a deep copy of source, which should be an object or an array. @@ -122,7 +122,7 @@ declare namespace angular { fromJson(json: string): any; identity(arg?: T): T; injector(modules?: any[], strictDi?: boolean): auto.IInjectorService; - isArray(value: any): value is Array; + isArray(value: any): value is any[]; isDate(value: any): value is Date; isDefined(value: any): boolean; isElement(value: any): boolean; @@ -514,7 +514,7 @@ declare namespace angular { $watchCollection(watchExpression: (scope: IScope) => T, listener: (newValue: T, oldValue: T, scope: IScope) => any): () => void; $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; - $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; + $watchGroup(watchExpressions: Array<{ (scope: IScope): any }>, listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; $parent: IScope; $root: IRootScopeService; @@ -662,9 +662,9 @@ declare namespace angular { } interface IFilterOrderByItem { - value: any, - type: string, - index: any + value: any; + type: string; + index: any; } interface IFilterOrderByComparatorFunc { @@ -756,7 +756,7 @@ declare namespace angular { * @param comparator Function used to determine the relative order of value pairs. * @return An array containing the items from the specified collection, ordered by a comparator function based on the values computed using the expression predicate. */ - (array: T[], expression: string|((value: T) => any)|(((value: T) => any)|string)[], reverse?: boolean, comparator?: IFilterOrderByComparatorFunc): T[]; + (array: T[], expression: string|((value: T) => any)|Array<((value: T) => any)|string>, reverse?: boolean, comparator?: IFilterOrderByComparatorFunc): T[]; } /** @@ -1023,7 +1023,7 @@ declare namespace angular { all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise ]): IPromise<[T1, T2, T3, T4]>; all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise]): IPromise<[T1, T2, T3]>; all(values: [T1 | IPromise, T2 | IPromise]): IPromise<[T1, T2]>; - all(promises: IPromise[]): IPromise; + all(promises: Array>): IPromise; /** * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. * @@ -1284,11 +1284,11 @@ declare namespace angular { } interface ITemplateLinkingFunctionOptions { - parentBoundTranscludeFn?: ITranscludeFunction, + parentBoundTranscludeFn?: ITranscludeFunction; transcludeControllers?: { [controller: string]: { instance: IController } - }, - futureParentElement?: JQuery + }; + futureParentElement?: JQuery; } /** @@ -1510,7 +1510,9 @@ declare namespace angular { (data: any, headersGetter: IHttpHeadersGetter, status: number): any; } - type HttpHeaderType = {[requestType: string]:string|((config:IRequestConfig) => string)}; + interface HttpHeaderType { + [requestType: string]: string|((config: IRequestConfig) => string); + } interface IHttpRequestConfigHeaders { [requestType: string]: any; @@ -1593,7 +1595,7 @@ declare namespace angular { * Register service factories (names or implementations) for interceptors which are called before and after * each request. */ - interceptors: (string | Injectable)[]; + interceptors: Array>; useApplyAsync(): boolean; useApplyAsync(value: boolean): IHttpProvider; @@ -1603,7 +1605,7 @@ declare namespace angular { * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. * otherwise, returns the current configured value. */ - useLegacyPromiseExtensions(value:boolean) : boolean | IHttpProvider; + useLegacyPromiseExtensions(value: boolean): boolean | IHttpProvider; } /////////////////////////////////////////////////////////////////////////// @@ -1687,16 +1689,15 @@ declare namespace angular { valueOf(value: any): any; } - /////////////////////////////////////////////////////////////////////////// // SCEDelegateProvider // see http://docs.angularjs.org/api/ng.$sceDelegateProvider /////////////////////////////////////////////////////////////////////////// interface ISCEDelegateProvider extends IServiceProvider { - resourceUrlBlacklist(blacklist: any[]): void; - resourceUrlWhitelist(whitelist: any[]): void; resourceUrlBlacklist(): any[]; + resourceUrlBlacklist(blacklist: any[]): void; resourceUrlWhitelist(): any[]; + resourceUrlWhitelist(whitelist: any[]): void; } /** @@ -1936,33 +1937,33 @@ declare namespace angular { annotate(fn: Function, strictDi?: boolean): string[]; annotate(inlineAnnotatedFunction: any[]): string[]; get(name: string, caller?: string): T; - get(name: '$anchorScroll'): IAnchorScrollService - get(name: '$cacheFactory'): ICacheFactoryService - get(name: '$compile'): ICompileService - get(name: '$controller'): IControllerService - get(name: '$document'): IDocumentService - get(name: '$exceptionHandler'): IExceptionHandlerService - get(name: '$filter'): IFilterService - get(name: '$http'): IHttpService - get(name: '$httpBackend'): IHttpBackendService - get(name: '$httpParamSerializer'): IHttpParamSerializer - get(name: '$httpParamSerializerJQLike'): IHttpParamSerializer - get(name: '$interpolate'): IInterpolateService - get(name: '$interval'): IIntervalService - get(name: '$locale'): ILocaleService - get(name: '$location'): ILocationService - get(name: '$log'): ILogService - get(name: '$parse'): IParseService - get(name: '$q'): IQService - get(name: '$rootElement'): IRootElementService - get(name: '$rootScope'): IRootScopeService - get(name: '$sce'): ISCEService - get(name: '$sceDelegate'): ISCEDelegateService - get(name: '$templateCache'): ITemplateCacheService - get(name: '$templateRequest'): ITemplateRequestService - get(name: '$timeout'): ITimeoutService - get(name: '$window'): IWindowService - get(name: '$xhrFactory'): IXhrFactory + get(name: '$anchorScroll'): IAnchorScrollService; + get(name: '$cacheFactory'): ICacheFactoryService; + get(name: '$compile'): ICompileService; + get(name: '$controller'): IControllerService; + get(name: '$document'): IDocumentService; + get(name: '$exceptionHandler'): IExceptionHandlerService; + get(name: '$filter'): IFilterService; + get(name: '$http'): IHttpService; + get(name: '$httpBackend'): IHttpBackendService; + get(name: '$httpParamSerializer'): IHttpParamSerializer; + get(name: '$httpParamSerializerJQLike'): IHttpParamSerializer; + get(name: '$interpolate'): IInterpolateService; + get(name: '$interval'): IIntervalService; + get(name: '$locale'): ILocaleService; + get(name: '$location'): ILocationService; + get(name: '$log'): ILogService; + get(name: '$parse'): IParseService; + get(name: '$q'): IQService; + get(name: '$rootElement'): IRootElementService; + get(name: '$rootScope'): IRootScopeService; + get(name: '$sce'): ISCEService; + get(name: '$sceDelegate'): ISCEDelegateService; + get(name: '$templateCache'): ITemplateCacheService; + get(name: '$templateRequest'): ITemplateRequestService; + get(name: '$timeout'): ITimeoutService; + get(name: '$window'): IWindowService; + get(name: '$xhrFactory'): IXhrFactory; has(name: string): boolean; instantiate(typeConstructor: Function, locals?: any): T; invoke(inlineAnnotatedFunction: any[]): any; diff --git a/angular/tslint.json b/angular/tslint.json new file mode 100644 index 0000000000..75f86620b4 --- /dev/null +++ b/angular/tslint.json @@ -0,0 +1,20 @@ +{ + "extends": "../tslint.json", + "rules": { + "class-name": true, + "curly": true, + "no-consecutive-blank-lines": true, + "no-shadowed-variable": true, + "quotemark": [true, "single"], + "align": true, + "callable-types": false, + "forbidden-types": false, + "indent": [true, "spaces"], + "interface-name": false, + "linebreak-style": [true, "LF"], + "no-empty-interface": false, + "unified-signatures": false, + "variable-name": [true, "check-format"], + "void-return": false + } +} From a5638e1ded48eb21b2f5273001de20411abc889e Mon Sep 17 00:00:00 2001 From: Jan Varwig Date: Fri, 27 Jan 2017 17:36:37 +0100 Subject: [PATCH 66/87] [react-datepicker] Fix callback signatures The signatures for onChange, onBlur, and onFocus were wrong. --- react-datepicker/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react-datepicker/index.d.ts b/react-datepicker/index.d.ts index aec8b61b72..3f10ad37ca 100644 --- a/react-datepicker/index.d.ts +++ b/react-datepicker/index.d.ts @@ -25,9 +25,9 @@ declare module "react-datepicker" { maxDate?: {}; minDate?: {}; name?: string; - onBlur?(handler: (e: any) => void): any; - onChange(handler: (date?: any, e?: any) => void): any; - onFocus?(handler: (e: any) => void): any; + onBlur?(e: any): void; + onChange(date?: any, e?: any): void; + onFocus?(e: any): void; peekNextMonth?: boolean; placeholderText?: string; popoverAttachment?: string; From 7c74f67ef7a3cf3fd10354b30bd1d448f8fad5f1 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 27 Jan 2017 17:21:50 +0000 Subject: [PATCH 67/87] added router?: InjectedRouter; to RouteComponentProps see https://github.com/ReactTraining/react-router/blob/master/CHANGES.md#v300-beta1 and https://github.com/ReactTraining/react-router/pull/3729 --- react-router/lib/Router.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/react-router/lib/Router.d.ts b/react-router/lib/Router.d.ts index a7dff58369..ccfc22979a 100644 --- a/react-router/lib/Router.d.ts +++ b/react-router/lib/Router.d.ts @@ -87,6 +87,7 @@ declare namespace Router { params?: P; route?: PlainRoute; routeParams?: R; + router?: InjectedRouter; routes?: PlainRoute[]; children?: React.ReactElement; } From 93b63ea6e9ed80dfc7b84a561bce5b6afdf59e5f Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 27 Jan 2017 17:24:51 +0000 Subject: [PATCH 68/87] Update to react-router 3.0.0 --- react-router/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-router/index.d.ts b/react-router/index.d.ts index b1a577c617..4e265ce99f 100644 --- a/react-router/index.d.ts +++ b/react-router/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for react-router 2.0 +// Type definitions for react-router 3.0 // Project: https://github.com/rackt/react-router -// Definitions by: Sergey Buturlakin , Yuichi Murata , Václav Ostrožlík , Nathan Brown , Alex Wendland , Kostya Esmukov +// Definitions by: Sergey Buturlakin , Yuichi Murata , Václav Ostrožlík , Nathan Brown , Alex Wendland , Kostya Esmukov , John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 From 2461ee114f7718677d6c369061e6ad946f517de2 Mon Sep 17 00:00:00 2001 From: Lukas Zech Date: Fri, 27 Jan 2017 18:29:09 +0100 Subject: [PATCH 69/87] Use PartialObject for object predicates in _.every, _.find and _.some (#13994) * Use PartialObject for object predicates * Add typescript version * Update lodash module generator and update modules to TypeScript 2.1 * Use Partial to define PartialObject, fix LodashStatic.find * Use PartialObject as predicate in lodash.filter * Add TS2.1 header to bookshelf, lodash-decorators, lodash-es, sequelize/v3, sequelize, sequelize-fixtures, and umzug --- bookshelf/index.d.ts | 1 + lodash-decorators/index.d.ts | 1 + lodash-es/index.d.ts | 1 + lodash.add/index.d.ts | 1 + lodash.after/index.d.ts | 1 + lodash.ary/index.d.ts | 1 + lodash.assign/index.d.ts | 1 + lodash.assignin/index.d.ts | 1 + lodash.assigninwith/index.d.ts | 1 + lodash.assignwith/index.d.ts | 1 + lodash.at/index.d.ts | 1 + lodash.attempt/index.d.ts | 1 + lodash.before/index.d.ts | 1 + lodash.bind/index.d.ts | 1 + lodash.bindall/index.d.ts | 1 + lodash.bindkey/index.d.ts | 1 + lodash.camelcase/index.d.ts | 1 + lodash.capitalize/index.d.ts | 1 + lodash.castarray/index.d.ts | 1 + lodash.ceil/index.d.ts | 1 + lodash.chunk/index.d.ts | 1 + lodash.clamp/index.d.ts | 1 + lodash.clone/index.d.ts | 1 + lodash.clonedeep/index.d.ts | 1 + lodash.clonedeepwith/index.d.ts | 1 + lodash.clonewith/index.d.ts | 1 + lodash.compact/index.d.ts | 1 + lodash.concat/index.d.ts | 1 + lodash.constant/index.d.ts | 1 + lodash.countby/index.d.ts | 1 + lodash.create/index.d.ts | 1 + lodash.curry/index.d.ts | 1 + lodash.curryright/index.d.ts | 1 + lodash.debounce/index.d.ts | 1 + lodash.deburr/index.d.ts | 1 + lodash.defaults/index.d.ts | 1 + lodash.defaultsdeep/index.d.ts | 1 + lodash.defer/index.d.ts | 1 + lodash.delay/index.d.ts | 1 + lodash.difference/index.d.ts | 1 + lodash.differenceby/index.d.ts | 1 + lodash.differencewith/index.d.ts | 1 + lodash.drop/index.d.ts | 1 + lodash.dropright/index.d.ts | 1 + lodash.droprightwhile/index.d.ts | 1 + lodash.dropwhile/index.d.ts | 1 + lodash.endswith/index.d.ts | 1 + lodash.eq/index.d.ts | 1 + lodash.escape/index.d.ts | 1 + lodash.escaperegexp/index.d.ts | 1 + lodash.every/index.d.ts | 1 + lodash.fill/index.d.ts | 1 + lodash.filter/index.d.ts | 1 + lodash.find/index.d.ts | 1 + lodash.findindex/index.d.ts | 1 + lodash.findkey/index.d.ts | 1 + lodash.findlast/index.d.ts | 1 + lodash.findlastindex/index.d.ts | 1 + lodash.findlastkey/index.d.ts | 1 + lodash.first/index.d.ts | 1 + lodash.flatmap/index.d.ts | 1 + lodash.flatten/index.d.ts | 1 + lodash.flattendeep/index.d.ts | 1 + lodash.flattendepth/index.d.ts | 1 + lodash.flip/index.d.ts | 1 + lodash.floor/index.d.ts | 1 + lodash.flow/index.d.ts | 1 + lodash.flowright/index.d.ts | 1 + lodash.foreach/index.d.ts | 1 + lodash.foreachright/index.d.ts | 1 + lodash.forin/index.d.ts | 1 + lodash.forinright/index.d.ts | 1 + lodash.forown/index.d.ts | 1 + lodash.forownright/index.d.ts | 1 + lodash.frompairs/index.d.ts | 1 + lodash.functions/index.d.ts | 1 + lodash.functionsin/index.d.ts | 1 + lodash.get/index.d.ts | 1 + lodash.groupby/index.d.ts | 1 + lodash.gt/index.d.ts | 1 + lodash.gte/index.d.ts | 1 + lodash.has/index.d.ts | 1 + lodash.hasin/index.d.ts | 1 + lodash.head/index.d.ts | 1 + lodash.identity/index.d.ts | 1 + lodash.includes/index.d.ts | 1 + lodash.indexof/index.d.ts | 1 + lodash.initial/index.d.ts | 1 + lodash.inrange/index.d.ts | 1 + lodash.intersection/index.d.ts | 1 + lodash.intersectionby/index.d.ts | 1 + lodash.intersectionwith/index.d.ts | 1 + lodash.invert/index.d.ts | 1 + lodash.invertby/index.d.ts | 1 + lodash.invoke/index.d.ts | 1 + lodash.invokemap/index.d.ts | 1 + lodash.isarguments/index.d.ts | 1 + lodash.isarray/index.d.ts | 1 + lodash.isarraybuffer/index.d.ts | 1 + lodash.isarraylike/index.d.ts | 1 + lodash.isarraylikeobject/index.d.ts | 1 + lodash.isboolean/index.d.ts | 1 + lodash.isbuffer/index.d.ts | 1 + lodash.isdate/index.d.ts | 1 + lodash.iselement/index.d.ts | 1 + lodash.isempty/index.d.ts | 1 + lodash.isequal/index.d.ts | 3 +- lodash.isequalwith/index.d.ts | 1 + lodash.iserror/index.d.ts | 1 + lodash.isfinite/index.d.ts | 1 + lodash.isfunction/index.d.ts | 1 + lodash.isinteger/index.d.ts | 1 + lodash.islength/index.d.ts | 1 + lodash.ismap/index.d.ts | 1 + lodash.ismatch/index.d.ts | 1 + lodash.ismatchwith/index.d.ts | 1 + lodash.isnan/index.d.ts | 1 + lodash.isnative/index.d.ts | 1 + lodash.isnil/index.d.ts | 1 + lodash.isnull/index.d.ts | 1 + lodash.isnumber/index.d.ts | 1 + lodash.isobject/index.d.ts | 1 + lodash.isobjectlike/index.d.ts | 1 + lodash.isplainobject/index.d.ts | 1 + lodash.isregexp/index.d.ts | 1 + lodash.issafeinteger/index.d.ts | 1 + lodash.isset/index.d.ts | 1 + lodash.isstring/index.d.ts | 1 + lodash.issymbol/index.d.ts | 1 + lodash.istypedarray/index.d.ts | 1 + lodash.isundefined/index.d.ts | 1 + lodash.isweakmap/index.d.ts | 1 + lodash.isweakset/index.d.ts | 1 + lodash.iteratee/index.d.ts | 1 + lodash.join/index.d.ts | 1 + lodash.kebabcase/index.d.ts | 1 + lodash.keyby/index.d.ts | 1 + lodash.keys/index.d.ts | 1 + lodash.keysin/index.d.ts | 1 + lodash.last/index.d.ts | 1 + lodash.lastindexof/index.d.ts | 1 + lodash.lowercase/index.d.ts | 1 + lodash.lowerfirst/index.d.ts | 1 + lodash.lt/index.d.ts | 1 + lodash.lte/index.d.ts | 1 + lodash.mapkeys/index.d.ts | 1 + lodash.mapvalues/index.d.ts | 1 + lodash.matches/index.d.ts | 1 + lodash.matchesproperty/index.d.ts | 1 + lodash.max/index.d.ts | 1 + lodash.maxby/index.d.ts | 1 + lodash.mean/index.d.ts | 1 + lodash.meanby/index.d.ts | 8 ++ lodash.meanby/tsconfig.json | 19 +++++ lodash.meanby/tslint.json | 3 + lodash.memoize/index.d.ts | 1 + lodash.merge/index.d.ts | 1 + lodash.mergewith/index.d.ts | 1 + lodash.method/index.d.ts | 1 + lodash.methodof/index.d.ts | 1 + lodash.min/index.d.ts | 1 + lodash.minby/index.d.ts | 1 + lodash.mixin/index.d.ts | 1 + lodash.negate/index.d.ts | 1 + lodash.noop/index.d.ts | 1 + lodash.now/index.d.ts | 1 + lodash.ntharg/index.d.ts | 1 + lodash.omit/index.d.ts | 1 + lodash.omitby/index.d.ts | 1 + lodash.once/index.d.ts | 1 + lodash.orderby/index.d.ts | 1 + lodash.over/index.d.ts | 1 + lodash.overargs/index.d.ts | 1 + lodash.overevery/index.d.ts | 1 + lodash.oversome/index.d.ts | 1 + lodash.pad/index.d.ts | 1 + lodash.padend/index.d.ts | 1 + lodash.padstart/index.d.ts | 1 + lodash.parseint/index.d.ts | 1 + lodash.partial/index.d.ts | 1 + lodash.partialright/index.d.ts | 1 + lodash.partition/index.d.ts | 1 + lodash.pick/index.d.ts | 1 + lodash.pickby/index.d.ts | 1 + lodash.property/index.d.ts | 1 + lodash.propertyof/index.d.ts | 1 + lodash.pull/index.d.ts | 1 + lodash.pullall/index.d.ts | 1 + lodash.pullallby/index.d.ts | 1 + lodash.pullat/index.d.ts | 1 + lodash.random/index.d.ts | 1 + lodash.range/index.d.ts | 1 + lodash.rangeright/index.d.ts | 1 + lodash.rearg/index.d.ts | 1 + lodash.reduce/index.d.ts | 1 + lodash.reduceright/index.d.ts | 1 + lodash.reject/index.d.ts | 1 + lodash.remove/index.d.ts | 1 + lodash.repeat/index.d.ts | 1 + lodash.replace/index.d.ts | 1 + lodash.rest/index.d.ts | 1 + lodash.result/index.d.ts | 1 + lodash.reverse/index.d.ts | 1 + lodash.round/index.d.ts | 1 + lodash.sample/index.d.ts | 1 + lodash.samplesize/index.d.ts | 1 + lodash.set/index.d.ts | 1 + lodash.setwith/index.d.ts | 1 + lodash.shuffle/index.d.ts | 1 + lodash.size/index.d.ts | 1 + lodash.slice/index.d.ts | 1 + lodash.snakecase/index.d.ts | 1 + lodash.some/index.d.ts | 1 + lodash.sortby/index.d.ts | 1 + lodash.sortedindex/index.d.ts | 1 + lodash.sortedindexby/index.d.ts | 1 + lodash.sortedindexof/index.d.ts | 1 + lodash.sortedlastindex/index.d.ts | 1 + lodash.sortedlastindexby/index.d.ts | 1 + lodash.sortedlastindexof/index.d.ts | 1 + lodash.sorteduniq/index.d.ts | 1 + lodash.sorteduniqby/index.d.ts | 1 + lodash.split/index.d.ts | 1 + lodash.spread/index.d.ts | 1 + lodash.startcase/index.d.ts | 1 + lodash.startswith/index.d.ts | 1 + lodash.subtract/index.d.ts | 1 + lodash.sum/index.d.ts | 1 + lodash.sumby/index.d.ts | 1 + lodash.tail/index.d.ts | 1 + lodash.take/index.d.ts | 1 + lodash.takeright/index.d.ts | 1 + lodash.takerightwhile/index.d.ts | 1 + lodash.takewhile/index.d.ts | 1 + lodash.template/index.d.ts | 1 + lodash.throttle/index.d.ts | 1 + lodash.times/index.d.ts | 1 + lodash.toarray/index.d.ts | 1 + lodash.tointeger/index.d.ts | 1 + lodash.tolength/index.d.ts | 1 + lodash.tolower/index.d.ts | 1 + lodash.tonumber/index.d.ts | 1 + lodash.topairs/index.d.ts | 1 + lodash.topairsin/index.d.ts | 1 + lodash.topath/index.d.ts | 1 + lodash.toplainobject/index.d.ts | 1 + lodash.tosafeinteger/index.d.ts | 1 + lodash.tostring/index.d.ts | 1 + lodash.toupper/index.d.ts | 1 + lodash.transform/index.d.ts | 1 + lodash.trim/index.d.ts | 1 + lodash.trimend/index.d.ts | 1 + lodash.trimstart/index.d.ts | 1 + lodash.truncate/index.d.ts | 1 + lodash.unary/index.d.ts | 1 + lodash.unescape/index.d.ts | 1 + lodash.union/index.d.ts | 1 + lodash.unionby/index.d.ts | 1 + lodash.unionwith/index.d.ts | 1 + lodash.uniq/index.d.ts | 1 + lodash.uniqby/index.d.ts | 1 + lodash.uniqueid/index.d.ts | 1 + lodash.uniqwith/index.d.ts | 1 + lodash.unset/index.d.ts | 1 + lodash.unzip/index.d.ts | 1 + lodash.unzipwith/index.d.ts | 1 + lodash.update/index.d.ts | 1 + lodash.uppercase/index.d.ts | 1 + lodash.upperfirst/index.d.ts | 1 + lodash.values/index.d.ts | 1 + lodash.valuesin/index.d.ts | 1 + lodash.without/index.d.ts | 1 + lodash.words/index.d.ts | 1 + lodash.wrap/index.d.ts | 1 + lodash.xor/index.d.ts | 1 + lodash.xorby/index.d.ts | 1 + lodash.xorwith/index.d.ts | 1 + lodash.zip/index.d.ts | 1 + lodash.zipobject/index.d.ts | 1 + lodash.zipwith/index.d.ts | 1 + lodash/index.d.ts | 74 +++++++++-------- lodash/lodash-tests.ts | 92 ++++++++++----------- lodash/meanBy/index.d.ts | 5 +- lodash/scripts/generate-modules.ts | 119 ++++++++++++++++++++++++++-- lodash/scripts/tsconfig.json | 10 +++ sequelize-fixtures/index.d.ts | 1 + sequelize/index.d.ts | 1 + sequelize/v3/index.d.ts | 1 + umzug/index.d.ts | 1 + 289 files changed, 522 insertions(+), 91 deletions(-) create mode 100644 lodash.meanby/index.d.ts create mode 100644 lodash.meanby/tsconfig.json create mode 100644 lodash.meanby/tslint.json create mode 100644 lodash/scripts/tsconfig.json diff --git a/bookshelf/index.d.ts b/bookshelf/index.d.ts index 3895ef95a1..56472a3213 100644 --- a/bookshelf/index.d.ts +++ b/bookshelf/index.d.ts @@ -2,6 +2,7 @@ // Project: http://bookshelfjs.org/ // Definitions by: Andrew Schurman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import Knex = require('knex'); import knex = require('knex'); diff --git a/lodash-decorators/index.d.ts b/lodash-decorators/index.d.ts index 0e0b8d9e3c..eb05886150 100644 --- a/lodash-decorators/index.d.ts +++ b/lodash-decorators/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/steelsojka/lodash-decorators // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/lodash-es/index.d.ts b/lodash-es/index.d.ts index 71f98587ff..1c9e42c18e 100644 --- a/lodash-es/index.d.ts +++ b/lodash-es/index.d.ts @@ -2,3 +2,4 @@ // Project: http://lodash.com/ // Definitions by: Stephen Lautier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 \ No newline at end of file diff --git a/lodash.add/index.d.ts b/lodash.add/index.d.ts index 0a9aecd185..76c74086e3 100644 --- a/lodash.add/index.d.ts +++ b/lodash.add/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { add } from "lodash"; export = add; diff --git a/lodash.after/index.d.ts b/lodash.after/index.d.ts index 52f5efd8e1..7ba8e38a1a 100644 --- a/lodash.after/index.d.ts +++ b/lodash.after/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { after } from "lodash"; export = after; diff --git a/lodash.ary/index.d.ts b/lodash.ary/index.d.ts index d78cd0c60e..fe902df0d0 100644 --- a/lodash.ary/index.d.ts +++ b/lodash.ary/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { ary } from "lodash"; export = ary; diff --git a/lodash.assign/index.d.ts b/lodash.assign/index.d.ts index 0558933c3f..8da5d220bf 100644 --- a/lodash.assign/index.d.ts +++ b/lodash.assign/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { assign } from "lodash"; export = assign; diff --git a/lodash.assignin/index.d.ts b/lodash.assignin/index.d.ts index 7e8740aea3..50551ff9d7 100644 --- a/lodash.assignin/index.d.ts +++ b/lodash.assignin/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { assignIn } from "lodash"; export = assignIn; diff --git a/lodash.assigninwith/index.d.ts b/lodash.assigninwith/index.d.ts index 1e1e3189c1..76f3d2dede 100644 --- a/lodash.assigninwith/index.d.ts +++ b/lodash.assigninwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { assignInWith } from "lodash"; export = assignInWith; diff --git a/lodash.assignwith/index.d.ts b/lodash.assignwith/index.d.ts index 02e395824d..a01c36eb29 100644 --- a/lodash.assignwith/index.d.ts +++ b/lodash.assignwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { assignWith } from "lodash"; export = assignWith; diff --git a/lodash.at/index.d.ts b/lodash.at/index.d.ts index 7b237c170b..061d6040b8 100644 --- a/lodash.at/index.d.ts +++ b/lodash.at/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { at } from "lodash"; export = at; diff --git a/lodash.attempt/index.d.ts b/lodash.attempt/index.d.ts index a93d1efb06..52874b4372 100644 --- a/lodash.attempt/index.d.ts +++ b/lodash.attempt/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { attempt } from "lodash"; export = attempt; diff --git a/lodash.before/index.d.ts b/lodash.before/index.d.ts index 50456ca93b..3c211206c0 100644 --- a/lodash.before/index.d.ts +++ b/lodash.before/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { before } from "lodash"; export = before; diff --git a/lodash.bind/index.d.ts b/lodash.bind/index.d.ts index 2ace06a403..eda3868cae 100644 --- a/lodash.bind/index.d.ts +++ b/lodash.bind/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { bind } from "lodash"; export = bind; diff --git a/lodash.bindall/index.d.ts b/lodash.bindall/index.d.ts index 7d5b08e79e..9a80f928cc 100644 --- a/lodash.bindall/index.d.ts +++ b/lodash.bindall/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { bindAll } from "lodash"; export = bindAll; diff --git a/lodash.bindkey/index.d.ts b/lodash.bindkey/index.d.ts index 581f950cc1..a7ecab5dd1 100644 --- a/lodash.bindkey/index.d.ts +++ b/lodash.bindkey/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { bindKey } from "lodash"; export = bindKey; diff --git a/lodash.camelcase/index.d.ts b/lodash.camelcase/index.d.ts index 7e330178df..b489f3f7a5 100644 --- a/lodash.camelcase/index.d.ts +++ b/lodash.camelcase/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { camelCase } from "lodash"; export = camelCase; diff --git a/lodash.capitalize/index.d.ts b/lodash.capitalize/index.d.ts index 5cdfce9f64..06a3f72fd4 100644 --- a/lodash.capitalize/index.d.ts +++ b/lodash.capitalize/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { capitalize } from "lodash"; export = capitalize; diff --git a/lodash.castarray/index.d.ts b/lodash.castarray/index.d.ts index 468ae08464..2d77145a0c 100644 --- a/lodash.castarray/index.d.ts +++ b/lodash.castarray/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { castArray } from "lodash"; export = castArray; diff --git a/lodash.ceil/index.d.ts b/lodash.ceil/index.d.ts index 382e7c6452..4d91e60e65 100644 --- a/lodash.ceil/index.d.ts +++ b/lodash.ceil/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { ceil } from "lodash"; export = ceil; diff --git a/lodash.chunk/index.d.ts b/lodash.chunk/index.d.ts index 9fd9a55c59..ffd11b71b2 100644 --- a/lodash.chunk/index.d.ts +++ b/lodash.chunk/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { chunk } from "lodash"; export = chunk; diff --git a/lodash.clamp/index.d.ts b/lodash.clamp/index.d.ts index 58372494cd..0a28f04829 100644 --- a/lodash.clamp/index.d.ts +++ b/lodash.clamp/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { clamp } from "lodash"; export = clamp; diff --git a/lodash.clone/index.d.ts b/lodash.clone/index.d.ts index b9fa987104..a2d6e34490 100644 --- a/lodash.clone/index.d.ts +++ b/lodash.clone/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { clone } from "lodash"; export = clone; diff --git a/lodash.clonedeep/index.d.ts b/lodash.clonedeep/index.d.ts index 4bd178bff0..5e9382e296 100644 --- a/lodash.clonedeep/index.d.ts +++ b/lodash.clonedeep/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { cloneDeep } from "lodash"; export = cloneDeep; diff --git a/lodash.clonedeepwith/index.d.ts b/lodash.clonedeepwith/index.d.ts index e014c80686..80439cef54 100644 --- a/lodash.clonedeepwith/index.d.ts +++ b/lodash.clonedeepwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { cloneDeepWith } from "lodash"; export = cloneDeepWith; diff --git a/lodash.clonewith/index.d.ts b/lodash.clonewith/index.d.ts index cb29709538..bdaa109a3a 100644 --- a/lodash.clonewith/index.d.ts +++ b/lodash.clonewith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { cloneWith } from "lodash"; export = cloneWith; diff --git a/lodash.compact/index.d.ts b/lodash.compact/index.d.ts index d6dc0b2fb8..9af681aeb4 100644 --- a/lodash.compact/index.d.ts +++ b/lodash.compact/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { compact } from "lodash"; export = compact; diff --git a/lodash.concat/index.d.ts b/lodash.concat/index.d.ts index dd6f9bb6e2..692dfa5aab 100644 --- a/lodash.concat/index.d.ts +++ b/lodash.concat/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { concat } from "lodash"; export = concat; diff --git a/lodash.constant/index.d.ts b/lodash.constant/index.d.ts index 92fc209518..1b941af3ad 100644 --- a/lodash.constant/index.d.ts +++ b/lodash.constant/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { constant } from "lodash"; export = constant; diff --git a/lodash.countby/index.d.ts b/lodash.countby/index.d.ts index a3c6d24d93..03940a5e7d 100644 --- a/lodash.countby/index.d.ts +++ b/lodash.countby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { countBy } from "lodash"; export = countBy; diff --git a/lodash.create/index.d.ts b/lodash.create/index.d.ts index 5ca15075eb..e9d553be1c 100644 --- a/lodash.create/index.d.ts +++ b/lodash.create/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { create } from "lodash"; export = create; diff --git a/lodash.curry/index.d.ts b/lodash.curry/index.d.ts index 61f26316fd..a613fce91a 100644 --- a/lodash.curry/index.d.ts +++ b/lodash.curry/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { curry } from "lodash"; export = curry; diff --git a/lodash.curryright/index.d.ts b/lodash.curryright/index.d.ts index caf7dfcfe3..b16fdd5147 100644 --- a/lodash.curryright/index.d.ts +++ b/lodash.curryright/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { curryRight } from "lodash"; export = curryRight; diff --git a/lodash.debounce/index.d.ts b/lodash.debounce/index.d.ts index 2bef22974b..4e4e3aec55 100644 --- a/lodash.debounce/index.d.ts +++ b/lodash.debounce/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { debounce } from "lodash"; export = debounce; diff --git a/lodash.deburr/index.d.ts b/lodash.deburr/index.d.ts index 6f92fcbbd4..0caa30be24 100644 --- a/lodash.deburr/index.d.ts +++ b/lodash.deburr/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { deburr } from "lodash"; export = deburr; diff --git a/lodash.defaults/index.d.ts b/lodash.defaults/index.d.ts index 15c8e57184..6c0bb1b47b 100644 --- a/lodash.defaults/index.d.ts +++ b/lodash.defaults/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { defaults } from "lodash"; export = defaults; diff --git a/lodash.defaultsdeep/index.d.ts b/lodash.defaultsdeep/index.d.ts index 22cb0667a3..c552b805ff 100644 --- a/lodash.defaultsdeep/index.d.ts +++ b/lodash.defaultsdeep/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { defaultsDeep } from "lodash"; export = defaultsDeep; diff --git a/lodash.defer/index.d.ts b/lodash.defer/index.d.ts index ad67ed0c82..6c35dd7513 100644 --- a/lodash.defer/index.d.ts +++ b/lodash.defer/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { defer } from "lodash"; export = defer; diff --git a/lodash.delay/index.d.ts b/lodash.delay/index.d.ts index b65bd46abe..bb4922c81c 100644 --- a/lodash.delay/index.d.ts +++ b/lodash.delay/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { delay } from "lodash"; export = delay; diff --git a/lodash.difference/index.d.ts b/lodash.difference/index.d.ts index 38aa798be1..7ad8c6c414 100644 --- a/lodash.difference/index.d.ts +++ b/lodash.difference/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { difference } from "lodash"; export = difference; diff --git a/lodash.differenceby/index.d.ts b/lodash.differenceby/index.d.ts index 2d0c4859f0..50dfcd6a9c 100644 --- a/lodash.differenceby/index.d.ts +++ b/lodash.differenceby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { differenceBy } from "lodash"; export = differenceBy; diff --git a/lodash.differencewith/index.d.ts b/lodash.differencewith/index.d.ts index fff454ca64..9870768137 100644 --- a/lodash.differencewith/index.d.ts +++ b/lodash.differencewith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { differenceWith } from "lodash"; export = differenceWith; diff --git a/lodash.drop/index.d.ts b/lodash.drop/index.d.ts index 0605e176ec..f702675717 100644 --- a/lodash.drop/index.d.ts +++ b/lodash.drop/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { drop } from "lodash"; export = drop; diff --git a/lodash.dropright/index.d.ts b/lodash.dropright/index.d.ts index 1322022901..1385005315 100644 --- a/lodash.dropright/index.d.ts +++ b/lodash.dropright/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { dropRight } from "lodash"; export = dropRight; diff --git a/lodash.droprightwhile/index.d.ts b/lodash.droprightwhile/index.d.ts index b5fd1a75d2..02f5d13ac8 100644 --- a/lodash.droprightwhile/index.d.ts +++ b/lodash.droprightwhile/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { dropRightWhile } from "lodash"; export = dropRightWhile; diff --git a/lodash.dropwhile/index.d.ts b/lodash.dropwhile/index.d.ts index e24e46bccc..270e0d0189 100644 --- a/lodash.dropwhile/index.d.ts +++ b/lodash.dropwhile/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { dropWhile } from "lodash"; export = dropWhile; diff --git a/lodash.endswith/index.d.ts b/lodash.endswith/index.d.ts index 191301b21e..3a1c9b314e 100644 --- a/lodash.endswith/index.d.ts +++ b/lodash.endswith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { endsWith } from "lodash"; export = endsWith; diff --git a/lodash.eq/index.d.ts b/lodash.eq/index.d.ts index 87e927aa6d..8af8729bb4 100644 --- a/lodash.eq/index.d.ts +++ b/lodash.eq/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { eq } from "lodash"; export = eq; diff --git a/lodash.escape/index.d.ts b/lodash.escape/index.d.ts index 8e72963f22..a74f554830 100644 --- a/lodash.escape/index.d.ts +++ b/lodash.escape/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { escape } from "lodash"; export = escape; diff --git a/lodash.escaperegexp/index.d.ts b/lodash.escaperegexp/index.d.ts index 19eb0c6807..b80f492f70 100644 --- a/lodash.escaperegexp/index.d.ts +++ b/lodash.escaperegexp/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { escapeRegExp } from "lodash"; export = escapeRegExp; diff --git a/lodash.every/index.d.ts b/lodash.every/index.d.ts index a7ce29ad7a..84fd71115a 100644 --- a/lodash.every/index.d.ts +++ b/lodash.every/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { every } from "lodash"; export = every; diff --git a/lodash.fill/index.d.ts b/lodash.fill/index.d.ts index 1c8c619422..c2b785fbe5 100644 --- a/lodash.fill/index.d.ts +++ b/lodash.fill/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { fill } from "lodash"; export = fill; diff --git a/lodash.filter/index.d.ts b/lodash.filter/index.d.ts index 83dd5a1ddb..4960ebde70 100644 --- a/lodash.filter/index.d.ts +++ b/lodash.filter/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { filter } from "lodash"; export = filter; diff --git a/lodash.find/index.d.ts b/lodash.find/index.d.ts index eda8769f54..f1d736f0c0 100644 --- a/lodash.find/index.d.ts +++ b/lodash.find/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { find } from "lodash"; export = find; diff --git a/lodash.findindex/index.d.ts b/lodash.findindex/index.d.ts index bfb5034785..bc2fee9d18 100644 --- a/lodash.findindex/index.d.ts +++ b/lodash.findindex/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { findIndex } from "lodash"; export = findIndex; diff --git a/lodash.findkey/index.d.ts b/lodash.findkey/index.d.ts index bf5c2a357c..4bca193179 100644 --- a/lodash.findkey/index.d.ts +++ b/lodash.findkey/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { findKey } from "lodash"; export = findKey; diff --git a/lodash.findlast/index.d.ts b/lodash.findlast/index.d.ts index ad5f1d00f9..7ec89440be 100644 --- a/lodash.findlast/index.d.ts +++ b/lodash.findlast/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { findLast } from "lodash"; export = findLast; diff --git a/lodash.findlastindex/index.d.ts b/lodash.findlastindex/index.d.ts index 6e771c3842..37c0ba4567 100644 --- a/lodash.findlastindex/index.d.ts +++ b/lodash.findlastindex/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { findLastIndex } from "lodash"; export = findLastIndex; diff --git a/lodash.findlastkey/index.d.ts b/lodash.findlastkey/index.d.ts index ea09517b83..6e53f08733 100644 --- a/lodash.findlastkey/index.d.ts +++ b/lodash.findlastkey/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { findLastKey } from "lodash"; export = findLastKey; diff --git a/lodash.first/index.d.ts b/lodash.first/index.d.ts index b1e1b84a54..21b7337178 100644 --- a/lodash.first/index.d.ts +++ b/lodash.first/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { first } from "lodash"; export = first; diff --git a/lodash.flatmap/index.d.ts b/lodash.flatmap/index.d.ts index 26d291b7bc..075c3eba57 100644 --- a/lodash.flatmap/index.d.ts +++ b/lodash.flatmap/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { flatMap } from "lodash"; export = flatMap; diff --git a/lodash.flatten/index.d.ts b/lodash.flatten/index.d.ts index 4c3d68eb5e..b0247fd668 100644 --- a/lodash.flatten/index.d.ts +++ b/lodash.flatten/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { flatten } from "lodash"; export = flatten; diff --git a/lodash.flattendeep/index.d.ts b/lodash.flattendeep/index.d.ts index 4e6b573eae..b596ff5fad 100644 --- a/lodash.flattendeep/index.d.ts +++ b/lodash.flattendeep/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { flattenDeep } from "lodash"; export = flattenDeep; diff --git a/lodash.flattendepth/index.d.ts b/lodash.flattendepth/index.d.ts index 186641d1bc..d8df8b242b 100644 --- a/lodash.flattendepth/index.d.ts +++ b/lodash.flattendepth/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { flattenDepth } from "lodash"; export = flattenDepth; diff --git a/lodash.flip/index.d.ts b/lodash.flip/index.d.ts index d4a69991ab..a87354fe7d 100644 --- a/lodash.flip/index.d.ts +++ b/lodash.flip/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { flip } from "lodash"; export = flip; diff --git a/lodash.floor/index.d.ts b/lodash.floor/index.d.ts index 7e43e4335b..ca831b6e0f 100644 --- a/lodash.floor/index.d.ts +++ b/lodash.floor/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { floor } from "lodash"; export = floor; diff --git a/lodash.flow/index.d.ts b/lodash.flow/index.d.ts index 36be0e704f..d2bc98d1ab 100644 --- a/lodash.flow/index.d.ts +++ b/lodash.flow/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { flow } from "lodash"; export = flow; diff --git a/lodash.flowright/index.d.ts b/lodash.flowright/index.d.ts index 95189e5684..e1275db957 100644 --- a/lodash.flowright/index.d.ts +++ b/lodash.flowright/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { flowRight } from "lodash"; export = flowRight; diff --git a/lodash.foreach/index.d.ts b/lodash.foreach/index.d.ts index d2fd5757b4..9aec8eaf2b 100644 --- a/lodash.foreach/index.d.ts +++ b/lodash.foreach/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { forEach } from "lodash"; export = forEach; diff --git a/lodash.foreachright/index.d.ts b/lodash.foreachright/index.d.ts index cdd20d5fec..147f43d771 100644 --- a/lodash.foreachright/index.d.ts +++ b/lodash.foreachright/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { forEachRight } from "lodash"; export = forEachRight; diff --git a/lodash.forin/index.d.ts b/lodash.forin/index.d.ts index e95e69f8b4..af03a8a4e1 100644 --- a/lodash.forin/index.d.ts +++ b/lodash.forin/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { forIn } from "lodash"; export = forIn; diff --git a/lodash.forinright/index.d.ts b/lodash.forinright/index.d.ts index 160f182cf9..c79a18f746 100644 --- a/lodash.forinright/index.d.ts +++ b/lodash.forinright/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { forInRight } from "lodash"; export = forInRight; diff --git a/lodash.forown/index.d.ts b/lodash.forown/index.d.ts index 20ae037f37..32d2ac758d 100644 --- a/lodash.forown/index.d.ts +++ b/lodash.forown/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { forOwn } from "lodash"; export = forOwn; diff --git a/lodash.forownright/index.d.ts b/lodash.forownright/index.d.ts index 0736346722..1a2ff70788 100644 --- a/lodash.forownright/index.d.ts +++ b/lodash.forownright/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { forOwnRight } from "lodash"; export = forOwnRight; diff --git a/lodash.frompairs/index.d.ts b/lodash.frompairs/index.d.ts index db158444d5..b74020f99f 100644 --- a/lodash.frompairs/index.d.ts +++ b/lodash.frompairs/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { fromPairs } from "lodash"; export = fromPairs; diff --git a/lodash.functions/index.d.ts b/lodash.functions/index.d.ts index 03ca7febbb..865f3c0c1e 100644 --- a/lodash.functions/index.d.ts +++ b/lodash.functions/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { functions } from "lodash"; export = functions; diff --git a/lodash.functionsin/index.d.ts b/lodash.functionsin/index.d.ts index 93168e67a3..5bfc7a5ca2 100644 --- a/lodash.functionsin/index.d.ts +++ b/lodash.functionsin/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { functionsIn } from "lodash"; export = functionsIn; diff --git a/lodash.get/index.d.ts b/lodash.get/index.d.ts index 91e6b74e66..fd7d336a70 100644 --- a/lodash.get/index.d.ts +++ b/lodash.get/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { get } from "lodash"; export = get; diff --git a/lodash.groupby/index.d.ts b/lodash.groupby/index.d.ts index 06156f9b00..c55d2e3db7 100644 --- a/lodash.groupby/index.d.ts +++ b/lodash.groupby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { groupBy } from "lodash"; export = groupBy; diff --git a/lodash.gt/index.d.ts b/lodash.gt/index.d.ts index f541f408a8..cd5aa96019 100644 --- a/lodash.gt/index.d.ts +++ b/lodash.gt/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { gt } from "lodash"; export = gt; diff --git a/lodash.gte/index.d.ts b/lodash.gte/index.d.ts index 4041863b22..0e9eb62a7c 100644 --- a/lodash.gte/index.d.ts +++ b/lodash.gte/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { gte } from "lodash"; export = gte; diff --git a/lodash.has/index.d.ts b/lodash.has/index.d.ts index aaf4c27353..28ee7cd4e9 100644 --- a/lodash.has/index.d.ts +++ b/lodash.has/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { has } from "lodash"; export = has; diff --git a/lodash.hasin/index.d.ts b/lodash.hasin/index.d.ts index 53052f5cc3..09be59f7da 100644 --- a/lodash.hasin/index.d.ts +++ b/lodash.hasin/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { hasIn } from "lodash"; export = hasIn; diff --git a/lodash.head/index.d.ts b/lodash.head/index.d.ts index d2e3e06eac..0b3b6da94f 100644 --- a/lodash.head/index.d.ts +++ b/lodash.head/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { head } from "lodash"; export = head; diff --git a/lodash.identity/index.d.ts b/lodash.identity/index.d.ts index 810313857d..0e683ed1c4 100644 --- a/lodash.identity/index.d.ts +++ b/lodash.identity/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { identity } from "lodash"; export = identity; diff --git a/lodash.includes/index.d.ts b/lodash.includes/index.d.ts index dccbc5e3ee..ddb703d38d 100644 --- a/lodash.includes/index.d.ts +++ b/lodash.includes/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { includes } from "lodash"; export = includes; diff --git a/lodash.indexof/index.d.ts b/lodash.indexof/index.d.ts index 0551b9acc6..180fde9e2f 100644 --- a/lodash.indexof/index.d.ts +++ b/lodash.indexof/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { indexOf } from "lodash"; export = indexOf; diff --git a/lodash.initial/index.d.ts b/lodash.initial/index.d.ts index 303d425de1..40fec082f7 100644 --- a/lodash.initial/index.d.ts +++ b/lodash.initial/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { initial } from "lodash"; export = initial; diff --git a/lodash.inrange/index.d.ts b/lodash.inrange/index.d.ts index b65ff730db..8140966ac2 100644 --- a/lodash.inrange/index.d.ts +++ b/lodash.inrange/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { inRange } from "lodash"; export = inRange; diff --git a/lodash.intersection/index.d.ts b/lodash.intersection/index.d.ts index 8bc7dbde4f..149a324277 100644 --- a/lodash.intersection/index.d.ts +++ b/lodash.intersection/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { intersection } from "lodash"; export = intersection; diff --git a/lodash.intersectionby/index.d.ts b/lodash.intersectionby/index.d.ts index 74ae5d4dfc..81c206df48 100644 --- a/lodash.intersectionby/index.d.ts +++ b/lodash.intersectionby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { intersectionBy } from "lodash"; export = intersectionBy; diff --git a/lodash.intersectionwith/index.d.ts b/lodash.intersectionwith/index.d.ts index 73b816b192..e18b9d41ff 100644 --- a/lodash.intersectionwith/index.d.ts +++ b/lodash.intersectionwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { intersectionWith } from "lodash"; export = intersectionWith; diff --git a/lodash.invert/index.d.ts b/lodash.invert/index.d.ts index 99fdb04c76..25fe9ce360 100644 --- a/lodash.invert/index.d.ts +++ b/lodash.invert/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { invert } from "lodash"; export = invert; diff --git a/lodash.invertby/index.d.ts b/lodash.invertby/index.d.ts index c3959934a2..63e5c70405 100644 --- a/lodash.invertby/index.d.ts +++ b/lodash.invertby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { invertBy } from "lodash"; export = invertBy; diff --git a/lodash.invoke/index.d.ts b/lodash.invoke/index.d.ts index 7af1475a29..e16b07d462 100644 --- a/lodash.invoke/index.d.ts +++ b/lodash.invoke/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { invoke } from "lodash"; export = invoke; diff --git a/lodash.invokemap/index.d.ts b/lodash.invokemap/index.d.ts index 4995018391..1365a4f752 100644 --- a/lodash.invokemap/index.d.ts +++ b/lodash.invokemap/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { invokeMap } from "lodash"; export = invokeMap; diff --git a/lodash.isarguments/index.d.ts b/lodash.isarguments/index.d.ts index f46218acd9..7eb30e26dd 100644 --- a/lodash.isarguments/index.d.ts +++ b/lodash.isarguments/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isArguments } from "lodash"; export = isArguments; diff --git a/lodash.isarray/index.d.ts b/lodash.isarray/index.d.ts index a777294028..d4df88d8d7 100644 --- a/lodash.isarray/index.d.ts +++ b/lodash.isarray/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isArray } from "lodash"; export = isArray; diff --git a/lodash.isarraybuffer/index.d.ts b/lodash.isarraybuffer/index.d.ts index 827727c372..bb65311721 100644 --- a/lodash.isarraybuffer/index.d.ts +++ b/lodash.isarraybuffer/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isArrayBuffer } from "lodash"; export = isArrayBuffer; diff --git a/lodash.isarraylike/index.d.ts b/lodash.isarraylike/index.d.ts index 44e0da10d2..e722669eb4 100644 --- a/lodash.isarraylike/index.d.ts +++ b/lodash.isarraylike/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isArrayLike } from "lodash"; export = isArrayLike; diff --git a/lodash.isarraylikeobject/index.d.ts b/lodash.isarraylikeobject/index.d.ts index e5a2a5d847..8d094d8261 100644 --- a/lodash.isarraylikeobject/index.d.ts +++ b/lodash.isarraylikeobject/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isArrayLikeObject } from "lodash"; export = isArrayLikeObject; diff --git a/lodash.isboolean/index.d.ts b/lodash.isboolean/index.d.ts index 39ae1338ee..38bcb53406 100644 --- a/lodash.isboolean/index.d.ts +++ b/lodash.isboolean/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isBoolean } from "lodash"; export = isBoolean; diff --git a/lodash.isbuffer/index.d.ts b/lodash.isbuffer/index.d.ts index 985ce28952..0c9d922967 100644 --- a/lodash.isbuffer/index.d.ts +++ b/lodash.isbuffer/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isBuffer } from "lodash"; export = isBuffer; diff --git a/lodash.isdate/index.d.ts b/lodash.isdate/index.d.ts index 0c59a7a05f..bc61921489 100644 --- a/lodash.isdate/index.d.ts +++ b/lodash.isdate/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isDate } from "lodash"; export = isDate; diff --git a/lodash.iselement/index.d.ts b/lodash.iselement/index.d.ts index d4538e9e40..e059b8b1f5 100644 --- a/lodash.iselement/index.d.ts +++ b/lodash.iselement/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isElement } from "lodash"; export = isElement; diff --git a/lodash.isempty/index.d.ts b/lodash.isempty/index.d.ts index dc550a45a3..bff4c499aa 100644 --- a/lodash.isempty/index.d.ts +++ b/lodash.isempty/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isEmpty } from "lodash"; export = isEmpty; diff --git a/lodash.isequal/index.d.ts b/lodash.isequal/index.d.ts index b19d0c04d5..d06f5a2a2a 100644 --- a/lodash.isequal/index.d.ts +++ b/lodash.isequal/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for lodash.isEqual 4.4 +// Type definitions for lodash.isEqual 4.5 // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isEqual } from "lodash"; export = isEqual; diff --git a/lodash.isequalwith/index.d.ts b/lodash.isequalwith/index.d.ts index 1298491bd4..250895312b 100644 --- a/lodash.isequalwith/index.d.ts +++ b/lodash.isequalwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isEqualWith } from "lodash"; export = isEqualWith; diff --git a/lodash.iserror/index.d.ts b/lodash.iserror/index.d.ts index d12d1b7cce..42a2bc0923 100644 --- a/lodash.iserror/index.d.ts +++ b/lodash.iserror/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isError } from "lodash"; export = isError; diff --git a/lodash.isfinite/index.d.ts b/lodash.isfinite/index.d.ts index 8cd096692c..02a28fa204 100644 --- a/lodash.isfinite/index.d.ts +++ b/lodash.isfinite/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isFinite } from "lodash"; export = isFinite; diff --git a/lodash.isfunction/index.d.ts b/lodash.isfunction/index.d.ts index a2276e5633..3253939f6b 100644 --- a/lodash.isfunction/index.d.ts +++ b/lodash.isfunction/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isFunction } from "lodash"; export = isFunction; diff --git a/lodash.isinteger/index.d.ts b/lodash.isinteger/index.d.ts index f2d78c2b1f..7d604a19b6 100644 --- a/lodash.isinteger/index.d.ts +++ b/lodash.isinteger/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isInteger } from "lodash"; export = isInteger; diff --git a/lodash.islength/index.d.ts b/lodash.islength/index.d.ts index abcc89acda..6ed54652e5 100644 --- a/lodash.islength/index.d.ts +++ b/lodash.islength/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isLength } from "lodash"; export = isLength; diff --git a/lodash.ismap/index.d.ts b/lodash.ismap/index.d.ts index 62bde83057..1fc93f3462 100644 --- a/lodash.ismap/index.d.ts +++ b/lodash.ismap/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isMap } from "lodash"; export = isMap; diff --git a/lodash.ismatch/index.d.ts b/lodash.ismatch/index.d.ts index 617f6c9bda..3c8de854e8 100644 --- a/lodash.ismatch/index.d.ts +++ b/lodash.ismatch/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isMatch } from "lodash"; export = isMatch; diff --git a/lodash.ismatchwith/index.d.ts b/lodash.ismatchwith/index.d.ts index ed8ff1b11b..c69ae83ea6 100644 --- a/lodash.ismatchwith/index.d.ts +++ b/lodash.ismatchwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isMatchWith } from "lodash"; export = isMatchWith; diff --git a/lodash.isnan/index.d.ts b/lodash.isnan/index.d.ts index 029f8c6e9b..1d95ffe160 100644 --- a/lodash.isnan/index.d.ts +++ b/lodash.isnan/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isNaN } from "lodash"; export = isNaN; diff --git a/lodash.isnative/index.d.ts b/lodash.isnative/index.d.ts index 133f9cea47..29050811ef 100644 --- a/lodash.isnative/index.d.ts +++ b/lodash.isnative/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isNative } from "lodash"; export = isNative; diff --git a/lodash.isnil/index.d.ts b/lodash.isnil/index.d.ts index d3aaa388ee..5199f1657a 100644 --- a/lodash.isnil/index.d.ts +++ b/lodash.isnil/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isNil } from "lodash"; export = isNil; diff --git a/lodash.isnull/index.d.ts b/lodash.isnull/index.d.ts index 87a041d532..117b41f2e5 100644 --- a/lodash.isnull/index.d.ts +++ b/lodash.isnull/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isNull } from "lodash"; export = isNull; diff --git a/lodash.isnumber/index.d.ts b/lodash.isnumber/index.d.ts index 1f88c13582..70e51e9842 100644 --- a/lodash.isnumber/index.d.ts +++ b/lodash.isnumber/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isNumber } from "lodash"; export = isNumber; diff --git a/lodash.isobject/index.d.ts b/lodash.isobject/index.d.ts index 229357175a..6f79f888df 100644 --- a/lodash.isobject/index.d.ts +++ b/lodash.isobject/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isObject } from "lodash"; export = isObject; diff --git a/lodash.isobjectlike/index.d.ts b/lodash.isobjectlike/index.d.ts index 5c5c4bcdb3..8423f18a2a 100644 --- a/lodash.isobjectlike/index.d.ts +++ b/lodash.isobjectlike/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isObjectLike } from "lodash"; export = isObjectLike; diff --git a/lodash.isplainobject/index.d.ts b/lodash.isplainobject/index.d.ts index c5e4af82cd..33e85453d2 100644 --- a/lodash.isplainobject/index.d.ts +++ b/lodash.isplainobject/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isPlainObject } from "lodash"; export = isPlainObject; diff --git a/lodash.isregexp/index.d.ts b/lodash.isregexp/index.d.ts index bb6e4c182b..509c93a365 100644 --- a/lodash.isregexp/index.d.ts +++ b/lodash.isregexp/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isRegExp } from "lodash"; export = isRegExp; diff --git a/lodash.issafeinteger/index.d.ts b/lodash.issafeinteger/index.d.ts index 9c86763ba2..28fe1c868c 100644 --- a/lodash.issafeinteger/index.d.ts +++ b/lodash.issafeinteger/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isSafeInteger } from "lodash"; export = isSafeInteger; diff --git a/lodash.isset/index.d.ts b/lodash.isset/index.d.ts index eb77cabac8..67f643bb74 100644 --- a/lodash.isset/index.d.ts +++ b/lodash.isset/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isSet } from "lodash"; export = isSet; diff --git a/lodash.isstring/index.d.ts b/lodash.isstring/index.d.ts index 67ee27673d..42cca91fee 100644 --- a/lodash.isstring/index.d.ts +++ b/lodash.isstring/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isString } from "lodash"; export = isString; diff --git a/lodash.issymbol/index.d.ts b/lodash.issymbol/index.d.ts index d7be47d922..16468073cc 100644 --- a/lodash.issymbol/index.d.ts +++ b/lodash.issymbol/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isSymbol } from "lodash"; export = isSymbol; diff --git a/lodash.istypedarray/index.d.ts b/lodash.istypedarray/index.d.ts index 138f4baa08..e93a364295 100644 --- a/lodash.istypedarray/index.d.ts +++ b/lodash.istypedarray/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isTypedArray } from "lodash"; export = isTypedArray; diff --git a/lodash.isundefined/index.d.ts b/lodash.isundefined/index.d.ts index 2b112959c9..e9a3553600 100644 --- a/lodash.isundefined/index.d.ts +++ b/lodash.isundefined/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isUndefined } from "lodash"; export = isUndefined; diff --git a/lodash.isweakmap/index.d.ts b/lodash.isweakmap/index.d.ts index a6fbc47986..7e2be4cfb2 100644 --- a/lodash.isweakmap/index.d.ts +++ b/lodash.isweakmap/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isWeakMap } from "lodash"; export = isWeakMap; diff --git a/lodash.isweakset/index.d.ts b/lodash.isweakset/index.d.ts index d4b016f106..d7e1a801eb 100644 --- a/lodash.isweakset/index.d.ts +++ b/lodash.isweakset/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { isWeakSet } from "lodash"; export = isWeakSet; diff --git a/lodash.iteratee/index.d.ts b/lodash.iteratee/index.d.ts index 3e494ef2c8..7f6a197f12 100644 --- a/lodash.iteratee/index.d.ts +++ b/lodash.iteratee/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { iteratee } from "lodash"; export = iteratee; diff --git a/lodash.join/index.d.ts b/lodash.join/index.d.ts index 14f26d67ed..a8dd2622a1 100644 --- a/lodash.join/index.d.ts +++ b/lodash.join/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { join } from "lodash"; export = join; diff --git a/lodash.kebabcase/index.d.ts b/lodash.kebabcase/index.d.ts index 0851c7672a..00163a5a33 100644 --- a/lodash.kebabcase/index.d.ts +++ b/lodash.kebabcase/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { kebabCase } from "lodash"; export = kebabCase; diff --git a/lodash.keyby/index.d.ts b/lodash.keyby/index.d.ts index 51aac439ca..8b5700ad76 100644 --- a/lodash.keyby/index.d.ts +++ b/lodash.keyby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { keyBy } from "lodash"; export = keyBy; diff --git a/lodash.keys/index.d.ts b/lodash.keys/index.d.ts index b514c21483..d862fb0541 100644 --- a/lodash.keys/index.d.ts +++ b/lodash.keys/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { keys } from "lodash"; export = keys; diff --git a/lodash.keysin/index.d.ts b/lodash.keysin/index.d.ts index 66a18cdfa7..e15bece518 100644 --- a/lodash.keysin/index.d.ts +++ b/lodash.keysin/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { keysIn } from "lodash"; export = keysIn; diff --git a/lodash.last/index.d.ts b/lodash.last/index.d.ts index a06a998d86..29b4ce9c63 100644 --- a/lodash.last/index.d.ts +++ b/lodash.last/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { last } from "lodash"; export = last; diff --git a/lodash.lastindexof/index.d.ts b/lodash.lastindexof/index.d.ts index 5fccab48d0..a9459ada4d 100644 --- a/lodash.lastindexof/index.d.ts +++ b/lodash.lastindexof/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { lastIndexOf } from "lodash"; export = lastIndexOf; diff --git a/lodash.lowercase/index.d.ts b/lodash.lowercase/index.d.ts index 4232be29ad..b9505737bc 100644 --- a/lodash.lowercase/index.d.ts +++ b/lodash.lowercase/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { lowerCase } from "lodash"; export = lowerCase; diff --git a/lodash.lowerfirst/index.d.ts b/lodash.lowerfirst/index.d.ts index c5d0ea1ca6..424d02631b 100644 --- a/lodash.lowerfirst/index.d.ts +++ b/lodash.lowerfirst/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { lowerFirst } from "lodash"; export = lowerFirst; diff --git a/lodash.lt/index.d.ts b/lodash.lt/index.d.ts index 71cc6c1c00..5bad744986 100644 --- a/lodash.lt/index.d.ts +++ b/lodash.lt/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { lt } from "lodash"; export = lt; diff --git a/lodash.lte/index.d.ts b/lodash.lte/index.d.ts index 61ddce98b1..5299138c0f 100644 --- a/lodash.lte/index.d.ts +++ b/lodash.lte/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { lte } from "lodash"; export = lte; diff --git a/lodash.mapkeys/index.d.ts b/lodash.mapkeys/index.d.ts index c56b7647f5..bb32f2862f 100644 --- a/lodash.mapkeys/index.d.ts +++ b/lodash.mapkeys/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { mapKeys } from "lodash"; export = mapKeys; diff --git a/lodash.mapvalues/index.d.ts b/lodash.mapvalues/index.d.ts index 4507f9234e..db516f2de8 100644 --- a/lodash.mapvalues/index.d.ts +++ b/lodash.mapvalues/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { mapValues } from "lodash"; export = mapValues; diff --git a/lodash.matches/index.d.ts b/lodash.matches/index.d.ts index 9179ed074b..f80ba05944 100644 --- a/lodash.matches/index.d.ts +++ b/lodash.matches/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { matches } from "lodash"; export = matches; diff --git a/lodash.matchesproperty/index.d.ts b/lodash.matchesproperty/index.d.ts index afbb8dbfb3..e240a6ebad 100644 --- a/lodash.matchesproperty/index.d.ts +++ b/lodash.matchesproperty/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { matchesProperty } from "lodash"; export = matchesProperty; diff --git a/lodash.max/index.d.ts b/lodash.max/index.d.ts index 55167fee93..dc8297841f 100644 --- a/lodash.max/index.d.ts +++ b/lodash.max/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { max } from "lodash"; export = max; diff --git a/lodash.maxby/index.d.ts b/lodash.maxby/index.d.ts index 2513ce999f..47210f79a7 100644 --- a/lodash.maxby/index.d.ts +++ b/lodash.maxby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { maxBy } from "lodash"; export = maxBy; diff --git a/lodash.mean/index.d.ts b/lodash.mean/index.d.ts index bbf8183e23..dc839ace51 100644 --- a/lodash.mean/index.d.ts +++ b/lodash.mean/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { mean } from "lodash"; export = mean; diff --git a/lodash.meanby/index.d.ts b/lodash.meanby/index.d.ts new file mode 100644 index 0000000000..8973d40ded --- /dev/null +++ b/lodash.meanby/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for lodash.meanBy 4.10 +// Project: http://lodash.com/ +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { meanBy } from "lodash"; +export = meanBy; diff --git a/lodash.meanby/tsconfig.json b/lodash.meanby/tsconfig.json new file mode 100644 index 0000000000..5692e5627e --- /dev/null +++ b/lodash.meanby/tsconfig.json @@ -0,0 +1,19 @@ +{ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file diff --git a/lodash.meanby/tslint.json b/lodash.meanby/tslint.json new file mode 100644 index 0000000000..192203ab54 --- /dev/null +++ b/lodash.meanby/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file diff --git a/lodash.memoize/index.d.ts b/lodash.memoize/index.d.ts index 6a4c57a197..25002a9086 100644 --- a/lodash.memoize/index.d.ts +++ b/lodash.memoize/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { memoize } from "lodash"; export = memoize; diff --git a/lodash.merge/index.d.ts b/lodash.merge/index.d.ts index f4250afe0a..a5352b8cc9 100644 --- a/lodash.merge/index.d.ts +++ b/lodash.merge/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { merge } from "lodash"; export = merge; diff --git a/lodash.mergewith/index.d.ts b/lodash.mergewith/index.d.ts index d22369299e..85cad973d9 100644 --- a/lodash.mergewith/index.d.ts +++ b/lodash.mergewith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { mergeWith } from "lodash"; export = mergeWith; diff --git a/lodash.method/index.d.ts b/lodash.method/index.d.ts index d890f661e2..cee310ff55 100644 --- a/lodash.method/index.d.ts +++ b/lodash.method/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { method } from "lodash"; export = method; diff --git a/lodash.methodof/index.d.ts b/lodash.methodof/index.d.ts index b464af2fc4..5420de784a 100644 --- a/lodash.methodof/index.d.ts +++ b/lodash.methodof/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { methodOf } from "lodash"; export = methodOf; diff --git a/lodash.min/index.d.ts b/lodash.min/index.d.ts index 5f4dc842dd..87fccd9876 100644 --- a/lodash.min/index.d.ts +++ b/lodash.min/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { min } from "lodash"; export = min; diff --git a/lodash.minby/index.d.ts b/lodash.minby/index.d.ts index 95293a83bf..d46f507c70 100644 --- a/lodash.minby/index.d.ts +++ b/lodash.minby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { minBy } from "lodash"; export = minBy; diff --git a/lodash.mixin/index.d.ts b/lodash.mixin/index.d.ts index 78190227b1..8a4190762b 100644 --- a/lodash.mixin/index.d.ts +++ b/lodash.mixin/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { mixin } from "lodash"; export = mixin; diff --git a/lodash.negate/index.d.ts b/lodash.negate/index.d.ts index 48796a3750..a4c8b4b88e 100644 --- a/lodash.negate/index.d.ts +++ b/lodash.negate/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { negate } from "lodash"; export = negate; diff --git a/lodash.noop/index.d.ts b/lodash.noop/index.d.ts index 632d3d1292..04e6cacbb3 100644 --- a/lodash.noop/index.d.ts +++ b/lodash.noop/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { noop } from "lodash"; export = noop; diff --git a/lodash.now/index.d.ts b/lodash.now/index.d.ts index 80e893d018..ecda7f778d 100644 --- a/lodash.now/index.d.ts +++ b/lodash.now/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { now } from "lodash"; export = now; diff --git a/lodash.ntharg/index.d.ts b/lodash.ntharg/index.d.ts index 51eb387c96..0d35cb5772 100644 --- a/lodash.ntharg/index.d.ts +++ b/lodash.ntharg/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { nthArg } from "lodash"; export = nthArg; diff --git a/lodash.omit/index.d.ts b/lodash.omit/index.d.ts index b60f1d503b..491b505016 100644 --- a/lodash.omit/index.d.ts +++ b/lodash.omit/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { omit } from "lodash"; export = omit; diff --git a/lodash.omitby/index.d.ts b/lodash.omitby/index.d.ts index 82c8b6d063..fee479036b 100644 --- a/lodash.omitby/index.d.ts +++ b/lodash.omitby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { omitBy } from "lodash"; export = omitBy; diff --git a/lodash.once/index.d.ts b/lodash.once/index.d.ts index 3089544fe9..3f8622e6a0 100644 --- a/lodash.once/index.d.ts +++ b/lodash.once/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { once } from "lodash"; export = once; diff --git a/lodash.orderby/index.d.ts b/lodash.orderby/index.d.ts index e862a62e96..b348cefebc 100644 --- a/lodash.orderby/index.d.ts +++ b/lodash.orderby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { orderBy } from "lodash"; export = orderBy; diff --git a/lodash.over/index.d.ts b/lodash.over/index.d.ts index 1df6138a41..5715f0a46e 100644 --- a/lodash.over/index.d.ts +++ b/lodash.over/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { over } from "lodash"; export = over; diff --git a/lodash.overargs/index.d.ts b/lodash.overargs/index.d.ts index 1cd9c19126..576ab8588a 100644 --- a/lodash.overargs/index.d.ts +++ b/lodash.overargs/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { overArgs } from "lodash"; export = overArgs; diff --git a/lodash.overevery/index.d.ts b/lodash.overevery/index.d.ts index 2211dc569b..68d6cd3639 100644 --- a/lodash.overevery/index.d.ts +++ b/lodash.overevery/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { overEvery } from "lodash"; export = overEvery; diff --git a/lodash.oversome/index.d.ts b/lodash.oversome/index.d.ts index f8ec5329f6..4e4fe4eb5c 100644 --- a/lodash.oversome/index.d.ts +++ b/lodash.oversome/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { overSome } from "lodash"; export = overSome; diff --git a/lodash.pad/index.d.ts b/lodash.pad/index.d.ts index 06a7c7f5ac..259c312381 100644 --- a/lodash.pad/index.d.ts +++ b/lodash.pad/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { pad } from "lodash"; export = pad; diff --git a/lodash.padend/index.d.ts b/lodash.padend/index.d.ts index b42ad0ab11..825479dae8 100644 --- a/lodash.padend/index.d.ts +++ b/lodash.padend/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { padEnd } from "lodash"; export = padEnd; diff --git a/lodash.padstart/index.d.ts b/lodash.padstart/index.d.ts index b020c51ee5..b3607d61cc 100644 --- a/lodash.padstart/index.d.ts +++ b/lodash.padstart/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { padStart } from "lodash"; export = padStart; diff --git a/lodash.parseint/index.d.ts b/lodash.parseint/index.d.ts index cafd05c882..4724867112 100644 --- a/lodash.parseint/index.d.ts +++ b/lodash.parseint/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { parseInt } from "lodash"; export = parseInt; diff --git a/lodash.partial/index.d.ts b/lodash.partial/index.d.ts index 4d6dc3c303..8466a32963 100644 --- a/lodash.partial/index.d.ts +++ b/lodash.partial/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { partial } from "lodash"; export = partial; diff --git a/lodash.partialright/index.d.ts b/lodash.partialright/index.d.ts index d24675203d..5f9f7bef4d 100644 --- a/lodash.partialright/index.d.ts +++ b/lodash.partialright/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { partialRight } from "lodash"; export = partialRight; diff --git a/lodash.partition/index.d.ts b/lodash.partition/index.d.ts index c79c676a46..d481bae93b 100644 --- a/lodash.partition/index.d.ts +++ b/lodash.partition/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { partition } from "lodash"; export = partition; diff --git a/lodash.pick/index.d.ts b/lodash.pick/index.d.ts index 7fa2ef6e84..f27646190a 100644 --- a/lodash.pick/index.d.ts +++ b/lodash.pick/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { pick } from "lodash"; export = pick; diff --git a/lodash.pickby/index.d.ts b/lodash.pickby/index.d.ts index 2c72e96edd..0a77aaedc8 100644 --- a/lodash.pickby/index.d.ts +++ b/lodash.pickby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { pickBy } from "lodash"; export = pickBy; diff --git a/lodash.property/index.d.ts b/lodash.property/index.d.ts index e9ea2b894e..90e3eb20b3 100644 --- a/lodash.property/index.d.ts +++ b/lodash.property/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { property } from "lodash"; export = property; diff --git a/lodash.propertyof/index.d.ts b/lodash.propertyof/index.d.ts index d52d898afa..2db1d2461f 100644 --- a/lodash.propertyof/index.d.ts +++ b/lodash.propertyof/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { propertyOf } from "lodash"; export = propertyOf; diff --git a/lodash.pull/index.d.ts b/lodash.pull/index.d.ts index b60aec6f73..7232218789 100644 --- a/lodash.pull/index.d.ts +++ b/lodash.pull/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { pull } from "lodash"; export = pull; diff --git a/lodash.pullall/index.d.ts b/lodash.pullall/index.d.ts index 4c55d19fc0..9503a4c6e5 100644 --- a/lodash.pullall/index.d.ts +++ b/lodash.pullall/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { pullAll } from "lodash"; export = pullAll; diff --git a/lodash.pullallby/index.d.ts b/lodash.pullallby/index.d.ts index 18bc32f579..4f5c91696f 100644 --- a/lodash.pullallby/index.d.ts +++ b/lodash.pullallby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { pullAllBy } from "lodash"; export = pullAllBy; diff --git a/lodash.pullat/index.d.ts b/lodash.pullat/index.d.ts index 4a7c29cb90..2330713675 100644 --- a/lodash.pullat/index.d.ts +++ b/lodash.pullat/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { pullAt } from "lodash"; export = pullAt; diff --git a/lodash.random/index.d.ts b/lodash.random/index.d.ts index 018f4e1c99..87ba37f817 100644 --- a/lodash.random/index.d.ts +++ b/lodash.random/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { random } from "lodash"; export = random; diff --git a/lodash.range/index.d.ts b/lodash.range/index.d.ts index 289101b98a..6e9871a10a 100644 --- a/lodash.range/index.d.ts +++ b/lodash.range/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { range } from "lodash"; export = range; diff --git a/lodash.rangeright/index.d.ts b/lodash.rangeright/index.d.ts index 15d7f8be2b..b7fcfd8b34 100644 --- a/lodash.rangeright/index.d.ts +++ b/lodash.rangeright/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { rangeRight } from "lodash"; export = rangeRight; diff --git a/lodash.rearg/index.d.ts b/lodash.rearg/index.d.ts index 987565e162..8c6f912bcd 100644 --- a/lodash.rearg/index.d.ts +++ b/lodash.rearg/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { rearg } from "lodash"; export = rearg; diff --git a/lodash.reduce/index.d.ts b/lodash.reduce/index.d.ts index 44f4007e94..5ef634a93d 100644 --- a/lodash.reduce/index.d.ts +++ b/lodash.reduce/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { reduce } from "lodash"; export = reduce; diff --git a/lodash.reduceright/index.d.ts b/lodash.reduceright/index.d.ts index 3377523e1a..ee3e05ea62 100644 --- a/lodash.reduceright/index.d.ts +++ b/lodash.reduceright/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { reduceRight } from "lodash"; export = reduceRight; diff --git a/lodash.reject/index.d.ts b/lodash.reject/index.d.ts index f7e56a60bc..2a7a953403 100644 --- a/lodash.reject/index.d.ts +++ b/lodash.reject/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { reject } from "lodash"; export = reject; diff --git a/lodash.remove/index.d.ts b/lodash.remove/index.d.ts index b6b2871f51..cf3ecdb008 100644 --- a/lodash.remove/index.d.ts +++ b/lodash.remove/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { remove } from "lodash"; export = remove; diff --git a/lodash.repeat/index.d.ts b/lodash.repeat/index.d.ts index a0ab5e77f2..066a9f7741 100644 --- a/lodash.repeat/index.d.ts +++ b/lodash.repeat/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { repeat } from "lodash"; export = repeat; diff --git a/lodash.replace/index.d.ts b/lodash.replace/index.d.ts index d1dc58bad0..deaf6f5925 100644 --- a/lodash.replace/index.d.ts +++ b/lodash.replace/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { replace } from "lodash"; export = replace; diff --git a/lodash.rest/index.d.ts b/lodash.rest/index.d.ts index c8b2728ec5..12d89f07a4 100644 --- a/lodash.rest/index.d.ts +++ b/lodash.rest/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { rest } from "lodash"; export = rest; diff --git a/lodash.result/index.d.ts b/lodash.result/index.d.ts index 344d75766a..ca67b40446 100644 --- a/lodash.result/index.d.ts +++ b/lodash.result/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { result } from "lodash"; export = result; diff --git a/lodash.reverse/index.d.ts b/lodash.reverse/index.d.ts index 8da6b703f7..0486ee3715 100644 --- a/lodash.reverse/index.d.ts +++ b/lodash.reverse/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { reverse } from "lodash"; export = reverse; diff --git a/lodash.round/index.d.ts b/lodash.round/index.d.ts index 828aee5487..5eb7dddb09 100644 --- a/lodash.round/index.d.ts +++ b/lodash.round/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { round } from "lodash"; export = round; diff --git a/lodash.sample/index.d.ts b/lodash.sample/index.d.ts index 2fa651cce8..b5873086e2 100644 --- a/lodash.sample/index.d.ts +++ b/lodash.sample/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sample } from "lodash"; export = sample; diff --git a/lodash.samplesize/index.d.ts b/lodash.samplesize/index.d.ts index 5be09b8960..01a187726b 100644 --- a/lodash.samplesize/index.d.ts +++ b/lodash.samplesize/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sampleSize } from "lodash"; export = sampleSize; diff --git a/lodash.set/index.d.ts b/lodash.set/index.d.ts index 45c51f879a..f76b88790e 100644 --- a/lodash.set/index.d.ts +++ b/lodash.set/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { set } from "lodash"; export = set; diff --git a/lodash.setwith/index.d.ts b/lodash.setwith/index.d.ts index 8c41eb3be6..43502688be 100644 --- a/lodash.setwith/index.d.ts +++ b/lodash.setwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { setWith } from "lodash"; export = setWith; diff --git a/lodash.shuffle/index.d.ts b/lodash.shuffle/index.d.ts index 7b8e65fde0..1283f11844 100644 --- a/lodash.shuffle/index.d.ts +++ b/lodash.shuffle/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { shuffle } from "lodash"; export = shuffle; diff --git a/lodash.size/index.d.ts b/lodash.size/index.d.ts index 6e7201c394..e0aa69d12f 100644 --- a/lodash.size/index.d.ts +++ b/lodash.size/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { size } from "lodash"; export = size; diff --git a/lodash.slice/index.d.ts b/lodash.slice/index.d.ts index b9206644eb..2b53bb2386 100644 --- a/lodash.slice/index.d.ts +++ b/lodash.slice/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { slice } from "lodash"; export = slice; diff --git a/lodash.snakecase/index.d.ts b/lodash.snakecase/index.d.ts index 36fbaec580..db2758999b 100644 --- a/lodash.snakecase/index.d.ts +++ b/lodash.snakecase/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { snakeCase } from "lodash"; export = snakeCase; diff --git a/lodash.some/index.d.ts b/lodash.some/index.d.ts index e722a5ccae..3de45fa161 100644 --- a/lodash.some/index.d.ts +++ b/lodash.some/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { some } from "lodash"; export = some; diff --git a/lodash.sortby/index.d.ts b/lodash.sortby/index.d.ts index 028b50fa20..cc75aa6dca 100644 --- a/lodash.sortby/index.d.ts +++ b/lodash.sortby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sortBy } from "lodash"; export = sortBy; diff --git a/lodash.sortedindex/index.d.ts b/lodash.sortedindex/index.d.ts index 9c799fec11..ab6e8eca1f 100644 --- a/lodash.sortedindex/index.d.ts +++ b/lodash.sortedindex/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sortedIndex } from "lodash"; export = sortedIndex; diff --git a/lodash.sortedindexby/index.d.ts b/lodash.sortedindexby/index.d.ts index 73601c7b4d..1f5d0c15ac 100644 --- a/lodash.sortedindexby/index.d.ts +++ b/lodash.sortedindexby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sortedIndexBy } from "lodash"; export = sortedIndexBy; diff --git a/lodash.sortedindexof/index.d.ts b/lodash.sortedindexof/index.d.ts index 471e408bb9..814afd3e3c 100644 --- a/lodash.sortedindexof/index.d.ts +++ b/lodash.sortedindexof/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sortedIndexOf } from "lodash"; export = sortedIndexOf; diff --git a/lodash.sortedlastindex/index.d.ts b/lodash.sortedlastindex/index.d.ts index 95825a983a..5a1c0faa7d 100644 --- a/lodash.sortedlastindex/index.d.ts +++ b/lodash.sortedlastindex/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sortedLastIndex } from "lodash"; export = sortedLastIndex; diff --git a/lodash.sortedlastindexby/index.d.ts b/lodash.sortedlastindexby/index.d.ts index e5a167a17b..5b939599b2 100644 --- a/lodash.sortedlastindexby/index.d.ts +++ b/lodash.sortedlastindexby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sortedLastIndexBy } from "lodash"; export = sortedLastIndexBy; diff --git a/lodash.sortedlastindexof/index.d.ts b/lodash.sortedlastindexof/index.d.ts index c908ede67a..9817ef54f5 100644 --- a/lodash.sortedlastindexof/index.d.ts +++ b/lodash.sortedlastindexof/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sortedLastIndexOf } from "lodash"; export = sortedLastIndexOf; diff --git a/lodash.sorteduniq/index.d.ts b/lodash.sorteduniq/index.d.ts index c9ff4eb4e7..c8b8feea6f 100644 --- a/lodash.sorteduniq/index.d.ts +++ b/lodash.sorteduniq/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sortedUniq } from "lodash"; export = sortedUniq; diff --git a/lodash.sorteduniqby/index.d.ts b/lodash.sorteduniqby/index.d.ts index 295d3bcaf3..637895af43 100644 --- a/lodash.sorteduniqby/index.d.ts +++ b/lodash.sorteduniqby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sortedUniqBy } from "lodash"; export = sortedUniqBy; diff --git a/lodash.split/index.d.ts b/lodash.split/index.d.ts index 43c187c455..fd5a261917 100644 --- a/lodash.split/index.d.ts +++ b/lodash.split/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { split } from "lodash"; export = split; diff --git a/lodash.spread/index.d.ts b/lodash.spread/index.d.ts index adaec68385..7bbc4e9245 100644 --- a/lodash.spread/index.d.ts +++ b/lodash.spread/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { spread } from "lodash"; export = spread; diff --git a/lodash.startcase/index.d.ts b/lodash.startcase/index.d.ts index 9c550e4a0c..53798256bc 100644 --- a/lodash.startcase/index.d.ts +++ b/lodash.startcase/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { startCase } from "lodash"; export = startCase; diff --git a/lodash.startswith/index.d.ts b/lodash.startswith/index.d.ts index ebb4178ac5..84071e3d10 100644 --- a/lodash.startswith/index.d.ts +++ b/lodash.startswith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { startsWith } from "lodash"; export = startsWith; diff --git a/lodash.subtract/index.d.ts b/lodash.subtract/index.d.ts index 6d148eb796..0b57101cee 100644 --- a/lodash.subtract/index.d.ts +++ b/lodash.subtract/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { subtract } from "lodash"; export = subtract; diff --git a/lodash.sum/index.d.ts b/lodash.sum/index.d.ts index df4194246e..e6aaf24aee 100644 --- a/lodash.sum/index.d.ts +++ b/lodash.sum/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sum } from "lodash"; export = sum; diff --git a/lodash.sumby/index.d.ts b/lodash.sumby/index.d.ts index dad7e3dfa7..e1f21e1454 100644 --- a/lodash.sumby/index.d.ts +++ b/lodash.sumby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { sumBy } from "lodash"; export = sumBy; diff --git a/lodash.tail/index.d.ts b/lodash.tail/index.d.ts index 1edf5423c0..7543f1ae31 100644 --- a/lodash.tail/index.d.ts +++ b/lodash.tail/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { tail } from "lodash"; export = tail; diff --git a/lodash.take/index.d.ts b/lodash.take/index.d.ts index f477178ee3..688eaf7b8d 100644 --- a/lodash.take/index.d.ts +++ b/lodash.take/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { take } from "lodash"; export = take; diff --git a/lodash.takeright/index.d.ts b/lodash.takeright/index.d.ts index f44b5b7a99..9599696c72 100644 --- a/lodash.takeright/index.d.ts +++ b/lodash.takeright/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { takeRight } from "lodash"; export = takeRight; diff --git a/lodash.takerightwhile/index.d.ts b/lodash.takerightwhile/index.d.ts index 1940bdab6a..b0ccc8647f 100644 --- a/lodash.takerightwhile/index.d.ts +++ b/lodash.takerightwhile/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { takeRightWhile } from "lodash"; export = takeRightWhile; diff --git a/lodash.takewhile/index.d.ts b/lodash.takewhile/index.d.ts index b1c7464e21..8e557afdd4 100644 --- a/lodash.takewhile/index.d.ts +++ b/lodash.takewhile/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { takeWhile } from "lodash"; export = takeWhile; diff --git a/lodash.template/index.d.ts b/lodash.template/index.d.ts index af31692e84..a81b832990 100644 --- a/lodash.template/index.d.ts +++ b/lodash.template/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { template } from "lodash"; export = template; diff --git a/lodash.throttle/index.d.ts b/lodash.throttle/index.d.ts index ed74ec008b..0a2903b317 100644 --- a/lodash.throttle/index.d.ts +++ b/lodash.throttle/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { throttle } from "lodash"; export = throttle; diff --git a/lodash.times/index.d.ts b/lodash.times/index.d.ts index adabd498e2..f899aac24e 100644 --- a/lodash.times/index.d.ts +++ b/lodash.times/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { times } from "lodash"; export = times; diff --git a/lodash.toarray/index.d.ts b/lodash.toarray/index.d.ts index 42e878de35..f1cb6ecdea 100644 --- a/lodash.toarray/index.d.ts +++ b/lodash.toarray/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toArray } from "lodash"; export = toArray; diff --git a/lodash.tointeger/index.d.ts b/lodash.tointeger/index.d.ts index 19a97ef2fd..32f5bafbb7 100644 --- a/lodash.tointeger/index.d.ts +++ b/lodash.tointeger/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toInteger } from "lodash"; export = toInteger; diff --git a/lodash.tolength/index.d.ts b/lodash.tolength/index.d.ts index 1170461e93..0af29d75fd 100644 --- a/lodash.tolength/index.d.ts +++ b/lodash.tolength/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toLength } from "lodash"; export = toLength; diff --git a/lodash.tolower/index.d.ts b/lodash.tolower/index.d.ts index 1f350ff005..1403cc4cee 100644 --- a/lodash.tolower/index.d.ts +++ b/lodash.tolower/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toLower } from "lodash"; export = toLower; diff --git a/lodash.tonumber/index.d.ts b/lodash.tonumber/index.d.ts index fd6fe57a0b..aeacc96956 100644 --- a/lodash.tonumber/index.d.ts +++ b/lodash.tonumber/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toNumber } from "lodash"; export = toNumber; diff --git a/lodash.topairs/index.d.ts b/lodash.topairs/index.d.ts index 0623631aac..e5c92897ba 100644 --- a/lodash.topairs/index.d.ts +++ b/lodash.topairs/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toPairs } from "lodash"; export = toPairs; diff --git a/lodash.topairsin/index.d.ts b/lodash.topairsin/index.d.ts index 6da8aac997..c4980bf227 100644 --- a/lodash.topairsin/index.d.ts +++ b/lodash.topairsin/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toPairsIn } from "lodash"; export = toPairsIn; diff --git a/lodash.topath/index.d.ts b/lodash.topath/index.d.ts index ed9ce7c5a9..5647cbca88 100644 --- a/lodash.topath/index.d.ts +++ b/lodash.topath/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toPath } from "lodash"; export = toPath; diff --git a/lodash.toplainobject/index.d.ts b/lodash.toplainobject/index.d.ts index c1b5793d7d..27de1990bd 100644 --- a/lodash.toplainobject/index.d.ts +++ b/lodash.toplainobject/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toPlainObject } from "lodash"; export = toPlainObject; diff --git a/lodash.tosafeinteger/index.d.ts b/lodash.tosafeinteger/index.d.ts index b126b0188a..c8d7567a70 100644 --- a/lodash.tosafeinteger/index.d.ts +++ b/lodash.tosafeinteger/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toSafeInteger } from "lodash"; export = toSafeInteger; diff --git a/lodash.tostring/index.d.ts b/lodash.tostring/index.d.ts index bf9ed55be9..42f59393f1 100644 --- a/lodash.tostring/index.d.ts +++ b/lodash.tostring/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toString } from "lodash"; export = toString; diff --git a/lodash.toupper/index.d.ts b/lodash.toupper/index.d.ts index 9e26f50c2b..02bef92ae3 100644 --- a/lodash.toupper/index.d.ts +++ b/lodash.toupper/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { toUpper } from "lodash"; export = toUpper; diff --git a/lodash.transform/index.d.ts b/lodash.transform/index.d.ts index 78c4bfdb7c..ac5ee501cf 100644 --- a/lodash.transform/index.d.ts +++ b/lodash.transform/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { transform } from "lodash"; export = transform; diff --git a/lodash.trim/index.d.ts b/lodash.trim/index.d.ts index 4848a6ddbd..7aa6fcc4e6 100644 --- a/lodash.trim/index.d.ts +++ b/lodash.trim/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { trim } from "lodash"; export = trim; diff --git a/lodash.trimend/index.d.ts b/lodash.trimend/index.d.ts index 116f295b06..1e871b2126 100644 --- a/lodash.trimend/index.d.ts +++ b/lodash.trimend/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { trimEnd } from "lodash"; export = trimEnd; diff --git a/lodash.trimstart/index.d.ts b/lodash.trimstart/index.d.ts index 93df2c2483..c525bf5c8e 100644 --- a/lodash.trimstart/index.d.ts +++ b/lodash.trimstart/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { trimStart } from "lodash"; export = trimStart; diff --git a/lodash.truncate/index.d.ts b/lodash.truncate/index.d.ts index b658478894..cb421e8a26 100644 --- a/lodash.truncate/index.d.ts +++ b/lodash.truncate/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { truncate } from "lodash"; export = truncate; diff --git a/lodash.unary/index.d.ts b/lodash.unary/index.d.ts index 55c5e46f1d..12a281f507 100644 --- a/lodash.unary/index.d.ts +++ b/lodash.unary/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { unary } from "lodash"; export = unary; diff --git a/lodash.unescape/index.d.ts b/lodash.unescape/index.d.ts index c78fecec34..8340900768 100644 --- a/lodash.unescape/index.d.ts +++ b/lodash.unescape/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { unescape } from "lodash"; export = unescape; diff --git a/lodash.union/index.d.ts b/lodash.union/index.d.ts index 386967dec1..cddbaf12aa 100644 --- a/lodash.union/index.d.ts +++ b/lodash.union/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { union } from "lodash"; export = union; diff --git a/lodash.unionby/index.d.ts b/lodash.unionby/index.d.ts index dc0c0f1245..9c64ce9ed8 100644 --- a/lodash.unionby/index.d.ts +++ b/lodash.unionby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { unionBy } from "lodash"; export = unionBy; diff --git a/lodash.unionwith/index.d.ts b/lodash.unionwith/index.d.ts index da2cae278a..a3757085ba 100644 --- a/lodash.unionwith/index.d.ts +++ b/lodash.unionwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { unionWith } from "lodash"; export = unionWith; diff --git a/lodash.uniq/index.d.ts b/lodash.uniq/index.d.ts index 675b710028..a274db1b67 100644 --- a/lodash.uniq/index.d.ts +++ b/lodash.uniq/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { uniq } from "lodash"; export = uniq; diff --git a/lodash.uniqby/index.d.ts b/lodash.uniqby/index.d.ts index 0eedfb6d3f..c6dcd7c0c1 100644 --- a/lodash.uniqby/index.d.ts +++ b/lodash.uniqby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { uniqBy } from "lodash"; export = uniqBy; diff --git a/lodash.uniqueid/index.d.ts b/lodash.uniqueid/index.d.ts index abd2ebf55c..046d62d775 100644 --- a/lodash.uniqueid/index.d.ts +++ b/lodash.uniqueid/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { uniqueId } from "lodash"; export = uniqueId; diff --git a/lodash.uniqwith/index.d.ts b/lodash.uniqwith/index.d.ts index 6541b4ef03..515bcc2cba 100644 --- a/lodash.uniqwith/index.d.ts +++ b/lodash.uniqwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { uniqWith } from "lodash"; export = uniqWith; diff --git a/lodash.unset/index.d.ts b/lodash.unset/index.d.ts index dcf8e6881a..7662c3fd56 100644 --- a/lodash.unset/index.d.ts +++ b/lodash.unset/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { unset } from "lodash"; export = unset; diff --git a/lodash.unzip/index.d.ts b/lodash.unzip/index.d.ts index 6fe3ebc759..60adfd32e9 100644 --- a/lodash.unzip/index.d.ts +++ b/lodash.unzip/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { unzip } from "lodash"; export = unzip; diff --git a/lodash.unzipwith/index.d.ts b/lodash.unzipwith/index.d.ts index 64f86e45e7..641d1c1468 100644 --- a/lodash.unzipwith/index.d.ts +++ b/lodash.unzipwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { unzipWith } from "lodash"; export = unzipWith; diff --git a/lodash.update/index.d.ts b/lodash.update/index.d.ts index 27c5499aeb..f861786fd0 100644 --- a/lodash.update/index.d.ts +++ b/lodash.update/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { update } from "lodash"; export = update; diff --git a/lodash.uppercase/index.d.ts b/lodash.uppercase/index.d.ts index 82e3f7af39..152bf80399 100644 --- a/lodash.uppercase/index.d.ts +++ b/lodash.uppercase/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { upperCase } from "lodash"; export = upperCase; diff --git a/lodash.upperfirst/index.d.ts b/lodash.upperfirst/index.d.ts index 27cfc0bdc2..b76d75f8b6 100644 --- a/lodash.upperfirst/index.d.ts +++ b/lodash.upperfirst/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { upperFirst } from "lodash"; export = upperFirst; diff --git a/lodash.values/index.d.ts b/lodash.values/index.d.ts index 633dbed76d..ff22e7ef36 100644 --- a/lodash.values/index.d.ts +++ b/lodash.values/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { values } from "lodash"; export = values; diff --git a/lodash.valuesin/index.d.ts b/lodash.valuesin/index.d.ts index 1cca8a411d..9137156620 100644 --- a/lodash.valuesin/index.d.ts +++ b/lodash.valuesin/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { valuesIn } from "lodash"; export = valuesIn; diff --git a/lodash.without/index.d.ts b/lodash.without/index.d.ts index 41a55ad642..88cea94b79 100644 --- a/lodash.without/index.d.ts +++ b/lodash.without/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { without } from "lodash"; export = without; diff --git a/lodash.words/index.d.ts b/lodash.words/index.d.ts index 6b886a190f..8076cee94f 100644 --- a/lodash.words/index.d.ts +++ b/lodash.words/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { words } from "lodash"; export = words; diff --git a/lodash.wrap/index.d.ts b/lodash.wrap/index.d.ts index 18ee43f769..ef1e41cb4c 100644 --- a/lodash.wrap/index.d.ts +++ b/lodash.wrap/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { wrap } from "lodash"; export = wrap; diff --git a/lodash.xor/index.d.ts b/lodash.xor/index.d.ts index 6a641cd153..819ad96d72 100644 --- a/lodash.xor/index.d.ts +++ b/lodash.xor/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { xor } from "lodash"; export = xor; diff --git a/lodash.xorby/index.d.ts b/lodash.xorby/index.d.ts index 49ef941467..a60b78d049 100644 --- a/lodash.xorby/index.d.ts +++ b/lodash.xorby/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { xorBy } from "lodash"; export = xorBy; diff --git a/lodash.xorwith/index.d.ts b/lodash.xorwith/index.d.ts index 30b53691f9..ccf6499b89 100644 --- a/lodash.xorwith/index.d.ts +++ b/lodash.xorwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { xorWith } from "lodash"; export = xorWith; diff --git a/lodash.zip/index.d.ts b/lodash.zip/index.d.ts index f4793f82ae..278d7a7cff 100644 --- a/lodash.zip/index.d.ts +++ b/lodash.zip/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { zip } from "lodash"; export = zip; diff --git a/lodash.zipobject/index.d.ts b/lodash.zipobject/index.d.ts index df8d4929f9..63e4661ff6 100644 --- a/lodash.zipobject/index.d.ts +++ b/lodash.zipobject/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { zipObject } from "lodash"; export = zipObject; diff --git a/lodash.zipwith/index.d.ts b/lodash.zipwith/index.d.ts index e5b4a6714a..93c417ca57 100644 --- a/lodash.zipwith/index.d.ts +++ b/lodash.zipwith/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { zipWith } from "lodash"; export = zipWith; diff --git a/lodash/index.d.ts b/lodash/index.d.ts index 678e0c58b9..0cda5ae3d5 100644 --- a/lodash/index.d.ts +++ b/lodash/index.d.ts @@ -2,6 +2,7 @@ // Project: http://lodash.com/ // Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /** ### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog) @@ -241,7 +242,10 @@ export as namespace _; declare var _: _.LoDashStatic; +type PartialObject = Partial; + declare namespace _ { + type Many = T | T[]; interface LoDashStatic { @@ -6558,9 +6562,9 @@ declare namespace _ { /** * @see _.every */ - every( + every( collection: List|Dictionary|NumericDictionary, - predicate?: TObject + predicate?: PartialObject ): boolean; } @@ -6582,8 +6586,8 @@ declare namespace _ { /** * @see _.every */ - every( - predicate?: TObject + every( + predicate?: PartialObject ): boolean; } @@ -6605,8 +6609,8 @@ declare namespace _ { /** * @see _.every */ - every( - predicate?: TObject + every( + predicate?: PartialObject ): boolean; } @@ -6628,8 +6632,8 @@ declare namespace _ { /** * @see _.every */ - every( - predicate?: TObject + every( + predicate?: PartialObject ): LoDashExplicitWrapper; } @@ -6651,8 +6655,8 @@ declare namespace _ { /** * @see _.every */ - every( - predicate?: TObject + every( + predicate?: PartialObject ): LoDashExplicitWrapper; } @@ -6708,9 +6712,9 @@ declare namespace _ { /** * @see _.filter */ - filter( + filter( collection: List|Dictionary, - predicate: W + predicate: PartialObject ): T[]; } @@ -6741,7 +6745,7 @@ declare namespace _ { /** * @see _.filter */ - filter(predicate: W): LoDashImplicitArrayWrapper; + filter(predicate: PartialObject): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { @@ -6762,7 +6766,7 @@ declare namespace _ { /** * @see _.filter */ - filter(predicate: W): LoDashImplicitArrayWrapper; + filter(predicate: PartialObject): LoDashImplicitArrayWrapper; } interface LoDashExplicitWrapper { @@ -6792,7 +6796,7 @@ declare namespace _ { /** * @see _.filter */ - filter(predicate: W): LoDashExplicitArrayWrapper; + filter(predicate: PartialObject): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { @@ -6813,7 +6817,7 @@ declare namespace _ { /** * @see _.filter */ - filter(predicate: W): LoDashExplicitArrayWrapper; + filter(predicate: PartialObject): LoDashExplicitArrayWrapper; } //_.find @@ -6863,9 +6867,9 @@ declare namespace _ { /** * @see _.find */ - find( + find( collection: List|Dictionary, - predicate?: TObject, + predicate?: PartialObject, fromIndex?: number ): T|undefined; } @@ -6890,8 +6894,8 @@ declare namespace _ { /** * @see _.find */ - find( - predicate?: TObject, + find( + predicate?: PartialObject, fromIndex?: number ): T|undefined; } @@ -6916,8 +6920,8 @@ declare namespace _ { /** * @see _.find */ - find( - predicate?: TObject, + find( + predicate?: PartialObject, fromIndex?: number ): TResult|undefined; } @@ -9204,9 +9208,9 @@ declare namespace _ { /** * @see _.some */ - some( + some( collection: List|Dictionary|NumericDictionary, - predicate?: TObject + predicate?: PartialObject ): boolean; /** @@ -9214,15 +9218,15 @@ declare namespace _ { */ some( collection: List|Dictionary|NumericDictionary, - predicate?: Object + predicate?: PartialObject ): boolean; /** * @see _.some */ - some( + some( collection: Object, - predicate?: TObject + predicate?: PartialObject ): boolean; } @@ -9244,8 +9248,8 @@ declare namespace _ { /** * @see _.some */ - some( - predicate?: TObject + some( + predicate?: PartialObject ): boolean; } @@ -9267,8 +9271,8 @@ declare namespace _ { /** * @see _.some */ - some( - predicate?: TObject + some( + predicate?: PartialObject ): boolean; } @@ -9290,8 +9294,8 @@ declare namespace _ { /** * @see _.some */ - some( - predicate?: TObject + some( + predicate?: PartialObject ): LoDashExplicitWrapper; } @@ -9313,8 +9317,8 @@ declare namespace _ { /** * @see _.some */ - some( - predicate?: TObject + some( + predicate?: PartialObject ): LoDashExplicitWrapper; } diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index c1a5ca3e64..7268f1a8c2 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3530,49 +3530,49 @@ namespace TestEvery { result = _.every(array, listIterator); result = _.every(array, 'a'); result = _.every(array, ['a', 42]); - result = _.every<{a: number}, SampleObject>(array, {a: 42}); + result = _.every(array, {a: 42}); result = _.every(list); result = _.every(list, listIterator); result = _.every(list, 'a'); result = _.every(list, ['a', 42]); - result = _.every<{a: number}, SampleObject>(list, {a: 42}); + result = _.every(list, {a: 42}); result = _.every(dictionary); result = _.every(dictionary, dictionaryIterator); result = _.every(dictionary, 'a'); result = _.every(dictionary, ['a', 42]); - result = _.every<{a: number}, SampleObject>(dictionary, {a: 42}); + result = _.every(dictionary, {a: 42}); result = _.every(numericDictionary); result = _.every(numericDictionary, numericDictionaryIterator); result = _.every(numericDictionary, 'a'); result = _.every(numericDictionary, ['a', 42]); - result = _.every<{a: number}, SampleObject>(numericDictionary, {a: 42}); + result = _.every(numericDictionary, {a: 42}); result = _(array).every(); result = _(array).every(listIterator); result = _(array).every('a'); result = _(array).every(['a', 42]); - result = _(array).every<{a: number}>({a: 42}); + result = _(array).every({a: 42}); result = _(list).every(); result = _(list).every(listIterator); result = _(list).every('a'); result = _(list).every(['a', 42]); - result = _(list).every<{a: number}>({a: 42}); + result = _(list).every({a: 42}); result = _(dictionary).every(); result = _(dictionary).every(dictionaryIterator); result = _(dictionary).every('a'); result = _(dictionary).every(['a', 42]); - result = _(dictionary).every<{a: number}>({a: 42}); + result = _(dictionary).every({a: 42}); result = _(numericDictionary).every(); result = _(numericDictionary).every(numericDictionaryIterator); result = _(numericDictionary).every('a'); result = _(numericDictionary).every(['a', 42]); - result = _(numericDictionary).every<{a: number}>({a: 42}); + result = _(numericDictionary).every({a: 42}); } { @@ -3582,19 +3582,19 @@ namespace TestEvery { result = _(array).chain().every(listIterator); result = _(array).chain().every('a'); result = _(array).chain().every(['a', 42]); - result = _(array).chain().every<{a: number}>({a: 42}); + result = _(array).chain().every({a: 42}); result = _(list).chain().every(); result = _(list).chain().every(listIterator); result = _(list).chain().every('a'); result = _(list).chain().every(['a', 42]); - result = _(list).chain().every<{a: number}>({a: 42}); + result = _(list).chain().every({a: 42}); result = _(dictionary).chain().every(); result = _(dictionary).chain().every(dictionaryIterator); result = _(dictionary).chain().every('a'); result = _(dictionary).chain().every(['a', 42]); - result = _(dictionary).chain().every<{a: number}>({a: 42}); + result = _(dictionary).chain().every({a: 42}); result = _(numericDictionary).chain().every(); result = _(numericDictionary).chain().every(numericDictionaryIterator); @@ -3625,15 +3625,15 @@ namespace TestFilter { result = _.filter(array, listIterator); result = _.filter(array, ''); - result = _.filter<{a: number}, TResult>(array, {a: 42}); + result = _.filter(array, {a: 42}); result = _.filter(list, listIterator); result = _.filter(list, ''); - result = _.filter<{a: number}, TResult>(list, {a: 42}); + result = _.filter(list, {a: 42}); result = _.filter(dictionary, dictionaryIterator); result = _.filter(dictionary, ''); - result = _.filter<{a: number}, TResult>(dictionary, {a: 42}); + result = _.filter(dictionary, {a: 42}); } { @@ -3647,15 +3647,15 @@ namespace TestFilter { result = _(array).filter(listIterator); result = _(array).filter(''); - result = _(array).filter<{a: number}>({a: 42}); + result = _(array).filter({a: 42}); result = _(list).filter(listIterator); result = _(list).filter(''); - result = _(list).filter<{a: number}, TResult>({a: 42}); + result = _(list).filter({a: 42}); result = _(dictionary).filter(dictionaryIterator); result = _(dictionary).filter(''); - result = _(dictionary).filter<{a: number}, TResult>({a: 42}); + result = _(dictionary).filter({a: 42}); } { @@ -3669,15 +3669,15 @@ namespace TestFilter { result = _(array).chain().filter(listIterator); result = _(array).chain().filter(''); - result = _(array).chain().filter<{a: number}>({a: 42}); + result = _(array).chain().filter({a: 42}); result = _(list).chain().filter(listIterator); result = _(list).chain().filter(''); - result = _(list).chain().filter<{a: number}, TResult>({a: 42}); + result = _(list).chain().filter({a: 42}); result = _(dictionary).chain().filter(dictionaryIterator); result = _(dictionary).chain().filter(''); - result = _(dictionary).chain().filter<{a: number}, TResult>({a: 42}); + result = _(dictionary).chain().filter({a: 42}); } } @@ -3697,48 +3697,48 @@ namespace TestFind { result = _.find(array, listIterator, 1); result = _.find(array, ''); result = _.find(array, '', 1); - result = _.find<{a: number}, TResult>(array, {a: 42}); - result = _.find<{a: number}, TResult>(array, {a: 42}, 1); + result = _.find(array, {a: 42}); + result = _.find(array, {a: 42}, 1); result = _.find(list); result = _.find(list, listIterator); result = _.find(list, listIterator, 1); result = _.find(list, ''); result = _.find(list, '', 1); - result = _.find<{a: number}, TResult>(list, {a: 42}); - result = _.find<{a: number}, TResult>(list, {a: 42}, 1); + result = _.find(list, {a: 42}); + result = _.find(list, {a: 42}, 1); result = _.find(dictionary); result = _.find(dictionary, dictionaryIterator); result = _.find(dictionary, dictionaryIterator, 1); result = _.find(dictionary, ''); result = _.find(dictionary, '', 1); - result = _.find<{a: number}, TResult>(dictionary, {a: 42}); - result = _.find<{a: number}, TResult>(dictionary, {a: 42}, 1); + result = _.find(dictionary, {a: 42}); + result = _.find(dictionary, {a: 42}, 1); result = _(array).find(); result = _(array).find(listIterator); result = _(array).find(listIterator, 1); result = _(array).find(''); result = _(array).find('', 1); - result = _(array).find<{a: number}>({a: 42}); - result = _(array).find<{a: number}>({a: 42}, 1); + result = _(array).find({a: 42}); + result = _(array).find({a: 42}, 1); result = _(list).find(); result = _(list).find(listIterator); result = _(list).find(listIterator, 1); result = _(list).find(''); result = _(list).find('', 1); - result = _(list).find<{a: number}, TResult>({a: 42}); - result = _(list).find<{a: number}, TResult>({a: 42}, 1); + result = _(list).find({a: 42}); + result = _(list).find({a: 42}, 1); result = _(dictionary).find(); result = _(dictionary).find(dictionaryIterator); result = _(dictionary).find(dictionaryIterator, 1); result = _(dictionary).find(''); result = _(dictionary).find('', 1); - result = _(dictionary).find<{a: number}, TResult>({a: 42}); - result = _(dictionary).find<{a: number}, TResult>({a: 42}, 1); + result = _(dictionary).find({a: 42}); + result = _(dictionary).find({a: 42}, 1); } result = _.findLast([1, 2, 3, 4], function (num) { @@ -5014,25 +5014,25 @@ namespace TestSome { result = _.some(array, listIterator); result = _.some(array, 'a'); result = _.some(array, ['a', 42]); - result = _.some<{a: number}, SampleObject>(array, {a: 42}); + result = _.some(array, {a: 42}); result = _.some(list); result = _.some(list, listIterator); result = _.some(list, 'a'); result = _.some(list, ['a', 42]); - result = _.some<{a: number}, SampleObject>(list, {a: 42}); + result = _.some(list, {a: 42}); result = _.some(dictionary); result = _.some(dictionary, dictionaryIterator); result = _.some(dictionary, 'a'); result = _.some(dictionary, ['a', 42]); - result = _.some<{a: number}, SampleObject>(dictionary, {a: 42}); + result = _.some(dictionary, {a: 42}); result = _.some(numericDictionary); result = _.some(numericDictionary, numericDictionaryIterator); result = _.some(numericDictionary, 'a'); result = _.some(numericDictionary, ['a', 42]); - result = _.some<{a: number}, SampleObject>(numericDictionary, {a: 42}); + result = _.some(numericDictionary, {a: 42}); result = _.some(sampleObject); result = _.some(sampleObject, objectIterator); @@ -5044,31 +5044,31 @@ namespace TestSome { result = _(array).some(listIterator); result = _(array).some('a'); result = _(array).some(['a', 42]); - result = _(array).some<{a: number}>({a: 42}); + result = _(array).some({a: 42}); result = _(list).some(); result = _(list).some(listIterator); result = _(list).some('a'); result = _(list).some(['a', 42]); - result = _(list).some<{a: number}>({a: 42}); + result = _(list).some({a: 42}); result = _(dictionary).some(); result = _(dictionary).some(dictionaryIterator); result = _(dictionary).some('a'); result = _(dictionary).some(['a', 42]); - result = _(dictionary).some<{a: number}>({a: 42}); + result = _(dictionary).some({a: 42}); result = _(numericDictionary).some(); result = _(numericDictionary).some(numericDictionaryIterator); result = _(numericDictionary).some('a'); result = _(numericDictionary).some(['a', 42]); - result = _(numericDictionary).some<{a: number}>({a: 42}); + result = _(numericDictionary).some({a: 42}); result = _(sampleObject).some(); result = _(sampleObject).some(objectIterator); result = _(sampleObject).some('a'); result = _(sampleObject).some(['a', 42]); - result = _(sampleObject).some<{a: number}>({a: 42}); + result = _(sampleObject).some({a: 42}); } { @@ -5078,31 +5078,31 @@ namespace TestSome { result = _(array).chain().some(listIterator); result = _(array).chain().some('a'); result = _(array).chain().some(['a', 42]); - result = _(array).chain().some<{a: number}>({a: 42}); + result = _(array).chain().some({a: 42}); result = _(list).chain().some(); result = _(list).chain().some(listIterator); result = _(list).chain().some('a'); result = _(list).chain().some(['a', 42]); - result = _(list).chain().some<{a: number}>({a: 42}); + result = _(list).chain().some({a: 42}); result = _(dictionary).chain().some(); result = _(dictionary).chain().some(dictionaryIterator); result = _(dictionary).chain().some('a'); result = _(dictionary).chain().some(['a', 42]); - result = _(dictionary).chain().some<{a: number}>({a: 42}); + result = _(dictionary).chain().some({a: 42}); result = _(numericDictionary).chain().some(); result = _(numericDictionary).chain().some(numericDictionaryIterator); result = _(numericDictionary).chain().some('a'); result = _(numericDictionary).chain().some(['a', 42]); - result = _(numericDictionary).chain().some<{a: number}>({a: 42}); + result = _(numericDictionary).chain().some({a: 42}); result = _(sampleObject).chain().some(); result = _(sampleObject).chain().some(objectIterator); result = _(sampleObject).chain().some('a'); result = _(sampleObject).chain().some(['a', 42]); - result = _(sampleObject).chain().some<{a: number}>({a: 42}); + result = _(sampleObject).chain().some({a: 42}); } } diff --git a/lodash/meanBy/index.d.ts b/lodash/meanBy/index.d.ts index 3004930ef6..e4651a4412 100644 --- a/lodash/meanBy/index.d.ts +++ b/lodash/meanBy/index.d.ts @@ -1,3 +1,2 @@ -import * as _ from "../index"; -declare const meanBy: typeof _.meanBy; -export = meanBy; +import { meanBy } from "../index"; +export = meanBy; \ No newline at end of file diff --git a/lodash/scripts/generate-modules.ts b/lodash/scripts/generate-modules.ts index 127f1f44c6..395bb7ab4d 100644 --- a/lodash/scripts/generate-modules.ts +++ b/lodash/scripts/generate-modules.ts @@ -1,16 +1,124 @@ -// Usage: ts-node generate-modules +// Usage: ts-node generate-modules.ts /// import * as fs from "fs"; +import { get, STATUS_CODES } from "http"; +import * as path from "path"; -for (const module of allModuleNames()) { - if (!fs.existsSync(module)) { - fs.mkdirSync(module); +main().catch(console.error); + +async function main() { + const all = new Set(allModuleNames()); + const notOnNpm = new Set(modulesNotOnNpm()); + for (const n of notOnNpm) { + if (!all.has(n)) { + throw new Error(n); + } + } + + for (const module of all) { + console.log(module); + + // Generate local module + const localDir = path.join("..", module); + ensureDir(localDir); + fs.writeFileSync(path.join(localDir, "index.d.ts"), `import { ${module} } from "../index";\nexport = ${module};`); + + // Generate non-local module + if (!notOnNpm.has(module)) { + const dir = path.join("..", "..", `lodash.${module.toLowerCase()}`); + ensureDir(dir); + fs.writeFileSync(path.join(dir, "index.d.ts"), await globalDefinitionText(module)); + fs.writeFileSync(path.join(dir, "tsconfig.json"), tsconfig()); + fs.writeFileSync(path.join(dir, "tslint.json"), tslint()); + } } - fs.writeFileSync(`${module}/index.d.ts`, `import { ${module} } from "../index";\nexport = ${module};`); } +function ensureDir(dir: string) { + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir); + } +} + +async function globalDefinitionText(moduleName: string): Promise { + const fullName = "lodash." + moduleName; + const url = `http://registry.npmjs.org/${fullName.toLowerCase()}`; + const npmInfo = JSON.parse(await loadString(url)); + const fullVersion = npmInfo["dist-tags"].latest; + const majorMinor = fullVersion.split(".").slice(0, 2).join("."); + + return ` +// Type definitions for ${fullName} ${majorMinor} +// Project: http://lodash.com/ +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { ${moduleName} } from "lodash"; +export = ${moduleName}; +`.trim() + "\n"; +} + +function tsconfig() { + return JSON.stringify({ + "files": [ + "index.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } + }, undefined, 4); +} + +function tslint() { + return JSON.stringify({ + "extends": "../tslint.json" + }, undefined, 4); +} + + +function loadString(url: string): Promise { + return new Promise((resolve, reject) => { + get(url, (res) => { + if (res.statusCode !== 200) { + return reject(new Error(`HTTP Error ${res.statusCode}: ${STATUS_CODES[res.statusCode || 500]} for ${url}`)) + } + let rawData = "" + res.on("data", chunk => rawData += chunk) + res.on("end", () => resolve(rawData)) + }).on("error", e => reject(e)) + }) +} + +function modulesNotOnNpm() { + return [ + "chain", + "each", + "eachRight", + "extend", + "extendWith", + "noConflict", + "runInContext", + "tap", + "thru", + ]; +} + +// Note: "fb" is not a usual module, so it is made by hand. + function allModuleNames() { return [ "add", @@ -66,7 +174,6 @@ function allModuleNames() { "every", "extend", "extendWith", - "fb", "fill", "filter", "find", diff --git a/lodash/scripts/tsconfig.json b/lodash/scripts/tsconfig.json new file mode 100644 index 0000000000..a06b8ed24f --- /dev/null +++ b/lodash/scripts/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "es6", + "baseUrl": "../..", + "typeRoots": [ + "../../" + ], + "types": [] + } +} \ No newline at end of file diff --git a/sequelize-fixtures/index.d.ts b/sequelize-fixtures/index.d.ts index 2810e7b2ea..b865d91d0c 100644 --- a/sequelize-fixtures/index.d.ts +++ b/sequelize-fixtures/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/domasx2/sequelize-fixtures // Definitions by: Christian Schwarz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/sequelize/index.d.ts b/sequelize/index.d.ts index a2a9b6380c..6ff2c3e6df 100644 --- a/sequelize/index.d.ts +++ b/sequelize/index.d.ts @@ -2,6 +2,7 @@ // Project: http://sequelizejs.com // Definitions by: samuelneff , Peter Harris , Ivan Drinchev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 // Based on original work by: samuelneff diff --git a/sequelize/v3/index.d.ts b/sequelize/v3/index.d.ts index 8b22524878..81a4eab0ed 100644 --- a/sequelize/v3/index.d.ts +++ b/sequelize/v3/index.d.ts @@ -2,6 +2,7 @@ // Project: http://sequelizejs.com // Definitions by: samuelneff , Peter Harris , Ivan Drinchev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 // Based on original work by: samuelneff diff --git a/umzug/index.d.ts b/umzug/index.d.ts index 0395d09fd7..af3618df7e 100644 --- a/umzug/index.d.ts +++ b/umzug/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/sequelize/umzug // Definitions by: Ivan Drinchev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// /// From c8b9d48923795415d222a38d73f3c15bfd2bd276 Mon Sep 17 00:00:00 2001 From: Shun Takahashi Date: Fri, 27 Jan 2017 10:03:54 -0800 Subject: [PATCH 70/87] Drop namespace and change to flat export model --- forever-monitor/forever-monitor-tests.ts | 10 +- forever-monitor/index.d.ts | 173 +++++++++++------------ 2 files changed, 94 insertions(+), 89 deletions(-) diff --git a/forever-monitor/forever-monitor-tests.ts b/forever-monitor/forever-monitor-tests.ts index f679c4704a..e44a9c35b0 100644 --- a/forever-monitor/forever-monitor-tests.ts +++ b/forever-monitor/forever-monitor-tests.ts @@ -1,6 +1,10 @@ // Test from https://github.com/foreverjs/forever-monitor import * as forever from "forever-monitor"; +forever.start('script') + .on("start", () => console.log("started")); + +forever.kill(10, true); const child = new (forever.Monitor)('your-filename.js', { max: 3, @@ -12,4 +16,8 @@ child.on('exit', function() { console.log('your-filename.js has exited after 3 restarts'); }); -child.start(); +child.start() + .on("start", () => console.log("started")) + .restart() + .stop() + .on("exit", () => console.log("STOPPED")) diff --git a/forever-monitor/index.d.ts b/forever-monitor/index.d.ts index d59c446f1a..22fa4b0c61 100644 --- a/forever-monitor/index.d.ts +++ b/forever-monitor/index.d.ts @@ -4,93 +4,90 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare namespace forever { - export interface SpawnWith { - customFds: number[]; - setsid: boolean; - uid: number; - gid: number; - } - - export interface Options { - silent?: boolean; - uid?: string; - pidFile?: string; - max?: number; - killTree?: boolean; - minUptime?: number; - spinSleepTime?: number; - command?: string; - args?: string[]; - sourceDir?: string; - watch?: boolean; - watchIgnoreDotFiles?: boolean; - watchIgnorePatters?: string[]; - watchDirectory?: string; - spawnWith?: SpawnWith; - env?: { [envKey: string]: string; }; - cwd?: string; - logFile?: string; - outFile?: string; - errFile?: string; - parser?: (command: string, args: string[]) => { command: string, args: string[] }; - } - - export function start(script: string, options: Options): Monitor; - export function kill(pid: number, killTree?: boolean, signal?: string, callback?: () => any): void; - export function checkProcess(pid: number): boolean; - export const version: string; - export class Monitor extends NodeJS.EventEmitter { - - /** - * @param script - Location of the target script to run. - * @param [options] - Configuration for this instance. - */ - constructor(script: string, options?: Options); - - /** - * @description Start the process that this instance is configured for - * @param [restart] - Value indicating whether this is a restart. - */ - start(restart?: boolean): this; - - /** - * @description Tries to spawn the target Forever child process. - */ - trySpawn(): boolean; - - /** - * @description Restarts the target script associated with this instance. - */ - restart(): this; - - /** - * @description Stops the target script associated with this instance. Prevents it from auto-respawning - */ - stop(): this; - - /** - * @description Kills the ChildProcess object associated with this instance - * @param [forceStop] - Value indicating whether short circuit forever auto-restart - */ - kill(forceStop?: boolean): this; - - /** - * @description Sends a message to a forked ChildProcess object associated with this instance - */ - send(msg?: any): this; - - /** - * respond with JSON for this instance - */ - toString(): string; - - /** - * @param command - Command string to parse - * @param args - Additional default arguments - */ - parseCommand(command: string, args?: string[]): (false | { command: string, args?: string[]}); - } +export interface SpawnWith { + customFds: number[]; + setsid: boolean; + uid: number; + gid: number; } -export = forever; +export interface Options { + silent?: boolean; + uid?: string; + pidFile?: string; + max?: number; + killTree?: boolean; + minUptime?: number; + spinSleepTime?: number; + command?: string; + args?: string[]; + sourceDir?: string; + watch?: boolean; + watchIgnoreDotFiles?: boolean; + watchIgnorePatters?: string[]; + watchDirectory?: string; + spawnWith?: SpawnWith; + env?: { [envKey: string]: string; }; + cwd?: string; + logFile?: string; + outFile?: string; + errFile?: string; + parser?: (command: string, args: string[]) => { command: string, args: string[] }; +} + +export function start(script: string, options?: Options): Monitor; +export function kill(pid: number, killTree?: boolean, signal?: string, callback?: () => any): void; +export function checkProcess(pid: number): boolean; +export const version: string; + +export class Monitor extends NodeJS.EventEmitter { + + /** + * @param script - Location of the target script to run. + * @param [options] - Configuration for this instance. + */ + constructor(script: string, options?: Options); + + /** + * @description Start the process that this instance is configured for + * @param [restart] - Value indicating whether this is a restart. + */ + start(restart?: boolean): this; + + /** + * @description Tries to spawn the target Forever child process. + */ + trySpawn(): boolean; + + /** + * @description Restarts the target script associated with this instance. + */ + restart(): this; + + /** + * @description Stops the target script associated with this instance. Prevents it from auto-respawning + */ + stop(): this; + + /** + * @description Kills the ChildProcess object associated with this instance + * @param [forceStop] - Value indicating whether short circuit forever auto-restart + */ + kill(forceStop?: boolean): this; + + /** + * @description Sends a message to a forked ChildProcess object associated with this instance + */ + send(msg?: any): this; + + /** + * respond with JSON for this instance + */ + toString(): string; + + /** + * @param command - Command string to parse + * @param args - Additional default arguments + */ + parseCommand(command: string, args?: string[]): (false | { command: string, args?: string[]}); +} From 088284583fabdcb74a9f245d691cd121fe80114b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Nguyen?= Date: Fri, 27 Jan 2017 20:52:05 +0100 Subject: [PATCH 71/87] Added type definitions for sharp --- sharp/index.d.ts | 642 +++++++++++++++++++++++++++++++++++++++++++ sharp/sharp-tests.ts | 202 ++++++++++++++ sharp/tsconfig.json | 20 ++ sharp/tslint.json | 1 + 4 files changed, 865 insertions(+) create mode 100644 sharp/index.d.ts create mode 100644 sharp/sharp-tests.ts create mode 100644 sharp/tsconfig.json create mode 100644 sharp/tslint.json diff --git a/sharp/index.d.ts b/sharp/index.d.ts new file mode 100644 index 0000000000..a11385aaa7 --- /dev/null +++ b/sharp/index.d.ts @@ -0,0 +1,642 @@ +// Type definitions for sharp 0.17 +// Project: https://github.com/lovell/sharp +// Definitions by: François Nguyen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Duplex } from "stream"; + +/** + * Creates a sharp instance from an image + * @param {string} input Buffer containing JPEG, PNG, WebP, GIF, SVG, TIFF or raw pixel image data, or String containing the path to an JPEG, PNG, WebP, GIF, SVG or TIFF image file. + * @param {sharp.SharpOptions} options Object with optional attributes. + * @throws {Error} Invalid parameters + * @returns {sharp.SharpInstance} A sharp instance that can be used to chain operations + */ +declare function sharp(input?: string | Buffer, options?: sharp.SharpOptions): sharp.SharpInstance; +declare namespace sharp { + export const gravity: sharp.GravityEnum; + export const strategy: sharp.StrategyEnum; + /** + * Gets, or when options are provided sets, the limits of libvips' operation cache. Existing entries in the cache will be trimmed after any change in limits. This method always returns cache statistics, useful for determining how much working memory is required for a particular task. + * @param {boolean|sharp.CacheOptions} options Object with the cache options, or Boolean where true uses default cache settings and false removes all caching. + * @returns {Object} + */ + export function cache(options?: boolean | sharp.CacheOptions): CacheResult; + /** + * Gets, or when a concurrency is provided sets, the number of threads libvips' should create to process each image. + * @param {number} concurrency concurrency value + */ + export function concurrency(threads?: number): number; + /** + * Provides access to internal task counters. + * @returns {sharp.SharpCounters} Object containing task counters + */ + export function counters(): sharp.SharpCounters; + /** + * Get and set use of SIMD vector unit instructions. + * @param {boolean} enable enable or disable use of SIMD vector unit instructions + * @returns {boolean} true if usage of SIMD vector unit instructions is enabled + */ + export function simd(enable?: boolean): boolean; + export const kernel: sharp.KernelEnum; + export const interpolator: sharp.InterpolatorEnum; + /** + * Object containing nested boolean values representing the available input and output formats/methods. + */ + export const format: FormatEnum; + /** An EventEmitter that emits a change event when a task is either queued, waiting for libuv to provide a worker thread, complete */ + export const queue: NodeJS.EventEmitter; + /** An Object containing the version numbers of libvips and its dependencies. */ + export const versions: string[]; + export const bool: BoolEnum; + + interface SharpInstance extends Duplex { + /** + * Fast access to image metadata without decoding any compressed image data. + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + metadata(callback: (err: Error, metadata: Metadata) => void): SharpInstance; + /** + * Fast access to image metadata without decoding any compressed image data. + * @returns {Promise} A promise that fulfills with a metadata object. + */ + metadata(): Promise; + /** + * Take a "snapshot" of the Sharp instance, returning a new instance. + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + clone(): SharpInstance; + /** + * An advanced setting that switches the libvips access method to VIPS_ACCESS_SEQUENTIAL. + * @param {boolean} sequentialRead true to enable and false to disable (defaults to true) + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + sequentialRead(sequentialRead?: boolean): SharpInstance; + /** + * Do not process input images where the number of pixels (width _ height) exceeds this limit. + * @param {number|boolean} pixels An integral Number of pixels, zero or false to remove limit, true to use default limit. + * @throws {Error} Invalid limit + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + limitInputPixels(pixels: number | boolean): SharpInstance; + /** + * Resize image to width x height. By default, the resized image is centre cropped to the exact size specified. + * @param {number} width pixels wide the resultant image should be, between 1 and 16383 (0x3FFF). Use null or undefined to auto-scale the width to match the height. + * @param {number} height pixels high the resultant image should be, between 1 and 16383. Use null or undefined to auto-scale the height to match the width. + * @param {ResizeOptions} options resize options + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + resize(width?: number, height?: number, options?: ResizeOptions): SharpInstance; + /** + * Crop the resized image to the exact size specified, the default behaviour. + * @param {number|string} crop A member of sharp.gravity to crop to an edge/corner or sharp.strategy to crop dynamically. (optional, default 'centre') + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + crop(crop?: number | string): SharpInstance; + /** + * Preserving aspect ratio, resize the image to the maximum width or height specified then embed on a background of the exact width and height specified. + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + embed(): SharpInstance; + /** + * Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to the width and height specified. + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + max(): SharpInstance; + /** + * Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to the width and height specified. + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + min(): SharpInstance; + /** + * Do not enlarge the output image if the input image width or height are already less than the required dimensions. + * @param {boolean} withoutEnlargement true to enable and false to disable (defaults to true) + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + withoutEnlargement(withoutEnlargement?: boolean): SharpInstance; + /** + * Ignoring the aspect ratio of the input, stretch the image to the exact width and/or height provided via resize. + */ + ignoreAspectRatio(): SharpInstance; + /** + * Extract a region of the image. + * @param {Region} region Region to extract + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + extract(region: Region): SharpInstance; + /** + * Trim "boring" pixels from all edges that contain values within a percentage similarity of the top-left pixel. + * @param {number} tolerance value between 1 and 99 representing the percentage similarity. (optional, default 10) + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + trim(tolerance?: number): SharpInstance; + /** + * Set the background for the embed, flatten and extend operations. The default background is {r: 0, g: 0, b: 0, alpha: 1}, black without transparency. + * @param {RGBA|string} rgba String or Object parsed by the color module to extract values for red, green, blue and alpha. + * @throws {Error} Invalid parameter + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + background(rgba?: RGBA | string): SharpInstance; // Wait for typings to fetch latest color typings from DT + /** + * Merge alpha transparency channel, if any, with background. + * @param {boolean} flatten true to enable and false to disable (defaults to true) + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + flatten(flatten?: boolean): SharpInstance; + /** + * Extends/pads the edges of the image with the colour provided to the background method. + * @param {number|ExtendOptions} extend single pixel count to add to all edges or an Object with per-edge counts + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + extend(extend: number | ExtendOptions): SharpInstance; + /** + * Produce the "negative" of the image. + * @param {boolean} negate true to enable and false to disable (defaults to true) + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + negate(negate?: boolean): SharpInstance; + /** + * Rotate the output image by either an explicit angle or auto-orient based on the EXIF Orientation tag. + * @param {number} angle 0, 90, 180 or 270. (optional, default auto) + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + rotate(angle?: number): SharpInstance; + /** + * Flip the image about the vertical Y axis. + * @param {boolean} flip true to enable and false to disable (defaults to true) + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + flip(flip?: boolean): SharpInstance; + /** + * Flop the image about the horizontal X axis. + * @param {boolean} flop true to enable and false to disable (defaults to true) + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + flop(flop?: boolean): SharpInstance; + /** + * Blur the image. + * @param {number} sigma a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where sigma = 1 + radius / 2. + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + blur(sigma?: number): SharpInstance; + /** + * Convolve the image with the specified kernel. + * @param {Kernel} kernel the specified kernel + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + convolve(kernel: Kernel): SharpInstance; + /** + * Sharpen the image. + * @param {number} sigma the sigma of the Gaussian mask, where sigma = 1 + radius / 2. + * @param {number} flat the level of sharpening to apply to "flat" areas. (optional, default 1.0) + * @param {number} jagged the level of sharpening to apply to "jagged" areas. (optional, default 2.0) + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + sharpen(sigma?: number, flat?: number, jagged?: number): SharpInstance; + /** + * Any pixel value greather than or equal to the threshold value will be set to 255, otherwise it will be set to 0. + * @param {number} threshold a value in the range 0-255 representing the level at which the threshold will be applied. (optional, default 128) + * @param {ThresholdOptions} options threshold options + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + threshold(threshold?: number, options?: ThresholdOptions): SharpInstance; + /** + * Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of 1/gamma then increasing the encoding (brighten) post-resize at a factor of gamma. + * @param {number} gamma value between 1.0 and 3.0. (optional, default 2.2) + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + gamma(gamma?: number): SharpInstance; + /** + * Alternative spelling of greyscale. + * Convert to 8-bit greyscale; 256 shades of grey. This is a linear operation. If the input image is in a non-linear colour space such as sRGB, use gamma() with greyscale() for the best results. By default the output image will be web-friendly sRGB and contain three (identical) color channels. This may be overridden by other sharp operations such as toColourspace('b-w'), which will produce an output image containing one color channel. An alpha channel may be present, and will be unchanged by the operation. + * @param {boolean} grayscale true to enable and false to disable (defaults to true) + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + grayscale(grayscale?: boolean): SharpInstance; + /** + * Convert to 8-bit greyscale; 256 shades of grey. This is a linear operation. If the input image is in a non-linear colour space such as sRGB, use gamma() with greyscale() for the best results. By default the output image will be web-friendly sRGB and contain three (identical) color channels. This may be overridden by other sharp operations such as toColourspace('b-w'), which will produce an output image containing one color channel. An alpha channel may be present, and will be unchanged by the operation. + * @param {boolean} greyscale true to enable and false to disable (defaults to true) + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + greyscale(greyscale?: boolean): SharpInstance; + /** + * Enhance output image contrast by stretching its luminance to cover the full dynamic range. + * @param {boolean} normalize true to enable and false to disable (defaults to true) + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + normalize(normalize?: boolean): SharpInstance; + /** + * Alternative spelling of normalise. + * Enhance output image contrast by stretching its luminance to cover the full dynamic range. + * @param {boolean} normalise true to enable and false to disable (defaults to true) + */ + normalise(normalise?: boolean): SharpInstance; + /** + * Overlay (composite) an image over the processed (resized, extracted etc.) image. + * @param {string|Buffer} image Buffer containing image data or String containing the path to an image file. + * @param {OverlayOptions} options overlay options + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + overlayWith(image: string | Buffer, options?: OverlayOptions): SharpInstance; + /** + * Set the output colourspace. + * @param {string} colourspace output colourspace e.g. srgb, rgb, cmyk, lab, b-w ... + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + toColourspace(colourspace?: string): SharpInstance; + /** + * Alternative spelling of toColourspace. + * Set the output colorspace. + * @param {string} colorspace output colourspace e.g. srgb, rgb, cmyk, lab, b-w ... + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + toColorspace(colorspace: string): SharpInstance; + /** + * Extract a single channel from a multi-channel image. + * @param {number|string} channel zero-indexed band number to extract, or red, green or blue as alternative to 0, 1 or 2 respectively. + * @throws {Error} Invalid channel + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + extractChannel(channel: number | string): SharpInstance; + /** + * Join one or more channels to the image. The meaning of the added channels depends on the output colourspace, set with toColourspace(). + * @param {string|string[]|Buffer|Buffer[]} channels one or more images (file paths, Buffers). + * @param {{raw:Raw}} options image options + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + joinChannel(channels: string | string[] | Buffer | Buffer[], options?: { raw: Raw }): SharpInstance; + /** + * Perform a bitwise boolean operation on all input image channels (bands) to produce a single channel output image. + * @param {string} boolOp one of and, or or eor to perform that bitwise operation, like the C logic operators &, | and ^ respectively. + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + bandbool(boolOp: string): SharpInstance; + /** + * Perform a bitwise boolean operation with operand image. + * @param {string|Buffer} image Buffer containing image data or String containing the path to an image file. + * @param {strip} operator one of and, or or eor to perform that bitwise operation, like the C logic operators &, | and ^ respectively. + * @param {{raw:Raw}} options describes operand when using raw pixel data. + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + boolean(operand: string | Buffer, operator: string, options?: { raw: Raw }): SharpInstance; + /** + * Write output image data to a file. + * @param {string} fileOut The path to write the image data to. + * @param {Function} callback Callback function called on completion with two arguments (err, info). info contains the output image format, size (bytes), width, height and channels. + * @throws {Error} Invalid parameters + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + toFile(fileOut: string, callback: (err: Error, info: OutputInfo) => void): SharpInstance; + /** + * Write output image data to a file. + * @param {string} fileOut The path to write the image data to. + * @throws {Error} Invalid parameters + * @returns {Promise} A promise that fulfills with an object containing informations on the resulting file + */ + toFile(fileOut: string): Promise; + /** + * Write output to a Buffer. JPEG, PNG, WebP, and RAW output are supported. By default, the format will match the input image, except GIF and SVG input which become PNG output. + * @param {Function} callback Callback function called on completion with three arguments (err, buffer, info). err is an error message, if any. buffer is the output image data. info contains the output image format, size (bytes), width, height and channels. A Promises/A+ promise is returned when callback is not provided. + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + toBuffer(callback: (err: Error, buffer: Buffer, info: OutputInfo) => void): SharpInstance; + /** + * Write output to a Buffer. JPEG, PNG, WebP, and RAW output are supported. By default, the format will match the input image, except GIF and SVG input which become PNG output. + * @returns {Promise} A promise that fulfills with the resulting Buffer + */ + toBuffer(): Promise; + /** + * Use these JPEG options for output image. + * @param {JpegOptions} options Output options. + * @throws {Error} Invalid options + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + jpeg(options?: JpegOptions): SharpInstance; + /** + * Use these PNG options for output image. + * @param {PngOptions} options Output options. + * @throws {Error} Invalid options + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + png(options?: PngOptions): SharpInstance; + /** + * Use these WebP options for output image. + * @param {OutputOptions} options Output options. + * @throws {Error} Invalid options + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + webp(options?: OutputOptions): SharpInstance; + /** + * Use these TIFF options for output image. + * @param {OutputOptions} options Output options. + * @throws {Error} Invalid options + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + tiff(options?: OutputOptions): SharpInstance; + /** + * Force output to be raw, uncompressed uint8 pixel data. + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + raw(): SharpInstance; + /** + * Force output to a given format. + * @param {string|AvailableFormatInfo} format a String or an Object with an 'id' attribute + * @param {OutputOptions|JpegOptions|PngOptions} options output options + * @throws {Error} Unsupported format or options + * @returns {SharpInstance} A sharp instance that can be used to chain operations + */ + toFormat(format: string | AvailableFormatInfo, options?: OutputOptions | JpegOptions | PngOptions): SharpInstance; + /** + * Include all metadata (EXIF, XMP, IPTC) from the input image in the output image. The default behaviour, when withMetadata is not used, is to strip all metadata and convert to the device-independent sRGB colour space. This will also convert to and add a web-friendly sRGB ICC profile. + * @param {Metadata} + * @throws {Error} Invalid parameters. + */ + withMetadata(metadata?: Metadata): SharpInstance; + /** + * Use tile-based deep zoom (image pyramid) output. Set the format and options for tile images via the toFormat, jpeg, png or webp functions. Use a .zip or .szi file extension with toFile to write to a compressed archive file format. + * @param {TileOptions} options options + */ + tile(options: TileOptions): SharpInstance; + } + + export interface SharpOptions { + /** integral number representing the DPI for vector images. */ + density?: number; + /** describes raw pixel image data. */ + raw?: Raw; + } + + export interface CacheOptions { + /** is the maximum memory in MB to use for this cache */ + memory?: number; + /** is the maximum number of files to hold open */ + files?: number; + /** is the maximum number of operations to cache */ + items?: number; + } + + export interface SharpCounters { + queue: number; + process: number; + } + + export interface Raw { + width: number; + height: number; + channels: number; + } + + export interface Metadata { + /** Name of decoder used to decompress image data e.g. jpeg, png, webp, gif, svg */ + format?: string; + /** Number of pixels wide */ + width?: number; + /** Number of pixels high */ + height?: number; + /** Name of colour space interpretation e.g. srgb, rgb, cmyk, lab, b-w ... */ + space?: string; + /** Number of bands e.g. 3 for sRGB, 4 for CMYK */ + channels?: number; + /** Number of pixels per inch (DPI), if present */ + density?: number; + /** Boolean indicating the presence of an embedded ICC profile */ + hasProfile?: boolean; + /** Boolean indicating the presence of an alpha transparency channel */ + hasAlpha?: boolean; + /** Number value of the EXIF Orientation header, if present */ + orientation?: number; + /** Buffer containing raw EXIF data, if present */ + exif?: Buffer; + /** Buffer containing raw ICC profile data, if present */ + icc?: Buffer; + } + + export interface JpegOptions extends OutputOptions { + /** Use progressive (interlace) scan (optional, default false) */ + progressive?: boolean; + /** Set to '4:4:4' to prevent chroma subsampling when quality <= 90 (optional, default '4:2:0') */ + chromaSubsampling?: string; + /** Apply trellis quantisation, requires mozjpeg (optional, default false) */ + trellisQuantisation?: boolean; + /** Apply overshoot deringing, requires mozjpeg (optional, default false) */ + overshootDeringing?: boolean; + /** Optimise progressive scans, forces progressive, requires mozjpeg (optional, default false) */ + optimiseScans?: boolean; + /** Alternative spelling of optimiseScans (optional, default false) */ + optimizeScans?: boolean; + } + + export interface PngOptions { + /** Use progressive (interlace) scan (optional, default false) */ + progressive?: boolean; + /** zlib compression level (optional, default 6) */ + compressionLevel?: number; + /** Use adaptive row filtering (optional, default true) */ + adaptiveFiltering?: boolean; + /** Force PNG output, otherwise attempt to use input format (optional, default true) */ + force?: boolean; + } + + export interface OutputOptions { + /** Quality, integer 1-100 (optional, default 80) */ + quality?: number; + /** Force format output, otherwise attempt to use input format (optional, default true) */ + force?: boolean; + } + + export interface ResizeOptions { + /** the kernel to use for image reduction. (optional, default 'lanczos3') */ + kernel?: string; + /** the interpolator to use for image enlargement. (optional, default 'bicubic') */ + interpolator?: string; + /** use magick centre sampling convention instead of corner sampling. (optional, default false) */ + centreSampling?: boolean; + /** alternative spelling of centreSampling. (optional, default false) */ + centerSampling?: boolean; + } + + export interface Region { + /** zero-indexed offset from left edge */ + left?: number; + /** zero-indexed offset from top edge */ + top?: number; + /** dimension of extracted image */ + width?: number; + /** dimension of extracted image */ + height?: number; + } + + export interface ExtendOptions { + top?: number; + left?: number; + bottom?: number; + right?: number; + } + + export interface RGBA { + r?: number; + g?: number; + b?: number; + alpha?: number; + } + + export interface Kernel { + /** width of the kernel in pixels. */ + width: number; + /** height of the kernel in pixels. */ + height: number; + /** Array of length width*height containing the kernel values. */ + kernel: number[]; + /** the scale of the kernel in pixels. (optional, default sum) */ + scale?: number; + /** the offset of the kernel in pixels. (optional, default 0) */ + offset?: number; + } + + export interface ThresholdOptions { + /** convert to single channel greyscale. (optional, default true) */ + greyscale?: boolean; + /** alternative spelling for greyscale. (optional, default true) */ + grayscale?: boolean; + } + + export interface OverlayOptions { + /** gravity at which to place the overlay. (optional, default 'centre') */ + gravity?: number; + /** the pixel offset from the top edge. */ + top?: number; + /** the pixel offset from the left edge. */ + left?: number; + /** set to true to repeat the overlay image across the entire image with the given gravity. (optional, default false) */ + tile?: boolean; + /** set to true to apply only the alpha channel of the overlay image to the input image, giving the appearance of one image being cut out of another. (optional, default false) */ + cutout?: boolean; + /** describes overlay when using raw pixel data. */ + raw?: Raw; + } + + export interface TileOptions { + /** Tile size in pixels, a value between 1 and 8192. (optional, default 256) */ + size?: number; + /** Tile overlap in pixels, a value between 0 and 8192. (optional, default 0) */ + overlap?: number; + /** Tile container, with value fs (filesystem) or zip (compressed file). (optional, default 'fs') */ + container?: string; + /** Filesystem layout, possible values are dz, zoomify or google. (optional, default 'dz') */ + layout?: string; + } + + export interface OutputInfo { + format: string; + size: number; + width: number; + height: number; + channels: number; + } + + export interface AvailableFormatInfo { + id: string; + input: { file: boolean; buffer: boolean; stream: boolean; }; + output: { file: boolean; buffer: boolean; stream: boolean; }; + } + + export interface KernelEnum { + cubic: string; + lanczos2: string; + lanczos3: string; + } + + export interface InterpolatorEnum { + nearest: string; + bilinear: string; + bicubic: string; + nohalo: string; + lbb: string; + locallyBoundedBicubic: string; + vsqbs: string; + vertexSplitQuadraticBasisSpline: string; + } + + export interface BoolEnum { + and: string; + or: string; + eor: string; + } + + export interface ColourspaceEnum { + multiband: string; + "b-w": string; + bw: string; + cmyk: string; + srgb: string; + } + + export interface GravityEnum { + north: number; + northeast: number; + southeast: number; + south: number; + southwest: number; + west: number; + northwest: number; + east: number; + center: number; + centre: number; + } + + export interface StrategyEnum { + entropy: number; + attention: number; + } + + export interface FormatEnum { + jpeg: AvailableFormatInfo; + png: AvailableFormatInfo; + webp: AvailableFormatInfo; + raw: AvailableFormatInfo; + tiff: AvailableFormatInfo; + dz: AvailableFormatInfo; + input: AvailableFormatInfo; + magick: AvailableFormatInfo; + openslide: AvailableFormatInfo; + ppm: AvailableFormatInfo; + fits: AvailableFormatInfo; + gif: AvailableFormatInfo; + svg: AvailableFormatInfo; + pdf: AvailableFormatInfo; + v: AvailableFormatInfo; + } + + interface FormatObject extends FormatEnum { + /** + * Returns an Object containing nested boolean values representing the available input and output formats/methods. + * @returns Object containing available formats + */ + (): FormatEnum; + } + + export interface CacheResult { + memory: { current: number; high: number; max: number; }; + files: { current: number; max: number; }; + items: { current: number; max: number; }; + } +} + +export = sharp; \ No newline at end of file diff --git a/sharp/sharp-tests.ts b/sharp/sharp-tests.ts new file mode 100644 index 0000000000..00c318feb9 --- /dev/null +++ b/sharp/sharp-tests.ts @@ -0,0 +1,202 @@ +import * as sharp from "sharp"; +import { createReadStream, createWriteStream } from "fs"; + +// Test samples taken from the official documentation + +const input: Buffer = new Buffer(0); +const readableStream: NodeJS.ReadableStream = createReadStream(input); +const writableStream: NodeJS.WritableStream = createWriteStream(input); + +sharp(input) + .extractChannel('green') + .toFile('input_green.jpg', function(err, info) { + // info.channels === 1 + // input_green.jpg contains the green channel of the input image + }); + +sharp('3-channel-rgb-input.png') + .bandbool(sharp.bool.and) + .toFile('1-channel-output.png', function(err, info) { + // The output will be a single channel image where each pixel `P = R & G & B`. + // If `I(1,1) = [247, 170, 14] = [0b11110111, 0b10101010, 0b00001111]` + // then `O(1,1) = 0b11110111 & 0b10101010 & 0b00001111 = 0b00000010 = 2`. + }); + +sharp('input.png') + .rotate(180) + .resize(300) + .flatten() + .background('#ff6600') + .overlayWith('overlay.png', { gravity: sharp.gravity.southeast }) + .sharpen() + .withMetadata() + .webp({ + quality: 90 + }) + .toBuffer() + .then(function(outputBuffer: Buffer) { + // outputBuffer contains upside down, 300px wide, alpha channel flattened + // onto orange background, composited with overlay.png with SE gravity, + // sharpened, with metadata, 90% quality WebP image data. Phew! + }); + +sharp('input.jpg') + .resize(300, 200) + .toFile('output.jpg', function(err: Error) { + // output.jpg is a 300 pixels wide and 200 pixels high image + // containing a scaled and cropped version of input.jpg + }); + +var transformer = sharp() + .resize(300) + .on('info', function(info: sharp.OutputInfo) { + console.log('Image height is ' + info.height); + }); +readableStream.pipe(transformer).pipe(writableStream); + +console.log(sharp.format); +console.log(sharp.versions); + +sharp.queue.on('change', function(queueLength: number) { + console.log('Queue contains ' + queueLength + ' task(s)'); +}); + +let pipeline: sharp.SharpInstance = sharp().rotate(); +pipeline.clone().resize(800, 600).pipe(writableStream); +pipeline.clone().extract({ left: 20, top: 20, width: 100, height: 100 }).pipe(writableStream); +readableStream.pipe(pipeline); +// firstWritableStream receives auto-rotated, resized readableStream +// secondWritableStream receives auto-rotated, extracted region of readableStream + +const image: sharp.SharpInstance = sharp(input); +image + .metadata() + .then(function(metadata: sharp.Metadata) { + if (metadata.width) { + return image + .resize(Math.round(metadata.width / 2)) + .webp() + .toBuffer(); + } + }) + .then(function(data: Buffer) { + // data contains a WebP image half the width and height of the original JPEG + }); + +pipeline = sharp() + .rotate() + .resize(undefined, 200) + .toBuffer(function(err: Error, outputBuffer: Buffer, info: sharp.OutputInfo) { + // outputBuffer contains 200px high JPEG image data, + // auto-rotated using EXIF Orientation tag + // info.width and info.height contain the dimensions of the resized image + }); +readableStream.pipe(pipeline); + +sharp(input) + .extract({ left: 0, top: 0, width: 100, height: 100 }) + .toFile("output", function(err: Error) { + // Extract a region of the input image, saving in the same format. + }); + +sharp(input) + .extract({ left: 0, top: 0, width: 100, height: 100 }) + .resize(200, 200) + .extract({ left: 0, top: 0, width: 100, height: 100 }) + .toFile("output", function(err: Error) { + // Extract a region, resize, then extract from the resized image + }); + +// Resize to 140 pixels wide, then add 10 transparent pixels +// to the top, left and right edges and 20 to the bottom edge +sharp(input) + .resize(140) + .background({ r: 0, g: 0, b: 0, alpha: 0 }) + .extend({ top: 10, bottom: 20, left: 10, right: 10 }); + +sharp(input) + .convolve({ + width: 3, + height: 3, + kernel: [-1, 0, 1, -2, 0, 2, -1, 0, 1] + }) + .raw() + .toBuffer(function(err: Error, data: Buffer, info: sharp.OutputInfo) { + // data contains the raw pixel data representing the convolution + // of the input image with the horizontal Sobel operator + }); + +sharp('input.tiff') + .png() + .tile({ + size: 512 + }) + .toFile('output.dz', function(err: Error, info: sharp.OutputInfo) { + // output.dzi is the Deep Zoom XML definition + // output_files contains 512x512 tiles grouped by zoom level + }); + +sharp(input) + .resize(200, 300, { + kernel: sharp.kernel.lanczos2, + interpolator: sharp.interpolator.nohalo + }) + .background('white') + .embed() + .toFile('output.tiff') + .then(function() { + // output.tiff is a 200 pixels wide and 300 pixels high image + // containing a lanczos2/nohalo scaled version, embedded on a white canvas, + // of the image data in inputBuffer + }); + +transformer = sharp() + .resize(200, 200) + .crop(sharp.strategy.entropy) + .on('error', function(err: Error) { + console.log(err); + }); +// Read image data from readableStream +// Write 200px square auto-cropped image data to writableStream +readableStream.pipe(transformer).pipe(writableStream); + +sharp('input.gif') + .resize(200, 300) + .background({ r: 0, g: 0, b: 0, alpha: 0 }) + .embed() + .toFormat(sharp.format.webp) + .toBuffer(function(err: Error, outputBuffer: Buffer) { + if (err) { + throw err; + } + // outputBuffer contains WebP image data of a 200 pixels wide and 300 pixels high + // containing a scaled version, embedded on a transparent canvas, of input.gif + }); + +sharp(input) + .resize(200, 200) + .max() + .toFormat('jpeg') + .toBuffer() + .then(function(outputBuffer: Buffer) { + // outputBuffer contains JPEG image data no wider than 200 pixels and no higher + // than 200 pixels regardless of the inputBuffer image dimensions + }); + +const stats = sharp.cache(); + +sharp.cache({ items: 200 }); +sharp.cache({ files: 0 }); +sharp.cache(false); + +const threads = sharp.concurrency(); // 4 +sharp.concurrency(2); // 2 +sharp.concurrency(0); // 4 + +const counters = sharp.counters(); // { queue: 2, process: 4 } + +let simd: boolean = sharp.simd(); +// simd is `true` if SIMD is currently enabled + +simd = sharp.simd(true); +// attempts to enable the use of SIMD, returning true if available diff --git a/sharp/tsconfig.json b/sharp/tsconfig.json new file mode 100644 index 0000000000..d896ff0b33 --- /dev/null +++ b/sharp/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "types", + "typeRoots": [ + "types" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sharp-tests.ts" + ] +} \ No newline at end of file diff --git a/sharp/tslint.json b/sharp/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/sharp/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 9af924c0809717524634c35bb48c6ebfccaa411d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Nguyen?= Date: Fri, 27 Jan 2017 21:11:18 +0100 Subject: [PATCH 72/87] Fixed tsconfig.json and removed exports from namespace --- sharp/index.d.ts | 78 ++++++++++++++++++++++----------------------- sharp/tsconfig.json | 4 +-- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/sharp/index.d.ts b/sharp/index.d.ts index a11385aaa7..119e1d9b10 100644 --- a/sharp/index.d.ts +++ b/sharp/index.d.ts @@ -16,41 +16,41 @@ import { Duplex } from "stream"; */ declare function sharp(input?: string | Buffer, options?: sharp.SharpOptions): sharp.SharpInstance; declare namespace sharp { - export const gravity: sharp.GravityEnum; - export const strategy: sharp.StrategyEnum; + const gravity: sharp.GravityEnum; + const strategy: sharp.StrategyEnum; /** * Gets, or when options are provided sets, the limits of libvips' operation cache. Existing entries in the cache will be trimmed after any change in limits. This method always returns cache statistics, useful for determining how much working memory is required for a particular task. * @param {boolean|sharp.CacheOptions} options Object with the cache options, or Boolean where true uses default cache settings and false removes all caching. * @returns {Object} */ - export function cache(options?: boolean | sharp.CacheOptions): CacheResult; + function cache(options?: boolean | sharp.CacheOptions): CacheResult; /** * Gets, or when a concurrency is provided sets, the number of threads libvips' should create to process each image. * @param {number} concurrency concurrency value */ - export function concurrency(threads?: number): number; + function concurrency(threads?: number): number; /** * Provides access to internal task counters. * @returns {sharp.SharpCounters} Object containing task counters */ - export function counters(): sharp.SharpCounters; + function counters(): sharp.SharpCounters; /** * Get and set use of SIMD vector unit instructions. * @param {boolean} enable enable or disable use of SIMD vector unit instructions * @returns {boolean} true if usage of SIMD vector unit instructions is enabled */ - export function simd(enable?: boolean): boolean; - export const kernel: sharp.KernelEnum; - export const interpolator: sharp.InterpolatorEnum; + function simd(enable?: boolean): boolean; + const kernel: sharp.KernelEnum; + const interpolator: sharp.InterpolatorEnum; /** * Object containing nested boolean values representing the available input and output formats/methods. */ - export const format: FormatEnum; + const format: FormatEnum; /** An EventEmitter that emits a change event when a task is either queued, waiting for libuv to provide a worker thread, complete */ - export const queue: NodeJS.EventEmitter; + const queue: NodeJS.EventEmitter; /** An Object containing the version numbers of libvips and its dependencies. */ - export const versions: string[]; - export const bool: BoolEnum; + const versions: string[]; + const bool: BoolEnum; interface SharpInstance extends Duplex { /** @@ -376,14 +376,14 @@ declare namespace sharp { tile(options: TileOptions): SharpInstance; } - export interface SharpOptions { + interface SharpOptions { /** integral number representing the DPI for vector images. */ density?: number; /** describes raw pixel image data. */ raw?: Raw; } - export interface CacheOptions { + interface CacheOptions { /** is the maximum memory in MB to use for this cache */ memory?: number; /** is the maximum number of files to hold open */ @@ -392,18 +392,18 @@ declare namespace sharp { items?: number; } - export interface SharpCounters { + interface SharpCounters { queue: number; process: number; } - export interface Raw { + interface Raw { width: number; height: number; channels: number; } - export interface Metadata { + interface Metadata { /** Name of decoder used to decompress image data e.g. jpeg, png, webp, gif, svg */ format?: string; /** Number of pixels wide */ @@ -428,7 +428,7 @@ declare namespace sharp { icc?: Buffer; } - export interface JpegOptions extends OutputOptions { + interface JpegOptions extends OutputOptions { /** Use progressive (interlace) scan (optional, default false) */ progressive?: boolean; /** Set to '4:4:4' to prevent chroma subsampling when quality <= 90 (optional, default '4:2:0') */ @@ -443,7 +443,7 @@ declare namespace sharp { optimizeScans?: boolean; } - export interface PngOptions { + interface PngOptions { /** Use progressive (interlace) scan (optional, default false) */ progressive?: boolean; /** zlib compression level (optional, default 6) */ @@ -454,14 +454,14 @@ declare namespace sharp { force?: boolean; } - export interface OutputOptions { + interface OutputOptions { /** Quality, integer 1-100 (optional, default 80) */ quality?: number; /** Force format output, otherwise attempt to use input format (optional, default true) */ force?: boolean; } - export interface ResizeOptions { + interface ResizeOptions { /** the kernel to use for image reduction. (optional, default 'lanczos3') */ kernel?: string; /** the interpolator to use for image enlargement. (optional, default 'bicubic') */ @@ -472,7 +472,7 @@ declare namespace sharp { centerSampling?: boolean; } - export interface Region { + interface Region { /** zero-indexed offset from left edge */ left?: number; /** zero-indexed offset from top edge */ @@ -483,21 +483,21 @@ declare namespace sharp { height?: number; } - export interface ExtendOptions { + interface ExtendOptions { top?: number; left?: number; bottom?: number; right?: number; } - export interface RGBA { + interface RGBA { r?: number; g?: number; b?: number; alpha?: number; } - export interface Kernel { + interface Kernel { /** width of the kernel in pixels. */ width: number; /** height of the kernel in pixels. */ @@ -510,14 +510,14 @@ declare namespace sharp { offset?: number; } - export interface ThresholdOptions { + interface ThresholdOptions { /** convert to single channel greyscale. (optional, default true) */ greyscale?: boolean; /** alternative spelling for greyscale. (optional, default true) */ grayscale?: boolean; } - export interface OverlayOptions { + interface OverlayOptions { /** gravity at which to place the overlay. (optional, default 'centre') */ gravity?: number; /** the pixel offset from the top edge. */ @@ -532,7 +532,7 @@ declare namespace sharp { raw?: Raw; } - export interface TileOptions { + interface TileOptions { /** Tile size in pixels, a value between 1 and 8192. (optional, default 256) */ size?: number; /** Tile overlap in pixels, a value between 0 and 8192. (optional, default 0) */ @@ -543,7 +543,7 @@ declare namespace sharp { layout?: string; } - export interface OutputInfo { + interface OutputInfo { format: string; size: number; width: number; @@ -551,19 +551,19 @@ declare namespace sharp { channels: number; } - export interface AvailableFormatInfo { + interface AvailableFormatInfo { id: string; input: { file: boolean; buffer: boolean; stream: boolean; }; output: { file: boolean; buffer: boolean; stream: boolean; }; } - export interface KernelEnum { + interface KernelEnum { cubic: string; lanczos2: string; lanczos3: string; } - export interface InterpolatorEnum { + interface InterpolatorEnum { nearest: string; bilinear: string; bicubic: string; @@ -574,13 +574,13 @@ declare namespace sharp { vertexSplitQuadraticBasisSpline: string; } - export interface BoolEnum { + interface BoolEnum { and: string; or: string; eor: string; } - export interface ColourspaceEnum { + interface ColourspaceEnum { multiband: string; "b-w": string; bw: string; @@ -588,7 +588,7 @@ declare namespace sharp { srgb: string; } - export interface GravityEnum { + interface GravityEnum { north: number; northeast: number; southeast: number; @@ -601,12 +601,12 @@ declare namespace sharp { centre: number; } - export interface StrategyEnum { + interface StrategyEnum { entropy: number; attention: number; } - export interface FormatEnum { + interface FormatEnum { jpeg: AvailableFormatInfo; png: AvailableFormatInfo; webp: AvailableFormatInfo; @@ -632,11 +632,11 @@ declare namespace sharp { (): FormatEnum; } - export interface CacheResult { + interface CacheResult { memory: { current: number; high: number; max: number; }; files: { current: number; max: number; }; items: { current: number; max: number; }; } } -export = sharp; \ No newline at end of file +export = sharp; diff --git a/sharp/tsconfig.json b/sharp/tsconfig.json index d896ff0b33..a7b4e6b9d6 100644 --- a/sharp/tsconfig.json +++ b/sharp/tsconfig.json @@ -5,9 +5,9 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "baseUrl": "types", + "baseUrl": "../", "typeRoots": [ - "types" + "../" ], "types": [], "noEmit": true, From c52ae152ef4ee51247da5a70d29756591233f787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Nguyen?= Date: Fri, 27 Jan 2017 21:20:25 +0100 Subject: [PATCH 73/87] Use "lib" in tsconfigs instead of "target". --- sharp/index.d.ts | 8 -------- sharp/tsconfig.json | 4 +++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sharp/index.d.ts b/sharp/index.d.ts index 119e1d9b10..ef2026a782 100644 --- a/sharp/index.d.ts +++ b/sharp/index.d.ts @@ -624,14 +624,6 @@ declare namespace sharp { v: AvailableFormatInfo; } - interface FormatObject extends FormatEnum { - /** - * Returns an Object containing nested boolean values representing the available input and output formats/methods. - * @returns Object containing available formats - */ - (): FormatEnum; - } - interface CacheResult { memory: { current: number; high: number; max: number; }; files: { current: number; max: number; }; diff --git a/sharp/tsconfig.json b/sharp/tsconfig.json index a7b4e6b9d6..eafee068c7 100644 --- a/sharp/tsconfig.json +++ b/sharp/tsconfig.json @@ -1,7 +1,9 @@ { "compilerOptions": { "module": "commonjs", - "target": "es6", + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, From d79f340d574873ca4deabd545ee4b9fdab1164ec Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Fri, 27 Jan 2017 15:23:51 -0800 Subject: [PATCH 74/87] Add tests and fix broken test --- react-day-picker/index.d.ts | 2 +- react-dom/index.d.ts | 4 ++-- react-input-mask/index.d.ts | 2 +- react-native-scrollable-tab-view/index.d.ts | 18 +++++++++--------- .../react-native-swiper-tests.tsx | 2 +- react/index.d.ts | 4 ++-- react/test/tsx.tsx | 3 +++ 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/react-day-picker/index.d.ts b/react-day-picker/index.d.ts index 01c5492922..f2993d95c5 100644 --- a/react-day-picker/index.d.ts +++ b/react-day-picker/index.d.ts @@ -75,7 +75,7 @@ declare namespace ReactDayPicker { toMonth?: Date; localeUtils?: LocaleUtils; locale?: string; - captionElement?: React.ReactElement; + captionElement?: React.ReactElement | null; onDayClick?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; onDayTouchTap?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; onDayMouseEnter?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; diff --git a/react-dom/index.d.ts b/react-dom/index.d.ts index 00520fc6ed..bf0a246211 100644 --- a/react-dom/index.d.ts +++ b/react-dom/index.d.ts @@ -28,7 +28,7 @@ declare namespace ReactDOM { container: Element | null, callback?: (component: T) => any): T; function render

( - element: ReactElement

, + element: ReactElement

| null, container: Element | null, callback?: (component?: Component | Element) => any): Component | Element | void; @@ -57,7 +57,7 @@ declare namespace ReactDOM { callback?: () => any): void; function unstable_renderSubtreeIntoContainer

( parentComponent: Component, - element: ReactElement

, + element: ReactElement

| null, container: Element, callback?: (component?: Component | Element) => any): Component | Element | void; } diff --git a/react-input-mask/index.d.ts b/react-input-mask/index.d.ts index 6fc8c6008f..c6acce5858 100644 --- a/react-input-mask/index.d.ts +++ b/react-input-mask/index.d.ts @@ -13,7 +13,7 @@ declare namespace reactInputMask { * * `9`: `0-9` * * `a`: `A-Z, a-z` * * `\*`: `A-Z, a-z, 0-9` - * + * * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings. For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}` */ mask: string; diff --git a/react-native-scrollable-tab-view/index.d.ts b/react-native-scrollable-tab-view/index.d.ts index 2f22f1bcf4..9287ede79d 100644 --- a/react-native-scrollable-tab-view/index.d.ts +++ b/react-native-scrollable-tab-view/index.d.ts @@ -37,9 +37,9 @@ export interface renderTabBarProperties { interface ScrollableTabViewProperties extends React.Props { /** - * tabBarPosition (String) Defaults to "top". + * tabBarPosition (String) Defaults to "top". * "bottom" to position the tab bar below content. - * "overlayTop" or "overlayBottom" for a semitransparent tab bar that overlays content. Custom + * "overlayTop" or "overlayBottom" for a semitransparent tab bar that overlays content. Custom * tab bars must consume a style prop on their outer element to support this feature: style={this.props.style}. */ tabBarPosition?: 'top' | 'bottom' | 'overlayTop' | 'overlayBottom'; @@ -50,27 +50,27 @@ interface ScrollableTabViewProperties extends React.Props { initialPage?: number; /** - * (Integer) - set selected tab(can be buggy see + * (Integer) - set selected tab(can be buggy see * https://github.com/skv-headless/react-native-scrollable-tab-view/issues/126 */ page?: number; /** - * onChangeTab (Function) - function to call when tab changes, should accept 1 argument which is - * an Object containing two keys: i: the index of the tab that is selected, ref: the ref of the + * onChangeTab (Function) - function to call when tab changes, should accept 1 argument which is + * an Object containing two keys: i: the index of the tab that is selected, ref: the ref of the * tab that is selected */ onChangeTab?: (value: onChangeTabProperties) => void; /** - * onScroll (Function) - function to call when the pages are sliding, + * onScroll (Function) - function to call when the pages are sliding, * should accept 1 argument which is an Float number representing the page position in the slide frame. */ onScroll?: (value: number) => void; /** * renderTabBar (Function:ReactComponent) - accept 1 argument props and should return a component - * to use as the tab bar. The component has goToPage, tabs, activeTab and ref added to the props, + * to use as the tab bar. The component has goToPage, tabs, activeTab and ref added to the props, * and should implement setAnimationValue to be able to animate itself along with the tab content. * You can manually pass the props to the TabBar component. */ @@ -82,7 +82,7 @@ interface ScrollableTabViewProperties extends React.Props { style?: ViewStyle; /** - * contentProps (Object) - props that are applied to root ScrollView/ViewPagerAndroid. + * contentProps (Object) - props that are applied to root ScrollView/ViewPagerAndroid. * Note that overriding defaults set by the library may break functionality; see the source for details. */ contentProps?: React.ScrollViewProperties; @@ -98,7 +98,7 @@ interface ScrollableTabViewProperties extends React.Props { locked?: boolean; /** - * prerenderingSiblingsNumber (Integer) - pre-render nearby # sibling, Infinity === render all + * prerenderingSiblingsNumber (Integer) - pre-render nearby # sibling, Infinity === render all * the siblings, default to 0 === render current page. */ prerenderingSiblingsNumber?: number; diff --git a/react-native-swiper/react-native-swiper-tests.tsx b/react-native-swiper/react-native-swiper-tests.tsx index 93cdfcfd18..c8dae8511e 100644 --- a/react-native-swiper/react-native-swiper-tests.tsx +++ b/react-native-swiper/react-native-swiper-tests.tsx @@ -18,7 +18,7 @@ class SwiperTest extends React.Component { super(props); } - public render(): React.ReactElement { + public render(): React.ReactElement | null { return ( diff --git a/react/index.d.ts b/react/index.d.ts index 6f88127305..61aa81ab01 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -168,7 +168,7 @@ declare namespace React { setState(f: (prevState: S, props: P) => Pick, callback?: () => any): void; setState(state: Pick, callback?: () => any): void; forceUpdate(callBack?: () => any): void; - render(): JSX.Element | null; + render(): JSX.Element; // React.Props is now deprecated, which means that the `children` // property is not available on `P` by default, even though you can @@ -2624,7 +2624,7 @@ declare global { type Element = JSXElement | null; interface ElementClass extends React.Component { - render(): JSX.Element | null; + render(): JSX.Element; } interface ElementAttributesProperty { props: {}; } diff --git a/react/test/tsx.tsx b/react/test/tsx.tsx index 0531cb52c0..0b0bc096ae 100644 --- a/react/test/tsx.tsx +++ b/react/test/tsx.tsx @@ -32,3 +32,6 @@ StatelessComponent2.defaultProps = { ; + +const CustomComponent = (props: { flag: boolean }) => props.flag ? React.createElement('div') : null; +const UseComponent2 = (f: boolean) => ; From 7a05f51b8d4078f5a20057550a4d0fcbcd0d2771 Mon Sep 17 00:00:00 2001 From: Gregor MacDougall Date: Fri, 27 Jan 2017 21:53:38 -0500 Subject: [PATCH 75/87] Correct Jest toBeCloseTo signature In Jest .toBeCloseTo's second parameter is optional with a default of 5. See: https://facebook.github.io/jest/docs/api.html#tobeclosetonumber-numdigits This updates the type definition to make this parameter optional as well. --- jest/index.d.ts | 2 +- jest/jest-tests.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jest/index.d.ts b/jest/index.d.ts index f376ea5bcc..cb25dcc758 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -117,7 +117,7 @@ declare namespace jest { toBe(expected: any): void; toBeCalled(): void; toBeCalledWith(...args: any[]): void; - toBeCloseTo(expected: number, delta: number): void; + toBeCloseTo(expected: number, delta?: number): void; toBeDefined(): void; toBeFalsy(): void; toBeGreaterThan(expected: number): void; diff --git a/jest/jest-tests.ts b/jest/jest-tests.ts index 913a671fa1..4f54d44236 100644 --- a/jest/jest-tests.ts +++ b/jest/jest-tests.ts @@ -147,6 +147,10 @@ describe('compartion', function () { it('works sanely with simple decimals', function () { expect(0.2 + 0.1).toBeCloseTo(0.3, 5); }); + + it('works sanely with simple decimals and the default delta', function () { + expect(0.2 + 0.1).toBeCloseTo(0.3); + }); }); describe('toThrow API', function () { From 1043ffe71c4cdea7f0a0e97f022e70c018e1e01f Mon Sep 17 00:00:00 2001 From: Paul Isache Date: Fri, 27 Jan 2017 08:49:48 +0200 Subject: [PATCH 76/87] Steed - declare namespace and modify tests --- steed/index.d.ts | 79 +++++++++++++------------- steed/steed-tests.ts | 129 +++++++++++++++++-------------------------- 2 files changed, 92 insertions(+), 116 deletions(-) diff --git a/steed/index.d.ts b/steed/index.d.ts index f88669e92c..ba4b199999 100644 --- a/steed/index.d.ts +++ b/steed/index.d.ts @@ -3,48 +3,49 @@ // Definitions by: Paul Isache // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -interface Dictionary { [key: string]: T; } -interface ErrorCallback { (err?: T): void; } -interface SteedResultCallback { (err: E, result: T): void; } -interface SteedResultArrayCallback { (err: E, results: T[]): void; } -interface SteedResultObjectCallback { (err: E, results: Dictionary): void; } +declare namespace steed { + interface Dictionary { [key: string]: T; } + interface ErrorCallback { (err?: T): void; } -interface SteedWorker { (task: T, callback: ErrorCallback): void; } -interface SteedIterator { (item: T, callback: ErrorCallback): void; } -interface SteedResultIterator { (item: T, callback: SteedResultCallback): void; } -interface SteedFunction { (callback: (err?: E, result?: T) => void): void; } + interface SteedResultCallback { (err: E, result: T): void; } + interface SteedResultArrayCallback { (err: E, results: T[]): void; } + interface SteedResultObjectCallback { (err: E, results: Dictionary): void; } -interface SteedQueue { - push(task: T | T[], callback?: ErrorCallback | SteedResultCallback): void; - unshift(task: T | T[], callback?: ErrorCallback): void; - pause(): void; - resume(): void; - idle(): boolean; - length(): number; - kill(): void; - concurrency: number; - drain: () => any; - empty: () => any; - saturated: () => any; + interface SteedWorker { (task: T, callback: ErrorCallback): void; } + interface SteedIterator { (item: T, callback: ErrorCallback): void; } + interface SteedResultIterator { (item: T, callback: SteedResultCallback): void; } + interface SteedFunction { (callback: (err?: E, result?: T) => void): void; } + + interface SteedQueue { + push(task: T | T[], callback?: ErrorCallback | SteedResultCallback): void; + unshift(task: T | T[], callback?: ErrorCallback): void; + pause(): void; + resume(): void; + idle(): boolean; + length(): number; + kill(): void; + concurrency: number; + drain: () => any; + empty: () => any; + saturated: () => any; + } + + interface Steed { + parallel(tasks: Array>, callback?: SteedResultArrayCallback): void; + parallel(tasks: Dictionary>, callback?: SteedResultObjectCallback): void; + series(tasks: Array>, callback?: SteedResultArrayCallback): void; + series(tasks: Dictionary>, callback?: SteedResultObjectCallback): void; + waterfall(tasks: Function[], callback?: SteedResultCallback): void; + each(arr: T[] | Dictionary, iterator: SteedIterator, callback?: ErrorCallback): void; + eachSeries: typeof steed.each; + map(arr: T[] | Dictionary, iterator: SteedResultIterator, callback?: SteedResultArrayCallback): void; + mapSeries: typeof steed.map; + queue(worker: SteedWorker, concurrency?: number): SteedQueue; + queue(worker: SteedResultIterator, concurrency?: number): SteedQueue; + } } -interface Steed { - parallel(tasks: Array>, callback?: SteedResultArrayCallback): void; - parallel(tasks: Dictionary>, callback?: SteedResultObjectCallback): void; - series(tasks: Array>, callback?: SteedResultArrayCallback): void; - series(tasks: Dictionary>, callback?: SteedResultObjectCallback): void; - waterfall(tasks: Function[], callback?: SteedResultCallback): void; - each(arr: T[] | Dictionary, iterator: SteedIterator, callback?: ErrorCallback): void; - eachSeries: typeof steed.each; - map(arr: T[] | Dictionary, iterator: SteedResultIterator, callback?: SteedResultArrayCallback): void; - mapSeries: typeof steed.map; - queue(worker: SteedWorker, concurrency?: number): SteedQueue; - queue(worker: SteedResultIterator, concurrency?: number): SteedQueue; -} +declare const steed: steed.Steed; -declare const steed: Steed; - -declare module "steed" { - export = steed; -} +export = steed; diff --git a/steed/steed-tests.ts b/steed/steed-tests.ts index 729e59472f..685654cc52 100644 --- a/steed/steed-tests.ts +++ b/steed/steed-tests.ts @@ -1,19 +1,14 @@ /// -import fs = require("fs"); -import process = require("process"); +import steed = require('steed') declare var path: { - exists: (path: string, callback?: (err: Error, exists: boolean) => any) => void; + exists: (path: string, callback?: (error: Error, exists: boolean) => any) => void; }; -function funcStringCbErrBoolean(v:string, cb:(err:Error,res:boolean) => void) {} +function funcStringCbErrBoolean(v: string, cb: (error: Error, res: boolean) => void) { } function callback() { } -steed.map(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); -steed.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); - - steed.parallel([ function () { }, function () { } @@ -25,16 +20,16 @@ steed.series([ ]); var data: any[] = []; -function steedProcess(item: any, callback: (err: Error, result: any) => void) { } -steed.map(data, steedProcess, function (err, results) { +function steedProcess(item: any, callback: (error: Error, result: any) => void) { } +steed.map(data, steedProcess, function (error, results) { console.log(results); }); var openFiles = ['file1', 'file2']; -var saveFile = function (file:string,cb:(err:Error)=>void) { } -steed.each(openFiles, saveFile, function (err:Error) { }); -steed.eachSeries(openFiles, saveFile, function (err:Error) { }); +var saveFile = function (file: string, cb: (error: Error) => void) { } +steed.each(openFiles, saveFile, function (error: Error) { }); +steed.eachSeries(openFiles, saveFile, function (error: Error) { }); // Control Flow // @@ -46,9 +41,9 @@ steed.series([ callback(undefined, 'two'); }, ], -function (err, results) { }); + function (error, results) { }); -steed.series([ +steed.series([ function (callback) { callback(undefined, 'one'); }, @@ -56,7 +51,7 @@ steed.series([ callback(undefined, 'two'); }, ], -function (err, results) { }); + function (error, results) { }); steed.series({ one: function (callback) { @@ -70,9 +65,9 @@ steed.series({ }, 100); }, }, -function (err, results) { }); + function (error, results) { }); -steed.series({ +steed.series({ one: function (callback) { setTimeout(function () { callback(undefined, 1); @@ -84,7 +79,7 @@ steed.series({ }, 100); }, }, -function (err, results) { }); + function (error, results) { }); steed.parallel([ function (callback) { @@ -98,9 +93,9 @@ steed.parallel([ }, 100); }, ], -function (err, results) { }); + function (error, results) { }); -steed.parallel([ +steed.parallel([ function (callback) { setTimeout(function () { callback(undefined, 'one'); @@ -112,7 +107,7 @@ steed.parallel([ }, 100); }, ], -function (err, results) { }); + function (error, results) { }); steed.parallel({ @@ -127,9 +122,9 @@ steed.parallel({ }, 100); }, }, -function (err, results) { }); + function (error, results) { }); -steed.parallel({ +steed.parallel({ one: function (callback) { setTimeout(function () { callback(undefined, 1); @@ -141,7 +136,7 @@ steed.parallel({ }, 100); }, }, - function (err, results) { }); + function (error, results) { }); function whileFn(callback: any) { count++; @@ -161,10 +156,10 @@ steed.waterfall([ function (arg1: any, callback: any) { callback(null, 'done'); } -], function (err, result) { }); +], function (error, result) { }); -var q = steed.queue(function (task: any, callback: () => void) { +var q = steed.queue(function (task: any, callback: () => void) { console.log('hello ' + task.name); callback(); }, 2); @@ -180,7 +175,7 @@ q.push({ name: 'bar' }, function (err) { console.log('finished processing bar'); }); -q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { +q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (error: Error) { console.log('finished processing bar'); }); @@ -190,22 +185,22 @@ q.unshift({ name: 'bar' }, function (err) { console.log('finished processing bar'); }); -q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { +q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (error: Error) { console.log('finished processing bar'); }); -var qLength : number = q.length(); -var qIsIdle : boolean = q.idle(); +var qLength: number = q.length(); +var qIsIdle: boolean = q.idle(); -q.saturated = function() { +q.saturated = function () { console.log('queue is saturated.'); } -q.empty = function() { +q.empty = function () { console.log('queue is empty.'); } -q.drain = function() { +q.drain = function () { console.log('queue was drained.'); } @@ -214,7 +209,7 @@ q.resume(); q.kill(); // tests for strongly typed tasks -var q2 = steed.queue(function (task: string, callback: () => void) { +var q2 = steed.queue(function (task: string, callback: () => void) { console.log('Task: ' + task); callback(); }, 1); @@ -225,7 +220,7 @@ q2.push('task2', function (error) { console.log('Finished tasks'); }); -q2.push(['task3', 'task4', 'task5'], function (error) { +q2.push(['task3', 'task4', 'task5'], function (error: Error) { console.log('Finished tasks'); }); @@ -235,49 +230,29 @@ q2.unshift('task2', function (error) { console.log('Finished tasks'); }); -q2.unshift(['task3', 'task4', 'task5'], function (error) { +q2.unshift(['task3', 'task4', 'task5'], function (error: Error) { console.log('Finished tasks'); }); - -// var aq = steed.queue(function (level: number, callback: (error : Error, newLevel: number) => void) { -// console.log('hello ' + level); -// callback(null, level+1); -// }); -// -// aq.push(1, function (err : Error, newLevel : number) { -// console.log('finished processing bar' + newLevel); -// }); - - steed.parallel([ - function (callback: ( err:Error, val:string ) => void ) { }, + function (callback: (error: Error, val: string) => void) { }, function (callback) { } ], -function (err:Error,results:Array) { - steed.series([ - function (callback) { }, - function email_link(callback) { } - ]); -}); - -steed.parallel([ - function (callback) { - fs.writeFile('testfile1', 'test1', callback); - }, - function (callback) { - fs.writeFile('testfile2', 'test2', callback); - }, -]); + function (error: Error, results: Array) { + steed.series([ + function (callback) { }, + function email_link(callback) { } + ]); + }); // each -steed.each({ +steed.each({ "a": 1, "b": 2 -}, function(val: number, next: ErrorCallback): void { +}, function (val: number, next: steed.ErrorCallback): void { - setTimeout(function(): void { + setTimeout(function (): void { console.log(`steed.each: ${val}`); @@ -285,7 +260,7 @@ steed.each({ }, 500); -}, function(err?: Error): void { +}, function (err?: Error): void { console.log("steed.each: done."); @@ -294,9 +269,9 @@ steed.each({ steed.eachSeries({ "a": 1, "b": 2 -}, function(val: number, next: ErrorCallback): void { +}, function (val: number, next: steed.ErrorCallback): void { - setTimeout(function(): void { + setTimeout(function (): void { console.log(`steed.eachSeries: ${val}`); @@ -304,7 +279,7 @@ steed.eachSeries({ }, 500); -}, function(err?: Error): void { +}, function (err?: Error): void { console.log("steed.eachSeries: done."); @@ -316,9 +291,9 @@ steed.map({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: SteedResultCallback): void { +}, function (val: number, next: steed.SteedResultCallback): void { - setTimeout(function(): void { + setTimeout(function (): void { console.log(`steed.map: ${val}`); @@ -326,7 +301,7 @@ steed.map({ }, 500); -}, function(err: Error, results: string[]): void { +}, function (error: Error, results: string[]): void { console.log("steed.map: done with results", results); @@ -336,9 +311,9 @@ steed.mapSeries({ "a": 1, "b": 2, "c": 3 -}, function(val: number, next: SteedResultCallback): void { +}, function (val: number, next: steed.SteedResultCallback): void { - setTimeout(function(): void { + setTimeout(function (): void { console.log(`steed.mapSeries: ${val}`); @@ -346,7 +321,7 @@ steed.mapSeries({ }, 500); -}, function(err: Error, results: string[]): void { +}, function (error: Error, results: string[]): void { console.log("steed.mapSeries: done with results", results); From 65131e2649dd9ae86214634cd66056d2c791e712 Mon Sep 17 00:00:00 2001 From: Sander Koenders Date: Sat, 28 Jan 2017 22:56:51 +0100 Subject: [PATCH 77/87] Added ns-api typings --- ns-api/index.d.ts | 66 ++++++++++++++++++++++++++++++++++++++++++ ns-api/ns-api-tests.ts | 56 +++++++++++++++++++++++++++++++++++ ns-api/tsconfig.json | 20 +++++++++++++ ns-api/tslint.json | 1 + 4 files changed, 143 insertions(+) create mode 100644 ns-api/index.d.ts create mode 100644 ns-api/ns-api-tests.ts create mode 100644 ns-api/tsconfig.json create mode 100644 ns-api/tslint.json diff --git a/ns-api/index.d.ts b/ns-api/index.d.ts new file mode 100644 index 0000000000..db66f109f3 --- /dev/null +++ b/ns-api/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for ns-api 2.0 +// Project: https://github.com/fvdm/nodejs-ns-api#readme +// Definitions by: Sander Koenders +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = nsApi; +declare function nsApi(conf: nsApi.Configuration): nsApi; + +interface nsApi { + /** + * Vertrektijden - departure times + * + * @callback callback + * @param station {string} - Station ID + * @param callback {function} - `function (err, data) {}` + * @returns {void} + */ + vertrektijden(station: string, callback: (err: string, data: {}) => void): void; + + /** + * Reisadvies - travel advise + * + * @callback callback + * @param params {object} - Parameters + * @param callback {function} - `function (err, data) {}` + * @returns {void} + */ + reisadvies(params: {}, callback: (err: string, data: {}) => void): void; + + /** + * Prijzen - tariffs + * + * @callback callback + * @param params {object} - Parameters + * @param callback {function} - `function (err, data) {}` + * @returns {void} + */ + prijzen(params: {}, callback: (err: any, data: {}) => void): void; + + /** + * List available stations + * + * @callback callback + * @param [treeKey] {string} - Group by this key + * @param callback {function} - `function (err, data) {}` + */ + stations(treeKey: string, callback: (err: string, data: {}) => void): void; + stations(callback: (err: string, data: {}) => void): void; + + /** + * List disruptions + * + * @callback callback + * @param params {object} - Parameters + * @param callback {function} - `function (err, data) {}` + */ + storingen(params: {}, callback: (err: string, data: {}) => void): void; +} + +declare namespace nsApi { + interface Configuration { + username: string; + password: string; + timeout?: number; + } +} diff --git a/ns-api/ns-api-tests.ts b/ns-api/ns-api-tests.ts new file mode 100644 index 0000000000..8a3b8c5bb6 --- /dev/null +++ b/ns-api/ns-api-tests.ts @@ -0,0 +1,56 @@ +import * as NsApi from "ns-api"; + +let ns: NsApi = NsApi({ + username: "", + password: "", + timeout: 1500 +}); + +ns.vertrektijden("", (err: any, data: Object) => { + if(err) { + console.log(err); + } else { + console.log(data); + } +}); + +// Get travel advise +ns.reisadvies ({}, (err: any, data: Object) => { + if(err) { + console.log(err); + } else { + console.log(data); + } +}); + +ns.prijzen({}, (err: any, data: Object) => { + if(err) { + console.log(err); + } else { + console.log(data); + } +}); + +ns.stations("code", (err: any, data: Object) => { + if(err) { + console.log(err); + } else { + console.log(data); + } +}); + +ns.stations((err: any, data: Object) => { + if(err) { + console.log(err); + } else { + console.log(data); + } +}); + +ns.storingen({}, (err: any, data: Object) => { + if(err) { + console.log(err); + } else { + console.log(data); + } +}); \ No newline at end of file diff --git a/ns-api/tsconfig.json b/ns-api/tsconfig.json new file mode 100644 index 0000000000..fae5845b2d --- /dev/null +++ b/ns-api/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ns-api-tests.ts" + ] +} diff --git a/ns-api/tslint.json b/ns-api/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/ns-api/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 556c7a325edfb519d1a528d29d91efaa47d8d98d Mon Sep 17 00:00:00 2001 From: Benjamin Lim Date: Sun, 29 Jan 2017 06:13:01 +0800 Subject: [PATCH 78/87] feat: lodash-webpack-plugin --- lodash-webpack-plugin/index.d.ts | 34 +++++++++++++++++++ .../lodash-webpack-plugin-tests.ts | 27 +++++++++++++++ lodash-webpack-plugin/tsconfig.json | 20 +++++++++++ lodash-webpack-plugin/tslint.json | 1 + 4 files changed, 82 insertions(+) create mode 100644 lodash-webpack-plugin/index.d.ts create mode 100644 lodash-webpack-plugin/lodash-webpack-plugin-tests.ts create mode 100644 lodash-webpack-plugin/tsconfig.json create mode 100644 lodash-webpack-plugin/tslint.json diff --git a/lodash-webpack-plugin/index.d.ts b/lodash-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..26d633e79f --- /dev/null +++ b/lodash-webpack-plugin/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for lodash-webpack-plugin 0.11 +// Project: https://github.com/lodash/lodash-webpack-plugin#readme +// Definitions by: Benjamin Lim +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin, Webpack } from 'webpack'; + +export = LodashModuleReplacementPlugin; + +declare class LodashModuleReplacementPlugin implements Plugin { + constructor(options?: LodashModuleReplacementPlugin.Options); + apply(thisArg: Webpack, ...args: any[]): void; +} + +declare namespace LodashModuleReplacementPlugin { + export interface Options { + caching?: boolean; + chaining?: boolean; + cloning?: boolean; + coercions?: boolean; + collections?: boolean; + currying?: boolean; + deburring?: boolean; + exotics?: boolean; + flattening?: boolean; + guards?: boolean; + memoizing?: boolean; + metadata?: boolean; + paths?: boolean; + placeholders?: boolean; + shorthands?: boolean; + unicode?: boolean; + } +} diff --git a/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts b/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts new file mode 100644 index 0000000000..cd893f09f0 --- /dev/null +++ b/lodash-webpack-plugin/lodash-webpack-plugin-tests.ts @@ -0,0 +1,27 @@ +import * as LodashModuleReplacementPlugin from 'lodash-webpack-plugin' + +new LodashModuleReplacementPlugin() + +new LodashModuleReplacementPlugin({ + collections: true, + paths: true, +}) + +new LodashModuleReplacementPlugin({ + caching: true, + chaining: true, + cloning: true, + coercions: true, + collections: true, + currying: true, + deburring: true, + exotics: true, + flattening: true, + guards: true, + memoizing: true, + metadata: true, + paths: true, + placeholders: true, + shorthands: true, + unicode: true, +}) diff --git a/lodash-webpack-plugin/tsconfig.json b/lodash-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..03e491ef78 --- /dev/null +++ b/lodash-webpack-plugin/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "lodash-webpack-plugin-tests.ts" + ] +} diff --git a/lodash-webpack-plugin/tslint.json b/lodash-webpack-plugin/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/lodash-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From e52af758df95a81cca186b866742a3e8461757be Mon Sep 17 00:00:00 2001 From: Olmo del Corral Date: Mon, 30 Jan 2017 07:50:58 +0100 Subject: [PATCH 79/87] add justified to tabs --- react-bootstrap/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/react-bootstrap/index.d.ts b/react-bootstrap/index.d.ts index 3e5c69c034..e211264bc7 100644 --- a/react-bootstrap/index.d.ts +++ b/react-bootstrap/index.d.ts @@ -606,6 +606,7 @@ declare namespace ReactBootstrap { position?: string; tabWidth?: any; // TODO: Add more specific type unmountOnExit?: boolean; + justified?: boolean; } type Tabs = React.ClassicComponent; var Tabs: React.ClassicComponentClass; From c1faa58a1a3aa3fe066f30c2b965b71642821dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Kov=C3=A1cs?= Date: Mon, 30 Jan 2017 10:49:02 +0100 Subject: [PATCH 80/87] Add type definitions for dragster --- dragster/dragster-tests.ts | 7 +++++++ dragster/index.d.ts | 12 ++++++++++++ dragster/tsconfig.json | 23 +++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 dragster/dragster-tests.ts create mode 100644 dragster/index.d.ts create mode 100644 dragster/tsconfig.json diff --git a/dragster/dragster-tests.ts b/dragster/dragster-tests.ts new file mode 100644 index 0000000000..e6dea2fd98 --- /dev/null +++ b/dragster/dragster-tests.ts @@ -0,0 +1,7 @@ +import Dragster = require("dragster"); + +var dropzone = document.getElementById("my-dropzone"); +var dragster = new Dragster(dropzone); + +dragster.removeListeners(); +dragster.reset(); \ No newline at end of file diff --git a/dragster/index.d.ts b/dragster/index.d.ts new file mode 100644 index 0000000000..297096bd26 --- /dev/null +++ b/dragster/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for dragster 0.1.3 +// Project: https://github.com/bensmithett/dragster +// Definitions by: Zsolt Kovacs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Dragster { + constructor(elem: HTMLElement); + removeListeners(): void; + reset(): void; +} + +export = Dragster; \ No newline at end of file diff --git a/dragster/tsconfig.json b/dragster/tsconfig.json new file mode 100644 index 0000000000..600f1bed21 --- /dev/null +++ b/dragster/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dragster-tests.ts" + ] +} \ No newline at end of file From d8320ed922b06d321342996f2c7d31e4f39ecf16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Kov=C3=A1cs?= Date: Mon, 30 Jan 2017 10:59:56 +0100 Subject: [PATCH 81/87] Add tslint.json --- dragster/tslint.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 dragster/tslint.json diff --git a/dragster/tslint.json b/dragster/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/dragster/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 033a11cfee057225b1e5f3e192fb879236c5e688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Kov=C3=A1cs?= Date: Mon, 30 Jan 2017 11:01:11 +0100 Subject: [PATCH 82/87] Set strictNullChecks to true --- dragster/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dragster/tsconfig.json b/dragster/tsconfig.json index 600f1bed21..9740d729a0 100644 --- a/dragster/tsconfig.json +++ b/dragster/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From 83724cda4d9932e329971b6b713ec9571a88cb1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Kov=C3=A1cs?= Date: Mon, 30 Jan 2017 11:10:39 +0100 Subject: [PATCH 83/87] Fix test --- dragster/dragster-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dragster/dragster-tests.ts b/dragster/dragster-tests.ts index e6dea2fd98..a05d06e1dd 100644 --- a/dragster/dragster-tests.ts +++ b/dragster/dragster-tests.ts @@ -1,6 +1,6 @@ import Dragster = require("dragster"); -var dropzone = document.getElementById("my-dropzone"); +var dropzone = document.getElementById("my-dropzone") as HTMLElement; var dragster = new Dragster(dropzone); dragster.removeListeners(); From 666f54833ab821abb8170adbd7c481def566ff0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Kov=C3=A1cs?= Date: Mon, 30 Jan 2017 11:17:31 +0100 Subject: [PATCH 84/87] Fix header --- dragster/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dragster/index.d.ts b/dragster/index.d.ts index 297096bd26..997c641d54 100644 --- a/dragster/index.d.ts +++ b/dragster/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for dragster 0.1.3 +// Type definitions for dragster // Project: https://github.com/bensmithett/dragster // Definitions by: Zsolt Kovacs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From a2953a73ed8299e882f7c1751c73195a0f502e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Kov=C3=A1cs?= Date: Mon, 30 Jan 2017 11:20:23 +0100 Subject: [PATCH 85/87] Another fix for header --- dragster/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dragster/index.d.ts b/dragster/index.d.ts index 997c641d54..d60892244e 100644 --- a/dragster/index.d.ts +++ b/dragster/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for dragster +// Type definitions for dragster 0.1 // Project: https://github.com/bensmithett/dragster // Definitions by: Zsolt Kovacs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 9964163a159f93d68a249edec01900d0fe416f96 Mon Sep 17 00:00:00 2001 From: orta Date: Mon, 30 Jan 2017 15:09:05 -0500 Subject: [PATCH 86/87] Add more comments to Jest, and bump version to 18.1.0 --- jest/index.d.ts | 52 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/jest/index.d.ts b/jest/index.d.ts index 401f9ecb0e..b0b53625bb 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Jest 18.0.0 +// Type definitions for Jest 18.1.0 // Project: http://facebook.github.io/jest/ // Definitions by: Asana , Ivo Stratev , jwbay , Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -27,6 +27,7 @@ interface NodeRequire { } declare namespace jest { + /** Provides a way to add Jasmine-compatible matchers into your Jest context. */ function addMatchers(matchers: jasmine.CustomMatcherFactories): typeof jest; /** Disables automatic mocking in the module loader. */ function autoMockOff(): typeof jest; @@ -104,8 +105,16 @@ declare namespace jest { (fn: ProvidesCallback): any; } + /** Creates a test closure */ interface It { + /** + * Creates a test closure. + * + * @param {string} name The name of your test + * @param {fn?} ProvidesCallback The function for your test + */ (name: string, fn?: ProvidesCallback): void; + /** Only runs this test in the current file. */ only: It; skip: It; concurrent: It; @@ -141,48 +150,89 @@ declare namespace jest { [key: string]: (this: MatcherUtils, received: any, actual: any) => { message: () => string, pass: boolean }; } + /** The `expect` function is used every time you want to test a value. You will rarely call `expect` by itself. */ interface Expect { + /** + * The `expect` function is used every time you want to test a value. You will rarely call `expect` by itself. + * + * @param {any} actual The value to apply matchers against. + */ (actual: any): Matchers; anything(): void; + /** Matches anything that was created with the given constructor. You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value. */ any(classType: any): void; + /** Matches any array made up entirely of elements in the provided array. You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value. */ arrayContaining(arr: any[]): void; + /** Verifies that a certain number of assertions are called during a test. This is often useful when testing asynchronous code, in order to make sure that assertions in a callback actually got called. */ assertions(num: number): void; + /** You can use `expect.extend` to add your own matchers to Jest. */ extend(obj: ExpectExtendMap): void; + /** Matches any object that recursively matches the provided keys. This is often handy in conjunction with other asymmetric matchers. */ objectContaining(obj: {}): void; + /** Matches any string that contains the exact provided string */ stringMatching(str: string | RegExp): void; } interface Matchers { + /** If you know how to test something, `.not` lets you test its opposite. */ not: Matchers; lastCalledWith(...args: any[]): void; + /** Checks that a value is what you expect. It uses `===` to check strict equality. Don't use `toBe` with floating-point numbers. */ toBe(expected: any): void; + /** Ensures that a mock function is called. */ toBeCalled(): void; + /** Ensure that a mock function is called with specific arguments. */ toBeCalledWith(...args: any[]): void; + /** Using exact equality with floating point numbers is a bad idea. Rounding means that intuitive things fail. */ toBeCloseTo(expected: number, delta?: number): void; + /** Ensure that a variable is not undefined. */ toBeDefined(): void; + /** When you don't care what a value is, you just want to ensure a value is false in a boolean context. */ toBeFalsy(): void; + /** For comparing floating point numbers. */ toBeGreaterThan(expected: number): void; + /** For comparing floating point numbers. */ toBeGreaterThanOrEqual(expected: number): void; + /** Ensure that an object is an instance of a class. This matcher uses `instanceof` underneath. */ toBeInstanceOf(expected: any): void + /** For comparing floating point numbers. */ toBeLessThan(expected: number): void; + /** For comparing floating point numbers. */ toBeLessThanOrEqual(expected: number): void; + /** This is the same as `.toBe(null)` but the error messages are a bit nicer. So use `.toBeNull()` when you want to check that something is null. */ toBeNull(): void; + /** Use when you don't care what a value is, you just want to ensure a value is true in a boolean context. In JavaScript, there are six falsy values: `false`, `0`, `''`, `null`, `undefined`, and `NaN`. Everything else is truthy. */ toBeTruthy(): void; + /** Used to check that a variable is undefined. */ toBeUndefined(): void; + /** Used when you want to check that an item is in a list. For testing the items in the list, this uses `===`, a strict equality check. */ toContain(expected: any): void; + /** Used when you want to check that an item is in a list. For testing the items in the list, this matcher recursively checks the equality of all fields, rather than checking for object identity. */ toContainEqual(expected: any): void; + /** Used when you want to check that two objects have the same value. This matcher recursively checks the equality of all fields, rather than checking for object identity. */ toEqual(expected: any): void; + /** Ensures that a mock function is called. */ toHaveBeenCalled(): boolean; + /** Ensures that a mock function is called an exact number of times. */ toHaveBeenCalledTimes(expected: number): boolean; + /** Ensure that a mock function is called with specific arguments. */ toHaveBeenCalledWith(...params: any[]): boolean; + /** If you have a mock function, you can use `.toHaveBeenLastCalledWith` to test what arguments it was last called with. */ toHaveBeenLastCalledWith(...params: any[]): boolean; + /** Used to check that an object has a `.length` property and it is set to a certain numeric value. */ toHaveLength(expected: number): void; toHaveProperty(propertyPath: string, value?: any): void; + /** Check that a string matches a regular expression. */ toMatch(expected: string | RegExp): void; + /** Used to check that a JavaScript object matches a subset of the properties of an objec */ toMatchObject(expected: {}): void; + /** This ensures that a value matches the most recent snapshot. Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information. */ toMatchSnapshot(snapshotName?: string): void; + /** Used to test that a function throws when it is called. */ toThrow(): void; + /** If you want to test that a specific error is thrown inside a function. */ toThrowError(error?: string | Constructable | RegExp): void; + /** Used to test that a function throws a error matching the most recent snapshot when it is called. */ toThrowErrorMatchingSnapshot(): void; } From ec9bf7f22990ed5c3d419356e263f595bef7eebb Mon Sep 17 00:00:00 2001 From: Patricio Zavolinsky Date: Mon, 23 Jan 2017 10:48:46 +0000 Subject: [PATCH 87/87] React: Constrain typed changed events to inputs, selects and textareas --- react/index.d.ts | 40 ++++++++++++++++++++++++---------------- react/test/index.ts | 15 +++++++++++++++ 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/react/index.d.ts b/react/index.d.ts index 61aa81ab01..f25e5c0afd 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -81,6 +81,9 @@ declare namespace React { interface HTMLFactory extends DOMFactory, T> { } + interface ChangeTargetHTMLFactory extends DOMFactory, T> { + } + interface SVGFactory extends DOMFactory, SVGElement> { } @@ -270,9 +273,10 @@ declare namespace React { // // Event System // ---------------------------------------------------------------------- - interface SyntheticEventBase { + + interface SyntheticEvent { bubbles: boolean; - currentTarget: EventTarget & CURRENT; + currentTarget: EventTarget & T; cancelable: boolean; defaultPrevented: boolean; eventPhase: number; @@ -283,16 +287,12 @@ declare namespace React { stopPropagation(): void; isPropagationStopped(): boolean; persist(): void; - target: EventTarget & TARGET; + // If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/12239 + target: EventTarget; timeStamp: Date; type: string; } - interface SyntheticEvent extends SyntheticEventBase { - // If you thought target should be `EventTarget & T`, - // see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/12239 - } - interface ClipboardEvent extends SyntheticEvent { clipboardData: DataTransfer; } @@ -312,7 +312,8 @@ declare namespace React { interface FormEvent extends SyntheticEvent { } - interface ChangeEvent extends SyntheticEventBase { + interface ChangeEvent extends SyntheticEvent { + target: EventTarget & T; } interface KeyboardEvent extends SyntheticEvent { @@ -433,6 +434,9 @@ declare namespace React { interface HTMLProps extends HTMLAttributes, ClassAttributes { } + interface ChangeTargetHTMLProps extends ChangeTargetHTMLAttributes, ClassAttributes { + } + interface SVGProps extends SVGAttributes, ClassAttributes { } @@ -465,7 +469,7 @@ declare namespace React { onBlurCapture?: FocusEventHandler; // Form Events - onChange?: ChangeEventHandler; + onChange?: FormEventHandler; onChangeCapture?: FormEventHandler; onInput?: FormEventHandler; onInputCapture?: FormEventHandler; @@ -2149,6 +2153,10 @@ declare namespace React { unselectable?: boolean; } + interface ChangeTargetHTMLAttributes extends HTMLAttributes { + onChange?: ChangeEventHandler; + } + // this list is "complete" in that it contains every SVG attribute // that React supports, but the types can be improved. // Full list here: https://facebook.github.io/react/docs/dom-elements.html @@ -2459,7 +2467,7 @@ declare namespace React { i: HTMLFactory; iframe: HTMLFactory; img: HTMLFactory; - input: HTMLFactory; + input: ChangeTargetHTMLFactory; ins: HTMLFactory; kbd: HTMLFactory; keygen: HTMLFactory; @@ -2494,7 +2502,7 @@ declare namespace React { samp: HTMLFactory; script: HTMLFactory; section: HTMLFactory; - select: HTMLFactory; + select: ChangeTargetHTMLFactory; small: HTMLFactory; source: HTMLFactory; span: HTMLFactory; @@ -2506,7 +2514,7 @@ declare namespace React { table: HTMLFactory; tbody: HTMLFactory; td: HTMLFactory; - textarea: HTMLFactory; + textarea: ChangeTargetHTMLFactory; tfoot: HTMLFactory; th: HTMLFactory; thead: HTMLFactory; @@ -2686,7 +2694,7 @@ declare global { i: React.HTMLProps; iframe: React.HTMLProps; img: React.HTMLProps; - input: React.HTMLProps; + input: React.ChangeTargetHTMLProps; ins: React.HTMLProps; kbd: React.HTMLProps; keygen: React.HTMLProps; @@ -2722,7 +2730,7 @@ declare global { samp: React.HTMLProps; script: React.HTMLProps; section: React.HTMLProps; - select: React.HTMLProps; + select: React.ChangeTargetHTMLProps; small: React.HTMLProps; source: React.HTMLProps; span: React.HTMLProps; @@ -2734,7 +2742,7 @@ declare global { table: React.HTMLProps; tbody: React.HTMLProps; td: React.HTMLProps; - textarea: React.HTMLProps; + textarea: React.ChangeTargetHTMLProps; tfoot: React.HTMLProps; th: React.HTMLProps; thead: React.HTMLProps; diff --git a/react/test/index.ts b/react/test/index.ts index b575055514..38ad574aa4 100644 --- a/react/test/index.ts +++ b/react/test/index.ts @@ -674,3 +674,18 @@ class SyntheticEventTargetValue extends React.Component<{}, { value: string }> { }); } } + +React.DOM.input({ + onChange: event => { + // `event.target` is guaranteed to be HTMLInputElement + event.target.value; + } +}); + +// A ChangeEvent is a valid FormEvent (maintain compatibility with existing +// event handlers) + +type InputChangeEvent = React.ChangeEvent; +type InputFormEvent = React.FormEvent; +const changeEvent:InputChangeEvent = undefined as any; +const formEvent:InputFormEvent = changeEvent;