import { type TraceProcessorHttpRpcRequest } from './traceProcessorHttpRpcClient';
import type { QueryResult } from './workingTraceProcessor';
export type TraceProcessorQueryPriority = 'p0' | 'p1' | 'p2';
export interface TraceProcessorQueryOptions {
    priority?: TraceProcessorQueryPriority;
    timeoutMs?: number;
}
export interface TraceProcessorSqlWorkerOptions {
    processorId: string;
    traceId: string;
    port: number;
    hostname?: string;
    forceInline?: boolean;
    rawExecutor?: (request: TraceProcessorHttpRpcRequest) => Promise<Buffer>;
}
export declare function normalizeTraceProcessorQueryPriority(value: unknown, fallback?: TraceProcessorQueryPriority): TraceProcessorQueryPriority;
export declare class TraceProcessorSqlWorker {
    private readonly processorId;
    private readonly traceId;
    private readonly port;
    private readonly hostname;
    private readonly forceInline;
    private readonly rawExecutor?;
    private readonly queues;
    private pendingWorkerRequests;
    private worker;
    private running;
    private destroyed;
    private nextTaskId;
    constructor(options: TraceProcessorSqlWorkerOptions);
    get activeCount(): number;
    getStats(): {
        running: boolean;
        queuedP0: number;
        queuedP1: number;
        queuedP2: number;
        usesWorkerThread: boolean;
    };
    query(sql: string, options?: TraceProcessorQueryOptions): Promise<QueryResult>;
    enqueueRaw(body: Buffer, options?: TraceProcessorQueryOptions): Promise<Buffer>;
    destroy(): void;
    private drain;
    private nextTask;
    private runTask;
    private ensureWorker;
    private postToWorker;
    private rejectPendingWorkerRequests;
}
//# sourceMappingURL=traceProcessorSqlWorker.d.ts.map