just-hotkeys
Version:
A declarative keyboard shortcut manager for JavaScript and TypeScript - framework agnostic with React support
23 lines (22 loc) • 936 B
TypeScript
import { ShortcutMap, ShortcutOptions } from '../types';
/**
* React hook for declarative keyboard shortcuts
*/
export declare function useShortcuts(shortcuts: ShortcutMap, options?: ShortcutOptions): void;
/**
* Advanced React hook with more control over shortcut lifecycle
*/
export declare function useShortcutManager(options?: ShortcutOptions): {
addShortcuts: (shortcuts: ShortcutMap) => void;
removeShortcuts: (keys: string[]) => void;
getActiveShortcuts: () => string[];
};
/**
* Hook for conditional shortcuts
*/
export declare function useConditionalShortcuts(shortcuts: ShortcutMap, condition: boolean, options?: ShortcutOptions): void;
/**
* Hook for scoped shortcuts (only active when component is focused)
*/
export declare function useScopedShortcuts(shortcuts: ShortcutMap, targetRef: React.RefObject<HTMLElement>, options?: Omit<ShortcutOptions, 'target'>): void;
//# sourceMappingURL=index.d.ts.map