import * as Y from 'yjs';
import type { SyncularCrdtProjectionDefinition, SyncularCrdtProjectionEvent, YjsDocumentBinding, YjsDocumentRestoreReceipt } from './yjs-document-field-adapter';
export interface YjsProseMirrorBridgeOptions {
    containerKey: string;
    doc?: Y.Doc;
    localOrigin?: unknown;
    remoteOrigin?: unknown;
    ignoredOrigins?: readonly unknown[];
    onDocumentReplaced?: (event: YjsProseMirrorDocumentReplacedEvent) => void;
}
export interface YjsProseMirrorDocumentReplacedEvent {
    doc: Y.Doc;
    fragment: Y.XmlFragment;
    receipt?: YjsDocumentRestoreReceipt;
}
export interface YjsProseMirrorBridge extends YjsDocumentBinding {
    doc(): Y.Doc;
    fragment(): Y.XmlFragment;
    replaceDocumentFromState(state: Uint8Array, receipt?: YjsDocumentRestoreReceipt): void;
    encodeStateAsUpdate(): Uint8Array;
    destroy(): void;
}
export interface ProseMirrorReadModel {
    table: string;
    rowId: string;
    field: string;
    prosemirrorJson: unknown;
    title: string;
    preview: string;
    outline: string[];
    searchText: string;
    stateVectorBase64: string;
    source: SyncularCrdtProjectionEvent['source'];
    reason: SyncularCrdtProjectionEvent['reason'];
    operation?: string;
    commitId?: string | null;
    commitSeq?: number | null;
    serverVersion?: number | null;
    documentKey?: string;
    pendingUpdates?: number;
    flushedUpdates?: number;
    ackedUpdates?: number;
    logUpdates?: number;
    updatedAt?: number;
    compactedAt?: number | null;
    latestUpdateId?: string;
    latestUpdateStatus?: string;
}
export interface ProseMirrorReadModelStore {
    upsert(model: ProseMirrorReadModel, event: SyncularCrdtProjectionEvent): void | Promise<void>;
}
export interface ProseMirrorReadModelProjectionOptions {
    store: ProseMirrorReadModelStore;
    derive?: (value: unknown, event: SyncularCrdtProjectionEvent) => {
        prosemirrorJson: unknown;
        title: string;
        preview: string;
        outline: string[];
        searchText: string;
    };
}
export declare function createYjsProseMirrorBridge(options: YjsProseMirrorBridgeOptions): YjsProseMirrorBridge;
export declare function prosemirrorJsonProjection(value: unknown): {
    prosemirrorJson: unknown;
    title: string;
    preview: string;
    outline: string[];
    searchText: string;
};
export declare function createProseMirrorReadModelProjection(options: ProseMirrorReadModelProjectionOptions): SyncularCrdtProjectionDefinition<ProseMirrorReadModel>;
export declare function extractProseMirrorText(value: unknown): string;
export declare function extractProseMirrorHeadings(value: unknown): string[];
//# sourceMappingURL=yjs-prosemirror-bridge.d.ts.map