import { HTMLElementBase } from "../env";
export type StoryState = "idle" | "playing" | "paused" | "ended";
export declare class OmStoryElement extends HTMLElementBase {
private mapEl;
private steps;
private timeline;
private fired;
private elapsed;
private stateValue;
private raf;
private lastTimestamp;
/** Set by the test harness (advanceInternal): the clock is driven manually, never by rAF. */
private manualClock;
/** Generation token for the paced driver — bumping it aborts any in-flight run (replay, disconnect). */
private pacedGen;
/** True while the paced driver owns the camera — fireDueSteps must not dispatch camera actions against it. */
private pacedDriving;
private warnedPacedCameraSkip;
private pacedCapture;
private captured;
private capturedCamera;
private warnedCustomActions;
private readonly onUserGesture;
connectedCallback(): void;
disconnectedCallback(): void;
get state(): StoryState;
get currentTime(): number;
get duration(): number;
play(): void;
pause(): void;
seek(ms: number, opts?: {
interpolateCamera?: boolean;
}): void;
/**
* Per-frame capture hook for paced runs (the recorder seam, issue #16):
* called after each paced frame is fully refined and BEFORE the frame's
* om-paced-tick event; the story does not advance to the next frame until
* the returned promise resolves, so `await mapEl.snapshot()` — or a
* driving tool's screenshot — is race-free by construction. The final
* om-paced-tick therefore also guarantees every capture has completed.
* Pass null to clear.
*/
setPacedCapture(cb: ((tick: {
t: number;
waitedMs: number;
}) => void | Promise) | null): void;
/**
* Test-harness clock drive (spec: "Consumer Testing Surface" +
* "Map Stories"): switches this story to a manual clock permanently and
* advances it deterministically — rAF never runs for a manual story, so
* headless tests are exact.
*/
advanceInternal(ms: number): void;
private startClock;
private stopClock;
/**
* Load-paced playback (docs/design/paced-flyby.md): manual stepping via
* the pure runPacedFlyby driver — it owns the camera per frame
* (cameraAtTime over the same fly-to arc route warming samples, written
* through the instant setView path) and gates every advance on all live
* tilesets reporting isLoaded(). Emits om-paced-tick {t, waitedMs} per
* frame (the recorder hook). `paced` may carry a frame rate (`paced="60"`,
* default 30 — story-time fps of the output, not a wall-clock promise).
*/
private startPaced;
private advanceBy;
private fireDueSteps;
/** Steps and the timeline are (re)built lazily when idle — mid-play DOM edits apply on the next play/seek. */
private ensureBuilt;
private ensureCaptured;
private restoreInitial;
private attachInterruptListeners;
private detachInterruptListeners;
private tick;
}
declare global {
interface HTMLElementTagNameMap {
"om-story": OmStoryElement;
}
}