type callback = () => void; /** * Listen keydown/keyup event on document for a specific keyboard key. */ export declare class ListenKey { private readonly listenedKey; private readonly eventKeys; private keyDown; private keyDownCallback?; private keyUpCallback?; /** * @param listenedKey the key to listen. */ constructor(listenedKey: string); /** * Destroy listeners. The instance is then useless. */ destroy(): void; /** * Is the key currently pressed. */ isKeyDown(): boolean; /** * Register a callback that will be called each time the key is pressed. * @param callback */ setOnKeyDown(callback: callback): void; /** * Register a callback that will be called each time the key is released. * @param callback */ setOnKeyUp(callback: callback): void; /** * Check if the key is pressed. * @private */ private handleKeyDown; /** * Check if the key is released. * @private */ private handleKeyUp; } export {};