UNPKG

butlerd

Version:

Node.js library for butlerd, the butler daemon

27 lines (26 loc) 1.1 kB
import { NotificationHandler, RequestHandler, RequestCreator, NotificationCreator, RpcError, ResultCreator } from "./support"; import { Client } from "./client"; export declare const CONNECTION_TIMEOUT = 2000; export declare class Conversation { private cancelled; private closed; private notificationHandlers; private missingNotificationHandlersWarned; private requestHandlers; private client; private inboundRequests; private outboundRequests; private firstMethod?; private socket; constructor(client: Client); connect(): Promise<void>; onRequest<Params, Result>(rc: RequestCreator<Params, Result>, handler: RequestHandler<Params, Result>): void; onNotification<T>(nc: NotificationCreator<T>, handler: NotificationHandler<T>): void; private handleMessage; sendResult<Result>(rc: ResultCreator<Result>, id: number, result?: Result, error?: RpcError): void; call<T, U>(rc: RequestCreator<T, U>, params: T): Promise<U>; private internalCall; private write; cancel(): void; close(): void; }