json-joy
Version:
Collection of libraries for building collaborative editing apps.
20 lines (19 loc) • 597 B
TypeScript
import type { Printable } from 'tree-dump';
import type { UiLifeCycles } from '../types';
export interface KeyControllerOpts {
source: HTMLElement;
}
/**
* Keeps track of all pressed down keys.
*/
export declare class KeyController implements UiLifeCycles, Printable {
protected readonly opts: KeyControllerOpts;
/**
* All currently pressed keys.
*/
readonly pressed: Set<string>;
constructor(opts: KeyControllerOpts);
start(): () => void;
/** ----------------------------------------------------- {@link Printable} */
toString(tab?: string): string;
}