export default class VelociousHttpServerWorker {
    /**
     * Runs constructor.
     * @param {object} args - Options object.
     * @param {import("../../configuration.js").default} args.configuration - Configuration instance.
     * @param {number} args.workerCount - Worker count.
     */
    constructor({ configuration, workerCount }: {
        configuration: import("../../configuration.js").default;
        workerCount: number;
    });
    configuration: import("../../configuration.js").default;
    /**
     * Narrows the runtime value to the documented type.
      @type {Record<number, import("../server-client.js").default>} */
    clients: Record<number, import("../server-client.js").default>;
    logger: Logger;
    workerCount: number;
    workerStarted: boolean;
    _stopping: boolean;
    _debugRequestId: number;
    /**
     * Narrows the runtime value to the documented type.
      @type {Map<number, {resolve: (snapshot: Record<string, ?>) => void}>} */
    _debugSnapshotRequests: Map<number, {
        resolve: (snapshot: Record<string, unknown>) => void;
    }>;
    start(): Promise<any>;
    onStartCallback: ((value: any) => void) | null | undefined;
    _spawnWorker(): Promise<void>;
    worker: Worker | undefined;
    /**
     * Runs add socket connection.
     * @param {import("../server-client.js").default} client - Client instance.
     * @returns {void} - No return value.
     */
    addSocketConnection(client: import("../server-client.js").default): void;
    /**
     * On worker error.
     * @param {?} error - Error instance.
     */
    onWorkerError: (error: unknown) => never;
    /**
     * On worker exit.
     * @param {number} code - Code.
     * @returns {void} - No return value.
     */
    onWorkerExit: (code: number) => void;
    _hasExited: boolean | undefined;
    _stopResolve: ((value: void | PromiseLike<void>) => void) | null | undefined;
    /**
     * Runs close all clients.
     * @returns {void} - No return value.
     */
    _closeAllClients(): void;
    /**
     * On worker message.
     * @param {object} data - Data payload.
     * @param {string} data.command - Command.
     * @param {number} [data.clientCount] - Client count.
     * @param {string | Uint8Array} [data.output] - Output.
     * @param {string} [data.channel] - Channel name.
     * @param {number} [data.requestId] - Debug request id.
     * @param {Record<string, ?>} [data.snapshot] - Worker debug snapshot.
     * @param {?} [data.payload] - Payload data.
     * @param {Record<string, ?>} [data.broadcastParams] - V2 broadcast filter params.
     * @param {?} [data.body] - V2 broadcast body.
     * @returns {void} - No return value.
     */
    onWorkerMessage: (data: {
        command: string;
        clientCount?: number | undefined;
        output?: string | Uint8Array<ArrayBufferLike> | undefined;
        channel?: string | undefined;
        requestId?: number | undefined;
        snapshot?: Record<string, any> | undefined;
        payload?: unknown;
        broadcastParams?: Record<string, any> | undefined;
        body?: unknown;
    }) => void;
    /**
     * Runs get debug snapshot.
     * @returns {Promise<Record<string, ?>>} - Worker-local debug snapshot.
     */
    getDebugSnapshot(): Promise<Record<string, unknown>>;
    /**
     * Runs stop.
     * @returns {Promise<void>} - Resolves when stopped.
     */
    stop(): Promise<void>;
    /**
     * Runs dispatch websocket event.
     * @param {object} args - Options object.
     * @param {string} args.channel - Channel name.
     * @param {string} [args.createdAt] - Event creation time.
     * @param {string} [args.eventId] - Event identifier.
     * @param {?} args.payload - Payload data.
     * @returns {void} - No return value.
     */
    dispatchWebsocketEvent({ channel, createdAt, eventId, payload }: {
        channel: string;
        createdAt?: string | undefined;
        eventId?: string | undefined;
        payload: unknown;
    }): void;
    /**
     * Forwards a V2 channel broadcast to this worker's thread so it can
     * dispatch to any locally-registered V2 subscriptions.
     * @param {object} args - Options object.
     * @param {string} args.channel - Channel name.
     * @param {Record<string, ?>} args.broadcastParams - Routing filter params.
     * @param {?} args.body - Message body.
     * @param {string} [args.eventId] - Persisted event id for replay.
     * @param {string} [args.createdAt] - Event creation timestamp.
     * @returns {void}
     */
    dispatchWebsocketV2Broadcast({ body, broadcastParams, channel, eventId, createdAt }: {
        channel: string;
        broadcastParams: Record<string, unknown>;
        body: unknown;
        eventId?: string | undefined;
        createdAt?: string | undefined;
    }): void;
    /**
     * Runs register with events host.
      @returns {void} */
    registerWithEventsHost(): void;
    unregisterFromEventsHost: (() => void) | null | undefined;
    /**
     * Runs unregister from events host if needed.
      @returns {void} */
    unregisterFromEventsHostIfNeeded(): void;
}
import Logger from "../../logger.js";
import { Worker } from "worker_threads";
//# sourceMappingURL=index.d.ts.map