import type { WalkontableInstance, DomBindings } from './types'; import type Settings from './settings'; import type Table from './table'; import type { Overlay } from './overlay/_base'; import type EventManager from '../../../eventManager'; /** * @class Overlays */ declare class Overlays { #private; /** * DOM bindings for the Walkontable instance. * * @protected * @type {object} */ domBindings: DomBindings; /** * Function which returns proper facade. * * @protected * @type {Function} */ facadeGetter: Function; /** * Reference to the master table instance. * * @protected * @type {MasterTable} */ wtTable: Table; /** * Legacy support reference to the Walkontable instance. * * @protected * @type {Walkontable} */ instance: WalkontableInstance; /** * The walkontable event manager instance. * * @protected * @type {EventManager} */ eventManager: EventManager; /** * The width of the scrollbar. * * @protected * @type {number} */ scrollbarSize: number; /** * The main scrollable element. * * @protected * @type {HTMLElement|Window} */ scrollableElement: HTMLElement | Window; /** * Flag indicating whether the overlay has been destroyed. * * @protected * @type {boolean} */ destroyed: boolean; /** * Flag indicating whether a key is currently pressed. * * @protected * @type {boolean} */ keyPressed: boolean; /** * The last cached spreader size. * * @protected * @type {object} */ spreaderLastSize: { width: number | null; height: number | null; }; /** * Flag indicating whether the table is being scrolled vertically. * * @protected * @type {boolean} */ verticalScrolling: boolean; /** * Flag indicating whether the table is being scrolled horizontally. * * @protected * @type {boolean} */ horizontalScrolling: boolean; /** * The last horizontal scroll position. * * @protected * @type {number} */ lastScrollX: number; /** * The last vertical scroll position. * * @protected * @type {number} */ lastScrollY: number; /** * Walkontable instance's reference. * * @protected * @type {Walkontable} */ wot: WalkontableInstance; /** * Refer to the TopOverlay instance. * * @protected * @type {TopOverlay} */ topOverlay: Overlay; /** * Refer to the BottomOverlay instance. * * @protected * @type {BottomOverlay} */ bottomOverlay: Overlay; /** * Refer to the InlineStartOverlay or instance. * * @protected * @type {InlineStartOverlay} */ inlineStartOverlay: Overlay; /** * Refer to the TopInlineStartCornerOverlay instance. * * @protected * @type {TopInlineStartCornerOverlay} */ topInlineStartCornerOverlay: Overlay; /** * Refer to the BottomInlineStartCornerOverlay instance. * * @protected * @type {BottomInlineStartCornerOverlay} */ bottomInlineStartCornerOverlay: Overlay; /** * Browser line height for purposes of translating mouse wheel. * * @private * @type {number} */ browserLineHeight: number; /** * The walkontable settings. * * @protected * @type {Settings} */ wtSettings: Settings; /** * The instance of the ResizeObserver that observes the size of the Walkontable wrapper element. * In case of the size change detection the `onContainerElementResize` is fired. * * @private * @type {ResizeObserver} */ resizeObserver: ResizeObserver; /** * @param {Walkontable} wotInstance The Walkontable instance. @todo refactoring remove. * @param {FacadeGetter} facadeGetter Function which return proper facade. * @param {DomBindings} domBindings Bindings into DOM. * @param {Settings} wtSettings The Walkontable settings. * @param {EventManager} eventManager The walkontable event manager. * @param {MasterTable} wtTable The master table. */ constructor(wotInstance: WalkontableInstance, facadeGetter: Function, domBindings: DomBindings, wtSettings: Settings, eventManager: EventManager, wtTable: Table); /** * Get the list of references to all overlays. * * @param {boolean} [includeMaster = false] If set to `true`, the list will contain the master table as the last * element. * @returns {(TopOverlay|TopInlineStartCornerOverlay|InlineStartOverlay|BottomOverlay|BottomInlineStartCornerOverlay)[]} */ getOverlays(includeMaster?: boolean): (Table | Overlay)[]; /** * Retrieve browser line height and apply its value to `browserLineHeight`. * * @private */ initBrowserLineHeight(): void; /** * Prepare overlays based on user settings. * * @private */ initOverlays(): void; /** * Runs logic for the overlays before the table is drawn. */ beforeDraw(): void; /** * Runs logic for the overlays after the table is drawn. */ afterDraw(): void; /** * Refresh and redraw table. */ refreshAll(): void; /** * Register all necessary event listeners. */ registerListeners(): void; /** * Scroll listener. * * @param {Event} event The mouse event object. */ onTableScroll(event: Event): void; /** * Wheel listener for cloned overlays. * * @param {Event} event The mouse event object. * @param {boolean} preventDefault If `true`, the `preventDefault` will be called on event object. */ onCloneWheel(event: WheelEvent, preventDefault: boolean): void; /** * Key down listener. * * @param {Event} event The keyboard event object. */ onKeyDown(event: KeyboardEvent): void; /** * Key up listener. */ onKeyUp(): void; /** * Translate wheel event into scroll event and sync scroll overlays position. * * @private * @param {Event} event The mouse event object. * @returns {boolean} */ translateMouseWheelToScroll(event: WheelEvent): boolean; /** * Scrolls main scrollable element horizontally. * * @param {number} delta Relative value to scroll. * @returns {boolean} */ scrollVertically(delta: number): boolean; /** * Scrolls main scrollable element horizontally. * * @param {number} delta Relative value to scroll. * @returns {boolean} */ scrollHorizontally(delta: number): boolean; /** * Synchronize scroll position between master table and overlay table. * * @private */ syncScrollPositions(): void; /** * Synchronize overlay scrollbars with the master scrollbar. */ syncScrollWithMaster(): void; /** * Update the main scrollable elements for all the overlays. */ updateMainScrollableElements(): void; /** * */ destroy(): void; /** * @param {boolean} [fastDraw=false] When `true`, try to refresh only the positions of borders without rerendering * the data. It will only work if Table.draw() does not force * rendering anyway. */ refresh(fastDraw?: boolean): void; /** * Update the last cached spreader size with the current size. * * @returns {boolean} `true` if the lastSpreaderSize cache was updated, `false` otherwise. */ updateLastSpreaderSize(): boolean; /** * Adjust overlays elements size and master table size. */ adjustElementsSize(): void; /** * Expand the hider vertically element by the provided delta value. * * @param {number} heightDelta The delta value to expand the hider element by. */ expandHiderVerticallyBy(heightDelta: number): void; /** * Expand the hider horizontally element by the provided delta value. * * @param {number} widthDelta The delta value to expand the hider element by. */ expandHiderHorizontallyBy(widthDelta: number): void; /** * */ applyToDOM(): void; /** * Get the parent overlay of the provided element. * * @param {HTMLElement} element An element to process. * @returns {WalkontableInstance|null} */ getParentOverlay(element: HTMLElement): WalkontableInstance | null; /** * Synchronize the class names between the main overlay table and the tables on the other overlays. * */ syncOverlayTableClassNames(): void; } export default Overlays;