@teaui/core
Version:
A high-level terminal UI library for Node
29 lines (28 loc) • 896 B
TypeScript
import type { Program } from './types.js';
import type { SystemEvent } from './events/index.js';
import { TestTerminal } from './TestTerminal.js';
/**
* A headless Program for testing. Wraps a TestTerminal for output assertions,
* and allows pushing events programmatically via sendEvent().
*/
export declare class TestProgram implements Program {
#private;
constructor({ cols, rows }: {
cols: number;
rows: number;
});
get terminal(): TestTerminal;
get cols(): number;
get rows(): number;
move(x: number, y: number): void;
write(str: string): void;
flush(): void;
setup(): void;
teardown(): void;
onEvents(listener: (event: SystemEvent) => void): () => void;
onResize(_listener: () => void): () => void;
/**
* Push a system event into the Screen's event pipeline.
*/
sendEvent(event: SystemEvent): void;
}