import { Info, Key, Mouse, Production } from 'term-strings/parse'; import Observable from 'zen-observable'; import { EventOf } from '../misc/EventSource'; import { Point } from '../misc/Point'; import { Rect } from '../misc/Rect'; import { Ruleset } from '../style/Ruleset'; import { TermElement } from './TermElement'; type Subscription = ReturnType['subscribe']>; export type ScreenIn = { setRawMode?: (status: boolean) => void; addListener(event: `data`, cb: (data: Uint8Array) => void): void; addListener(event: `error`, cb: (error: Error) => void): void; addListener(event: string, cb: Function): void; pause(): void; }; export type ScreenOut = { columns?: number; rows?: number; addListener(event: string, cb: Function): void; removeListener(event: string, cb: Function): void; write(data: string): void; }; export type ScreenStreams = { stdin: ScreenIn; stdout: ScreenOut; }; export type RunOptions = Partial & { debugPaintRects?: boolean; trackOutputSize?: boolean; throttleMouseMoveEvents?: number; }; export declare class TermScreen { rootNode: TermElement; rootStyle: Ruleset; resolve?: (exitCode: number) => void; stdin: ScreenIn | null; stdout: ScreenOut | null; subscription: Subscription | null; updateTimer: Promise | null; trackOutputSize: boolean; mouseOverElement: TermElement | null; mouseEnterElements: Array; originalClearColor: string | null; clearColor: string | null; constructor(); run(opts: RunOptions, fn: () => void | undefined): Promise; terminate(exitCode?: number): void; private triggerCleanup; private requestUpdates; private attachScreen; private detachScreen; setClearColor(color: string | null): void; dispatchMouseOverEvents(e: EventOf): void; dispatchMouseEnterEvents(e: EventOf): void; getElementAt(position: Point): TermElement | null; renderScreen(): void; renderScreenImpl(dirtyRects?: Array): void; handleException: (exception: Error) => never; handleExit: () => void; handleInput: (input: Production) => void; handleInfo(info: Info): void; handleKey(key: Key): void; handleMouse(mouse: Mouse): void; handleData(data: Uint8Array): void; handleStdoutResize: () => void; } export {};