diff --git a/types/node-cleanup/index.d.ts b/types/node-cleanup/index.d.ts new file mode 100644 index 0000000000..103f0bc813 --- /dev/null +++ b/types/node-cleanup/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for node-cleanup 2.1 +// Project: https://github.com/jtlapp/node-cleanup +// Definitions by: Agadar +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Note that ES6 modules cannot directly export callable functions. +// This file should be imported using the CommonJS-style: +// import nodeCleanup = require('node-cleanup'); + +export = install; + +declare function install(cleanupHandler?: ((exitCode: number | null, signal: string | null) => boolean | undefined), + stderrMessages?: { ctrl_C: string; uncaughtException: string }): void; + +declare namespace install { + function uninstall(): void; +} diff --git a/types/node-cleanup/node-cleanup-tests.ts b/types/node-cleanup/node-cleanup-tests.ts new file mode 100644 index 0000000000..ec42821dff --- /dev/null +++ b/types/node-cleanup/node-cleanup-tests.ts @@ -0,0 +1,13 @@ +import nodeCleanup = require('node-cleanup'); + +function cleanupHandler(exitCode: number | null, signal: string | null): boolean | undefined { + return true; +} +const stderrMessages = { ctrl_C: 'ctrl_c', uncaughtException: 'UncaughtException' }; + +nodeCleanup(); +nodeCleanup(cleanupHandler); +nodeCleanup(cleanupHandler, undefined); +nodeCleanup(cleanupHandler, stderrMessages); +nodeCleanup(undefined, stderrMessages); +nodeCleanup.uninstall(); diff --git a/types/node-cleanup/tsconfig.json b/types/node-cleanup/tsconfig.json new file mode 100644 index 0000000000..c05b3b90bf --- /dev/null +++ b/types/node-cleanup/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", + "node-cleanup-tests.ts" + ] +} diff --git a/types/node-cleanup/tslint.json b/types/node-cleanup/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/node-cleanup/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/node-telegram-bot-api/index.d.ts b/types/node-telegram-bot-api/index.d.ts index 2b67bac385..60b46b137c 100644 --- a/types/node-telegram-bot-api/index.d.ts +++ b/types/node-telegram-bot-api/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-telegram-bot-api 0.28.0 +// Type definitions for node-telegram-bot-api 0.28 // Project: https://github.com/yagop/node-telegram-bot-api // Definitions by: Alex Muench // Agadar