import { type ClientRect, type CollisionDetection, type DragOverEvent, type Modifier } from '@dnd-kit/core'; import type { DragAndDropTransform } from '../../hooks/useTable/types.js'; /** * Transforms cells upwards or downwards to make space for the row which is currently being dragged ("active" row). * @param table - the table where the row ordering is happening. * @param event - contains "active" (row being dragged) and "over" ids (row where the active row is currently dragged over). * @param rowOrder - original row order before dragging. * @param rowSeparationNone - whether the rows are visually separated by a border. * @internal */ export declare function transformCellsOnDragOver(table: HTMLElement, event: DragOverEvent, rowOrder: string[] | undefined, rowSeparationNone: boolean): void; /** * Resets the transform style on the given cells. * @param cells - the cells we want to reset. * @internal */ export declare function resetAllStylesForCells(cells: HTMLElement[]): void; /** * Gets the row elements with a given row id (including row details row). * @param table - the current table. * @param id - id of the row (matches against `data-rowid`). * @returns matching rows. * @internal */ export declare function getRowWithId(table: HTMLElement, id: string | number | undefined): HTMLElement[]; /** * Gets all rows in the given table that are not within the same sub-row parent. * * @param table - the table we are concerned with. * @param parentIdToExclude - parent id to be excluded * @returns all cells in the table (div elements with role="cell"/role="presentation" and a data-rowid attribute). * @internal */ export declare function getAllNonTargetRowsInTableBody(table: HTMLElement, parentIdToExclude?: string): HTMLElement[]; /** * Gets all cells and rows in the given table (all cells that have role="cell"/role="presentation" or rows with the "data-row" attribute). * @param table - the table we are concerned with. * @returns all cells and rows in the table. * @internal */ export declare function getAllRowsInTableBody(table: HTMLElement): HTMLElement[]; /** * @param table - the table we are concerned with. * @param rowNumber - zero-based row number * @returns the drag handle of the given row for drag and drop ordering * @internal */ export declare function getDragHandleForRow(table: HTMLElement, rowNumber: number): HTMLElement | null; /** * Gets the `fromIndex` and `toIndex` from the over and active id. * @param rowOrder - contains the ids of the rows in order. * @param activeId - is the id of the currently actively dragged row * @param overId - is the target id of where the dragging row is currently dragged to * @returns indexes from where a row is dragged and where it is dragged to * @internal */ export declare function getDragIndexes(rowOrder: string[], activeId: string, overId: string): { fromIndex: number; toIndex: number; }; /** * Custom collision detection algorithm for row order drag and drop. * Determines the closest droppable target within the Y-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 row, or an empty array if none is found. * @internal */ export declare const closestTargetWithinY: CollisionDetection; /** * Custom collision detection function that filters droppable containers based the sub-row depth of the dragged row, * and then applies the custom closestCenterWithinY algorithm on the filtered targets. * Only rows on the same sub-row depth level can be ordered. * * @param active - The actively dragged item. * @param droppableContainers - The list of all droppable containers. * @internal */ export declare const rowOrderCollisionDetection: CollisionDetection; /** * Restricts the vertical 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 verticalBounds - The bounds within which the element should be restricted. * @returns The updated transform object with restricted y value. * @internal */ export declare function restrictToVerticalBounds(transform: DragAndDropTransform, rect: ClientRect, verticalBounds: { top: number; bottom: number; }): DragAndDropTransform; /** * Creates a dnd-kit modifier to restrict the dragging to the table row area. * @param tableHeaderHeight - This height is subtracted from the parent element height. * @param containedVariant - Whether the table is using the contained visual variant. * @param virtualizationContainer - The table's virtualization container. * @returns dnd-kit modifier * @internal */ export declare function createRestrictToTableRowAreaModifier(tableHeaderHeight: number, containedVariant: boolean, virtualizationContainer?: HTMLDivElement): Modifier;