import { type SchemaDefinition } from '../schema.js'; /** The compatibility projection and the immutable commit directory for one record. */ export interface RevisionedRecordLocation { readonly legacyPath: string; readonly revisionsDir: string; /** * False when the previous projection naming scheme is not injective for * this key. The immutable commit remains authoritative and enumerable; * publishing a colliding compatibility file would damage another record. */ readonly publishLegacyProjection?: boolean; } /** One proposed committed value and the caller value it produces. */ export interface RevisionMutation { readonly record: T; readonly result: R; } /** * Turn an opaque public id into exactly one injective filesystem segment. * * The unescaped alphabet deliberately excludes `.`, `%`, `~` and every path * separator. Each other UTF-16 code unit has one fixed-width spelling, so * `../x`, a literal escape-looking id, and an unpaired surrogate cannot * collide or leave the store root. */ export declare function revisionFileSegment(value: string): string; /** * Recover an opaque id from its canonical revision-directory segment. * * Listing stores need the inverse: a committed first write can exist without * its best-effort legacy projection, so enumerating projection files alone * would make a successful commit invisible. Non-canonical names return null * rather than aliasing a real id; re-encoding is the final canonicality check. */ export declare function decodeRevisionFileSegment(segment: string): string | null; /** * Preserve the old single-file name whenever it was already one path * component. The immutable log always uses {@link revisionFileSegment}, but * changing a dotted, spaced or Unicode id's projection name would strand the * record written by the previous store implementation during upgrade. */ export declare function legacyRevisionFileSegment(value: string): string; /** * Immutable revision commits over a filesystem. * * The body is complete before `link` publishes its revision name. `link` * supplies the one kernel decision a read-check-replace sequence lacks: * exactly one process can create `N.json`. Revision names are never deleted; * deleting one would let an arbitrarily delayed stale writer issue N again. * * The old single-file record remains a compatibility projection. It is not * authoritative once immutable commits exist, but it is checked on every * read. A different value at the same revision, or a legacy revision ahead * of the commit head, is evidence of an incompatible writer and is refused. */ export declare class DiskRevisionRecordStore { private readonly schema; private readonly label; private readonly revisionOf; private readonly records; constructor(schema: SchemaDefinition, label: string, revisionOf: (record: T) => number); private checkedRevision; read(location: RevisionedRecordLocation): Promise; private readStable; private findHead; transact(location: RevisionedRecordLocation, mutate: (current: T | null) => RevisionMutation): Promise; private publish; private incompatible; } //# sourceMappingURL=revision-record-store.d.ts.map