diff --git a/types/timeout/index.d.ts b/types/timeout/index.d.ts new file mode 100644 index 0000000000..faa225c6c4 --- /dev/null +++ b/types/timeout/index.d.ts @@ -0,0 +1,6 @@ +// Type definitions for timeout 0.2 +// Project: https://github.com/amccollum/timeout +// Definitions by: newt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function timeout(name?: string, ms?: number, callback?: () => void): string; diff --git a/types/timeout/timeout-tests.ts b/types/timeout/timeout-tests.ts new file mode 100644 index 0000000000..e21986b5cd --- /dev/null +++ b/types/timeout/timeout-tests.ts @@ -0,0 +1,3 @@ +import { timeout } from 'timeout'; + +timeout('name', 10, () => console.log('I work!')); // $ExpectType string diff --git a/types/timeout/tsconfig.json b/types/timeout/tsconfig.json new file mode 100644 index 0000000000..eaa93e77f2 --- /dev/null +++ b/types/timeout/tsconfig.json @@ -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" + ] +} diff --git a/types/timeout/tslint.json b/types/timeout/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/timeout/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }