import type { draggable, dropTargetForElements, ElementDropTargetGetFeedbackArgs, ElementMonitorGetFeedbackArgs, monitorForElements, } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'; import type { DragLocation, // oxlint-disable-next-line no-unused-vars DragLocationHistory, DropTargetRecord, ElementDragType, } from '@atlaskit/pragmatic-drag-and-drop/types'; import type { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element'; export type ElementDragEventBaseArgs = { /** * {@link DragLocationHistory} of the drag */ location: { /** * {@link DragLocationHistory.initial} */ initial: DragLocationWithPayload; /** * {@link DragLocationHistory.current} */ current: DragLocationWithPayload; /** * {@link DragLocationHistory.previous} */ previous: Pick, 'dropTargets'>; }; source: Omit & { data: Payload }; }; export type DragLocationWithPayload = Omit< DragLocation, 'dropTargets' > & { dropTargets: DropTargetRecordWithPayload[]; }; export type DropTargetRecordWithPayload = Omit< DropTargetRecord, 'data' > & { data: Payload; }; export type ElementDragEventMap = { onDragStart?: ( data: ElementDragEventBaseArgs ) => void; onDrag?: (data: ElementDragEventBaseArgs) => void; onDrop?: (data: ElementDragEventBaseArgs) => void; onDropTargetChange?: ( data: ElementDragEventBaseArgs ) => void; }; type DropTargetLocalizedData = { self: DropTargetRecord; }; export type ElementDropTargetFeedbackArgs = Omit< ElementDropTargetGetFeedbackArgs, 'source' > & { source: Omit & { data: Payload }; }; export type ElementDropEventMap = { onDragStart?: ( data: ElementDragEventBaseArgs & DropTargetLocalizedData ) => void; onDrag?: ( data: ElementDragEventBaseArgs & DropTargetLocalizedData ) => void; onDrop?: ( data: ElementDragEventBaseArgs & DropTargetLocalizedData ) => void; onDropTargetChange?: ( data: ElementDragEventBaseArgs & DropTargetLocalizedData ) => void; onDragEnter?: ( data: ElementDragEventBaseArgs & DropTargetLocalizedData ) => void; onDragLeave?: ( data: ElementDragEventBaseArgs & DropTargetLocalizedData ) => void; }; export type ElementMonitorFeedbackArgs = Omit< ElementMonitorGetFeedbackArgs, 'source' > & { source: Omit & { data: Payload }; }; export type OriginalDraggableOption = Parameters[0]; export type OriginalDropTargetOption = Parameters< typeof dropTargetForElements >[0]; export type OriginalMonitorOption = Parameters[0]; export type OriginalAutoScrollOption = Parameters< typeof autoScrollForElements >[0];