import { SurfaceManager } from '../core/surface-manager.js'; import { Editor, PasswordPromptConfig } from '../core/types/index.js'; export interface PasswordPromptDocument { id: string; password?: string; editorMountNonce: number; } export interface PasswordPromptException { error?: Error; editor?: Editor | null; } export interface UsePasswordPromptOptions { getSurfaceManager: () => Pick | null; getPasswordPromptConfig: () => boolean | PasswordPromptConfig | undefined; /** * Called when a queued prompt cannot be shown (resolver returned `none`, config error, or resolver threw). * Receives the original exception payload so the host can re-emit it unchanged. */ onUnhandled?: (doc: PasswordPromptDocument, errorCode: string, originalException?: PasswordPromptException) => void; } /** * Composable that coordinates password-prompt dialogs for encrypted DOCX files. * * Owns a FIFO queue of pending prompts (one active dialog at a time), and a * `pendingSignals` map that bridges the async gap between triggering a remount * and observing the result via `onEditorReady` / `onEditorException`. */ export declare function usePasswordPrompt({ getSurfaceManager, getPasswordPromptConfig, onUnhandled, }: UsePasswordPromptOptions): { handleEncryptionError: (doc: PasswordPromptDocument | null | undefined, errorCode: string, originalException?: PasswordPromptException) => boolean; handleEditorReady: (doc: PasswordPromptDocument | null | undefined) => void; destroy: () => void; };