/** * Sortable list with animated reordering via pointer events. * * Makes children of a container sortable by dragging. Items are * rearranged in the DOM with optional CSS animation. * * @module bquery/dnd */ import type { SortableHandle, SortableOptions } from './types'; /** * Makes the children of a container sortable by dragging. * * Features: * - Pointer event based (touch + mouse) * - Animated reordering with configurable duration * - Axis constraint (vertical or horizontal) * - Optional drag handle * - Placeholder element during sort * - Callbacks: `onSortStart`, `onSortMove`, `onSortEnd` * * @param container - The container element whose children will be sortable * @param options - Configuration options * @returns A handle with `destroy()`, `disable()`, and `enable()` methods * * @example * ```ts * import { sortable } from '@bquery/bquery/dnd'; * * const handle = sortable(document.querySelector('#list'), { * items: 'li', * axis: 'y', * animationDuration: 200, * onSortEnd: ({ oldIndex, newIndex }) => { * console.log(`Moved from ${oldIndex} to ${newIndex}`); * }, * }); * * // Later: * handle.destroy(); * ``` */ export declare const sortable: (container: HTMLElement, options?: SortableOptions) => SortableHandle; //# sourceMappingURL=sortable.d.ts.map