import type CellCoords from './cell/coords'; import type { DomBindings } from './types'; import type Settings from './settings'; import type Table from './table'; import type { SelectionManager } from './selection/manager'; import type EventManager from '../../../eventManager'; /** * @class Event */ declare class Event { #private; /** * State object tracking momentum scrolling status and timeout. * * @type {{ ongoing?: boolean; _timeout?: ReturnType }} */ momentumScrolling: { ongoing?: boolean; _timeout?: ReturnType; }; /** * Flag indicating whether a touch event is currently being processed. * * @type {boolean} */ touchApplied: boolean; /** * Reference to the last element the mouse was over, or null if none. * * @type {HTMLElement | null} */ lastMouseOver: HTMLElement | null; /** * @param {FacadeGetter} facadeGetter Gets an instance facade. * @param {DomBindings} domBindings Bindings into dom. * @param {Settings} wtSettings The walkontable settings. * @param {EventManager} eventManager The walkontable event manager. * @param {Table} wtTable The table. * @param {SelectionManager} selectionManager Selections. * @param {Event} [parent=null] The main Event instance. */ constructor(facadeGetter: Function, domBindings: DomBindings, wtSettings: Settings, eventManager: EventManager, wtTable: Table, selectionManager: SelectionManager, parent?: Event | null); /** * Adds listeners for mouse and touch events. * * @private */ registerEvents(): void; /** * Checks if an element is already selected. * * @private * @param {Element} touchTarget An element to check. * @returns {boolean} */ selectedCellWasTouched(touchTarget: Element | null): boolean; /** * Gets closest TD or TH element. * * @private * @param {Element} elem An element from the traversing starts. * @returns {object} Contains coordinates and reference to TD or TH if it exists. Otherwise it's empty object. */ parentCell(elem: Element | null): { coords: CellCoords | null; TD: HTMLTableCellElement | null; }; /** * OnMouseDown callback. * * @private * @param {MouseEvent} event The mouse event object. */ onMouseDown(event: MouseEvent | TouchEvent): void; /** * OnContextMenu callback. * * @private * @param {MouseEvent} event The mouse event object. */ onContextMenu(event: MouseEvent): void; /** * OnMouseOver callback. * * @private * @param {MouseEvent} event The mouse event object. */ onMouseOver(event: MouseEvent): void; /** * OnMouseMove callback. * * @private * @param {MouseEvent} event The mouse event object. */ onMouseMove(event: MouseEvent): void; /** * OnMouseOut callback. * * @private * @param {MouseEvent} event The mouse event object. */ onMouseOut(event: MouseEvent): void; /** * OnMouseUp callback. * * @private * @param {MouseEvent} event The mouse event object. */ onMouseUp(event: MouseEvent | TouchEvent): void; /** * OnTouchStart callback. Captures the gesture start so the synthesized mousedown can be * deferred to `touchend`; this lets a touch-drag gesture scroll the grid without * re-triggering the cell selection (see issue #11659). * * @private * @param {TouchEvent} event The touch event object. */ onTouchStart(event: TouchEvent): void; /** * OnTouchEnd callback. Fires the deferred mousedown only when the gesture is a tap * (no movement past the threshold and no long-press); for a scroll gesture the * selection stays untouched (see issue #11659). * * @private * @param {TouchEvent} event The touch event object. */ onTouchEnd(event: TouchEvent): void; /** * Holder `scroll` callback. Cancels the long-press timer and runs the momentum-scroll * bookkeeping. When called during an active touch sequence it also marks the gesture * as a scroll so the deferred mousedown is not fired on `touchend` - native scrolling * can start at ~8px, before the 10px LONG_PRESS_MOVE_THRESHOLD that `onTouchMove` * watches (issue #11659). * * @private */ onHolderScroll(): void; /** * OnTouchMove callback. Once the finger moves beyond the threshold, marks the gesture as a * scroll so `touchend` skips firing the deferred mousedown, and cancels the long-press timer. * * @private * @param {TouchEvent} event The touch event object. */ onTouchMove(event: TouchEvent): void; /** * Call listener with backward compatibility. * * @private * @param {string} name Name of listener. * @param {MouseEvent} event The event object. * @param {CellCoords} coords Coordinates. * @param {HTMLElement} target Event target. */ callListener(name: string, event: Event | MouseEvent | TouchEvent, coords: CellCoords, target: HTMLElement): void; /** * Clears double-click timeouts and destroys the internal eventManager instance. */ destroy(): void; } export default Event;