import { ScreenRow } from '../lines/screenTable'; /** * Global configuration options for the pager display and behavior. */ export interface Config { windowContent: string[]; startLine: number; row: number; subRow: number; /** * Characters PAST the sub-row boundary where the top row starts. * * less's screen top is a byte position, so a width change re-wraps * from the same byte and the top keeps showing the same words. Ours * is a boundary index, which cannot say "start mid-boundary" - this * carries the remainder. Measured against less (3000-char line, 79 * columns, -N taking 8): the top stays put, a forward move keeps * the shifted grid, and a backward move re-anchors to the absolute * one - which is why this is an overlay and not a replacement. */ subShift: number; /** * less's position table (position.c): one entry per screen row saying * where that row starts and ends. Empty means pos_clear - the next * paint regenerates it from the top alone. * * It persists across moves because the entries a backward step * prepends cannot be re-derived: back_line bounds the row it exposes * at the row that used to be on top, and the rows below keep the * extents they already had. */ screen: ScreenRow[]; blankTop: number; /** Rows at the BOTTOM the screen was cleared to and never redrawn - * less's jump_loc lclear()ing and then back()ing fewer null lines * than the screen holds. Blank, not tildes: nothing drew them. */ blankBelow: number; endRow: number; endSubRow: number; col: number; setCol: number; setWindow: number; setHalfWindow: number; window: number; halfWindow: number; screenWidth: number; halfScreenWidth: number; chopLongLines: boolean; tabObjectIndent: string | number; bufferOffset: number; keyPrefix: string; attnRow: number; } /** * Represents the current state of the pager. */ export type Mode = 'INIT' | 'EOF' | 'BUFFERING' | 'HELP' | 'DUMB'; /** * Represents all possible key-based actions in the pager. * * These actions control navigation, search, file operations, and various pager * behaviors. They are typically triggered by specific key presses. */ export type Actions = 'ADD_BUFFER' | 'DEL_BUFFER' | 'COMMAND' | 'ESC' | 'TAG_COMMAND' | 'OPTION_TAG' | 'ADD_COMMAND' | 'SHELL_COMMAND' | 'PSHELL_COMMAND' | 'QUIT' | 'HELP' | 'EXIT' | 'FORCE_EXIT' | 'LINE_FORWARD' | 'LINE_BACKWARD' | 'WINDOW_FORWARD' | 'WINDOW_BACKWARD' | 'SET_WINDOW_FORWARD' | 'SET_WINDOW_BACKWARD' | 'NO_EOF_WINDOW_FORWARD' | 'SET_HALF_WINDOW_FORWARD' | 'SET_HALF_WINDOW_BACKWARD' | 'SET_HALF_SCREEN_RIGHT' | 'SET_HALF_SCREEN_LEFT' | 'LAST_COL' | 'FIRST_COL' | 'REPAINT' | 'DROP_INPUT_REPAINT' | 'SEARCH_FORWARD' | 'SEARCH_BACKWARD' | 'REPEAT_SEARCH' | 'REVERSE_SEARCH' | 'HIGHLIGHT_TOGGLE' | 'CLEAR_SEARCH' | 'PATTERN_ONLY' | 'FIRST_LINE' | 'LAST_LINE' | 'PERCENT_LINE' | 'CURLY_BRACKET_RIGHT' | 'ROUND_BRACKET_RIGHT' | 'SQUARE_BRACKET_RIGHT' | 'CURLY_BRACKET_LEFT' | 'ROUND_BRACKET_LEFT' | 'SQUARE_BRACKET_LEFT' | 'CUSTOM_BRACKET_RIGHT' | 'CUSTOM_BRACKET_LEFT' | 'FOLLOW' | 'FOLLOW_BELL' | 'FOLLOW_HILITE' | 'SET_MARK' | 'SET_MARK_BOTTOM' | 'GO_MARK' | 'CLEAR_MARK' | 'PIPE_COMMAND' | 'SAVE_FILE' | 'EDIT_FILE' | 'OPEN_FILE' | 'NEXT_FILE' | 'PREV_FILE' | 'INDEX_FILE' | 'REMOVE_FILE' | 'CURRENT_INFO' /** less's A_X11MOUSE_IN / A_X116MOUSE_IN: the sequence that * INTRODUCES a mouse report, in the X10/X11 three-byte form and * the SGR (1006) form. lesskey names them "mouse" and "mouse6". */ | 'MOUSE_X11_IN' | 'MOUSE_SGR_IN' /** less's A_F_MOUSE / A_B_MOUSE / A_L_MOUSE / A_R_MOUSE: what a * decoded wheel report RESOLVES to. The --emouse gate and the * --rmouse flip both live in the decoder (decode.c:613), so these * four move unconditionally - which is what a lesskey file binding * their codes gets, with no mouse involved. */ | 'MOUSE_FORWARD' | 'MOUSE_BACKWARD' | 'MOUSE_LEFT' | 'MOUSE_RIGHT' | 'NOACTION' | 'VERSION' | 'FORCE_LINE_FORWARD' | 'FORCE_LINE_BACKWARD' | 'FORCE_WINDOW_BACKWARD' | 'NEWLINE_FORWARD' | 'NEWLINE_BACKWARD' | 'GO_POS' | 'SPAN_REPEAT_SEARCH' | 'SPAN_REVERSE_SEARCH' | 'NEXT_TAG' | 'PREV_TAG' | 'OSC8_FORWARD' | 'OSC8_BACKWARD' | 'OSC8_JUMP' | 'OSC8_OPEN';