mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
- Added dedicated types for listeners to avoid unneeded copy/paste.
- Added overloads for listen() to cover issue discussed in latest comments of #16705
This commit is contained in:
@@ -1903,6 +1903,10 @@ namespace process_tests {
|
||||
process.prependOnceListener("SIGBREAK", () => { });
|
||||
process.on("newListener", (event: string, listener: Function) => { });
|
||||
process.once("removeListener", (event: string, listener: Function) => { });
|
||||
|
||||
const listeners = process.listeners('uncaughtException');
|
||||
const oldHandler = listeners[listeners.length - 1];
|
||||
process.addListener('uncaughtException', oldHandler);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user