[one-time] Add types (#31747)

This commit is contained in:
Dimitri Benin
2018-12-31 08:33:41 -08:00
committed by Wesley Wigham
parent 524badb2af
commit e193757d8e
4 changed files with 39 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for one-time 0.0
// Project: https://github.com/unshiftio/one-time
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = oneTime;
declare function oneTime<TFn extends Function>(fn: TFn): TFn; // tslint:disable-line:ban-types
+7
View File
@@ -0,0 +1,7 @@
import one = require('one-time');
const fn = (foo: boolean) => {
return 'bar';
};
one(fn); // $ExpectType (foo: boolean) => string
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"one-time-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }