react-easy-sort
Version:
A React component to sort items in lists or grids
16 lines • 789 B
TypeScript
import type { Point } from './types';
/**
* This function check if a given point is inside of the items rect.
* If it's not inside any rect, it will return the index of the closest rect
*/
export declare const findItemIndexAtPosition: ({ x, y }: Point, itemsRect: DOMRect[], { fallbackToClosest }?: {
fallbackToClosest?: boolean | undefined;
}) => number;
/**
* Finds the first scrollable parent of an element.
* @param {HTMLElement} element The element to start searching from.
* @returns {HTMLElement | Window} The scrollable parent or the window.
*/
export declare const getScrollableParent: (element: HTMLElement | null) => HTMLElement | Window;
export declare function arrayMove<T>(array: T[], fromIndex: number, toIndex: number): T[];
//# sourceMappingURL=helpers.d.ts.map