import { Actions } from "./state/interfaces"; /** * Splits raw terminal input into individual key sequences. * * - Terminals batch rapid input (mouse wheel, held keys, pastes) into one * stdin chunk; each contained sequence must be handled separately. * * @param data - Raw input chunk from stdin. * @returns Array of individual key sequences. */ export declare function splitKeys(data: string): string[]; /** * less's kent translation (getcc_repl, command.c:1172): the terminal's * keypad-Enter sequence (terminfo kent, \eOM on xterm) reads as a * newline at getcc - commands and prompts alike - unless a lesskey * file mapped it. error()'s get_return reads RAW getchr instead, so * at a message the ESC ungets (dismissing) and the re-formed \eOM * becomes the NEXT command's newline: dismiss AND move. */ export declare function kentToNewline(key: string): string; /** The terminal's keypad-Enter sequence, empty when it has none. */ export declare const kentSequence: () => string; /** * Maps a key press to a corresponding pager action. * * @param key - A single-character string from user input. * @returns The corresponding `Actions` type if defined, otherwise `undefined`. */ /** * less's A_PREFIX test (cmd_decode, decode.c): the bytes in hand are a * proper prefix of some entry in the command table, so the command is * incomplete and the loop reads another character. * * less derives it from the TABLE. Ours hardcoded three characters * (`^X`, `:`, `^O`), so every other multi-key binding was * unreachable - `ZZ` is `'Z','Z',0, A_QUIT` (decode.c:236), and with * `Z` absent from that list its second key never had a chance. */ export declare function isKeyPrefix(keys: string): boolean; export declare function getAction(key: string): Actions | undefined; /** Drops the cached table, for a TERM change between sessions. */ export declare function resetBoundKeys(): void; /** * Resolves the bytes of an unbound sequence like less reprocessing * them through cmd_decode: a completed tail binding comes out as a * replayable key (ESC j still scrolls, a digit still counts), an * unmatched buffer as null - ONE invalid command, bell and count * dropped. less keeps waiting on a trailing partial match; sequences * arrive whole here, so a dangling prefix simply drops. */ export declare function tailCascade(stream: string): Array;