import { Ref } from 'vue'; /** Inline style for a visually hidden `aria-live` region (no global utility class in the SDK). */ export declare const REORDER_ANNOUNCER_STYLE: Readonly<{ position: "absolute"; width: "1px"; height: "1px"; padding: "0"; margin: "-1px"; overflow: "hidden"; clip: "rect(0, 0, 0, 0)"; whiteSpace: "nowrap"; border: "0"; }>; export interface UseReorderAnnouncerReturn { /** Bind to a polite live region's text content. */ announcement: Ref; /** Publishes a message to the live region. */ announce: (message: string) => void; /** Bind to the live region's `style` so it stays visually hidden. */ announcerStyle: typeof REORDER_ANNOUNCER_STYLE; } /** * Screen-reader announcements for drag/keyboard move interactions. Bind * `announcement` to a `role="status" aria-live="polite"` element styled with * `announcerStyle`. */ export declare function useReorderAnnouncer(): UseReorderAnnouncerReturn; export interface ListReorderMove { /** Index the item moved from, within `items()`. */ fromIndex: number; /** Index the item moved to, within `items()`. */ toIndex: number; /** The reordered array (a copy — `items()` is never mutated). */ items: T[]; /** Whether the move came from the keyboard or a pointer drag. */ source: 'keyboard' | 'drag'; } export interface UseListReorderOptions { /** The list being reordered, in its canonical (not merely rendered) order. */ items: () => T[]; /** Stable id for an item; falls back to the render index when ids repeat. */ getId: (item: T, index: number) => string; /** Applies the move. The composable never mutates the source array. */ onReorder: (move: ListReorderMove) => void; /** Human-readable name used in announcements. Defaults to the item's id. */ getLabel?: (item: T, index: number) => string; /** Blocks every reorder while it returns `true` (readonly / non-sortable lists). */ disabled?: () => boolean; /** Resolves the focusable element for an id so keyboard moves keep focus on the item. */ getElement?: (id: string) => HTMLElement | null | undefined; /** Noun used in announcements, e.g. `'Reagent'`. Default `'Item'`. */ itemNoun?: string; } export interface UseListReorderReturn { /** Id of the item currently being dragged, or `null`. */ draggingId: Ref; /** Id of the item the pointer is hovering as a drop target, or `null`. */ dragOverId: Ref; isDragging: (id: string) => boolean; isDragOver: (id: string) => boolean; announcement: Ref; announcerStyle: typeof REORDER_ANNOUNCER_STYLE; announce: (message: string) => void; /** Bind to the draggable element's `@dragstart`. */ onDragStart: (event: DragEvent, item: T, index: number) => void; /** Bind to `@dragover` — calls `preventDefault()` so the drop is accepted. */ onDragOver: (event: DragEvent, item: T, index: number) => void; /** Bind to `@dragleave`. */ onDragLeave: () => void; /** Bind to `@drop`. */ onDrop: (event: DragEvent, item: T, index: number) => void; /** Bind to `@dragend`. */ onDragEnd: () => void; /** * Bind to the item's (or its drag handle's) `@keydown`: Alt+ArrowUp / Alt+ArrowLeft * moves the item one position earlier, Alt+ArrowDown / Alt+ArrowRight one later. */ onKeydown: (event: KeyboardEvent, item: T, index: number) => void; /** Moves an item between two indices of `items()` programmatically. */ move: (fromIndex: number, toIndex: number, source?: 'keyboard' | 'drag') => void; } /** Pure helper: a copy of `items` with the entry at `from` moved to `to`. */ export declare function reorderList(items: T[], from: number, to: number): T[]; /** * Keyboard-accessible list reordering shared by the SDK's drag-to-reorder lists. * It owns the HTML5 drag state, the drop-index maths, and an Alt+Arrow keyboard * alternative that announces every move through a polite live region — so a * reorder never depends on a pointer. */ export declare function useListReorder(options: UseListReorderOptions): UseListReorderReturn;