export declare class RingBuffer<T> {
    private readonly capacity;
    private buffer;
    private head;
    private count;
    constructor(capacity: number);
    push(item: T): T | undefined;
    toArray(): T[];
    clear(): void;
    get length(): number;
}
export interface DevConsoleErrorInfo {
    name: string;
    message: string;
    stack?: string;
    cause?: DevConsoleErrorInfo;
    [key: string]: unknown;
}
export interface DevConsoleHttpEntry {
    id: string;
    timestamp: number;
    method: string;
    url: string;
    remoteAddress: string;
    requestHeaders: Record<string, string | string[] | undefined>;
    requestBody: string | null;
    statusCode: number;
    responseHeaders: Record<string, string | number | string[] | undefined>;
    responseBody: string | null;
    durationMs: number;
    error?: DevConsoleErrorInfo;
}
export interface DevConsoleSrpcMessage {
    id: string;
    timestamp: number;
    streamId: string;
    clientId: string;
    direction: 'inbound' | 'outbound';
    messageType: string;
    isReply: boolean;
    data: Record<string, unknown>;
    error?: string;
    isUserError?: boolean;
}
export interface DevConsoleSrpcConnection {
    streamId: string;
    clientId: string;
    clientStreamId: string;
    appVersion: string;
    address: string;
    connectedAt: number;
    lastPingAt: number;
    meta: Record<string, unknown>;
    messageCount: number;
}
export interface DevConsoleSrpcDisconnection {
    streamId: string;
    clientId: string;
    disconnectedAt: number;
    cause: string;
}
export interface DevConsoleDatabaseQueryEntry {
    id: string;
    timestamp: number;
    sql: string;
    params: unknown[];
    status: 'running' | 'ok' | 'error';
    durationMs?: number;
    error?: string;
}
export interface DevConsoleMutexEntry {
    id: string;
    key: string;
    status: 'pending' | 'acquired' | 'released' | 'error' | 'failed';
    startedAt: number;
    acquiredAt?: number;
    releasedAt?: number;
    durationMs?: number;
    waitDurationMs?: number;
    waited?: boolean;
    error?: string;
}
export declare class DevConsoleStore {
    readonly httpEntries: RingBuffer<DevConsoleHttpEntry>;
    readonly srpcMessages: RingBuffer<DevConsoleSrpcMessage>;
    readonly srpcConnections: Map<string, DevConsoleSrpcConnection>;
    readonly srpcDisconnected: RingBuffer<DevConsoleSrpcDisconnection>;
    readonly dbQueries: RingBuffer<DevConsoleDatabaseQueryEntry>;
    private readonly dbQueriesById;
    readonly mutexEntries: RingBuffer<DevConsoleMutexEntry>;
    readonly activeMutexes: Map<string, DevConsoleMutexEntry>;
    readonly startedAt: number;
    onEvent?: (type: string, data: unknown) => void;
    addHttpEntry(entry: DevConsoleHttpEntry): void;
    clearHttpEntries(): void;
    addSrpcConnection(conn: DevConsoleSrpcConnection): void;
    removeSrpcConnection(streamId: string, clientId: string, cause: string): void;
    addSrpcMessage(message: DevConsoleSrpcMessage): void;
    clearSrpcMessages(): void;
    addDatabaseQuery(entry: DevConsoleDatabaseQueryEntry): void;
    completeDatabaseQuery(entry: DevConsoleDatabaseQueryEntry): void;
    clearDatabaseQueries(): void;
    addMutexPending(entry: DevConsoleMutexEntry): void;
    updateMutexAcquired(id: string, waited: boolean | undefined, at: number): void;
    updateMutexReleased(id: string, at: number): void;
    updateMutexError(id: string, error: unknown, at: number): void;
    addMutexFailed(entry: DevConsoleMutexEntry): void;
    broadcastWorkerEvent(type: 'added' | 'active' | 'delayed' | 'job', data: unknown): void;
}
export declare function serializeErrorInfo(error: unknown): DevConsoleErrorInfo | undefined;
//# sourceMappingURL=store.d.ts.map