import type { SessionTreeNode } from "./sessions-group.js"; /** Display disclosure is independent of API page size and retained page caches. */ export declare const SESSION_GROUP_VISIBLE_STEP = 4; /** One rendered, expanded session group that can use spare rail height. */ export type SessionGroupFillCandidate = { key: string; /** Root rows already loaded for the group. */ loaded: number; /** Rows shown without automatic fill: the initial step or a manual disclosure. */ base: number; /** The server can return more rows for this group. */ hasMore: boolean; }; /** * Plan the extra rows each group shows to use spare rail height. * * Spare rows go top-down to groups that still hide rows. Rows already planned * or restored but not loaded yet count against the spare space, so slow pages * never cause over-allocation. Rows are taken back bottom-up only when `shrink` is set * (the rail viewport itself got shorter); content growth from manual * disclosure or new sessions never retracts rows the reader can already see. * Groups absent from `candidates` (collapsed or no longer rendered) drop * their fill. */ export declare function planSessionGroupFill(candidates: readonly SessionGroupFillCandidate[], current: ReadonlyMap, freeRows: number, shrink: boolean): Map; /** True when two fill plans show the same rows. */ export declare function sameSessionGroupFill(left: ReadonlyMap, right: ReadonlyMap): boolean; /** Fill a display step even when it straddles the retained server page. */ export declare function sessionGroupDisclosurePlan(visibleCount: number, loadedCount: number, hasMore: boolean, failed: boolean): { nextCount: number; needsPage: boolean; }; /** Keep the selected workstream visible without exceeding the group's window. */ export declare function sessionGroupWindowNodes(nodes: readonly SessionTreeNode[], visibleCount: number, selectedSessionId: string | null): SessionTreeNode[];