import type { FrameId, FrameLanding } from "./frame-timeline"; import { type EngineChannel, type PaintSeq, type PlaybackState, PlaybackStatus } from "./types"; /** * Tiny external store powering useSyncExternalStore subscriptions. Five * emit channels by mutation cadence: * * - time: emits when the playhead moves to a different frame. Consumers * wanting a slower rerender cadence apply their own selector. * - frame: emits on every settled cursor-yielded frame, for marker rails. * - state: status transitions only. Rare. Driven by load, play, pause, * seek, end, error. * - duration: emits once per loaded source. * - seeking: emits when the cursor transitions in/out of an in-flight * scrub. Powers an opt-in scrub-in-flight indicator. Cache-hit * scrubs typically don't trip this because the cache paint is * synchronous, so the engine writes true only when the cursor * is actually doing a decode walk. * - rate: emits on a playback-rate change. Rarest channel of the six. * * Channels are separate so a status-only consumer does not wake up at * 60Hz when only time advances. */ export declare class MirrorStore { private playhead; private paintSeq; private durationMs; private status; private error; private seeking; private rate; private playbackStateSnapshot; private readonly channelListeners; getPlayhead(): FrameLanding; getDurationMs(): number; getStatus(): PlaybackStatus; getError(): PlaybackState["error"]; getPaintSeq(): PaintSeq; getPlaybackState(): PlaybackState; getSeeking(): boolean; getRate(): number; /** * Moves the playhead onto a frame. Ticks are integers, so the same frame * arriving twice is recognised as the same frame and wakes nobody; the * millisecond plane this replaced could not tell two positions apart at all, * and emitted on every paint. */ writePlayhead(frame: FrameId, mediaTimeS: number): void; writePaintSeq(value: PaintSeq): void; writeDurationMs(value: number): void; writeStatus(status: PlaybackStatus, error?: PlaybackState["error"]): void; writeSeeking(isSeeking: boolean): void; writeRate(value: number): void; subscribe(channel: EngineChannel, listener: () => void): () => void; private emit; }