/** * The capture gate: which timeline events are produced, and who gets them. * * Two consumers want events. The panel wants them while it is recording; the * Chrome Performance tracks want them while that page-side preference is on. * The layers run while either does, each layer only while its flag is on, * and each event goes only to the consumers that asked. This module owns * those rules and the recording edge (re-zeroing the clock), and drives Lit's * render debug flag so lit-html pays for its per-render events only while a * render layer is actually captured. * * The consumers and side effects are injected, so the rules are testable * without a page; `install.ts` wires the real ones. */ import type { TimelineEvent, TimelineLayersState } from '../../../types/timeline.js'; export interface CaptureSinks { /** The panel transport. Receives events while recording. */ emit(event: TimelineEvent): void; /** The Chrome Performance tracks. Receives events while that is on. */ chromeTracks: { push(event: TimelineEvent): void; reset(): void; }; /** Lit's debug event flag; see `render.ts`. */ setRenderDebug(enabled: boolean): void; /** Re-zeroes the timeline clock. */ resetClock(): void; } export interface CaptureController { /** Routes one event to the consumers that want it. */ readonly out: (event: TimelineEvent) => void; /** * Sends one event to the panel only, for a replay of events the Chrome * tracks already have at the time they happened. */ readonly panel: (event: TimelineEvent) => void; /** Whether any consumer wants events; the layers' recording gate. */ readonly capturing: () => boolean; /** Per-layer flags, as the layer installers take them. */ readonly enabled: { readonly lifecycle: () => boolean; readonly render: () => boolean; readonly renderVerbose: () => boolean; readonly changedValues: () => boolean; readonly mouse: () => boolean; readonly keyboard: () => boolean; readonly customEvents: () => boolean; readonly warnings: () => boolean; }; /** The panel started or stopped recording. */ setRecording(recording: boolean): void; /** The panel toggled layers. */ setLayers(patch: Partial): void; /** The Chrome tracks preference changed. */ setChromeTracks(enabled: boolean): void; } export declare const createCaptureController: (sinks: CaptureSinks) => CaptureController; //# sourceMappingURL=capture.d.ts.map