import { PagerInput } from './input'; import { startupInit } from "../startup/startup"; /** * Starts an interactive pager session to navigate through string content. * * - Handles terminal resizing (SIGWINCH) to repaint content. * - Supports key-based navigation with buffered numeric input. * - Responds to various paging actions like line/window movement and exit. * * @param content - The content to be displayed in the pager. */ export declare function contentPager(initialContent: string[], startupOverride?: ReturnType | null, input?: PagerInput | null): Promise; /** * How long the screen rests at an edge before the queue moves again. * * A DURATION, not a count of surviving keys. Keeping n no-op commands * seemed like the same thing - they cost a frame each, so they buy * time - but a no-op frame is a couple of milliseconds and four of * them went by as a flash: the bottom was never actually seen. * * The pause matters when the keys that scroll BACK are already queued * behind the ones that hit the edge, which is what a fast down-then-up * burst is: without it the discarded tail lets them run immediately * and the screen leaves the bottom the instant it arrives. less needs * none of this because its backlog drains at microseconds a key and * the edge holds for however long the user keeps pressing. * * A FLOOR, not a target: the edge is guaranteed to hold this long, * and holds longer whenever the user simply keeps pressing. */ export declare const EDGE_DWELL_MS = 120; /** * How long the queue must still rest at an edge, 0 when it may run. * * A FLOOR, not a target: the edge is guaranteed to hold this long and * holds longer while the user keeps pressing. less needs none of it - * its no-op costs microseconds, so the edge naturally holds for as * long as keys arrive - but we discard the backlog, so without a rest * the keys that scroll BACK run the instant the bottom is reached and * the screen leaves it in the same breath. */ export declare function edgeWait(until: number, now: number): number; /** How long an unbroken backlog means the loop is losing the race. */ export declare const BEHIND_MS = 80; /** * Whether the key loop is BEHIND: keys waiting, and waiting since * longer ago than a person can type. * * Takes the clock rather than reading it, so the rule can be stated * without one. A terminal hands a burst over in chunks, so a queue * length on its own cannot tell "losing the race" from "briefly * holding five keys" - which is why hiding the ":" on queue length * alone took it off a one-screen file where less's stays put. * * @param since - When the CURRENT unbroken backlog began, 0 when the * queue is empty. Not "when the queue was last empty": after a quiet * spell that reads as an enormous backlog the moment one key lands. */ export declare function fallingBehind(queued: number, since: number, now: number): boolean; /** * Drops the run of keys identical to the one just run, in place. * * Stops at the first DIFFERENT key, which is the whole contract: at an * edge the repeats do the same nothing and are free to discard, but * the key that means something else must still run at once - hold j * into the bottom, press k, and it moves without waiting for the j's. * Dropping the lot instead makes the pager ignore the turn. */ export declare function collapseRun(queue: string[], key: string): void; /** * Reads the keystroke answering the dumb terminal warning, like less's * get_return before the screen initializes. */