import type { WalkontableInstance } from '../types'; import type { EngineContext } from '../wire'; import type Settings from '../settings'; import type Table from '../table/baseTable'; import type { Overlay } from './regions/_base'; import type EventManager from '../../../../eventManager'; import { StickyScrollStrategy } from './strategies/stickyScrollStrategy'; import { ResizeMonitor } from './resizeMonitor'; /** * Assembles the Overlays module's dependencies from the engine composition context. Overlays is the * sub-composition point for the individual overlays, so it carries `makeOverlayDeps` — a factory that * mints a fresh overlay dependency set (via `createOverlayDeps`) for each overlay it builds. * * @param {EngineContext} ctx The engine composition context. * @returns {object} The Overlays dependency set. */ export declare function createOverlaysDeps(ctx: EngineContext): { wot: WalkontableInstance; wtSettings: Settings; rootDocument: Document; rootWindow: Window; geometryReader: import("../domMeasure/geometryReader").GeometryReader; eventManager: EventManager; wtTable: Table; makeOverlayDeps: () => { wot: WalkontableInstance; facadeGetter: Function; wtSettings: Settings; rootDocument: Document; rootWindow: Window; geometryReader: import("../domMeasure/geometryReader").GeometryReader; getWtTable: () => Table; getWtViewport: () => import("../viewport/viewport").default; getWtOverlays: () => Overlays; getWtEvent: () => WalkontableInstance["wtEvent"]; getSelectionManager: () => import("../selection").SelectionManager; }; makeStickyScrollDeps: (overlays: Overlays) => { wtSettings: Settings; rootDocument: Document; rootWindow: Window; eventManager: EventManager; wtTable: Table; getWtViewport: () => import("../viewport/viewport").default; getTopOverlay: () => Overlay; getBottomOverlay: () => Overlay; getInlineStartOverlay: () => Overlay; getScrollableElement: () => HTMLElement | Window; refreshAll: () => void; applyToDOM: () => void; }; makeResizeMonitorDeps: () => { wtSettings: Settings; wtTable: Table; }; makeSpreaderSizeDeps: (overlays: Overlays) => { wtSettings: Settings; rootWindow: Window; geometryReader: import("../domMeasure/geometryReader").GeometryReader; wtTable: Table; getWtViewport: () => import("../viewport/viewport").default; getTopOverlay: () => Overlay; getInlineStartOverlay: () => Overlay; getBottomOverlay: () => Overlay; getScrollableElement: () => HTMLElement | Window; }; makeScrollSyncDeps: (overlays: Overlays, stickyScroll: StickyScrollStrategy) => { wtSettings: Settings; rootWindow: Window; geometryReader: import("../domMeasure/geometryReader").GeometryReader; wtTable: Table; getWtViewport: () => import("../viewport/viewport").default; getTopOverlay: () => Overlay; getInlineStartOverlay: () => Overlay; getBottomOverlay: () => Overlay; eventManager: EventManager; getDestroyed: () => boolean; refreshAll: () => void; registerListeners: () => void; tryActivateStickyScroll: (verticalScrolling: boolean, horizontalScrolling: boolean) => void; syncStickyScrollOffsets: () => void; }; makeNativeScrollInputDeps: (overlays: Overlays, stickyScroll: StickyScrollStrategy, resizeMonitor: ResizeMonitor) => { wtSettings: Settings; rootDocument: Document; rootWindow: Window; geometryReader: import("../domMeasure/geometryReader").GeometryReader; wtTable: Table; eventManager: EventManager; getTopOverlay: () => Overlay; getInlineStartOverlay: () => Overlay; getCloneableOverlays: () => Overlay[]; getScrollableElement: () => HTMLElement | Window; syncScrollPositions: () => void; scrollVertically: (delta: number) => boolean; scrollHorizontally: (delta: number) => boolean; registerStickyScrollListeners: () => void; resetResizeCount: () => void; observeResize: () => void; }; }; /** * The Overlays module dependencies, inferred from `createOverlaysDeps`. */ export type OverlaysDeps = ReturnType; /** * @class Overlays */ declare class Overlays { #private; /** * Reference to the master table instance. * * @protected * @type {MasterTable} */ wtTable: Table; /** * The walkontable event manager instance. * * @protected * @type {EventManager} */ eventManager: EventManager; /** * The width of the scrollbar. * * @protected * @type {number} */ scrollbarSize: number; /** * Flag indicating whether the overlay has been destroyed. * * @protected * @type {boolean} */ destroyed: boolean; /** * `true` while the in-progress master draw was entered as a fast/scroll draw (`draw(true)`), and * `false` for a full render (`draw(false)`, e.g. a `forceFullRender` from `hot.render()`). Set once * per master draw before the cells are rendered, and read by the draw cycle (master and its clones, * which reach it through the clone source) to gate the column-header render skip. It exists because * the `verticalScrolling`/`horizontalScrolling` flags can still be set when an `afterScroll` hook * synchronously triggers a `forceFullRender`, and a full render must always rebuild the headers. * * @type {boolean} */ isScrollDrivenDraw: boolean; /** * Flag indicating whether the table is being scrolled vertically. * * @returns {boolean} */ get verticalScrolling(): boolean; /** * @param {boolean} value Whether the table is being scrolled vertically. */ set verticalScrolling(value: boolean); /** * Flag indicating whether the table is being scrolled horizontally. * * @returns {boolean} */ get horizontalScrolling(): boolean; /** * @param {boolean} value Whether the table is being scrolled horizontally. */ set horizontalScrolling(value: boolean); /** * The element that scrolls the table (the trimming container or the window). * * @returns {HTMLElement | Window} */ get scrollableElement(): HTMLElement | Window; /** * Whether the scrolling element was resolved while the table generated no boxes, so the answer was * taken against nothing and a later draw still has to settle it. * * Covers that answer only, not the sizes measured in the same state. Goes false once a pass settles * it, or once a pass gives up because the answer stopped changing. * * @returns {boolean} */ get isScrollableElementProvisional(): boolean; /** * 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; /** * The walkontable settings. * * @protected * @type {Settings} */ wtSettings: Settings; /** * @param {OverlaysDeps} deps The Overlays module dependencies. */ constructor(deps: OverlaysDeps); /** * 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)[]; /** * Prepare overlays based on user settings. * * @private */ initOverlays(): void; /** * Pre-applies the header-border classes (`innerBorderTop` / `innerBorderInlineStart`) before * the cell render, so the post-render `resetFixedPosition` toggle is a no-op and the nested * `wot.draw(true)` re-render is skipped. Called from the master draw on the single-pass gated path, * before `beginDrawLayout`. Mirrors the overlay set used by the post-render position pass. */ prepareHeaderBorders(): void; /** * Runs logic for the overlays before the table is drawn. */ beforeDraw(): void; /** * Runs logic for the overlays after the table is drawn. * * A fast draw never runs `alignOverlaysWithTrimmingContainer`, so the holder still carries the * `overflow: visible` it was born with and the trimming container is whatever the last full draw * left – a layout resolution taken from it would read a table that nothing has aligned yet. No such * draw can currently precede the first full one (`refreshAll()` returns while `drawn` is false, and * a table built outside the layout stays undrawn until it joins it), so the gate protects the * settle test in `ScrollSync#resolveProvisionalLayout` from a state it never has to judge. * * @param {boolean} cellsRendered Whether this draw rendered the cell band. `false` for a fast * (scroll) draw and for a draw whose `beforeDraw` hook set * `skipRender`. Only a draw that rendered the band re-measured the * sizes the reset on the way in dropped, so only it may spend the * mark – otherwise the drop is retaken on the next draw. */ afterDraw(cellsRendered: boolean): void; /** * Refresh and redraw table. */ refreshAll(): void; /** * Register all necessary event listeners. */ registerListeners(): void; /** * Scrolls main scrollable element vertically. * * @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; /** * Re-applies the column-header heights to the master and every header-bearing overlay after the * Handsontable-side render-size probe has measured content-driven header heights. The probe runs * after the draw completes (once the DOM is final), so the overlays first render at the provided * height and are corrected here to match the master - a synchronous, hook-free reconcile that * replaces the old mid-draw `markOversizedColumnHeaders` measurement. The frozen-overlay sync runs * last so a wrapped header inside the frozen region still wins, and the sizes are flushed to the DOM. */ refreshColumnHeaderHeights(): void; /** * 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;