Add typings for yoctodelay (#27592)

This commit is contained in:
Sean Genabe
2018-07-26 10:05:37 -07:00
committed by Andy
parent aa312002f4
commit ada007d85b
4 changed files with 40 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for yoctodelay 1.1
// Project: https://github.com/sindresorhus/yoctodelay#readme
// Definitions by: Sean Marvi Oliver Genabe <https://github.com/seangenabe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Delay the promise and then resolve.
* @param ms Milliseconds to delay the promise.
*/
declare function delay(ms: number): Promise<void>;
export = delay;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": [
"index.d.ts",
"yoctodelay-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+4
View File
@@ -0,0 +1,4 @@
import delay = require('yoctodelay'); // delay is(ms: number) => Promise<void>
// $ExpectType Promise<void>
delay(4);