import { type Active, type ClientRect, type CollisionDetection, type DragOverEvent, type Modifier, type Over } from '@dnd-kit/core'; import type { ColumnPinningState } from '@tanstack/react-table'; import { TouchEvent } from 'react'; import type { DragAndDropTransform, Table } from '../../hooks/useTable/types.js'; export declare const unpinnedHeaderFilter = ":not([data-headerid*=\"left\"]):not([data-headerid*=\"right\"])"; export declare const SCROLL_PROXIMITY_ZONE = 10; /** * 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 updateColumnOrderOnDragEnd: ({ active, over, table, virtualizationContainer, }: { active: Active; over: Over | null; table: Table; virtualizationContainer?: HTMLDivElement; }) => void; /** * Gets the speed for the custom auto scroll used for when column pinning is enabled. * * @param scrollZoneDepth - the mouse pointer position when penetrating the area where auto scroll should kick in * * @returns scroll speed measured in pixels per frame, a number between MIN_SCROLL_SPEED and MAX_SCROLL_SPEED * @internal */ export declare const getCustomScrollSpeed: (scrollZoneDepth: number) => number; /** * Creates a temporary DOM element that is temporarily inserted into the header group * during a drag operation to preserve the CSS grid layout when the dragged header cell is portalled out * of its original position. * * @param gridArea - dragged element's position in the grid * @param width - dragged element's width * @param height - dragged element's height * @param verticalDividerOptions - optional config for the vertical divider styling on the placeholder * * @internal */ export declare const createHeaderPlaceholder: (gridArea: string, width: number, height: number, verticalDividerOptions?: { isParentColumn: boolean; heightOffset: number; }) => HTMLDivElement; /** * 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; /** * 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. * @param rest - Additional collision detection parameters. * @internal */ export declare const customCollisionDetection: CollisionDetection; /** * Retrieves the left and right bounds of a draggable area when there are pinned columns * @internal */ export declare function getDraggableAreaBounds(pinnedColumns: ColumnPinningState, virtualizationContainer?: HTMLDivElement, rowIndex?: 0 | 1): { left: number | undefined; right: number | undefined; }; /** * Gets the header element that is being dragged. * @internal */ export declare function getDraggedHeaderElement(headerId: string, virtualizationContainer?: HTMLDivElement): { headerGroupElement: Element | null; draggedHeaderElement: Element | null | undefined; }; /** * 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 pinnedColumns - pinned columns state. * @param hasSubHeaders - Whether the table has nested columns. * @param virtualizationContainer - The table's virtualization container. * @returns A custom dnd kit modifier. * @internal */ export declare const createRestrictColumnDragAndDrop: (totalHeaderHeight: number, containedVariant: boolean, pinnedColumns: ColumnPinningState, hasSubHeaders: boolean, virtualizationContainer?: HTMLDivElement) => Modifier;