/** Event emitted when the user drops a draggable item inside a drop container. */ import { DragDirective } from '../directives/drag/drag.directive'; import { CdkDrag, CdkDragDrop, CdkDragEnd, CdkDragEnter, CdkDragExit, CdkDragMove, CdkDragRelease, CdkDragSortEvent, CdkDragStart } from '@angular/cdk/drag-drop'; export interface SnDragDrop extends CdkDragDrop { /** Index of the item when it was picked up. */ previousIndex: number; /** Distance in pixels that the user has dragged since the drag sequence started. */ distance: { x: number; y: number; }; /** Position where the pointer was when the item was dropped */ dropPoint: { x: number; y: number; }; } /** Event emitted when the user starts dragging a draggable. */ export interface SnDragStart extends CdkDragStart { /** Draggable that emitted the event. */ source: CdkDrag; } /** Event emitted when the user stops dragging a draggable. */ export interface SnDragEnd extends CdkDragEnd { /** Draggable that emitted the event. */ source: CdkDrag; /** Distance in pixels that the user has dragged since the drag sequence started. */ distance: { x: number; y: number; }; /** Position where the pointer was when the item was dropped */ dropPoint: { x: number; y: number; }; } export interface SnDragMove extends CdkDragMove { /** * Indicates the direction in which the user is dragging the element along each axis. * `1` means that the position is increasing (e.g. the user is moving to the right or downwards), * whereas `-1` means that it's decreasing (they're moving to the left or upwards). `0` means * that the position hasn't changed. */ delta: { x: -1 | 0 | 1; y: -1 | 0 | 1; }; } /** Event emitted when the user starts dragging a draggable. */ export interface SnDragRelease extends CdkDragRelease { /** Draggable that emitted the event. */ source: CdkDrag; } export interface SnDragEnter extends CdkDragEnter { /** Item that was moved into the container. */ item: DragDirective | any; /** Index at which the item has entered the container. */ currentIndex: number; } /** * Event emitted when the user removes an item from a * drop container by moving it into another one. */ export interface SnDragExit extends CdkDragExit { /** Item that was removed from the container. */ item: any; } export interface SnDragSortEvent extends CdkDragSortEvent { /** Index from which the item was sorted previously. */ previousIndex: number; /** Index that the item is currently in. */ currentIndex: number; }