diff --git a/types/node-ipc/index.d.ts b/types/node-ipc/index.d.ts index 82e5cfa568..92eaaea49d 100644 --- a/types/node-ipc/index.d.ts +++ b/types/node-ipc/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for node-ipc 9.1 // Project: http://riaevangelist.github.io/node-ipc/ -// Definitions by: Arvitaly +// Definitions by: Arvitaly , gjurgens // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// import { Socket } from "net"; @@ -178,6 +178,10 @@ declare namespace NodeIPC { */ on(event: "data", callback: (buffer: Buffer) => void): Client; emit(event: string, value?: any): Client; + /** + * Unbind subscribed events + */ + off(event: string, handler: any): Client; } interface Server extends Client { /** diff --git a/types/node-ipc/node-ipc-tests.ts b/types/node-ipc/node-ipc-tests.ts index 9befb80b06..91644f3cf7 100644 --- a/types/node-ipc/node-ipc-tests.ts +++ b/types/node-ipc/node-ipc-tests.ts @@ -63,3 +63,4 @@ declare const socket: Socket; ipc.server.emit(socket, myBuffer); ipc.server.emit([10, 20, 30]); ipc.server.emit({ address: 'localhost', port: 8000 }, "message", { id: ipc.config.id, message: 'Goodbye' }); +ipc.server.off("error", "*");