diff --git a/types/is-function/index.d.ts b/types/is-function/index.d.ts new file mode 100644 index 0000000000..96a13f0b34 --- /dev/null +++ b/types/is-function/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-function 1.0 +// Project: https://github.com/grncdr/js-is-function +// Definitions by: Evangelos Zotos +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function isFunction(fn: any): boolean; +declare namespace isFunction {} +export = isFunction; diff --git a/types/is-function/is-function-tests.ts b/types/is-function/is-function-tests.ts new file mode 100644 index 0000000000..a4f4215875 --- /dev/null +++ b/types/is-function/is-function-tests.ts @@ -0,0 +1,9 @@ +import * as isFunction from "is-function"; + +const a: boolean = isFunction("string"); +const b: boolean = isFunction(true); +const c: boolean = isFunction((a: number) => a * a); +const d: boolean = isFunction({ type: "number" }); +const e: boolean = isFunction(() => { + return "I am anounymous!"; +}); diff --git a/types/is-function/tsconfig.json b/types/is-function/tsconfig.json new file mode 100644 index 0000000000..ab7efbe2c7 --- /dev/null +++ b/types/is-function/tsconfig.json @@ -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"] +} diff --git a/types/is-function/tslint.json b/types/is-function/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-function/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }