import { Announcements, ClientRect, CollisionDetection, KeyboardCoordinateGetter } from '@dnd-kit/core'; import { KanbanColumnDef } from './kanbanBoard.types.js'; export declare function columnsEqual(a: KanbanColumnDef[], b: KanbanColumnDef[]): boolean; export declare function findColumnForItem(columns: KanbanColumnDef[], itemId: string): number; /** Whether a drag's `active`/`over` participant is a whole column (vs. a card) — see `reorderableColumns`. */ export declare function isColumnDragData(data: unknown): boolean; /** * Reorders whole columns: moves `activeColumnId` to `overColumnId`'s position. Returns the same * `columns` reference, unchanged, when either id doesn't resolve to a column or they're the same * — callers can use that to skip a state update. */ export declare function moveColumn(columns: KanbanColumnDef[], activeColumnId: string, overColumnId: string): KanbanColumnDef[]; /** * Collision detection for the board's shared `DndContext`, which has to pick between two very * differently-scaled sets of droppables at once: individual cards / a column's own card list * (small, numerous) and whole columns (large, few). Plain `closestCorners` weighs every * registered droppable together regardless of what's actually being dragged, so while dragging a * column it competes against every card and card-list droppable it happens to fly over too — the * column-level target only wins when the pointer lands somewhere that geometrically favors it, * which reads as needing to "wiggle it around" before the right drop target lights up. This * restricts the candidates to only the same kind as whatever is being dragged: a column drag only * considers other columns, a card drag only considers cards and card lists. * * A card drag also lets the pointer pick the column, and `closestCorners` only the position within * it. Corners alone compare the dragged card's whole rect, so a wide card over a collapsed column * had its corners nearer the neighbours' cards, and landed beside the column under the pointer. * Without a pointer (the keyboard) or between columns, every column is a candidate as before. */ export declare const kanbanCollisionDetection: CollisionDetection; /** * Whether the auto-scroll may move `scroller`, an ancestor of the board such as the page, while * something is dragged: only toward a part of the board that is out of view. Nothing beyond the * board takes a drop, and a page left free to scroll carried the whole board off screen. */ export declare function scrollsTowardBoard(scroller: { top: number; bottom: number; }, board: { top: number; bottom: number; }, dragged: { top: number; height: number; }): boolean; /** Extracts the column id from a column droppable's `column-` identifier, or `null` for a card id. */ export declare function resolveColumnDropId(overId: string): string | null; export interface DragGeometry { /** The dragged card's current rect (translated by the drag delta), if measured. */ activeRect: ClientRect | null; /** The rect of whatever `overId` refers to — a card, or a column's own droppable. */ overRect: ClientRect; } /** * Computes the columns that result from dragging `activeItemId` over `overId` (a card id, or a * `column-` droppable id for empty column space). Returns the same `columns` reference, * unchanged, when the drag doesn't resolve to a valid source/destination — callers can use that * to skip a state update. * * `geometry` resolves cross-column drops that land on a card or gap with more than one possible * position (see the two branches below for what each one decides). */ export declare function moveItem(columns: KanbanColumnDef[], activeItemId: string, overId: string, geometry: DragGeometry): KanbanColumnDef[]; /** * Where a drag has put the dragged card or column so far. The board keeps this rather than a copy * of `columns`, so a change the consumer makes mid-drag (a page appended by `onLoadMore`) still * shows, and is still there in what `onChange` receives on drop. */ export interface DragPlacement { /** The dragged card's or column's id. */ id: string; /** The column the card sits in, or `null` while a whole column is dragged. */ columnId: string | null; index: number; } /** The position `id` holds in `columns`, as a placement to lay over a later `columns`. */ export declare function findPlacement(columns: KanbanColumnDef[], id: string, isColumn: boolean): DragPlacement | null; /** * Moves the dragged card or column to its placement in `columns`. Returns `columns` itself when * there is no placement, or when the card, the column, or its destination is no longer there. */ export declare function applyPlacement(columns: KanbanColumnDef[], placement: DragPlacement | null): KanbanColumnDef[]; /** * Where an arrow key moves focus from a focused card or column handle while nothing is picked up. * It mirrors what the same keys do to a picked-up card: Up/Down within the column, Left/Right to * the nearest card in the next column with anything to focus, or from a handle to the next handle. * Returns `null` when `from` is not a card or handle, or there is nowhere to go. */ export declare function findArrowFocusTarget(board: HTMLElement, from: HTMLElement, key: string): HTMLElement | null; /** * Builds screen-reader drag announcements against the columns layout as currently understood * (the live layout while a drag is in progress, or the settled `columns` prop otherwise). */ export declare function buildAnnouncements(columns: KanbanColumnDef[], items: Record, getItemLabel: (item: T, id: string) => string): Announcements; /** * Custom keyboard coordinate getter for the board's multi-column, multi-`SortableContext` * layout. dnd-kit's default `sortableKeyboardCoordinates` picks the geometrically closest * droppable across the *entire* board — cards and column containers alike — which is unreliable * once cards live inside independent per-column `SortableContext`s: up/down and left/right end up * interchangeable depending on incidental rect positions. This instead restricts up/down to * reordering within the active card's own column, and left/right to moving into the adjacent * column (landing on the closest card there by vertical position, or the column itself when * empty). Requires each `KanbanColumn`'s `SortableContext` to be given an explicit `id` matching * its column id, so a card's `sortable.containerId` can be correlated with its `column-` * droppable. */ export declare const kanbanKeyboardCoordinateGetter: KeyboardCoordinateGetter;