netkitty
Version:
Network tools kit
25 lines • 1.19 kB
TypeScript
import EventEmitter from 'events';
import { PipeClientSocket } from './PipeClientSocket';
export interface IPipeServerOptions {
actions?: Record<string, (...args: any[]) => Promise<any>>;
}
export declare class PipeServer extends EventEmitter {
#private;
protected readonly actions: Record<string, (...args: any[]) => Promise<any>>;
readonly socketPath: string;
get clients(): Map<string, PipeClientSocket>;
constructor(options?: IPipeServerOptions);
/**
* Dispose pipe server
*/
dispose(): void;
on(eventName: 'ready', listener: () => void): this;
on(eventName: 'connect', listener: (clientSocket: PipeClientSocket) => void): this;
on(eventName: 'disconnect', listener: (clientSocket: PipeClientSocket) => void): this;
on(eventName: string, listener: (...args: any) => void): this;
once(eventName: 'ready', listener: () => void): this;
once(eventName: 'connect', listener: (clientSocket: PipeClientSocket) => void): this;
once(eventName: 'disconnect', listener: (clientSocket: PipeClientSocket) => void): this;
once(eventName: string, listener: (...args: any) => void): this;
}
//# sourceMappingURL=PipeServer.d.ts.map