/** * Copyright Aquera Inc 2025 * * This source code is licensed under the BSD-3-Clause license found in the * LICENSE file in the root directory of this source tree. */ /** * Resizable Helper Utility * Provides common functionality for resizable table columns */ export interface ResizeOptions { minWidth?: number; startX: number; startWidth: number; element: HTMLElement; } export interface ColumnResizeData { columnIndex: number; newWidth: number; } /** * Handles the start of a resize operation * @param e Mouse event * @param options Resize configuration options * @returns Cleanup function to remove event listeners */ export declare function handleResizeStart(e: MouseEvent, options: ResizeOptions): () => void; /** * Gets the column index of an element within its table row * @param element The table cell or header element * @param selector The CSS selector for the column elements * @returns Column index (0-based) */ export declare function getColumnIndex(element: HTMLElement, selector: string): number; /** * Synchronizes the width of all cells in the same column * @param sourceElement The element that was resized * @param newWidth The new width to apply */ export declare function synchronizeColumnWidth(sourceElement: HTMLElement, newWidth: number): void; /** * Resets all column widths in a table to their default values * @param tableBody The table body element to reset */ export declare function resetAllColumnWidths(tableBody: HTMLElement): void; /** * Checks if an element has the resizable attribute * @param element The element to check * @returns True if the element is resizable */ export declare function isResizable(element: HTMLElement): boolean; /** * Creates a resize handler function for use in component event listeners * @param element The element to make resizable * @param minWidth Minimum width constraint * @returns Event handler function */ export declare function createResizeHandler(element: HTMLElement, minWidth?: number): (e: MouseEvent) => void; /** * Detects if any columns in a table are resizable * @param tableBody The table body element * @returns True if any columns have resizable attribute */ export declare function hasResizableColumns(tableBody: HTMLElement): boolean;