import type { CallerToMethods, TypedRpcClient } from '@jsonjoy.com/reactive-rpc/lib/common';
import type { JsonJoyDemoRpcCaller } from 'json-crdt-server';
import type { ServerBlock, ServerSnapshot, ServerPatch, ServerCursor, ServerHistory, ServerBatch, ServerEvent } from './types';
export type DemoServerClient = TypedRpcClient<CallerToMethods<JsonJoyDemoRpcCaller>>;
export type Cursor = ServerCursor;
export type DemoServerBlock = ServerBlock;
export type DemoServerSnapshot = ServerSnapshot;
export type DemoServerBatch = ServerBatch;
export type DemoServerPatch = ServerPatch;
export type DemoServerEvent = ServerEvent;
export declare class DemoServerRemoteHistory implements ServerHistory {
    protected readonly client: DemoServerClient;
    protected readonly clientId: number;
    constructor(client: DemoServerClient, clientId?: number);
    read(id: string): Promise<{
        block: DemoServerBlock;
    }>;
    pull(id: string, seq?: Cursor, create?: boolean): Promise<{
        batches: DemoServerBatch[];
        snapshot?: DemoServerSnapshot;
    }>;
    create(id: string, batch?: Pick<DemoServerBatch, 'patches'>): Promise<{
        snapshot: Omit<DemoServerSnapshot, 'blob'>;
        batch: Omit<DemoServerBatch, 'patches'>;
    }>;
    update(id: string, batch: Pick<DemoServerBatch, 'patches'>, seq?: number): Promise<{
        batch: Omit<DemoServerBatch, 'patches'>;
        pull?: {
            batches: DemoServerBatch[];
            snapshot?: DemoServerSnapshot;
        };
    }>;
    delete(id: string): Promise<void>;
    scanFwd(id: string, seq: Cursor): Promise<{
        batches: DemoServerBatch[];
    }>;
    scanBwd(id: string, seq: Cursor, snapshot?: boolean): Promise<{
        batches: DemoServerBatch[];
        snapshot?: DemoServerSnapshot;
    }>;
    readonly listen: (key: string) => import("rxjs").Observable<{
        event: ["new"] | ["upd", {
            batch: {
                patches: {
                    blob: Uint8Array<ArrayBufferLike>;
                }[];
                seq: number;
                ts: number;
                cts?: number | undefined;
            };
        }, number] | ["del"];
    }>;
}
