/**
 * Checkpoint loading and incremental materialization for WARP.
 *
 * Provides loadCheckpoint, materializeIncremental, and
 * reconstructStateFromCheckpoint.
 *
 * @module domain/services/state/checkpointLoad
 * @see WARP Spec Section 10
 */
import VersionVector from '../../crdt/VersionVector.ts';
import WarpState from './WarpState.ts';
import { ProvenanceIndex } from '../provenance/ProvenanceIndex.ts';
import type CommitPort from '../../../ports/CommitPort.ts';
import type BlobPort from '../../../ports/BlobPort.ts';
import type TreePort from '../../../ports/TreePort.ts';
import type CodecPort from '../../../ports/CodecPort.ts';
import type CommitMessageCodecPort from '../../../ports/CommitMessageCodecPort.ts';
import type CheckpointStorePort from '../../../ports/CheckpointStorePort.ts';
import type Patch from '../../types/Patch.ts';
/** Combined persistence surface needed for checkpoint loading. */
export type LoadPersistence = CommitPort & BlobPort & TreePort;
/** The result of loading a checkpoint. */
export interface LoadedCheckpoint {
    state: WarpState;
    frontier: Map<string, string>;
    stateHash: string;
    schema: number;
    appliedVV: VersionVector | null;
    provenanceIndex?: ProvenanceIndex;
    indexShardOids: Record<string, string> | null;
}
/** Options for loadCheckpoint. */
export interface LoadCheckpointOptions {
    codec?: CodecPort;
    checkpointStore?: CheckpointStorePort;
    commitMessageCodec?: CommitMessageCodecPort;
}
/**
 * Loads a current checkpoint from a commit SHA.
 *
 * Reads the checkpoint commit, extracts the tree entries,
 * and deserializes the current state and frontier.
 *
 * Loads the current state envelope as AUTHORITATIVE ORSet state.
 *
 * Retired schemas are not supported by shipped runtime and will throw an
 * explicit upgrade error.
 *
 * @throws {PersistenceError} If checkpoint schema is unsupported
 */
export declare function loadCheckpoint(persistence: LoadPersistence, checkpointSha: string, { codec, checkpointStore, commitMessageCodec }?: LoadCheckpointOptions): Promise<LoadedCheckpoint>;
/** Options for materializeIncremental. */
export interface MaterializeIncrementalOptions {
    persistence: LoadPersistence;
    graphName: string;
    checkpointSha: string;
    targetFrontier: Map<string, string>;
    patchLoader: (writerId: string, fromSha: string | null, toSha: string) => Promise<Array<{
        patch: Patch;
        sha: string;
    }>>;
    codec?: CodecPort;
}
/**
 * Materializes state incrementally from a current checkpoint.
 *
 * Loads the checkpoint state and frontier, then applies all patches
 * since the checkpoint frontier to reach the target frontier.
 *
 * Only supports the current checkpoint schema. Retired schemas will cause
 * loadCheckpoint to throw an explicit upgrade error.
 *
 * @throws {PersistenceError} If checkpoint is a retired schema (upgrade required)
 * @throws {PersistenceError} If checkpoint is missing required envelope blobs
 */
export declare function materializeIncremental({ persistence, graphName: _graphName, checkpointSha, targetFrontier, patchLoader, codec, }: MaterializeIncrementalOptions): Promise<WarpState>;
/** Visible projection used for reconstructStateFromCheckpoint. */
export interface VisibleProjection {
    nodes: string[];
    edges: Array<{
        from: string;
        to: string;
        label: string;
    }>;
    props: Array<{
        node: string;
        key: string;
        value: unknown;
    }>;
}
/**
 * Reconstructs WarpState (ORSet-based) from a checkpoint's visible projection.
 *
 * Creates ORSet-based state with synthetic dots for all visible elements.
 * This is used when reconstructing an incremental materialization basis.
 */
export declare function reconstructStateFromCheckpoint(visibleProjection: VisibleProjection): WarpState;
