diff options
Diffstat (limited to 'plugins/code-modernization/hooks/host.ts')
| -rw-r--r-- | plugins/code-modernization/hooks/host.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/code-modernization/hooks/host.ts b/plugins/code-modernization/hooks/host.ts index c315fecf..9190a4cc 100644 --- a/plugins/code-modernization/hooks/host.ts +++ b/plugins/code-modernization/hooks/host.ts @@ -12,6 +12,12 @@ import type { import type { ReaderFs } from './reader/fs' /** + * What `$.ui.open` answers: drawn, or open but held back undrawn (unasked, on a terminal narrower than the engine docks a + * pane on) with the reason. A build that answers nothing has drawn it, as far as anyone can tell. + */ +export type OpenResult = { isPlaced: boolean; reason?: string } | void + +/** * The engine as `session.start` bound it from its `$`: every later hook, * timer and button press reaches the engine through this, so the rest of * the module is plain functions over a small interface a test can stand in for. @@ -28,7 +34,7 @@ export type Host = { status: (text: string | undefined) => void toast: (text: string, timeoutMs?: number) => void log: (text: string) => void - openPane: (pane: PaneOpenArgs) => Promise<void> + openPane: (pane: PaneOpenArgs) => Promise<OpenResult> closePane: (pane: PaneCloseArgs) => Promise<void> registerCommand: (spec: CommandSpec) => Promise<unknown> fillPrompt: (input: PromptFillArgs) => Promise<{ isFilled: boolean }> |
