UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

30 lines (29 loc) 952 B
import { ValueSyncStore } from '../../../util/events/sync-store'; import type { Printable } from 'tree-dump'; import type { UiLifeCycles } from '../types'; import type { DomController } from './DomController'; declare class KeyPress { readonly key: string; readonly ts: number; constructor(key: string, ts: number); } /** * Keeps track of all pressed down keys. */ export declare class KeyController implements UiLifeCycles, Printable { readonly dom: DomController; /** * All currently pressed keys. */ readonly pressed: Set<string>; /** * History of last 5 pressed keys. */ readonly history: ValueSyncStore<KeyPress[]>; constructor(dom: DomController); /** ----------------------------------------------------- {@link Printable} */ start(): () => void; /** ----------------------------------------------------- {@link Printable} */ toString(tab?: string): string; } export {};