Minor Changes
-
#1915
9b24dffThanks @clauderic! - Redesign event type system to follow the DOM EventMap pattern. IntroducesDragDropEventMapfor event object types andDragDropEventHandlersfor event handler signatures, replacing the ambiguously namedDragDropEvents. Event type aliases (CollisionEvent,DragStartEvent, etc.) now derive directly fromDragDropEventMaprather than usingParameters<>extraction.Migration guide
DragDropEventshas been split into two types:DragDropEventMap— maps event names to event object types (likeWindowEventMap)DragDropEventHandlers— maps event names to(event, manager) => voidhandler signatures
- If you were importing
DragDropEventsto type event objects, useDragDropEventMapinstead:// Before type MyEvent = Parameters<DragDropEvents<D, P, M>['dragend']>[0]; // After type MyEvent = DragDropEventMap<D, P, M>['dragend'];
- If you were importing
DragDropEventsto type event handlers, useDragDropEventHandlersinstead:// Before const handler: DragDropEvents<D, P, M>['dragend'] = (event, manager) => {}; // After const handler: DragDropEventHandlers<D, P, M>['dragend'] = ( event, manager ) => {};
- The
DragDropEventsre-export from@dnd-kit/reactand@dnd-kit/solidhas been removed. ImportDragDropEventMaporDragDropEventHandlersfrom@dnd-kit/abstractdirectly if needed. - Convenience aliases (
CollisionEvent,DragStartEvent,DragEndEvent, etc.) are unchanged and continue to work as before.