/** * Compiles lesskey source into the binary a `-k` file carries, like * less's `lesskey` program (lesskey.c) over lesskey_parse.c's tables. * * NOT exposed as a command. less ships `lesskey` as a separate program * and this pager deliberately does not: an npm install has no business * putting a compiler on anyone's PATH, and a source file is the better * thing to keep anyway. It exists for --edit-lesskey, which has to * write a binary back where it found one. * * It is a PORT, not a re-invention - the byte layout, the escape * handling and the error messages all follow less, and the tests compare * its output against the real `lesskey` binary byte for byte. */ /** Where a parse error goes; --edit-lesskey shows them like less does. */ export interface CompileResult { /** The compiled file, or null when nothing could be written. */ data: Buffer | null; /** One message per error, already prefixed "line N: ". */ errors: string[]; } /** * Compiles lesskey source text into the binary file format. * * @param text - The source, as the editor left it. * @param version - The running less version, for #version lines. * @returns The bytes, and any messages less's parser would have printed. */ export declare function compileLesskey(text: string, version: number): CompileResult;