UNPKG

@peacockproject/core

Version:

Type definitions for Peacock's core.

25 lines (24 loc) 631 B
import EventEmitter from "events"; import type { RPCClient } from "./client"; declare const enum OPCodes { HANDSHAKE = 0, FRAME = 1, CLOSE = 2, PING = 3, PONG = 4 } export declare class IPCTransport extends EventEmitter { private readonly client; /** * This will only be true if the initial connection failed, to prevent unhandled promise rejections. */ unavailable: boolean; private socket; constructor(client: RPCClient); connect(): Promise<void>; onClose(e: any): void; send(data: any, op?: OPCodes): void; close(): Promise<void>; ping(): void; } export {};