@teaui/core
Version:
A high-level terminal UI library for Node
16 lines (15 loc) • 548 B
TypeScript
import type { KeyEvent as TUIKeyEvent } from '../sys';
export type KeyEvent = TUIKeyEvent & {
type: 'key';
};
export type HotKeyDef = {
char: string;
ctrl?: boolean;
meta?: boolean;
shift?: boolean;
};
export type HotKey = string | HotKeyDef;
export declare function toHotKeyDef(hotKey: HotKey): HotKeyDef;
export declare function isKeyPrintable(event: KeyEvent): boolean;
export declare const match: (key: HotKeyDef, event: KeyEvent) => boolean;
export declare const styleTextForHotKey: (text: string, key_: HotKey) => string;