UNPKG

@inquirer/testing

Version:
36 lines (35 loc) 1.06 kB
import MuteStream from 'mute-stream'; import { BufferedStream } from './buffered-stream.ts'; export type KeypressEvent = { name?: string; ctrl?: boolean; meta?: boolean; shift?: boolean; }; export declare class Screen { #private; constructor(); get input(): MuteStream; createOutput(): BufferedStream; setActivePromise(promise: Promise<unknown>): void; /** * Wait for the next screen update. * * Handles re-renders within the same prompt (e.g., validation errors, * async updates) and prompt transitions in multi-prompt flows * (automatically waits for the next prompt). * * Note: The initial prompt render is available immediately via getScreen() * — no next() call is needed before reading it. */ next(): Promise<void>; getScreen({ raw }?: { raw?: boolean; }): string; getFullOutput({ raw }?: { raw?: boolean; }): Promise<string>; keypress(key: string | KeypressEvent): void; type(text: string): void; clear(): void; }