mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
Added and fixed node-cleanup typings.
This commit is contained in:
17
types/node-cleanup/index.d.ts
vendored
Normal file
17
types/node-cleanup/index.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for node-cleanup 2.1
|
||||
// Project: https://github.com/jtlapp/node-cleanup
|
||||
// Definitions by: Agadar <https://github.com/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;
|
||||
}
|
||||
13
types/node-cleanup/node-cleanup-tests.ts
Normal file
13
types/node-cleanup/node-cleanup-tests.ts
Normal file
@@ -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();
|
||||
22
types/node-cleanup/tsconfig.json
Normal file
22
types/node-cleanup/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/node-cleanup/tslint.json
Normal file
1
types/node-cleanup/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
2
types/node-telegram-bot-api/index.d.ts
vendored
2
types/node-telegram-bot-api/index.d.ts
vendored
@@ -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 <https://github.com/ammuench>
|
||||
// Agadar <https://github.com/agadar>
|
||||
|
||||
Reference in New Issue
Block a user