import { type Active, type ClientRect, type CollisionDetection, type DragOverEvent, type Modifier, type Over } from '@dnd-kit/core'; import { TouchEvent } from 'react'; import type { DragAndDropTransform, Table } from '../../hooks/useTable/types.js'; /** * Determines if the touch interaction is a drag motion. * * @param touchMove - The current touch move event. * @param touchStart - The preceding touch start event. * @returns A boolean indicating whether the touch move event is considered a drag motion. * @internal */ export declare function isDragMotion(touchMove: TouchEvent, touchStart?: TouchEvent): boolean; /** * Updates the column order state based on the active and over columns. * * @param active - The actively dragged item. * @param over - The droppable item which the active item is currently dragged over. * @param table - The table instance. * @param virtualizationContainer - The table's virtualization container. * @internal */ export declare const handleDragEnd: ({ active, over, table, virtualizationContainer, }: { active: Active; over: Over | null; table: Table; virtualizationContainer?: HTMLDivElement; }) => void; /** * Transforms columns left/right to make space for the column which is currently being dragged ("active" column). * @param event - contains "active" (column being dragged) and "over" columns (column where the active column is currently dragged over). * @param virtualizationContainer - The table's virtualization container. * @internal */ export declare function indicateInsertPosition(event: DragOverEvent, virtualizationContainer?: HTMLDivElement): void; /** * Gets all cells with the given column id. * @param virtualizationContainer - The table's virtualization container. * @param columnId - id of the column (matches against `data-columnid`). * @returns matching cells. * @internal */ export declare function getHeaderCell(virtualizationContainer: HTMLDivElement, columnId?: string): HTMLElement | null; /** * Gets all resize handles in the table. * @param virtualizationContainer - The table's virtualization container. * @returns matching elements. * @internal */ export declare function getResizeHandles(virtualizationContainer: HTMLDivElement): HTMLElement[]; /** * Custom collision detection algorithm for column order drag and drop. * Determines the closest droppable target within the X-axis based on the dragging direction. * * @param param0 - Object containing the droppable containers, the droppable rects, the collision rect and * the active element, which are needed for the collision detection. * @returns An array of collision descriptors, sorted by the distance to the dragged column, or an empty array if none is found. * @internal */ export declare const closestTargetWithinX: CollisionDetection; /** * Custom collision detection function that filters droppable containers based on the type of column being dragged, * and then applies the custom closestCenterWithinX algorithm on the filtered targets. * * @param active - The actively dragged item. * @param droppableContainers - The list of all droppable containers. * @internal */ export declare const customCollisionDetection: CollisionDetection; /** * Restricts the horizontal movement of an element within the specified bounds. * * @param transform - Transform values of the currently dragged element * @param rect - The bounding rectangle of the element being transformed. * @param tableBounds - The bounds within which the element should be restricted. * @returns The updated transform object with restricted x value. * @internal */ export declare function restrictToTableBounds(transform: DragAndDropTransform, rect: ClientRect, tableBounds: { left: number; right: number; top: number; bottom: number; }): DragAndDropTransform; /** * Creates a custom modifier to restrict drag and drop for column ordering. * This function ensures that columns cannot be dragged outside the table container, * and that child columns cannot be dragged past their parent. * If the dragging element would be moved past the desired bounds, the movement * coordinates will be manually adjusted accordingly. * * @param totalHeaderHeight - The height of the table header that is subtracted from the table height. * @param containedVariant - Whether the table has the `contained` variant set. * @param virtualizationContainer - The table's virtualization container. * @returns A custom dnd kit modifier. * @internal */ export declare const createRestrictColumnDragAndDrop: (totalHeaderHeight: number, containedVariant: boolean, virtualizationContainer?: HTMLDivElement) => Modifier;