UNPKG

774 BTypeScriptView Raw
1/**
2 * A nifty little class that maintains event handlers to add a class to the container element
3 * when entering "mouse mode" (on a `mousedown` event) and remove it when entering "keyboard mode"
4 * (on a `tab` key `keydown` event).
5 */
6export declare class InteractionModeEngine {
7 private container;
8 private className;
9 private isRunning;
10 constructor(container: HTMLElement, className: string);
11 /** Returns whether the engine is currently running. */
12 isActive(): boolean;
13 /** Enable behavior which applies the given className when in mouse mode. */
14 start(): void;
15 /** Disable interaction mode behavior and remove className from container. */
16 stop(): void;
17 private reset;
18 private handleKeyDown;
19 private handleMouseDown;
20}