UNPKG

@orca-fe/hooks

Version:

React Hooks Collections

22 lines (21 loc) 833 B
import type React from 'react'; /** * 是否为mac系统(包含iphone手机) * */ export declare function isMac(): boolean; /** * 格式化快捷键字符串,按顺序排列功能键 * @param hotkeyStr */ export declare function formatHotKeyStr(hotkeyStr?: string): string; export declare function toHotkeyStr(event: React.KeyboardEvent | KeyboardEvent): string; export declare function divOnlyFilter(e: KeyboardEvent): boolean; export declare function isInput(element: HTMLElement): boolean; type HotkeyDefType = string | string[]; export type HotkeyDefsType = Record<string, [HotkeyDefType] | [HotkeyDefType, HotkeyDefType]>; /** * 生成热键缓存 */ export declare function createHotkeyCache(hotkey: HotkeyDefsType): { hotkeyMapping: Map<string, string>; macHotkeyMapping: Map<string, string>; }; export {};