ngx-document-scanner
Version:
Angular 2+ component for cropping and enhancing images of documents
58 lines (57 loc) • 1.96 kB
TypeScript
import { AfterViewInit } from '@angular/core';
import { LimitsService } from '../../services/limits.service';
import { XYPosition } from '../../PrivateModels';
export declare class NgxDraggablePointComponent implements AfterViewInit {
private limitsService;
width: number;
height: number;
color: string;
shape: 'rect' | 'circle';
pointOptions: 'rect' | 'circle';
limitRoles: Array<'left' | 'right' | 'top' | 'bottom'>;
startPosition: XYPosition;
container: HTMLElement;
private _currentPosition;
position: XYPosition;
private _paneDimensions;
resetPosition: XYPosition;
constructor(limitsService: LimitsService);
ngAfterViewInit(): void;
/**
* returns a css style object for the point
*/
pointStyle(): {
width: string;
height: string;
'background-color': string;
'border-radius': string | number;
position: string;
};
/**
* registers a position change on the limits service, and adjusts position if necessary
* @param position - the current position of the point
*/
positionChange(position: XYPosition): void;
/**
* adjusts the position of the point after a limit exception
*/
private adjustPosition;
/**
* called on movement end, checks if last position exceeded the limits ad adjusts
*/
movementEnd(position: XYPosition): void;
/**
* calculates the initial positions of the point by it's roles
* @param dimensions - dimensions of the pane in which the point is located
*/
private getInitialPosition;
/**
* repositions the point after an external reposition event
* @param positions - an array of all points on the pane
*/
private externalReposition;
/**
* returns a new point position if the movement exceeded the pane limit
*/
private enforcePaneLimits;
}