import type { ValidationResult } from './result.js'; /** * Validate a keyboard input fragment from stdin. * * This catches raw bytes from the terminal BEFORE they enter the input * buffer. The allow-list is: known control sequences, printable ASCII, * and common Unicode (which terminals emit as normal keystrokes). * * Rejects: * - Raw escape sequences that don't match known patterns * - Fragments containing C0 control chars other than tab/newline (0x09, 0x0a) * - Fragments longer than MAX_PASTE_FRAGMENT_CHARS (likely a flood) */ export declare function validateStdinFragment(data: Buffer | string): ValidationResult; /** * Validate a fully-assembled paste payload AFTER the terminal markers * have been stripped by paste-accumulator.ts. * * Rejects: * - Paste > MAX_PASTE_CHARS * - Paste containing C0 control chars (except \n, \t) * - Paste that looks binary (>30% non-printable) * - Paste with unbalanced surrogate pairs */ export declare function validatePasteContent(content: string): ValidationResult; /** * Validate a parsed mouse event from the SGR protocol. * * Rejects: * - Unknown mouse event kinds * - Unknown button values * - Coordinates outside reasonable terminal bounds (0 < x < 5000, 0 < y < 5000) * - Wheel values other than -1, 0, 1 */ export declare function validateMouseEvent(event: { kind: string; button: string; x: number; y: number; wheel: number; shift?: boolean; meta?: boolean; ctrl?: boolean; motion?: boolean; }): ValidationResult<{ kind: string; button: string; x: number; y: number; wheel: number; shift: boolean; meta: boolean; ctrl: boolean; motion: boolean; }>; /** * Validate a KeyEvent from stdin against the known allow-list. * * Every boolean field in a KeyEvent must be exactly `true` or `false`. * `fn` must be 1–12 when present. `wheelDeltaY` must be an integer. * * Rejects: * - Unknown fields on the key event object * - Non-boolean values for boolean fields * - fn outside 1–12 * - wheelDeltaY that is not an integer */ export declare function validateKeyEventFields(key: Record): ValidationResult>; //# sourceMappingURL=terminal.d.ts.map