react-elegant-ui
Version:
Elegant UI components, made by BEM best practices for react
32 lines (31 loc) • 806 B
TypeScript
import { KeyCodesList } from '../../lib/keyboard';
export interface KeyboardPickParameters {
/**
* Handlers work only when enabled
*/
enabled: boolean;
/**
* Handler for pick active item, to which point a cursor
*/
onPick?: () => void;
/**
* List of key codes which trigger pick event
*
* It will match with `code` property of native event
*/
pickKeys?: KeyCodesList;
/**
* Phase to handle pick
*/
pickStrategy?: 'keydown' | 'keyup';
/**
* Define event phase
*
* @default true
*/
eventCapture?: boolean;
}
/**
* Global hook which implement keyboard selection
*/
export declare const useKeyboardPick: ({ enabled, onPick, pickKeys, pickStrategy, eventCapture, }: KeyboardPickParameters) => void;