diff --git a/notNeededPackages.json b/notNeededPackages.json index be57d76a49..4c33728a01 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1116,6 +1116,12 @@ "sourceRepoURL": "http://onsen.io", "asOfVersion": "2.0.0" }, + { + "libraryName": "p-throttle", + "typingsPackageName": "p-throttle", + "sourceRepoURL": "https://github.com/sindresorhus/p-throttle", + "asOfVersion": "2.0.0" + }, { "libraryName": "param-case", "typingsPackageName": "param-case", diff --git a/types/p-throttle/index.d.ts b/types/p-throttle/index.d.ts deleted file mode 100644 index ae331e1ca2..0000000000 --- a/types/p-throttle/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Type definitions for p-throttle 1.1 -// Project: https://github.com/sindresorhus/p-throttle#readme -// Definitions by: BendingBender -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = pThrottle; - -declare function pThrottle(fn: () => PromiseLike | R, limit: number, interval: number): (() => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1) => PromiseLike | R, limit: number, interval: number): ((arg1: T1) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1, arg2: T2) => PromiseLike | R, limit: number, interval: number): ((arg1: T1, arg2: T2) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1, arg2: T2, arg3: T3) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise) & { abort(): void; }; -declare function pThrottle( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => Promise) & { abort(): void; }; -declare function pThrottle( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => Promise) & { abort(): void; }; -declare function pThrottle( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => Promise) & { abort(): void; }; -declare function pThrottle( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10) => PromiseLike | R, - limit: number, - interval: number): ((arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10) => Promise) & { abort(): void; }; -declare function pThrottle(fn: (...args: any[]) => PromiseLike | R, limit: number, interval: number): ((...args: any[]) => Promise) & { abort(): void; }; - -declare namespace pThrottle { - class AbortError extends Error { - readonly name: 'AbortError'; - - constructor(); - } -} diff --git a/types/p-throttle/p-throttle-tests.ts b/types/p-throttle/p-throttle-tests.ts deleted file mode 100644 index 713d445e6b..0000000000 --- a/types/p-throttle/p-throttle-tests.ts +++ /dev/null @@ -1,47 +0,0 @@ -import pThrottle = require('p-throttle'); - -const now = Date.now(); - -const throttled = pThrottle((i: number) => { - const secDiff = ((Date.now() - now) / 1000).toFixed(); - return Promise.resolve(`${i}: ${secDiff}s`); -}, 2, 1000); - -for (let i = 1; i <= 6; i++) { - throttled(i).then(res => { - const str: string = res; - }); -} - -throttled.abort(); - -pThrottle(() => true, 2, 3).abort(); -pThrottle(() => true, 2, 3)(); -pThrottle((n: number, s: string) => true, 2, 3).abort(); -pThrottle((n: number, s: string) => true, 2, 3)(1, 's'); -pThrottle((n: number, s: string, b: boolean) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean) => true, 2, 3)(1, 's', true); -pThrottle((n: number, s: string, b: boolean, n2: number) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number) => true, 2, 3)(1, 's', true, 1); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string) => true, 2, 3)(1, 's', true, 1, 's'); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean) => true, 2, 3)(1, 's', true, 1, 's', false); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1, 2); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1, 2, 3); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number) => true, 2, 3).abort(); -pThrottle((n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number) => true, 2, 3)(1, 's', true, 1, 's', false, 1, 2, 3, 4); -pThrottle( - (n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number, s3: string) => true, - 2, - 3).abort(); -pThrottle( - (n: number, s: string, b: boolean, n2: number, s2: string, b2: boolean, n3: number, n4: number, n5: number, n6: number, s3: string) => true, - 2, - 3)(1, 's', true, 1, 's', false, 1, 2, 3, 4, 'as'); - -throw new pThrottle.AbortError(); diff --git a/types/p-throttle/tsconfig.json b/types/p-throttle/tsconfig.json deleted file mode 100644 index 81852e4d18..0000000000 --- a/types/p-throttle/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "p-throttle-tests.ts" - ] -} \ No newline at end of file diff --git a/types/p-throttle/tslint.json b/types/p-throttle/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/p-throttle/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" }