import type { AttachSession } from './context.js'; export interface ChromeRefreshHooks { /** True once teardown has begun — stops both the loop and a re-arm. */ isTornDown: () => boolean; /** The viewer's transient notice slot — the ONLY failure channel here. */ setNotice: (msg: string) => void; /** Repaint the relationship roster (chrome/roster.ts refresh). */ refreshRoster: () => Promise; /** Repaint the graph overlay if open. */ refreshGraph: () => void; renderFooter: () => void; renderExtensionWidgets: () => void; /** Re-poll this pane's own git context (owned by the editor chrome). */ pollGit: () => void; } export interface ChromeRefresh { /** Refresh all canvas chrome (panels + overlay if open). Coalescing: an * overlapping request collapses into one queued re-run instead of stacking. */ refresh: () => void; /** The live ask-count map, keyed by node id. */ asks: () => Record; /** Report an async chrome failure through the notice slot — NEVER stderr: * this process owns an alternate-screen TUI, and a stray stderr write paints * raw bytes through the current frame and corrupts it. The last good chrome * snapshot is simply kept; the trimmed cause rides along so a persistent * failure (e.g. a stale viewer generation talking to a newer crtrd) is * diagnosable from the pane. */ reportFailure: (label: string, cause?: unknown) => void; /** Run the initial poll and arm the interval. Call once, after `tui.start()`. */ start: () => void; /** Clear the interval. Called from teardown's `stopLocal`. */ stop: () => void; } export declare function createChromeRefresh(ctx: Pick, hooks: ChromeRefreshHooks): ChromeRefresh;