Merge pull request #31436 from BendingBender/p-min-delay

[p-min-delay] Add types
This commit is contained in:
Nathan Shively-Sanders
2018-12-17 09:35:51 -08:00
committed by GitHub
4 changed files with 48 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for p-min-delay 2.0
// Project: https://github.com/sindresorhus/p-min-delay#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = pMinDelay;
declare function pMinDelay<T>(
input: PromiseLike<T>,
minimumDelay: number,
options?: pMinDelay.Options
): Promise<T>;
declare namespace pMinDelay {
interface Options {
delayRejection?: boolean;
}
}
+6
View File
@@ -0,0 +1,6 @@
import pMinDelay = require('p-min-delay');
// $ExpectType Promise<number>
pMinDelay(Promise.resolve(1), 1000);
// $ExpectType Promise<string>
pMinDelay(Promise.resolve("1"), 1000, { delayRejection: false });
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"p-min-delay-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }