UNPKG

ng2-dnd

Version:

Angular 2 Drag-and-Drop without dependencies

41 lines (40 loc) 1.74 kB
import { EventEmitter, ElementRef } from 'angular2/core'; import { AbstractComponent } from './dnd.component'; import { DragDropConfig } from './dnd.config'; import { DragDropService, DragDropSortableService } from './dnd.service'; export declare class SortableContainer extends AbstractComponent { private _sortableDataService; draggable: boolean; private _sortableData; sortableData: Array<any>; dropzones: Array<string>; constructor(elemRef: ElementRef, _dragDropService: DragDropService, _config: DragDropConfig, _sortableDataService: DragDropSortableService); _onDragEnterCallback(event: Event): void; } export declare class SortableComponent extends AbstractComponent { private _sortableContainer; private _sortableDataService; index: number; draggable: boolean; droppable: boolean; /** * The data that has to be dragged. It can be any JS object */ dragData: any; /** * Callback function called when the drag action ends with a valid drop action. * It is activated after the on-drop-success callback */ onDragSuccessCallback: EventEmitter<any>; /** * Callback function called when the drop action completes correctly. * It is activated before the on-drag-success callback. */ onDropSuccessCallback: EventEmitter<any>; constructor(elemRef: ElementRef, _dragDropService: DragDropService, _config: DragDropConfig, _sortableContainer: SortableContainer, _sortableDataService: DragDropSortableService); _onDragStartCallback(event: Event): void; _onDragOverCallback(event: Event): void; _onDragEndCallback(event: Event): void; _onDragEnterCallback(event: Event): void; _onDropCallback(event: Event): void; }