mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
[get-func-name] Add types (#31774)
This commit is contained in:
committed by
Wesley Wigham
parent
236449ab1d
commit
e713f37fd4
12
types/get-func-name/get-func-name-tests.ts
Normal file
12
types/get-func-name/get-func-name-tests.ts
Normal file
@@ -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
|
||||
8
types/get-func-name/index.d.ts
vendored
Normal file
8
types/get-func-name/index.d.ts
vendored
Normal file
@@ -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
|
||||
23
types/get-func-name/tsconfig.json
Normal file
23
types/get-func-name/tsconfig.json
Normal 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",
|
||||
"get-func-name-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/get-func-name/tslint.json
Normal file
1
types/get-func-name/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user