export default class BackgroundJobsSocketRequest {
    /**
     * Runs constructor.
     * @param {object} args - Options.
     * @param {string} args.host - Host.
     * @param {number} args.port - Port.
     * @param {"client" | "reporter"} args.role - Socket role.
     */
    constructor({ host, port, role }: {
        host: string;
        port: number;
        role: "client" | "reporter";
    });
    host: string;
    port: number;
    role: "client" | "reporter";
    /**
     * Runs run.
     * @template T
     * @param {object} args - Options.
     * @param {(jsonSocket: JsonSocket) => void} args.onConnect - Called after the socket connects.
     * @param {(args: {message: import("./types.js").BackgroundJobSocketMessage, resolve: (value: T) => void, reject: (error: Error) => void}) => void} args.onMessage - Message handler.
     * @returns {Promise<T>} - Resolved request value.
     */
    run<T>({ onConnect, onMessage }: {
        onConnect: (jsonSocket: JsonSocket) => void;
        onMessage: (args: {
            message: import("./types.js").BackgroundJobSocketMessage;
            resolve: (value: T) => void;
            reject: (error: Error) => void;
        }) => void;
    }): Promise<T>;
}
import JsonSocket from "./json-socket.js";
//# sourceMappingURL=socket-request.d.ts.map