[sortablejs] adds some missing event properties (#41160)

* [sortablejs] creates clear description for fake class

* [sortablejs] add some swap and multidrag event options
This commit is contained in:
Wayne Van Son
2019-12-20 17:13:16 +11:00
committed by Daniel Rosenwasser
parent 9f50313b4a
commit 4e6bf5b5f4

View File

@@ -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 {