mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
21 lines
434 B
TypeScript
21 lines
434 B
TypeScript
import onExit = require('signal-exit');
|
|
|
|
// $ExpectType () => void
|
|
onExit((code, signal) => {
|
|
code; // $ExpectType number | null
|
|
signal; // $ExpectType string | null
|
|
});
|
|
const detach = onExit(
|
|
(code, signal) => {
|
|
code; // $ExpectType number | null
|
|
signal; // $ExpectType string | null
|
|
},
|
|
{ alwaysLast: true }
|
|
);
|
|
|
|
detach();
|
|
|
|
onExit.unload();
|
|
onExit.load();
|
|
onExit.signals(); // $ExpectType string[]
|