import tty from 'tty'; /** The current keyboard stream (process.stdin by default). */ export declare const keyboard: () => tty.ReadStream; /** The keyboard's file descriptor, for synchronous interrupt polls. */ export declare const keyboardFd: () => number; export declare function openTtyKeyboard(): boolean; /** A never-blocking tty fd for mid-scan interrupt polls, or null * when the platform has no pollable terminal device. */ export declare function keyboardPollFd(): number | null; /** * True when the terminal lacks cursor capabilities, like less's * missing_cap: on unix a missing $TERM loads the "unknown" termcap * entry (screen.c's DEFAULT_TERM), which turns up dumb. less's Windows * build never consults $TERM — it drives the console API directly — * so a Windows console only degrades when it predates the VT * processing that node enables on its tty streams (Windows 10 build * 10586), or when $TERM names dumb explicitly. */ export declare function dumbTerminal(): boolean; /** Queues a polled key for after the blocking read (ungetcc_back). */ export declare function pushUngot(data: Buffer): void; /** Queues a key that was typed with the current screen already up. */ export declare function pushUngotLive(data: Buffer): void; /** Whether the queue holds a key typed against the current screen. */ export declare const ungotIsLive: () => boolean; /** Takes all queued keys, oldest first; null when none wait. */ export declare function takeUngot(): Buffer | null; /** less's ABORT_SIGS(). */ export declare const abortSigs: () => boolean; /** less's `sigs |= S_INTERRUPT`, from wherever the ^C was noticed. */ export declare function raiseAbort(): void; /** less's psignals clearing the flag once it has been handled. */ export declare function clearAbort(): void; /** * Discards the queued keys, like less's iread on READ_INTR running * `getcc_clear()` (os.c): keys typed before the interrupt — the * aborting ^C included — never run as commands. Keys still unread * in the kernel's tty buffer survive, exactly like less's. */ export declare function consumeInterrupt(): void; /** True while ungot input pends, less's prompt() early-return test. */ export declare function hasUngot(): boolean; /** * less's error()/get_return inline gate: prints the message on the * prompt line, BLOCKS for one raw key (output.c:696 - RETURN, space * or an interrupt dismiss; any other key ungets to run as the next * command), then clears the line so the interrupted action continues. */ type GateRelease = 'dismiss' | 'unget' | 'winch'; /** The last gate's release kind. */ export declare function gateReleaseKind(): GateRelease; /** Reads whether the last gate was released by a resize. */ export declare function gateReleasedByWinch(): boolean; /** The column the last gate's message reached. */ export declare function gateEndColumn(): number; export declare function gateReturn(message: string): void; /** Emulates ISIG for a typed ^C: SIGINT to our process group. */ export declare function raiseSigint(): void; /** Consumes the self-signal mark: true when the SIGINT now being * handled came from raiseSigint (the ^C byte path already acted). */ export declare function wasSelfSigint(): boolean; /** * The terminal size straight from the kernel, like less's scrsize * ioctl: node caches the winsize and refreshes it only in its own * SIGWINCH processing — a blocking scan delays that past less's * update_term moment, and a raw SIGWINCH handler can run before * the refresh. Returns [columns, rows], falling back to node's * cache when stty is unavailable (Windows). */ export declare function freshWindowSize(): [number, number] | null; /** * Watches window changes like less's lwinch: the handler fires on the * SIGNAL itself — less's psignals runs screen_trashed() even when the * size did not change, and the longjmp dismisses get_return waits — * while node's 'resize' event only fires when the dimensions * differ. Windows has no SIGWINCH, so 'resize' covers it, like less * polling the console size. */ export declare function watchWinch(fn: () => void): void; /** Removes a watchWinch handler. */ export declare function unwatchWinch(fn: () => void): void; /** * Releases a /dev/tty keyboard, like close_getchr: the open tty * handle would otherwise keep the process alive after the pager * quits. */ export declare function closeTtyKeyboard(): void; export {};