import type { WalkontableInstance } from '../../types'; import type EventManager from '../../../../../eventManager'; import type { BorderInstanceSettings, CornerDefaultStyle, SelectionHandles } from './types'; /** * */ declare class Border { /** * @type {EventManager} */ eventManager: EventManager; /** * @type {WalkontableInstance} */ instance: WalkontableInstance; /** * @type {WalkontableInstance} */ wot: WalkontableInstance; /** * @type {BorderInstanceSettings} */ settings: BorderInstanceSettings; /** * @type {boolean} */ mouseDown: boolean; /** * @type {HTMLDivElement | null} */ main: HTMLDivElement | null; /** * @type {HTMLElement | null} */ top: HTMLElement | null; /** * @type {HTMLElement | null} */ bottom: HTMLElement | null; /** * @type {HTMLElement | null} */ start: HTMLElement | null; /** * @type {HTMLElement | null} */ end: HTMLElement | null; /** * @type {CSSStyleDeclaration | null} */ topStyle: CSSStyleDeclaration | null; /** * @type {CSSStyleDeclaration | null} */ bottomStyle: CSSStyleDeclaration | null; /** * @type {CSSStyleDeclaration | null} */ startStyle: CSSStyleDeclaration | null; /** * @type {CSSStyleDeclaration | null} */ endStyle: CSSStyleDeclaration | null; /** * @type {CornerDefaultStyle} */ cornerDefaultStyle: CornerDefaultStyle; /** * @type {number} */ cornerCenterPointOffset: number; /** * @type {HTMLElement | null} */ corner: HTMLElement | null; /** * @type {CSSStyleDeclaration | null} */ cornerStyle: CSSStyleDeclaration | null; /** * @type {SelectionHandles} */ selectionHandles: SelectionHandles; /** * @type {boolean} */ disabled: boolean; /** * @param {WalkontableFacade} wotInstance The Walkontable instance. * @param {object} settings The border settings. */ constructor(wotInstance: WalkontableInstance, settings: BorderInstanceSettings); /** * Register all necessary events. */ registerListeners(): void; /** * Mouse down listener. * * @private */ onMouseDown(): void; /** * Mouse up listener. * * @private */ onMouseUp(): void; /** * Mouse enter listener for fragment selection functionality. * * @private * @param {Event} event Dom event. * @param {HTMLElement} parentElement Part of border element. */ onMouseEnter(event: MouseEvent, parentElement: HTMLElement): void; /** * Create border elements. * * @param {object} settings The border settings. */ createBorders(settings: BorderInstanceSettings): void; /** * Create multiple selector handler for mobile devices. */ createMultipleSelectorHandles(): void; /** * Checks if the given coordinates are south-east of the area selection. If `true` then * the fill handler should be visible. * * @param {number} row The visual row index. * @param {number} col The visual column index. * @returns {boolean} */ isSouthEastOfAreaSelection(row: number, col: number): boolean; /** * @param {number} row The visual row index. * @param {number} col The visual column index. * @param {number} top The top position of the handler. * @param {number} left The left position of the handler. * @param {number} width The width of the handler. * @param {number} height The height of the handler. */ updateMultipleSelectionHandlesPosition(row: number, col: number, top: number, left: number, width: number, height: number): void; /** * Show border around one or many cells. * * @param {Array} corners The corner coordinates. */ appear(corners: number[]): void; /** * Check whether an entire column of cells is selected. * * @private * @param {number} startRowIndex Start row index. * @param {number} endRowIndex End row index. * @returns {boolean} */ isEntireColumnSelected(startRowIndex: number, endRowIndex: number): boolean; /** * Check whether an entire row of cells is selected. * * @private * @param {number} startColumnIndex Start column index. * @param {number} endColumnIndex End column index. * @returns {boolean} */ isEntireRowSelected(startColumnIndex: number, endColumnIndex: number): boolean; /** * Get left/top index and width/height depending on the `direction` provided. * * @private * @param {string} direction `rows` or `columns`, defines if an entire column or row is selected. * @param {number} fromIndex Start index of the selection. * @param {number} toIndex End index of the selection. * @param {number} headerIndex The header index as negative value. * @param {number} containerOffset Offset of the container. * @returns {Array|boolean} Returns an array of [headerElement, left, width] or [headerElement, top, height], depending on `direction` (`false` in case of an error getting the headers). */ getDimensionsFromHeader(direction: string, fromIndex: number, toIndex: number, headerIndex: number, containerOffset: { top: number; left: number; }): false | [HTMLElement, number, number]; /** * Change border style. * * @private * @param {string} borderElement Coordinate where add/remove border: top, bottom, start, end. * @param {object} border The border object descriptor. */ changeBorderStyle(borderElement: 'top' | 'bottom' | 'start' | 'end', border: Record): void; /** * Change border style to default. * * @private * @param {string} position The position type ("top", "bottom", "start", "end") to change. */ changeBorderToDefaultStyle(position: 'top' | 'bottom' | 'start' | 'end'): void; /** * Toggle class 'hidden' to element. * * @private * @param {string} borderElement Coordinate where add/remove border: top, bottom, start, end. * @param {boolean} [remove] Defines type of the action to perform. */ toggleHiddenClass(borderElement: 'top' | 'bottom' | 'start' | 'end', remove: boolean): void; /** * Hide border. */ disappear(): void; /** * Cleans up all the DOM state related to a Border instance. Call this prior to deleting a Border instance. */ destroy(): void; } export default Border;