/** * SurfaceManager — a plain JavaScript class that owns surface lifecycle state. * * NOT a Pinia store. Lives on the SuperDoc instance and survives runtime * restarts (collaboration upgrades). Vue components observe the reactive * refs (`activeDialog`, `activeFloating`) via provide/inject. */ export class SurfaceManager { /** * @param {{ getModuleConfig: () => SurfacesModuleConfig | undefined }} options */ constructor({ getModuleConfig }: { getModuleConfig: () => SurfacesModuleConfig | undefined; }); /** @type {import('vue').ShallowRef} */ activeDialog: import('vue').ShallowRef; /** @type {import('vue').ShallowRef} */ activeFloating: import('vue').ShallowRef; /** * Open a surface. Returns a handle with a result promise that always resolves. * * Throws synchronously on API misuse (bad request shape, unresolvable intent). * Normal lifecycle events (close, replace, destroy) resolve through the handle. * * @template [TResult=unknown] * @param {SurfaceRequest} rawRequest * @returns {SurfaceHandle} */ open(rawRequest: SurfaceRequest): SurfaceHandle; /** * Close a surface by id, or the topmost surface if no id is given. * @param {string} [id] * @param {unknown} [reason] */ close(id?: string, reason?: unknown): void; /** * Settle all active surfaces with the given outcome. * Used by SuperDoc during runtime restart and destroy. * @param {SurfaceOutcome} outcome */ settleAll(outcome: SurfaceOutcome): void; /** * Permanently shut down the manager. All active surfaces are settled with * { status: 'destroyed' }. Future open() calls return destroyed handles. */ destroy(): void; #private; } export type SurfaceMode = import('./types').SurfaceMode; export type SurfaceRequest = import('./types').SurfaceRequest; export type SurfaceResolution = import('./types').SurfaceResolution; export type SurfaceHandle = import('./types').SurfaceHandle; export type SurfaceOutcome = import('./types').SurfaceOutcome; export type SurfacesModuleConfig = import('./types').SurfacesModuleConfig; export type ExternalSurfaceRenderContext = import('./types').ExternalSurfaceRenderContext; export type ActiveSurface = { id: string; mode: SurfaceMode; request: SurfaceRequest; /** * Resolved Vue component */ component?: unknown; /** * Extra props for the Vue component */ props?: Record | undefined; /** * External renderer */ render?: ((ctx: ExternalSurfaceRenderContext) => ({ destroy?: () => void; } | void)) | undefined; /** * Content-facing: settle with 'submitted' */ resolve: (data?: unknown) => void; /** * Content-facing: settle with 'closed' and clear slot */ close: (reason?: unknown) => void; /** * Settle the handle promise (internal) */ settle: (outcome: SurfaceOutcome) => boolean; /** * Whether the handle has already been settled */ settled: boolean; }; //# sourceMappingURL=surface-manager.d.ts.map