import type { HistoireBridgeCommand, HistoireBridgePublication, HistoireEmbedPresentation, HistoireRuntimeSnapshot, HistoireSourceDescriptor, HistoireSurface } from '@histoire/protocol'; import type { HistoireBridgePort, HistoireRequestCapture, HistoireSession } from '@histoire/sdk/internal'; /** Per-document first-party surface context; no global active frame or selection. */ export interface EmbedSurfaceContext { /** Explicit first-party local mount; enables compatible runtime-owned preferences. */ standalone?: boolean; /** Scoped explorer UI, independent of parent bridge authority. */ presentation?: HistoireEmbedPresentation; /** Explicit source base for local standalone mounts whose route changes independently. */ sourceBase?: string; /** Native provider renders generic editors locally; independent iframe defaults to full panel. */ controlsCustomOnly?: boolean; /** Element owned by this surface document. */ container: HTMLElement; /** Parent-backed canonical session proxy. */ session: HistoireSession; /** Dedicated transport for runtime publications. */ bridge: HistoireBridgePort; /** Portable source appearance/budgets, never executable configuration. */ descriptor: HistoireSourceDescriptor; /** Lifetime cancellation. */ signal: AbortSignal; } /** Mounted view's explicit runtime dispatch and teardown. */ export interface EmbedSurfaceInstance { /** Validated finite parent publication, used by controls overlay results. */ publication?: (event: HistoireBridgePublication) => void; /** Primary readiness comes from actual runtime, absent for data-only views. */ ready: Promise; /** Finite runtime methods; data views omit dispatcher. */ request?: (command: HistoireBridgeCommand, payload: unknown, capture: HistoireRequestCapture) => Promise | unknown; /** Retire a failed inspection request's exact runtime-owned side effect. */ cancelInspection?: (capture: HistoireRequestCapture) => void; /** Resource cleanup before document becomes inactive. */ close: () => Promise | void; } /** Register completed surface implementation, returning scoped removal. */ export declare function registerEmbedSurface(surface: HistoireSurface, mount: (context: EmbedSurfaceContext) => EmbedSurfaceInstance): () => void; /** Missing implementation fails before empty frame can acknowledge readiness. */ export declare function assertEmbedSurface(surface: HistoireSurface): void; /** Instantiate only explicit requested registered surface. */ export declare function mountEmbedSurface(surface: HistoireSurface, context: EmbedSurfaceContext): EmbedSurfaceInstance;