UNPKG

ng-reorder

Version:

Sort elements within a list by using drag-n-drop interface without any restrictions by direction

22 lines (21 loc) 909 B
import { DragUnitDirective as DragUnit } from './drag-unit.directive'; import { DragCollectionDirective as DragCollection } from './collection.directive'; import { Point, CollectionSorted } from './interfaces'; export declare class SortService { private _root; /** List of units with their positions on the screen */ private _listOfPositions; /** Old position (index) of the element in the array of the elements */ private _from; /** Old position (index) of the element in the array of the elements */ private _to; constructor(); private cachePosition; private findIndex; private getPosition; initService(container: DragCollection): void; cacheAllPositions(): void; moveUnits(unit: DragUnit, point: Point): void; start(units: DragUnit[], point: Point, from: number): void; stop(unit: DragUnit): Promise<CollectionSorted>; }