import type { HistoireTarget } from '@histoire/protocol'; import type { EmbedSurfaceContext } from '../surfaces.js'; /** Owned primary document as the runtime adapter reports it. */ interface RuntimeOwner { /** Current runtime document, `null` when retired. */ id: string | null; /** Selected target of the document. */ selected: HistoireTarget | null; /** Whether a variant of the document acknowledged readiness. */ ready: (variantId: string) => boolean; } /** Sandbox application message: host channel body or plugin body, never both. */ interface ApplicationMessage { /** Story the sending actor renders. */ storyId: string; /** Variant the sending actor renders. */ variantId: string; /** Named host channel body. */ channel?: unknown; /** Plugin channel body; addressed by actor, not by channel name. */ plugin?: unknown; } /** Outer wrapper admits data using same owned primary document and selected envelope as events. */ export declare function createEmbedHostChannels(context: EmbedSurfaceContext, runtime: () => RuntimeOwner): { /** Hostile/malformed/stale messages stop here, before parent callbacks. */ receive(message: ApplicationMessage): void; /** Host posts reach selected ready primary only; runtime requests retain exact capture. */ admit(payload: unknown): void; /** Diagnostic loss count is bounded and retained only for active runtime. */ getDroppedCount: () => number; /** Teardown retains no work, messages or callback closures. */ close(): void; }; export {};