mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-14 21:20:39 +00:00
[get-func-name] Add types (#31774)
This commit is contained in:
committed by
Wesley Wigham
parent
236449ab1d
commit
e713f37fd4
@@ -0,0 +1,12 @@
|
||||
import getFuncName = require('get-func-name');
|
||||
|
||||
const unknownFunction = function myCoolFunction(word: string) {
|
||||
return word + 'is cool';
|
||||
};
|
||||
|
||||
const anonymousFunction = (() => {
|
||||
return () => {};
|
||||
})();
|
||||
|
||||
getFuncName(unknownFunction); // $ExpectType string
|
||||
getFuncName(anonymousFunction); // $ExpectType string
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// Type definitions for get-func-name 2.0
|
||||
// Project: https://github.com/chaijs/get-func-name#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = getFuncName;
|
||||
|
||||
declare function getFuncName(fn: Function): string; // tslint:disable-line:ban-types
|
||||
@@ -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",
|
||||
"get-func-name-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user