@@ -2,13 +2,7 @@ import type { ReactNode } from 'react';
22
33import type { Simplify } from '../../helperTypes' ;
44import type { AnimatableProps } from '../../integrations/reanimated' ;
5- import type {
6- CommonValuesContextType ,
7- CustomHandleContextType ,
8- DebugContextType ,
9- GridLayoutContextType ,
10- OrderUpdater
11- } from '../providers' ;
5+ import type { SortStrategyFactory } from '../providers' ;
126import type { DragEndParams , SharedProps } from './shared' ;
137
148/** Parameters passed to the onDragEnd callback of a sortable grid */
@@ -61,28 +55,13 @@ export type SortableGridRenderItem<I> = (
6155 info : SortableGridRenderItemInfo < I >
6256) => ReactNode ;
6357
64- /** Factory function for creating custom reordering strategies
65- * @param props Context values and layout information
66- * @returns Function to update item order
67- */
68- export type SortableGridStrategyFactory = (
69- props : Simplify <
70- CommonValuesContextType &
71- GridLayoutContextType &
72- Partial < CustomHandleContextType > & { debugContext ?: DebugContextType }
73- >
74- ) => OrderUpdater ;
75-
7658/** Strategy to use for reordering items:
7759 * - 'insert': Shifts all items between the dragged item and the target
7860 * position to make space for the dragged item
7961 * - 'swap': Swaps the dragged item with the item at the target position
8062 * - Or a custom strategy factory function
8163 */
82- export type SortableGridStrategy =
83- | 'insert'
84- | 'swap'
85- | SortableGridStrategyFactory ;
64+ export type SortableGridStrategy = 'insert' | 'swap' | SortStrategyFactory ;
8665
8766/** Props for the SortableGrid component */
8867export type SortableGridProps < I > = Simplify <
0 commit comments