rx-hotkeys
Version:
Advanced Keyboard Shortcut Management library using rxjs
17 lines • 782 B
TypeScript
export declare function createMockFn(): {
(...args: any[]): void;
calledCount: number;
calls: any[];
lastArgs: any[];
mockClear(): void;
};
/**
* Dispatches a KeyboardEvent to a specified target element (or document).
* @param target - The EventTarget to dispatch the event on (e.g., document or an HTMLElement).
* @param key - The key value, e.g., "a", "Escape", "ArrowUp".
* @param eventType - The type of event to dispatch, 'keydown' or 'keyup'.
* @param modifiers - Optional modifier keys for the event.
* @returns The dispatched KeyboardEvent.
*/
export declare function dispatchKeyEvent(target: EventTarget, key: string, eventType?: 'keydown' | 'keyup', modifiers?: Partial<KeyboardEventInit>): KeyboardEvent;
//# sourceMappingURL=testutils.d.ts.map