import { type WorkbookSnapshot } from '@bilig/protocol';
import { type EngineReplicaSnapshot, SpreadsheetEngine, type SpreadsheetEngineOptions } from './engine.js';
export declare const SPREADSHEET_ENGINE_DOCUMENT_FORMAT: "bilig.spreadsheet-engine.document.v1";
export interface PersistedSpreadsheetEngineDocument {
    format: typeof SPREADSHEET_ENGINE_DOCUMENT_FORMAT;
    snapshot: WorkbookSnapshot;
    replica?: EngineReplicaSnapshot;
}
/**
 * Checks whether a value matches the persisted spreadsheet engine document format.
 */
export declare function isPersistedSpreadsheetEngineDocument(value: unknown): value is PersistedSpreadsheetEngineDocument;
/**
 * Exports a workbook snapshot and optional replica state from an engine instance.
 */
export declare function exportSpreadsheetEngineDocument(engine: SpreadsheetEngine, options?: {
    includeReplica?: boolean;
}): PersistedSpreadsheetEngineDocument;
/**
 * Imports a persisted workbook snapshot and optional replica state into an engine.
 */
export declare function importSpreadsheetEngineDocument(engine: SpreadsheetEngine, document: PersistedSpreadsheetEngineDocument): SpreadsheetEngine;
/**
 * Serializes a validated spreadsheet engine document to JSON.
 */
export declare function serializeSpreadsheetEngineDocument(document: PersistedSpreadsheetEngineDocument): string;
/**
 * Parses and validates a spreadsheet engine document from JSON.
 */
export declare function parseSpreadsheetEngineDocument(json: string): PersistedSpreadsheetEngineDocument;
/**
 * Creates a ready spreadsheet engine instance and hydrates it from a persisted document.
 */
export declare function createSpreadsheetEngineFromDocument(document: PersistedSpreadsheetEngineDocument, options?: SpreadsheetEngineOptions): Promise<SpreadsheetEngine>;
