Merge pull request #32316 from evangeloszotos/master

Adds type definitions for the npm module "is-function"
This commit is contained in:
Daniel Rosenwasser
2019-01-23 15:10:05 -08:00
committed by GitHub
4 changed files with 33 additions and 0 deletions

7
types/is-function/index.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
// Type definitions for is-function 1.0
// Project: https://github.com/grncdr/js-is-function
// Definitions by: Evangelos Zotos <https://github.com/evangeloszotos>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = isFunction;
declare function isFunction(fn: any): boolean;

View File

@@ -0,0 +1,9 @@
import isFunction = require("is-function");
const a: boolean = isFunction("string");
const b: boolean = isFunction(true);
const c: boolean = isFunction((x: number) => x * x);
const d: boolean = isFunction({ type: "number" });
const e: boolean = isFunction(() => {
return "I am anounymous!";
});

View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "is-function-tests.ts"]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }