import type { HostedLiveMapLibrariesSnapshot } from "../../types/livemap.types.js"; import type { HostedAggregateCommit } from "../livemap/livemap.hosted.js"; import { type LocusHostedAggregate, type LocusHostedAggregateOptions } from "./locus.hosted-multi-library.js"; /** Internal storage wrapper around one exact aggregate capture. */ export type LocusHostedAggregatePersistedCheckpoint = Readonly<{ logicalMapId: string; incarnationId: string; mapKind: "hosted-aggregate"; registryDigest: string; rev: number; snapshot: HostedLiveMapLibrariesSnapshot; }>; /** Internal storage wrapper around one exact aggregate commit. */ export type LocusHostedAggregatePersistedCommit = Readonly<{ logicalMapId: string; incarnationId: string; mapKind: "hosted-aggregate"; registryDigest: string; commit: HostedAggregateCommit; }>; /** Internal adapter port; it stores opaque authoritative aggregate records. */ export interface LocusHostedAggregatePersistenceAdapter { load(logicalMapId: string): Promise; appendCommit(record: LocusHostedAggregatePersistedCommit): Promise; /** Atomically replace the checkpoint and remove commits through its revision. */ replaceCheckpoint(record: LocusHostedAggregatePersistedCheckpoint): Promise; } /** Internal aggregate state returned verbatim by the storage adapter. */ export type LocusHostedAggregatePersistedState = Readonly<{ checkpoint: LocusHostedAggregatePersistedCheckpoint; commits: readonly LocusHostedAggregatePersistedCommit[]; }>; /** Internal durable aggregate authority; it never lowers into solo Locus. */ export type PersistentLocusHostedAggregate = Omit & Readonly<{ checkpoint: () => Promise; }>; /** Internal construction options for one fixed, already-hosted registry. */ export type PersistentLocusHostedAggregateOptions = Omit & Readonly<{ persistence: LocusHostedAggregatePersistenceAdapter; /** Optional storage identity override for a new, revision-zero hosted map. */ logicalMapId?: string; /** Optional storage incarnation override for a new, revision-zero hosted map. */ incarnationId?: string; }>; /** Internal restore options. Topology and identity come only from the checkpoint. */ export type RestorePersistentLocusHostedAggregateOptions = Omit; /** * Create the internal persistent hosted authority only after its one exact * aggregate checkpoint has been durably installed. */ export declare function create_persistent_locus_hosted_aggregate_internal(options: PersistentLocusHostedAggregateOptions): Promise; /** * Rebuild one aggregate authority from a fenced aggregate checkpoint and its ordered * exact aggregate tail. This never rewrites or checkpoints the loaded state. */ export declare function restore_persistent_locus_hosted_aggregate_internal(logicalMapId: string, state: LocusHostedAggregatePersistedState, options: RestorePersistentLocusHostedAggregateOptions): Promise; /** Load one aggregate state through its adapter, then reconstruct it atomically. */ export declare function load_persistent_locus_hosted_aggregate_internal(logicalMapId: string, options: RestorePersistentLocusHostedAggregateOptions): Promise; //# sourceMappingURL=locus.hosted-multi-library.persistence.d.ts.map