import type { ComputedRef, Ref } from 'vue'; import type { ChatDebugPlaybackState, ChatDebugScenario } from './chat-debug-scenarios.js'; import type { ChatDebugPlaybackSpeed } from './use-chat-debug-playback.js'; export type ChatDebugFindingKind = 'paint' | 'frame' | 'layout' | 'scroll' | 'clock'; export type ChatDebugFinding = { kind: ChatDebugFindingKind; label: string; atMs: number; }; export declare function shouldIgnoreChatDebugLayoutShift(entry: { hadRecentInput: boolean; startTime: number; }, ignoreUntil: number): boolean; export interface ChatScrollSample { top: number; height: number; viewport: number; pinned?: boolean; } export declare function unexpectedChatScrollMovement(previous: ChatScrollSample, next: ChatScrollSample): number; export declare function findChatDebugScrollRoot(stage: HTMLElement): HTMLElement | null; type ListenerTarget = { addEventListener: (type: string, listener: unknown, options?: unknown) => void; removeEventListener: (type: string, listener: unknown, options?: unknown) => void; }; /** * Counts the target's listener registrations from `install()` onwards by * wrapping add/removeEventListener. Mirrors the platform's identity rules — * duplicate (type, listener, capture) triples are ignored, and a remove only * counts against a registration this tracker saw. The net count is the signal * the conversation-switch reproducer watches: per-item global listeners used * to grow with the sidebar and with every switch. */ export declare function createChatDebugListenerTracker(target: ListenerTarget): { counters: { active: number; peak: number; byType: Record; }; install: () => void; uninstall: () => void; }; /** * Window-level listener counter for the workbench's lifetime. Dev-only * instrumentation: the wrap is installed on mount and fully restored on * unmount, and it never alters listener behavior — only counts it. */ export declare function useChatDebugWindowListenerProbe(): { active: number; peak: number; byType: Record; }; /** * Passive probes around the mounted chat component: event-to-paint latency, * dropped frames (reported by playback through `recordFrame`), DOM size, * layout shift, scroll anchoring and wall-clock drift of pending messages. * Thresholds that get crossed are recorded once each as findings. */ export declare function useChatDebugDiagnostics(options: { stageRef: Ref; scenario: ComputedRef; playbackState: ComputedRef; appliedEventCount: ComputedRef; elapsedMs: Ref; playing: Ref; speed: Ref; seekRevision: Ref; }): { diagnostics: { paintLatencyMs: number; droppedFrames: number; domNodes: number; cumulativeLayoutShift: number; scrollPosition: "idle" | "pinned" | "detached"; scrollTop: number; scrollHeight: number; maxScrollJump: number; clockDriftMs: number; findings: { kind: ChatDebugFindingKind; label: string; atMs: number; }[]; }; reset: () => void; recordFrame: (frameDeltaMs: number) => void; }; export {};