diff --git a/types/sortablejs/index.d.ts b/types/sortablejs/index.d.ts index 9d0b53c118..51e9652c49 100644 --- a/types/sortablejs/index.d.ts +++ b/types/sortablejs/index.d.ts @@ -96,7 +96,7 @@ declare namespace Sortable { SwapOptions {} /** - * A class that all plugins inherit from for the sake of types + * A class that all plugins inherit from for the sake of type inference. */ export class Plugin extends SortablePlugin {} export class MultiDrag extends MultiDragPlugin {} @@ -139,6 +139,24 @@ declare namespace Sortable { * Pull mode if dragging into another sortable */ pullMode: 'clone' | boolean | undefined; + /** + * When MultiDrag is used to sort, this holds a HTMLElement and oldIndex for each item selected. + * + * `oldIndicies[number]` is directly related to `newIndicies[number]` + * + * If MultiDrag is not used to sort, this array will be empty. + */ + oldIndicies: { multiDragElement: HTMLElement; index: number }[]; + /** + * When MultiDrag is used to sort, this holds a HTMLElement and newIndex for each item. + * + * `oldIndicies[number]` is directly related to `newIndicies[number]` + * + * If MultiDrag is not used to sort, this array will be empty. + */ + newIndicies: { multiDragElement: HTMLElement; index: number }[]; + /** When Swap is used to sort, this will contain the dragging item that was dropped on.*/ + swapItem: HTMLElement | null; } export interface MoveEvent extends Event {