/// <reference types="node" />
import { EventEmitter } from "events";
import { UnixDgramSocket } from "unix-dgram-socket";
import { JobItems } from "./JobItems";
export declare class IpcNetwork extends EventEmitter {
    private rpcCallback?;
    static readonly ERROR_RPC_SEND = "rpc_send_error";
    static readonly ERROR_RPC_TIMEOUT = "rpc_timeout_error";
    static readonly ERROR_RPC_EXEC = "rpc_exec_error";
    private static readonly TYPE_MESSAGE;
    private static readonly TYPE_RPC_JOB;
    private static readonly TYPE_RPC_RESULT;
    private static readonly TYPE_RPC_ERROR;
    private static readonly JOB_ID_LENGTH;
    private static readonly JOB_ID_BUFFER;
    protected processName: string;
    protected unixSocketPath: string;
    protected unixSocket: UnixDgramSocket;
    protected jobsItems: JobItems;
    protected uniqBuffer: string[];
    constructor(processName?: string, rpcCallback?: ((jobName: string, from: string) => string | Buffer) | undefined);
    startListening(): void;
    stopListening(): void;
    send(data: Buffer | string, socketName: string): boolean;
    sendRpc(jobName: string, socketName: string, timeout?: number): Promise<Buffer>;
    protected static composeMessage(messageType: number, messageData: Buffer | string, jobId?: string): Buffer;
    protected static getSocketPathFromName(socketName: string): string;
    protected static getSocketNameFromPath(socketPath: string): string;
}
