From eb27ec80abcab66fbe3e3fd6ecec15b05736558f Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Tue, 13 Jun 2017 01:56:39 -0300 Subject: [PATCH] [ofe] Add type declaration file --- types/ofe/index.d.ts | 6 ++++++ types/ofe/ofe-tests.ts | 8 ++++++++ types/ofe/tsconfig.json | 22 ++++++++++++++++++++++ types/ofe/tslint.json | 3 +++ 4 files changed, 39 insertions(+) create mode 100644 types/ofe/index.d.ts create mode 100644 types/ofe/ofe-tests.ts create mode 100644 types/ofe/tsconfig.json create mode 100644 types/ofe/tslint.json diff --git a/types/ofe/index.d.ts b/types/ofe/index.d.ts new file mode 100644 index 0000000000..663bc0510c --- /dev/null +++ b/types/ofe/index.d.ts @@ -0,0 +1,6 @@ +// Type definitions for ofe 0.5 +// Project: https://github.com/trevnorris/node-ofe +// Definitions by: Ben Davies +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function call(): 'done'; diff --git a/types/ofe/ofe-tests.ts b/types/ofe/ofe-tests.ts new file mode 100644 index 0000000000..002aecba23 --- /dev/null +++ b/types/ofe/ofe-tests.ts @@ -0,0 +1,8 @@ +/// + +import * as ofe from 'ofe'; + +let ret = ofe.call(); +if (ret === 'done') { + console.log('The ofe module was successfully called to create a heapdump if the process runs out of memory.'); +} diff --git a/types/ofe/tsconfig.json b/types/ofe/tsconfig.json new file mode 100644 index 0000000000..9c1f9c174a --- /dev/null +++ b/types/ofe/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ofe-tests.ts" + ] +} diff --git a/types/ofe/tslint.json b/types/ofe/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/ofe/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}