@mescius/dsimageviewer
Version:
Document Solutions Image Viewer
93 lines (92 loc) • 3.76 kB
TypeScript
import { GcImageViewer } from "../GcImageViewer";
import { IGcPoint } from "../Models/GcMeasurementTypes";
import { Bounds, GcSelectionBoxHandler, GcSelectionEdge, IGcSelectionBox, GcSelectionBoxUsageType, PointLocation, PointIndicatorType, GcSelectionBoxHandler2 } from "../Models/SelectionBoxTypes";
export declare class GcSelectionBox implements IGcSelectionBox {
viewer: GcImageViewer;
listeners: {
[listenerKey: string]: GcSelectionBoxHandler;
};
readonly id: string;
private static _panResumed;
private _selectedBounds1;
private _selectionContainer?;
private _viewBoxElementOuter;
private _viewBoxElement;
private _viewBoxImageElement;
private _selectionCropBoxElement;
private _selectionType;
private _pointerMoveHandler?;
private _pointerUpHandler?;
private _documentPointerDownHandler?;
private _keepAspectRatio?;
private _movedDif?;
private _onWindowResizeHandler?;
private _penCoords?;
private _prevDownTime;
private _previewImageUrl;
private _startInfo?;
private _windowResizeTimeout?;
private _moveOnly;
constructor(viewer: GcImageViewer);
showPointIndicator(coords: PointLocation, size: number, type: PointIndicatorType): void;
clearPointIndicator(type: PointIndicatorType): void;
clearPointIndicators(): void;
applySelectedBoundsMods(initialBounds: Bounds, finish?: boolean): Bounds;
_updateMovedDif(startPoint: IGcPoint, curPoint: IGcPoint, edge: GcSelectionEdge): boolean;
cursorStyle: "crosshair" | "text";
get moveOnly(): boolean;
set moveOnly(val: boolean);
get previewImageUrl(): string;
set previewImageUrl(dataUrl: string);
get maxBounds(): Bounds;
get selectionBounds(): Bounds;
set selectionBounds(bounds: Bounds);
get keepAspectRatio(): boolean;
set keepAspectRatio(keepAspectRatio: boolean);
get viewportSelectionBounds(): Bounds;
get activeImageAppearanceBounds(): Bounds;
show(initialBounds?: Bounds, selectionType?: GcSelectionBoxUsageType, keepAspectRatio?: boolean): void;
get selectionType(): GcSelectionBoxUsageType;
set selectionType(selectionType: GcSelectionBoxUsageType);
dispose(): void;
hide(): void;
disable(): void;
addListener(uniqueKey: string, selectionBoxHandler: GcSelectionBoxHandler | GcSelectionBoxHandler2): void;
removeListener(uniqueKey: string): void;
updatePreviewImage(): void;
invalidate(): void;
startSelection(point: IGcPoint, edge: GcSelectionEdge): void;
moveSelection(point: IGcPoint): void;
finishSelection(): void;
raiseSelectionChanged(isDirty: boolean, trigger: "start" | "move" | "end"): void;
raisePenCoordsChanged(penCoords: {
x: number;
y: number;
}[], isDirty: boolean, trigger: "start" | "move" | "end"): void;
raisePointerDownEvents(event: PointerEvent): void;
get viewportScaleRatio(): number;
fromViewportPoint(point: IGcPoint): IGcPoint;
toViewportBounds(bounds: Bounds): Bounds;
private _createControls;
private bindEvents;
private unbindEvents;
private onWindowResize;
private onContainerPointerDown;
onPointerDown(event: PointerEvent): void;
private onDocumentPointerDown;
private onPointerMove;
private onPointerUp;
onKeyDown(event: KeyboardEvent, params: {
alt: boolean;
space: boolean;
shift: boolean;
}): void;
onKeyUp(e: KeyboardEvent, params: {
alt: boolean;
space: boolean;
shift: boolean;
}): void;
resumePan(): void;
pauseResumedPan(): void;
getRelativeXY(event: PointerEvent): PointLocation;
}