@orca-fe/hooks
Version:
React Hooks Collections
17 lines (16 loc) • 854 B
TypeScript
import type React from 'react';
import type { BasicTarget } from './utils/domTarget';
/** * 是否为mac系统(包含iphone手机) * */
export declare function isMac(): boolean;
export declare function toHotkeyStr(event: React.KeyboardEvent | KeyboardEvent): string;
export declare function normalizeHotkeyStr(hotkeyStr: string): string;
export declare function divOnlyFilter(e: KeyboardEvent): boolean;
export type HotkeyEventType = string;
export type UseHotkeyListenerOptions = {
preventDefault?: boolean;
stopPropagation?: boolean;
target?: BasicTarget<HTMLElement | Element | Window | Document>;
filter?: (e: KeyboardEvent) => boolean | void;
allElement?: boolean;
};
export default function useCombineKeyListener(combineKey: HotkeyEventType, callback: (ev: KeyboardEvent) => void, options?: UseHotkeyListenerOptions): void;