UNPKG

lazy-widgets

Version:

Typescript retained mode GUI for the HTML canvas API

43 lines (42 loc) 1.73 kB
import { GenericClickHelper } from "./GenericClickHelper.js"; import { BaseClickHelper } from "./BaseClickHelper.js"; import { ClickState } from "./ClickState.js"; /** * A class that mixes multiple {@link GenericClickHelper} instances into one. * Useful if you want a widget to be both clickable by a pointer and by the * enter key * * @category Helper */ export declare class CompoundClickHelper implements BaseClickHelper { /** The {@link GenericClickHelper} instances being mixed */ private clickHelpers; constructor(clickHelpers: GenericClickHelper[]); get lastClickState(): ClickState; get clickState(): ClickState; /** * See {@link BaseClickHelper#clickStateChanged}. * * Note that this does not check if the combined state has changed, it only * check if any of the states in {@link CompoundClickHelper#clickHelpers} * has changed, meaning that this can be true while * {@link CompoundClickHelper#clickState} is equal to * {@link CompoundClickHelper#lastClickState}. To check whether the combined * state changed, compare the aforementioned values. This is the default * behaviour so that clicks aren't dropped. */ get clickStateChanged(): boolean; /** * Similar to {@link BaseClickHelper#wasClick}, except that the wasClick * property for each click helper is only true if the * {@link BaseClickHelper#clickStateChanged} property is also true. */ get wasClick(): boolean; /** Resets each click helper instance being mixed. */ reset(): void; /** * Unsets the {@link BaseClickHelper#clickStateChanged} flag in each click * helper instance being mixed. */ doneProcessing(): void; }