import type { ExtensionUIContext } from "../../core/extensions/index.js"; import type { IsolatedInteractiveRuntime } from "./isolated-runtime.js"; export type RemoteComponentRuntime = Pick; export type RemoteComponentUI = Pick; /** * A stalled engine must not make fullscreen input wait forever. A timed-out * reply is treated as unhandled and lets the viewport process the key. */ export declare const REMOTE_INPUT_REPLY_TIMEOUT_MS = 250; export interface TuiRendererLifecycle { isFullscreen(): boolean; onRendererReplaced(listener: () => void): () => void; } export declare class RemoteComponentController { private readonly mounted; private readonly unsubscribe; private readonly unsubscribeGenerationEnded; private readonly terminalModes; private readonly unsubscribeTuiRendererReplaced; private readonly runtime; private readonly ui; private readonly copyText; constructor(runtime: RemoteComponentRuntime, ui: RemoteComponentUI, tuiRendererLifecycle: TuiRendererLifecycle, copyText?: (text: string) => Promise); dispose(): void; /** The remote overlay proxy that currently holds focus (see remote-input-ownership.ts). */ focusedRemoteOverlay(): unknown; /** `component` itself when it is one of this generation's live non-widget proxies. */ remoteProxyOwner(component: unknown): unknown; /** True when the extension that mounted `component` declared it binds Ctrl+C. */ remoteProxyHandlesCtrlC(component: unknown): boolean; /** * Close exactly one live proxy through the ordinary host close path. * * The host escape from a component that traps Ctrl+C, and deliberately not * `disposeAll()`: that is generation-death teardown, which would also close * unrelated nested components and suppress the child notification. Here the * record stays registered while `done` runs, so `showExtensionCustom()` * hides this overlay (or remounts the editor) and its finalizer disposes the * proxy normally — which tells the healthy child to resolve its own * `ui.custom()` promise with `undefined`, exactly like a user cancel. */ dismissRemoteProxy(component: unknown): boolean; private releaseWidget; /** * Close every mounted component. * * `"generation-lost"` closes through the real host close path: it hides the * overlay or remounts the editor into `editorContainer`, restores the saved * draft and focus, releases `blockingInlineCustomUiDepth`, and resolves the * extension's `ui.custom()` promise. Records are removed BEFORE each `done` * runs so the settlement path cannot re-enter the controller, and proxy * disposal is local-only because the writer already points at a replacement * child whose component IDs restart at `remote_component_1`. * * Order is newest-first, matching the TUI's overlay stack. Closing oldest * first would let an overlay mounted above an inline proxy restore focus to * that inline proxy after it had already been disposed. * * `"host-shutdown"` notifies the still-live engine child instead and leaves * host mounts alone: the TUI is already stopping and must not repaint. */ private disposeAll; private handleMessage; private open; private close; private control; } //# sourceMappingURL=remote-component.d.ts.map