/**
 * DOM event bridge for the section runtime engine adapter (M7 — Variant
 * C, layered).
 *
 * Translates canonical engine outputs (`stage-change`,
 * `loading-complete`, `framework-error`) into DOM `CustomEvent`
 * dispatches on the host element. Mirrors the kernel's existing
 * `dispatch("pie-stage-change", …)` / `dispatch("pie-loading-complete", …)`
 * / `dispatch("framework-error", …)` emit chain bit-for-bit so the M6
 * canonical event surface stays stable while the kernel migrates onto
 * the engine in PR 5.
 *
 * **Detail-shape contract.** The engine core emits structurally minimal
 * outputs (`{ stage, status, cohort }`, `{ cohort, itemCount,
 * loadedCount }`). The bridge enriches them with `runtimeId`,
 * `sourceCe`, and `timestamp` so the dispatched DOM event detail
 * matches the canonical
 * `packages/players-shared/src/pie/stages.ts#StageChangeDetail` and
 * `LoadingCompleteDetail` shapes verbatim. `runtimeId` and `sourceCe`
 * are supplied at adapter construction time (one per engine instance);
 * `timestamp` is captured per-emit via the injected `now()` clock so
 * tests can pin a deterministic value.
 *
 * **Why not import the stage tracker.** The tracker's monotonic /
 * skipped-fill enforcement now lives in the engine core's transition
 * function. The bridge is purely an output-to-DOM translator — it does
 * not gate emissions, does not re-order, does not de-duplicate. That
 * keeps the responsibility clean and matches the "outputs are already
 * ordered correctly by the core" contract from
 * `engine-transition.ts`.
 *
 * The bridge **must not** import `svelte`; per the M7 layering
 * constraint the adapter is plain TS.
 */
import type { SectionEngineOutput } from "../core/engine-output.js";
export interface DomEventBridgeOptions {
    /** Element on which to dispatch the DOM events. */
    host: EventTarget;
    /** Stable runtime id for this engine instance. */
    runtimeId: string;
    /**
     * Tag name of the host CE without the `--version-<encoded>` suffix.
     * Each layout CE that mounts the kernel passes its own canonical tag
     * name; the toolkit CE passes its own.
     */
    sourceCe: string;
    /**
     * Clock injection for tests. Defaults to `() => new Date().toISOString()`.
     */
    now?: () => string;
}
export interface DomEventBridgeHandle {
    /** Translate a single engine output into a DOM dispatch. */
    dispatch(output: SectionEngineOutput): void;
    /**
     * Update the host element after construction (e.g. when the kernel
     * receives its host element via Svelte action / context). The
     * bridge keeps the latest host; future dispatches go to that host.
     */
    setHost(host: EventTarget): void;
}
export declare function createDomEventBridge(options: DomEventBridgeOptions): DomEventBridgeHandle;
