/**
 * Terminal keyboard input decoding.
 *
 * This module understands two flavours of input: the older, traditional
 * escape-sequence encodings as well as the newer Kitty keyboard protocol
 * (docs at https://sw.kovidgoyal.net/kitty/keyboard-protocol/).
 *
 * Punctuation/symbol keys are recognized too. Be aware that a handful of
 * ctrl+symbol presses collide with plain ASCII control codes — ctrl+[ , for
 * instance, is indistinguishable from ESC. Despite that overlap those keys are
 * still usable in ctrl+shift combinations. The legacy-mapping background is
 * described at
 * https://sw.kovidgoyal.net/kitty/keyboard-protocol/#legacy-ctrl-mapping-of-ascii-keys.
 *
 * Public surface:
 * - matchesKey(data, keyId): test whether some raw input equals a given key id
 * - parseKey(data): decode raw input back into its key id, if recognized
 * - Key: a builder that yields strongly-typed key ids
 * - setKittyProtocolActive(active): update the shared Kitty-protocol flag
 * - isKittyProtocolActive(): read the shared Kitty-protocol flag
 */
/**
 * Record whether the Kitty keyboard protocol is in effect. The terminal layer
 * flips this on once it has confirmed the protocol is supported.
 */
export declare function setKittyProtocolActive(active: boolean): void;
/**
 * Report the current value of the shared Kitty-protocol flag.
 */
