Added timeout definitions. (#43843)

This commit is contained in:
newt 2020-04-13 23:34:31 +01:00 committed by GitHub
parent 8d4301f28e
commit b4135370af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 0 deletions

6
types/timeout/index.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
// Type definitions for timeout 0.2
// Project: https://github.com/amccollum/timeout
// Definitions by: newt <https://github.com/itsnewt>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function timeout(name?: string, ms?: number, callback?: () => void): string;

View File

@ -0,0 +1,3 @@
import { timeout } from 'timeout';
timeout('name', 10, () => console.log('I work!')); // $ExpectType string

View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"timeout-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }