import type { WalkontableInstance } from '../../types'; import type { EngineContext } from '../../wire'; import type Settings from '../../settings'; /** * Assembles the dependency set shared by every overlay (and its corner subclasses) from the engine * composition context. Overlays still hold `wot` (the master instance) — the clone they build is a * second Walkontable instance that also reaches back to the master, so `wot` is a structural handle, * not a reach-through to be thunked away in this pass. The DOM roots are folded in flat. * * @param {EngineContext} ctx The engine composition context. * @returns {object} The overlay dependency set. */ export declare function createOverlayDeps(ctx: EngineContext): { wot: WalkontableInstance; facadeGetter: Function; wtSettings: Settings; rootDocument: Document; rootWindow: Window; geometryReader: import("../../domMeasure/geometryReader").GeometryReader; getWtTable: () => import("../../table/baseTable").default; getWtViewport: () => import("../../viewport/viewport").default; getWtOverlays: () => import("../overlays").default; getWtEvent: () => WalkontableInstance["wtEvent"]; getSelectionManager: () => import("../../selection").SelectionManager; }; /** * The overlay dependencies, inferred from `createOverlayDeps`. */ export type OverlayDeps = ReturnType; /** * Assembles the dependency set for the clone (a second Walkontable instance the overlay renders). * Replaces the former inline `this.wot.wtViewport` / `this.wot.wtEvent` / `this.wot.selectionManager` * reach-throughs: the shared master collaborators now come through the overlay's declared deps, and * the clone's back-reference to the master (`source`) and its owning `overlay` are passed explicitly. * * @param {OverlayDeps} deps The owning overlay's dependency set. * @param {Overlay} overlay The overlay that renders the clone. * @returns {object} The clone dependency set. */ export declare function createCloneDeps(deps: OverlayDeps, overlay: Overlay): { source: WalkontableInstance; overlay: Overlay; viewport: import("../../viewport/viewport").default; event: Record | import("../../event").default; selectionManager: import("../../selection").SelectionManager; geometryReader: import("../../domMeasure/geometryReader").GeometryReader; }; /** * The clone dependencies, inferred from `createCloneDeps`. */ export type CloneDeps = ReturnType; /** * Creates an overlay over the original Walkontable instance. The overlay renders the clone of the original Walkontable * and (optionally) implements behavior needed for native horizontal and vertical scrolling. * * @abstract * @class Overlay * @property {Walkontable} wot The Walkontable instance. */ export declare abstract class Overlay { #private; /** * The Walkontable settings. * * @private * @type {Settings} */ wtSettings: Settings; /** * The Walkontable instance. * * @type {WalkontableInstance} */ wot: WalkontableInstance; /** * Read-only access to the dependencies, for the overlay subclasses (top/bottom/inline-start and * the corner overlays), which are defined outside this class and so cannot reach the private * `#deps`. * * @returns {OverlayDeps} */ get deps(): OverlayDeps; /** * Function that returns the proper facade. * * @type {Function} */ facadeGetter: Function; /** * The overlay type name. * * @type {string} */ type: string; /** * The main table scrollable element. * * @type {HTMLElement | Window} */ mainTableScrollableElement: HTMLElement | Window; /** * The table element. * * @type {HTMLTableElement} */ TABLE: HTMLTableElement; /** * The hider element. * * @type {HTMLElement} */ hider: HTMLElement; /** * The spreader element. * * @type {HTMLElement} */ spreader: HTMLElement; /** * The holder element. * * @type {HTMLElement | Window} */ holder: HTMLElement | Window; /** * The Walkontable root element. * * @type {HTMLElement} */ wtRootElement: HTMLElement; /** * The trimming container. * * @type {HTMLElement | Window} */ trimmingContainer: HTMLElement | Window; /** * Flag indicating if full render is needed. * * @type {boolean} */ needFullRender: boolean; /** * The cloned Walkontable instance. * * @type {WalkontableInstance | null} */ clone: WalkontableInstance | null; /** * @param {OverlayDeps} deps The overlay module dependencies. * @param {CLONE_TYPES_ENUM} type The overlay type name (clone name). */ constructor(deps: OverlayDeps, type: string); abstract resetFixedPosition(): boolean; abstract createTable(...args: unknown[]): unknown; abstract setScrollPosition(pos: number): boolean; abstract getScrollPosition(): number; abstract getTableParentOffset(): number; abstract getOverlayOffset(): number; abstract onScroll(): void; abstract sumCellSizes(from: number, to: number): number; abstract adjustElementsSize(): void; abstract applyToDOM(): void; abstract scrollTo(sourceIndex: number, snapToEdge: boolean): boolean; /** * Pre-applies the overlay's header-border class before the cell render (single-pass gated * path). Overridden by the top, bottom, and inline-start overlays, which own an `innerBorder*` * toggle; a no-op on overlays that have none (e.g. the corner overlays). */ prepareHeaderBorders(): void; /** * Checks if the overlay rendering state has changed. * * @returns {boolean} */ hasRenderingStateChanged(): boolean; /** * Updates internal state with an information about the need of full rendering of the overlay in the next draw cycles. * * If the state is changed to render the overlay, the `needFullRender` property is set to `true` which means that * the overlay will be fully rendered in the current draw cycle. If the state is changed to not render the overlay, * the `needFullRender` property is set to `false` which means that the overlay will be fully rendered in the * current draw cycle but it will not be rendered in the next draw cycles. * * @param {'before' | 'after'} drawPhase The phase of the rendering process. */ updateStateOfRendering(drawPhase: 'before' | 'after'): void; /** * Checks if overlay should be fully rendered. * * @returns {boolean} */ shouldBeRendered(): boolean; /** * Update the trimming container. */ updateTrimmingContainer(): void; /** * Update the main scrollable element. */ updateMainScrollableElement(): void; /** * Calculates coordinates of the provided element, relative to the root Handsontable element. * NOTE: The element needs to be a child of the overlay in order for the method to work correctly. * * @param {HTMLElement} element The cell element to calculate the position for. * @param {number} rowIndex Visual row index. * @param {number} columnIndex Visual column index. * @returns {{top: number, start: number}|undefined} */ getRelativeCellPosition(element: HTMLElement, rowIndex: number, columnIndex: number): { start: number; top: number; } | undefined; /** * Get inline start value depending of direction. * * @param {HTMLElement} el Element. * @returns {number} */ getRelativeStartPosition(el: HTMLElement): number; /** * Calculates coordinates of the provided element, relative to the root Handsontable element within a table with window * as a scrollable element. * * @private * @param {boolean} onFixedRowTop `true` if the coordinates point to a place within the top fixed rows. * @param {boolean} onFixedColumn `true` if the coordinates point to a place within the fixed columns. * @param {number} elementOffset Offset position of the cell element. * @param {number} spreaderOffset Offset position of the spreader element. * @returns {{top: number, left: number}} */ getRelativeCellPositionWithinWindow(onFixedRowTop: boolean, onFixedColumn: boolean, elementOffset: { start: number; top: number; }, spreaderOffset: { start: number; top: number; }): { start: number; top: number; }; /** * Calculates coordinates of the provided element, relative to the root Handsontable element within a table with window * as a scrollable element. * * @private * @param {boolean} onFixedRowTop `true` if the coordinates point to a place within the top fixed rows. * @param {boolean} onFixedRowBottom `true` if the coordinates point to a place within the bottom fixed rows. * @param {boolean} onFixedColumn `true` if the coordinates point to a place within the fixed columns. * @param {number} elementOffset Offset position of the cell element. * @param {number} spreaderOffset Offset position of the spreader element. * @returns {{top: number, left: number}} */ getRelativeCellPositionWithinHolder(onFixedRowTop: boolean, onFixedRowBottom: boolean, onFixedColumn: boolean, elementOffset: { start: number; top: number; }, spreaderOffset: { start: number; top: number; }): { start: number; top: number; }; /** * Make a clone of table for overlay. * * @returns {Clone} */ makeClone(): WalkontableInstance; /** * Refresh/Redraw overlay. * * @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; /** * Reset overlay styles to initial values. */ reset(): void; /** * Determine if Walkontable is running in RTL mode. * * @returns {boolean} */ isRtl(): boolean; /** * Destroy overlay instance. */ destroy(): void; }