import type { IControllerSessionGroupsDocument } from '../dist_ts/interfaces.projects.js'; import type { IV30ItemRefSessionGroupsDocument } from './v30_sessionlayoutitemrefs.js'; export interface IV32MergeInput { /** Per-project layout documents, already lifted to item refs by v30. */ documents: readonly IV30ItemRefSessionGroupsDocument[]; /** * Registered project ids in registration order. A document whose project is not in the list * is merged last rather than dropped: deciding that a project is gone belongs to the running * controller, which prunes unresolvable rows on the next layout read. */ projectOrder: readonly string[]; /** The controller-wide document, when a previous run already wrote one. */ existing?: IControllerSessionGroupsDocument; } export interface IV32MergeResult { document: IControllerSessionGroupsDocument; /** True when the merge changed anything a rerun would have to repeat. */ migrated: boolean; /** * Items that did not fit the controller-wide bounds. Only their remembered position is lost: * the conversations and resources themselves are untouched and appear in the default order. */ droppedItemCount: number; } /** * Merges every per-project sidebar layout into the one controller-wide layout. * * Projects contribute in registration order, which is the order the project selector listed them * before the sidebar spanned projects, so the first render after the upgrade reads familiar. A * document whose project is not registered keeps its order too, merged after the known ones and * sorted by project id so the merge is deterministic; whether such rows can still be resolved is * the running controller's question, and it prunes them on the next layout read. * * The merge is resumable. A controller-wide document that already exists is the base, and the * per-project documents that are still present are appended to it, so a crash between writing the * merged document and deleting its sources cannot lose or duplicate an item. */ export declare const mergeV32ControllerLayoutDocuments: (inputArg: IV32MergeInput) => IV32MergeResult;