import type { ResolvedSyncularClientConfig, SyncularDiagnosticEvent, SyncularLiveQueryEvent, SyncularSyncRequestOptions, SyncularSyncResult } from './types';
import type { SyncularWorkerEvent, SyncularWorkerRealtimeOptions } from './worker-protocol';
export interface SyncularWorkerRealtimeClient {
    syncPull(options?: SyncularSyncRequestOptions): Promise<SyncularSyncResult>;
    applyRealtimeSyncPack?(bytes: Uint8Array): Promise<SyncularSyncResult>;
    drainLiveQueryEvents<Row extends Record<string, unknown> = Record<string, unknown>>(): Array<SyncularLiveQueryEvent<Row>>;
}
export interface SyncularWorkerRealtimeSocket {
    onopen: ((event: Event) => void) | null;
    onmessage: ((event: MessageEvent) => void) | null;
    onerror: ((event: Event) => void) | null;
    onclose: ((event: CloseEvent) => void) | null;
    send(data: string): void;
    close(): void;
}
export interface SyncularWorkerRealtimeControllerOptions {
    getClient(): SyncularWorkerRealtimeClient;
    getConfig(): ResolvedSyncularClientConfig | undefined;
    getLocationOrigin(): string;
    createWebSocket(url: string): SyncularWorkerRealtimeSocket;
    postEvent(event: SyncularWorkerEvent): void;
    postDiagnostic?: (event: Omit<SyncularDiagnosticEvent, 'at'> & {
        at?: number;
    }) => void;
    setTimeout?: typeof setTimeout;
    clearTimeout?: typeof clearTimeout;
    random?: () => number;
}
export declare class SyncularWorkerRealtimeController {
    #private;
    private readonly controllerOptions;
    constructor(controllerOptions: SyncularWorkerRealtimeControllerOptions);
    start(options: SyncularWorkerRealtimeOptions): void;
    stop(): void;
    sendPresence(action: 'join' | 'leave' | 'update', scopeKey: string, metadata?: Record<string, unknown>): void;
}
export declare function resolveSyncularRealtimeUrl(config: ResolvedSyncularClientConfig, options: SyncularWorkerRealtimeOptions, locationOrigin: string): string;
export declare function isSyncularRealtimeSyncMessage(value: unknown): boolean;
//# sourceMappingURL=worker-realtime.d.ts.map