mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
[one-time] Add types (#31747)
This commit is contained in:
committed by
Wesley Wigham
parent
524badb2af
commit
e193757d8e
Vendored
+8
@@ -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
|
||||
@@ -0,0 +1,7 @@
|
||||
import one = require('one-time');
|
||||
|
||||
const fn = (foo: boolean) => {
|
||||
return 'bar';
|
||||
};
|
||||
|
||||
one(fn); // $ExpectType (foo: boolean) => string
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user