import type { Operation } from "../objects/types.ts"; export interface AliasMap { /** Original path → final path, chased through the whole rename chain. */ readonly final: ReadonlyMap; /** Paths no single destination can be derived for (concurrent multi-destination * renames, or a rename cycle). These are NOT moved — conflict detection reports * them and a human decides. */ readonly contested: ReadonlySet; /** rename op oid → the `fromPath` that op moved. Input to the causal condition in * {@link resolvePath}. */ readonly byOp: ReadonlyMap; } /** * Build the path alias map from a set of `rename_file` operations. * * `renames` should be the ops actually projected into the tree (accepted, or whatever * `materializeStatuses` admits). `isConcurrent(a, b)` answers whether two op oids are * causally unrelated. * * Two renames moving the SAME source to DIFFERENT destinations are only a genuine * contest when they are concurrent; when they are causally ordered they are a chain the * author walked deliberately, and the latest (canonical (lamport, oid)) hop wins. A * contested source is left where it is and reported, never moved somewhere arbitrary — * silent data loss is the one outcome worse than a conflict. * * Every iteration order here is sorted rather than insertion-derived, so the returned * maps are byte-identical no matter what order the caller enumerated the renames in. */ export declare function buildAliasMap(renames: Operation[], isConcurrent: (a: string, b: string) => boolean): AliasMap; /** * Resolve the path an op should actually be applied at. * * The causal condition is what keeps this from misrouting NEW files: an op that causally * descends from the rename was written by an author who already saw the moved world, so * the path it names is the path it means. Only an op that is concurrent with (or precedes) * the rename is talking about the pre-move world and needs the alias. */ export declare function resolvePath(aliases: AliasMap, path: string, opOid: string, descendsFromRename: (opOid: string, renameOid: string) => boolean): string; //# sourceMappingURL=aliases.d.ts.map