diff --git a/types/universalify/index.d.ts b/types/universalify/index.d.ts new file mode 100644 index 0000000000..ca1c441be0 --- /dev/null +++ b/types/universalify/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for universalify 0.1 +// Project: https://github.com/RyanZim/universalify#readme +// Definitions by: Richie Bendall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function fromCallback(fn: (...args: any[]) => any): (...args: any[]) => Promise | void; +export function fromPromise(fn: (...args: any[]) => any): (...args: any[]) => Promise | void; diff --git a/types/universalify/tsconfig.json b/types/universalify/tsconfig.json new file mode 100644 index 0000000000..899e898c06 --- /dev/null +++ b/types/universalify/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "universalify-tests.ts" + ] +} diff --git a/types/universalify/tslint.json b/types/universalify/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/universalify/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/universalify/universalify-tests.ts b/types/universalify/universalify-tests.ts new file mode 100644 index 0000000000..9cf4de6935 --- /dev/null +++ b/types/universalify/universalify-tests.ts @@ -0,0 +1,4 @@ +import universalify = require("universalify"); + +universalify.fromCallback(() => { }); // $ExpectType (...args: any[]) => void | Promise +universalify.fromPromise(() => { }); // $ExpectType (...args: any[]) => void | Promise