mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added timeout definitions. (#43843)
This commit is contained in:
parent
8d4301f28e
commit
b4135370af
6
types/timeout/index.d.ts
vendored
Normal file
6
types/timeout/index.d.ts
vendored
Normal 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;
|
||||
3
types/timeout/timeout-tests.ts
Normal file
3
types/timeout/timeout-tests.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import { timeout } from 'timeout';
|
||||
|
||||
timeout('name', 10, () => console.log('I work!')); // $ExpectType string
|
||||
24
types/timeout/tsconfig.json
Normal file
24
types/timeout/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/timeout/tslint.json
Normal file
1
types/timeout/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user