import type { Color, ScreenSize, ColorSupport, TerminalOptions, FullscreenOptions, InputEvent, ImageOptions, UnderlineStyle } from './types.js'; import { StyleBuilder } from './style.js'; export declare class Terminal { private output; private input; private cursorCtrl; private screenCtrl; private inputReader; private screenBuffer; private useBuffer; private styleOpen; private wasRawMode; private resizeCleanup; private writeBuffer; constructor(options?: TerminalOptions); private _write; /** * Enable write buffering. All writes are collected in memory until * `flushWrites()` is called, which emits them as a single `output.write()`. */ enableWriteBuffer(): this; /** * Flush buffered writes to the output stream as a single write call. * No-op when write buffering is not enabled. */ flushWrites(): this; private addAttr; bold(): this; dim(): this; italic(): this; underline(): this; strikethrough(): this; inverse(): this; fg(color: Color): this; bg(color: Color): this; reset(): this; write(text: string): this; writeln(text: string): this; /** Write directly to the output stream, bypassing the buffer. */ writeRaw(text: string): this; moveTo(x: number, y: number): this; moveBy(dx: number, dy: number): this; saveCursor(): this; restoreCursor(): this; showCursor(): this; hideCursor(): this; get size(): ScreenSize; /** Number of columns. Alias for `size.columns`. */ get cols(): number; /** Number of rows. Alias for `size.rows`. */ get rows(): number; get colorSupport(): ColorSupport; onResize(cb: (size: ScreenSize) => void): () => void; clear(): this; /** * Flush the screen buffer — diffs against the previous frame and writes * only changed cells. Uses synchronized output to prevent tearing. * No-op when buffer mode is disabled. */ flush(): this; enterFullscreen(options?: FullscreenOptions): this; exitFullscreen(): this; onInput(cb: (event: InputEvent) => void): () => void; /** * Listen for raw data on stdin. Useful for reading proprietary escape * sequence responses (e.g. iTerm2 background color query). */ onRawData(cb: (data: Buffer) => void): () => void; /** * Listen for raw data once, then remove the listener. */ onceRawData(cb: (data: Buffer) => void): void; link(url: string, text: string): this; image(data: Buffer, options?: ImageOptions): this; /** Enable CSI u keyboard enhancement (disambiguates shift+enter vs alt+enter, etc). */ keyboardEnhance(): this; /** Disable CSI u keyboard enhancement (pops the enhancement off the stack). */ keyboardEnhanceDisable(): this; beginSync(): this; endSync(): this; sync(fn: () => void): this; underlineStyle(style: UnderlineStyle): this; underlineColor(color: Color): this; title(title: string): this; notify(title: string, body?: string): this; style(): StyleBuilder; } //# sourceMappingURL=terminal.d.ts.map