From f88f85476f2d37d5635d5ab6a6014e39ba052b06 Mon Sep 17 00:00:00 2001 From: Alessandro Vergani Date: Tue, 26 Sep 2017 20:41:54 +0200 Subject: [PATCH] Add missing node-ipc configuration options (#19942) * Add missing options * Use method signature --- types/node-ipc/index.d.ts | 14 +++++++++++++- types/node-ipc/node-ipc-tests.ts | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/types/node-ipc/index.d.ts b/types/node-ipc/index.d.ts index 2f33935a86..82e5cfa568 100644 --- a/types/node-ipc/index.d.ts +++ b/types/node-ipc/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-ipc 9.0 +// Type definitions for node-ipc 9.1 // Project: http://riaevangelist.github.io/node-ipc/ // Definitions by: Arvitaly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -260,6 +260,11 @@ declare namespace NodeIPC { * Set the depth for util.inspect during ipc.log */ logDepth: number; + /** + * Default: console.log + * The function which receives the output from ipc.log; should take a single string argument + */ + logger(msg: string): void; /** * Default: 100 * This is the max number of connections allowed to a socket. It is currently only being set on Unix Sockets. @@ -287,6 +292,13 @@ declare namespace NodeIPC { * If set to 0, the client will NOT try to reconnect */ stopRetrying: boolean; + /** + * Default: true + * Defaults to true meaning that the module will take care of deleting the IPC socket prior to startup. + * If you use node-ipc in a clustered environment where there will be multiple listeners on the same socket, + * you must set this to false and then take care of deleting the socket in your own code. + */ + unlink: boolean; /** * Primarily used when specifying which interface a client should connect through. * see the socket.connect documentation in the node.js api https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener diff --git a/types/node-ipc/node-ipc-tests.ts b/types/node-ipc/node-ipc-tests.ts index 69a8ffa46e..9befb80b06 100644 --- a/types/node-ipc/node-ipc-tests.ts +++ b/types/node-ipc/node-ipc-tests.ts @@ -14,6 +14,7 @@ ipc.config.interfaces = { }; ipc.config.logDepth = 6; ipc.config.logInColor = true; +ipc.config.logger = console.log; ipc.config.maxConnections = 200; ipc.config.maxRetries = false; ipc.config.networkHost = "127.0.0.1"; @@ -24,6 +25,7 @@ ipc.config.silent = true; ipc.config.socketRoot = ""; ipc.config.stopRetrying = false; ipc.config.sync = true; +ipc.config.unlink = false; ipc.config.tls = { rejectUnauthorized: false, public: "",