/** * [WHO]: Provides CustomOverlayHost, CustomOverlayContext — extension custom component (overlay/inline) * [FROM]: Depends on @catui/tui (Component/Container/TUI/EditorComponent/OverlayOptions/OverlayHandle), * theme, theme-contract (Theme), keybindings (KeybindingsManager) * [TO]: Consumed by modes/interactive/interactive-mode.ts (held as `this.customOverlay`; wired into * ExtensionUIContext.custom) * [HERE]: modes/interactive/controllers/extension-ui/custom-overlay-host.ts — P5 extension-ui rewrite, host 3/4 (UI02, 纯搬) * * Owns ExtensionUIContext.custom: render an extension-provided component either as an overlay (on top, * via ui.showOverlay) or inline (replacing the editor in the editor shell), saving/restoring the editor * text. Per-call lifecycle (no persistent state). Reaches the editor-shell handles via a narrow context. * Behavior is identical to the former InteractiveMode.showExtensionCustom (纯搬). */ import type { Component, Container, EditorComponent, OverlayHandle, OverlayOptions, TUI } from "@catui/tui"; import type { Theme } from "../../../../core/theme-contract.js"; import type { KeybindingsManager } from "../../../../core/platform/keybindings.js"; type DisposableComponent = Component & { dispose?(): void; }; /** Narrow capability seam: the editor-shell handles the custom component renders into. */ export interface CustomOverlayContext { getEditor(): EditorComponent; getUi(): TUI; getEditorContainer(): Container; getKeybindings(): KeybindingsManager; remountEditorShell(): void; } export declare class CustomOverlayHost { private readonly ctx; constructor(ctx: CustomOverlayContext); /** Show a custom component with keyboard focus. Overlay mode renders on top of existing content. */ show(factory: (tui: TUI, thm: Theme, keybindings: KeybindingsManager, done: (result: T) => void) => DisposableComponent | Promise, options?: { overlay?: boolean; overlayOptions?: OverlayOptions | (() => OverlayOptions); onHandle?: (handle: OverlayHandle) => void; }): Promise; } export {};