|
| 1 | +/** |
| 2 | + * @license |
| 3 | + * Copyright Google LLC All Rights Reserved. |
| 4 | + * |
| 5 | + * Use of this source code is governed by an MIT-style license that can be |
| 6 | + * found in the LICENSE file at https://angular.io/license |
| 7 | + */ |
| 8 | + |
| 9 | +import {CdkDrag} from './drag'; |
| 10 | +import {CdkDropContainer} from './drop-container'; |
| 11 | + |
| 12 | +/** Event emitted when the user starts dragging a draggable. */ |
| 13 | +export interface CdkDragStart { |
| 14 | + /** Draggable that emitted the event. */ |
| 15 | + source: CdkDrag; |
| 16 | +} |
| 17 | + |
| 18 | + |
| 19 | +/** Event emitted when the user stops dragging a draggable. */ |
| 20 | +export interface CdkDragEnd { |
| 21 | + /** Draggable that emitted the event. */ |
| 22 | + source: CdkDrag; |
| 23 | +} |
| 24 | + |
| 25 | +/** Event emitted when the user moves an item into a new drop container. */ |
| 26 | +export interface CdkDragEnter<T> { |
| 27 | + /** Container into which the user has moved the item. */ |
| 28 | + container: CdkDropContainer<T>; |
| 29 | + /** Item that was removed from the container. */ |
| 30 | + item: CdkDrag; |
| 31 | +} |
| 32 | + |
| 33 | +/** |
| 34 | + * Event emitted when the user removes an item from a |
| 35 | + * drop container by moving it into another one. |
| 36 | + */ |
| 37 | +export interface CdkDragExit<T> { |
| 38 | + /** Container from which the user has a removed an item. */ |
| 39 | + container: CdkDropContainer<T>; |
| 40 | + /** Item that was removed from the container. */ |
| 41 | + item: CdkDrag; |
| 42 | +} |
| 43 | + |
| 44 | + |
| 45 | +/** Event emitted when the user drops a draggable item inside a drop container. */ |
| 46 | +export interface CdkDragDrop<T, O = T> { |
| 47 | + /** Index of the item when it was picked up. */ |
| 48 | + previousIndex: number; |
| 49 | + /** Current index of the item. */ |
| 50 | + currentIndex: number; |
| 51 | + /** Item that is being dropped. */ |
| 52 | + item: CdkDrag; |
| 53 | + /** Container in which the item was dropped. */ |
| 54 | + container: CdkDropContainer<T>; |
| 55 | + /** Container from which the item was picked up. Can be the same as the `container`. */ |
| 56 | + previousContainer: CdkDropContainer<O>; |
| 57 | +} |
0 commit comments