/** * Observable wrapper around the pure transcript reducer (V2-050). * * The only side effect this store performs is notifying subscribers; state * transitions themselves stay in `applyAppEvent` so they remain replayable * and unit-testable without a subscriber. Components read state through * `getState`/`subscribe` (a `useSyncExternalStore` source), never by reaching * into reducer internals. */ import type { AnyAppEvent } from "../../app/events/app-event.js"; import type { TranscriptItem as ClassicTranscriptItem } from "../../app/ports/transcript-item.js"; import { type TranscriptState } from "./transcript-types.js"; export type TranscriptListener = () => void; export declare class TranscriptStore { private readonly maxItems; private readonly coalesceMs; private state; private readonly listeners; private notifyTimer; private notifyPending; private persistBase; private persistHydratedIds; private static readonly COALESCED_EVENT_TYPES; constructor(maxItems?: number, coalesceMs?: number); getState(): TranscriptState; dispatch(event: AnyAppEvent): void; /** CHAT-006: Ctrl+T toggles every thinking block's default visibility. */ toggleThinkingGlobal(): void; /** CHAT-005/007: Ctrl+O toggles tool OUTPUT + compacted memory cards. */ toggleOutputGlobal(): void; /** Expand/collapse every tool OUTPUT card at once (collapse all / expand * all chips). Clears only tool/compacted per-item overrides so thinking * overrides survive. */ setOutputGlobal(expanded: boolean): void; /** Expand/collapse every file-diff card in chat (hunks vs title-only). */ setFileDiffsGlobal(expanded: boolean): void; toggleFileDiffsGlobal(): void; /** Expand/collapse one tool's file-diff body. */ toggleFileDiffOverride(toolItemId: string, fallback: boolean): void; /** Expand/collapse one item, overriding whichever global toggle applies. */ toggleItemOverride(id: string, fallback: boolean): void; subscribe(listener: TranscriptListener): () => void; reset(): void; /** * Replace the entire visual transcript (used by /history resume). * Preserves global expand toggles so user prefs survive a session switch. * `rebaseSequence: false` keeps the live sequence clock (in-session restores * must never rewind it, or the next sequencer event arrives as a gap). */ hydrate(next: TranscriptState, options?: { readonly rebaseSequence?: boolean; readonly persistBase?: readonly ClassicTranscriptItem[] | undefined; } | undefined): void; mergePersistSnapshot(items: ClassicTranscriptItem[]): ClassicTranscriptItem[]; private setState; private applyState; private scheduleNotify; private flushNotify; }