type XY = [number, number]; export type DragHandler = { is_hovering: XY; is_down?: XY; is_just_down?: XY; is_up?: XY; is_double_click?: XY; update(delta: number): void; has_moved_after_last_down: boolean; cleanup(): void; }; /** * An object to listen for mouse events, it's API focuses on implementing a drag drop logic * @param game_width Logical width of the game, used to correctly scale the mouse coordinates * @param game_height Logical height of the game * @param el The canvas to listen the events for * @returns DragHandler * * @example * ``` * let drag = DragHandler(1920, 1080, el) * * // call update in update loop * drag.update(delta) * // query the mouse input * console.log(drag.is_hovering[0], drag.is_hovering[1]) * ``` */ export declare function DragHandler(game_width: number, game_height: number, el: HTMLCanvasElement): { readonly is_hovering: XY; readonly is_down: XY | undefined; readonly is_up: XY | undefined; readonly is_just_down: XY | undefined; readonly is_double_click: XY | undefined; readonly has_moved_after_last_down: boolean; update(delta: number): void; cleanup(): void; }; export {}; //# sourceMappingURL=drag.d.ts.map