import type { BlobRef, SyncOperation } from '@syncular/core';
import type { SyncularApplyYjsEnvelopeToPayloadArgs, SyncularApplyYjsTextUpdatesArgs, SyncularAuthHeaders, SyncularAuthLeaseRecord, SyncularBlobEncryptionConfig, SyncularBlobStoreOptions, SyncularBlobUploadQueueProcessOptions, SyncularBuildYjsTextUpdateArgs, SyncularClientConfig, SyncularConflictResolution, SyncularCrdtFieldCompactionRequest, SyncularCrdtFieldRequest, SyncularCrdtFieldTextRequest, SyncularCrdtFieldYjsUpdateRequest, SyncularEncryptedCrdtConfig, SyncularEncryptionHelperMethod, SyncularFieldEncryptionConfig, SyncularLiveQueryDependencyHint, SyncularLocalHealthRepairRequest, SyncularLocalSyncResetRequest, SyncularStorageCompactionOptions, SyncularSubscriptionSpec, SyncularSyncAttempt } from './types';
import type { SYNCULAR_WORKER_PROTOCOL_VERSION } from './worker-protocol';
export interface SyncularWorkerRuntimeArtifact {
    name?: string;
    wasmGlueUrl?: string;
    wasmUrl?: string;
    features?: string[];
}
export type SyncularWorkerRealtimeOptions = {
    wsUrl?: string;
    params?: Record<string, string>;
    initialReconnectDelayMs?: number;
    maxReconnectDelayMs?: number;
    reconnectBackoffFactor?: number;
    reconnectJitterRatio?: number;
    pullRecoveryJitterMs?: number;
    heartbeatTimeoutMs?: number;
};
export type SyncularGeneratedWorkerRequest = {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'open';
    config: SyncularClientConfig;
    runtime?: SyncularWorkerRuntimeArtifact;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'setAuthHeaders';
    headers: SyncularAuthHeaders;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'setFieldEncryption';
    config: SyncularFieldEncryptionConfig | null;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'setEncryptedCrdt';
    config: SyncularEncryptedCrdtConfig | null;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'setBlobEncryption';
    config: SyncularBlobEncryptionConfig | null;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'setSubscriptions';
    subscriptions: SyncularSubscriptionSpec[];
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'forceSubscriptionsBootstrap';
    subscriptionIds?: string[];
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'upsertAuthLease';
    lease: SyncularAuthLeaseRecord;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'authLease';
    leaseId: string;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'activeAuthLeases';
    actorId?: string | null;
    nowMs: number;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'startRealtime';
    options: SyncularWorkerRealtimeOptions;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'stopRealtime';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'sendPresence';
    action: 'join' | 'leave' | 'update';
    scopeKey: string;
    metadata?: Record<string, unknown>;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'executeSql';
    sql: string;
    params: unknown[];
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'executeUnsafeSql';
    sql: string;
    params: unknown[];
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'subscribeQuery';
    sql: string;
    params: unknown[];
    tables: string[];
    hints?: SyncularLiveQueryDependencyHint[];
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'unsubscribeQuery';
    queryId: string;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'drainLiveQueryEvents';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'liveQueryDiagnostics';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'applyMutation';
    operation: SyncOperation;
    localRow?: unknown | null;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'applyLeasedMutation';
    operation: SyncOperation;
    localRow?: unknown | null;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'applyMutationsBatch';
    operations: Array<{
        operation: SyncOperation;
        localRow?: unknown | null;
    }>;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'applyMutationsCommit';
    operations: Array<{
        operation: SyncOperation;
        localRow?: unknown | null;
    }>;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'applyLeasedMutationsCommit';
    operations: Array<{
        operation: SyncOperation;
        localRow?: unknown | null;
    }>;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'syncPull';
    syncAttempt?: SyncularSyncAttempt;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'syncPush';
    syncAttempt?: SyncularSyncAttempt;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'syncOnce';
    syncAttempt?: SyncularSyncAttempt;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'transportStats';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'resetTransportStats';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'conflictSummaries';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'retryConflictKeepLocal';
    conflictId: string;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'resolveConflict';
    conflictId: string;
    resolution: SyncularConflictResolution;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'listTable';
    table: string;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'storeBlob';
    data: Uint8Array;
    options?: SyncularBlobStoreOptions;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'retrieveBlob';
    ref: BlobRef;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'isBlobLocal';
    hash: string;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'processBlobUploadQueue';
    options?: SyncularBlobUploadQueueProcessOptions;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'blobUploadQueueStats';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'blobCacheStats';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'pruneBlobCache';
    maxBytes?: number;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'clearBlobCache';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'compactStorage';
    options?: SyncularStorageCompactionOptions;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'generatedSchemaState';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'localHealthCheck';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'exportLocalSupportBundle';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'importLocalSupportBundle';
    bundleJson: string;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'repairLocalHealth';
    request: SyncularLocalHealthRepairRequest;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'resetLocalSyncState';
    request?: SyncularLocalSyncResetRequest;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'buildYjsTextUpdate';
    args: SyncularBuildYjsTextUpdateArgs;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'applyYjsTextUpdates';
    args: SyncularApplyYjsTextUpdatesArgs;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'applyYjsEnvelopeToPayload';
    args: SyncularApplyYjsEnvelopeToPayloadArgs;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'openCrdtField';
    request: SyncularCrdtFieldRequest;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'applyCrdtFieldText';
    request: SyncularCrdtFieldTextRequest;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'applyCrdtFieldYjsUpdate';
    request: SyncularCrdtFieldYjsUpdateRequest;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'materializeCrdtField';
    request: SyncularCrdtFieldRequest;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'crdtDocumentSnapshot';
    request: SyncularCrdtFieldRequest;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'crdtUpdateLog';
    request: SyncularCrdtFieldRequest & {
        limit?: number;
    };
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'snapshotCrdtFieldStateVector';
    request: SyncularCrdtFieldRequest;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'compactCrdtField';
    request: SyncularCrdtFieldCompactionRequest;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'encryptionHelper';
    method: SyncularEncryptionHelperMethod;
    args?: unknown;
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'runtimeInfo';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'close';
} | {
    id: number;
    protocolVersion: typeof SYNCULAR_WORKER_PROTOCOL_VERSION;
    type: 'cancel';
    requestId: number;
};
export type SyncularGeneratedWorkerRequestInput = SyncularGeneratedWorkerRequest extends infer Request ? Request extends SyncularGeneratedWorkerRequest ? Omit<Request, 'id' | 'protocolVersion'> : never : never;
export type SyncularGeneratedWorkerRequestType = SyncularGeneratedWorkerRequest['type'];
export declare function isGeneratedSyncularAbortableWorkerRequestType(type: SyncularGeneratedWorkerRequestType): boolean;
export declare function isGeneratedSyncularDiagnosedSuccessWorkerRequestType(type: SyncularGeneratedWorkerRequestType): boolean;
export declare function isGeneratedSyncularOperationalStateWorkerRequestType(type: SyncularGeneratedWorkerRequestType): boolean;
export declare function generatedSyncularWorkerRequestDiagnosticSource(type: SyncularGeneratedWorkerRequestType): 'auth' | 'blob' | 'client' | 'realtime' | 'storage' | 'sync' | 'worker';
export interface SyncularGeneratedWorkerDispatchContext {
    requireClient(): any;
    openClient(request: Extract<SyncularGeneratedWorkerRequest, {
        type: 'open';
    }>): Promise<unknown>;
    startRealtime(options: SyncularWorkerRealtimeOptions): unknown;
    stopRealtime(): unknown;
    sendPresence(action: 'join' | 'leave' | 'update', scopeKey: string, metadata?: Record<string, unknown>): unknown;
    runtimeInfo(): Promise<unknown>;
    closeClient(): unknown;
}
export declare function dispatchGeneratedSyncularWorkerRequest(context: SyncularGeneratedWorkerDispatchContext, request: SyncularGeneratedWorkerRequest): Promise<unknown>;
//# sourceMappingURL=generated-bridge.d.ts.map