export declare function isKittyProtocolActive(): boolean;
declare const LETTER_VALUES: readonly ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
type Letter = (typeof LETTER_VALUES)[number];
declare const SYMBOL_VALUES: readonly ["`", "-", "=", "[", "]", "\\", ";", "'", ",", ".", "/", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "|", "~", "{", "}", ":", "<", ">", "?"];
type SymbolKey = (typeof SYMBOL_VALUES)[number];
declare const SPECIAL_KEY_VALUES: readonly ["escape", "esc", "enter", "return", "tab", "space", "backspace", "delete", "insert", "clear", "home", "end", "pageUp", "pageDown", "up", "down", "left", "right", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11", "f12"];
type SpecialKey = (typeof SPECIAL_KEY_VALUES)[number];
type BaseKey = Letter | SymbolKey | SpecialKey;
/**
 * Every legal key-identifier string, expressed as a union. Using a literal
 * union both powers editor autocomplete and rejects malformed ids during
 * type-checking.
 */
export type KeyId = BaseKey | `ctrl+${BaseKey}` | `shift+${BaseKey}` | `alt+${BaseKey}` | `ctrl+shift+${BaseKey}` | `shift+ctrl+${BaseKey}` | `ctrl+alt+${BaseKey}` | `alt+ctrl+${BaseKey}` | `shift+alt+${BaseKey}` | `alt+shift+${BaseKey}` | `ctrl+shift+alt+${BaseKey}` | `ctrl+alt+shift+${BaseKey}` | `shift+ctrl+alt+${BaseKey}` | `shift+alt+ctrl+${BaseKey}` | `alt+ctrl+shift+${BaseKey}` | `alt+shift+ctrl+${BaseKey}`;
/**
 * Convenience builder that produces well-typed key ids with editor hints.
 *
 * Examples:
 * - Named keys: Key.escape, Key.enter, Key.tab, ...
 * - Punctuation: Key.backtick, Key.comma, Key.period, ...
 * - One modifier: Key.ctrl("c"), Key.alt("x")
 * - Stacked modifiers: Key.ctrlShift("p"), Key.ctrlAlt("x")
 */
export declare const Key: {
    readonly ctrl: <K extends BaseKey>(key: K) => `ctrl+${K}`;
    readonly shift: <K extends BaseKey>(key: K) => `shift+${K}`;
    readonly alt: <K extends BaseKey>(key: K) => `alt+${K}`;
    readonly ctrlShift: <K extends BaseKey>(key: K) => `ctrl+shift+${K}`;
    readonly shiftCtrl: <K extends BaseKey>(key: K) => `shift+ctrl+${K}`;
    readonly ctrlAlt: <K extends BaseKey>(key: K) => `ctrl+alt+${K}`;
    readonly altCtrl: <K extends BaseKey>(key: K) => `alt+ctrl+${K}`;
    readonly shiftAlt: <K extends BaseKey>(key: K) => `shift+alt+${K}`;
    readonly altShift: <K extends BaseKey>(key: K) => `alt+shift+${K}`;
    readonly ctrlShiftAlt: <K extends BaseKey>(key: K) => `ctrl+shift+alt+${K}`;
    readonly backtick: "`";
    readonly hyphen: "-";
    readonly equals: "=";
    readonly leftbracket: "[";
    readonly rightbracket: "]";
    readonly backslash: "\\";
    readonly semicolon: ";";
    readonly quote: "'";
    readonly comma: ",";
    readonly period: ".";
    readonly slash: "/";
    readonly exclamation: "!";
    readonly at: "@";
    readonly hash: "#";
    readonly dollar: "$";
    readonly percent: "%";
    readonly caret: "^";
    readonly ampersand: "&";
    readonly asterisk: "*";
    readonly leftparen: "(";
    readonly rightparen: ")";
    readonly underscore: "_";
    readonly plus: "+";
    readonly pipe: "|";
    readonly tilde: "~";
    readonly leftbrace: "{";
    readonly rightbrace: "}";
    readonly colon: ":";
    readonly lessthan: "<";
    readonly greaterthan: ">";
    readonly question: "?";
    readonly escape: "escape";
    readonly esc: "esc";
    readonly enter: "enter";
    readonly return: "return";
    readonly tab: "tab";
    readonly space: "space";
    readonly backspace: "backspace";
    readonly delete: "delete";
    readonly insert: "insert";
    readonly clear: "clear";
    readonly home: "home";
    readonly end: "end";
    readonly pageUp: "pageUp";
    readonly pageDown: "pageDown";
    readonly up: "up";
    readonly down: "down";
    readonly left: "left";
    readonly right: "right";
    readonly f1: "f1";
    readonly f2: "f2";
    readonly f3: "f3";
    readonly f4: "f4";
    readonly f5: "f5";
    readonly f6: "f6";
    readonly f7: "f7";
    readonly f8: "f8";
    readonly f9: "f9";
    readonly f10: "f10";
    readonly f11: "f11";
    readonly f12: "f12";
};
/**
 * The kind of key event the Kitty protocol reports when flag 2 is enabled.
 * Numerically: 1 means press, 2 means auto-repeat, 3 means release.
 */
export type KeyEventType = "press" | "repeat" | "release";
/**
 * Tell whether the supplied input represents a key being released. This is
 * only relevant while the Kitty protocol is running with flag 2 turned on.
 */
export declare function isKeyRelease(data: string): boolean;
/**
 * Tell whether the supplied input represents an auto-repeated key. As with
 * releases, this only carries meaning when the Kitty protocol's flag 2 is on.
 */
export declare function isKeyRepeat(data: string): boolean;
export declare function normalizeKeyId(keyId: string): string;
export declare class KeyValidator {
    normalize(keyId: string): string;
    isValid(keyId: string): boolean;
}
/**
 * Decide whether raw terminal input corresponds to a particular key id.
 *
 * Identifiers it understands:
 * - Named keys such as "escape", "tab", "enter", "backspace", "delete", "home", "end", "space"
 * - The four arrows: "up", "down", "left", "right"
 * - Ctrl forms like "ctrl+c" or "ctrl+z"
 * - Shift forms like "shift+tab" or "shift+enter"
 * - Alt forms like "alt+enter" or "alt+backspace"
 * - Multi-modifier forms like "shift+ctrl+p" or "ctrl+alt+x"
 *
 * The Key builder gives you typed equivalents: Key.ctrl("c"), Key.escape, Key.ctrlShift("p").
 *
 * @param data - the bytes the terminal delivered
 * @param keyId - the identifier to test against (e.g. "ctrl+c", "escape", Key.ctrl("c"))
 */
export declare function matchesKey(data: string, keyId: KeyId): boolean;
/**
 * Decode raw terminal input back into its key id, or undefined when nothing
 * matches.
 *
 * @param data - the bytes the terminal delivered
 * @returns the matching key id (such as "ctrl+c"), or undefined
 */
export declare function parseKey(data: string): string | undefined;
export {};
