react-keyhub
Version:
A lightweight, scalable keyboard shortcut manager for React applications with TypeScript support
25 lines (24 loc) • 876 B
TypeScript
/**
* Normalizes a key combination string to a consistent format
* @param keyCombo The key combination to normalize
* @returns The normalized key combination
*/
export declare const normalizeKeyCombo: (keyCombo: string) => string;
/**
* Converts a keyboard event to a normalized key combination string
* @param event The keyboard event
* @returns The normalized key combination
*/
export declare const eventToKeyCombo: (event: KeyboardEvent) => string;
/**
* Creates a debounced version of a function
* @param func The function to debounce
* @param wait The debounce time in milliseconds
* @returns The debounced function
*/
export declare const debounce: <T extends (...args: any[]) => any>(func: T, wait: number) => (...args: Parameters<T>) => void;
/**
* Generates a unique ID
* @returns A unique ID string
*/
export declare const generateId: () => string;