@mescius/dsimageviewer
Version:
Document Solutions Image Viewer
50 lines (49 loc) • 2.07 kB
TypeScript
export interface PointLocation {
x: number;
y: number;
}
export interface Size {
width: number;
height: number;
}
export interface Bounds extends PointLocation, Size {
}
export interface IGcSelectionBox {
cursorStyle: "crosshair" | "text";
get selectionBounds(): Bounds;
set selectionBounds(bounds: Bounds);
get previewImageUrl(): string | undefined;
set previewImageUrl(dataUrl: string | undefined);
get keepAspectRatio(): boolean;
set keepAspectRatio(keepAspectRatio: boolean);
disable(): any;
show(initialBounds?: Bounds, selectionType?: GcSelectionBoxUsageType, keepAspectRatio?: boolean): any;
hide(): any;
showPointIndicator(coords: PointLocation, size: number, type: PointIndicatorType): void;
clearPointIndicator(type: PointIndicatorType): void;
clearPointIndicators(): void;
addListener(uniqueKey: string, selectionBoxHandler: GcSelectionBoxHandler): any;
removeListener(uniqueKey: string): any;
invalidate(): any;
}
export declare type PointIndicatorType = "clone-stamp-src" | "clone-stamp-dest";
export declare type GcSelectionEdge = "s" | "e" | "n" | "w" | "ne" | "nw" | "sw" | "se" | "center";
export declare type SelectionBoundsChangedParams = {
isDirty: boolean;
trigger: "start" | "move" | "end";
};
export interface GcSelectionBoxHandler {
onSelectionBoundsChanged(selection: Bounds, params: SelectionBoundsChangedParams): any;
}
export interface GcSelectionBoxHandler2 extends GcSelectionBoxHandler {
onKeyDown: (e: KeyboardEvent, params: {
alt: boolean;
space: boolean;
shift: boolean;
}) => any;
onSelectionDownOutside: (e: PointerEvent, params: {}) => any;
onSelectionDownInside: (e: PointerEvent, params: {}) => any;
onSelectionDblOutside: (e: PointerEvent, params: {}) => any;
onSelectionDblInside: (e: PointerEvent, params: {}) => any;
}
export declare type GcSelectionBoxUsageType = "crop" | "resize" | "pencil" | "image-preview" | "object" | "default";