aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/types
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-01-11 10:30:12 +0000
committerMario <mario@mariovavti.com>2020-01-11 10:30:12 +0000
commitf645c6f3a57bf5f53bbb2bde362b2447f725c977 (patch)
tree9b37650aad46296c5d98a55969348ebb4ee2d097 /library/cropperjs/types
parent4c1c6908165e5c4fb1b7238f66764f89faa2301a (diff)
downloadvolse-hubzilla-f645c6f3a57bf5f53bbb2bde362b2447f725c977.tar.gz
volse-hubzilla-f645c6f3a57bf5f53bbb2bde362b2447f725c977.tar.bz2
volse-hubzilla-f645c6f3a57bf5f53bbb2bde362b2447f725c977.zip
update cropperjs to the recent version
Diffstat (limited to 'library/cropperjs/types')
-rw-r--r--library/cropperjs/types/index.d.ts164
1 files changed, 164 insertions, 0 deletions
diff --git a/library/cropperjs/types/index.d.ts b/library/cropperjs/types/index.d.ts
new file mode 100644
index 000000000..187290f92
--- /dev/null
+++ b/library/cropperjs/types/index.d.ts
@@ -0,0 +1,164 @@
+declare namespace Cropper {
+ type DragMode = 'crop' | 'move' | 'none';
+ type ViewMode = 0 | 1 | 2 | 3;
+ type ImageSmoothingQuality = 'low' | 'medium' | 'high';
+
+ export interface Data {
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+ rotate: number;
+ scaleX: number;
+ scaleY: number;
+ }
+
+ export interface ContainerData {
+ width: number;
+ height: number;
+ }
+
+ export interface ImageData {
+ left: number;
+ top: number;
+ width: number;
+ height: number;
+ rotate: number;
+ scaleX: number;
+ scaleY: number;
+ naturalWidth: number;
+ naturalHeight: number;
+ aspectRatio: number;
+ }
+
+ export interface CanvasData {
+ left: number;
+ top: number;
+ width: number;
+ height: number;
+ naturalWidth: number;
+ naturalHeight: number;
+ }
+
+ export interface CropBoxData {
+ left: number;
+ top: number;
+ width: number;
+ height: number;
+ }
+
+ export interface GetCroppedCanvasOptions {
+ width?: number;
+ height?: number;
+ minWidth?: number;
+ minHeight?: number;
+ maxWidth?: number;
+ maxHeight?: number;
+ fillColor?: string;
+ imageSmoothingEnabled?: boolean;
+ imageSmoothingQuality?: ImageSmoothingQuality;
+ }
+
+ export interface SetDataOptions {
+ x?: number;
+ y?: number;
+ width?: number;
+ height?: number;
+ rotate?: number;
+ scaleX?: number;
+ scaleY?: number;
+ }
+
+ export interface SetCanvasDataOptions {
+ left?: number;
+ top?: number;
+ width?: number;
+ height?: number;
+ }
+
+ export interface SetCropBoxDataOptions {
+ left?: number;
+ top?: number;
+ width?: number;
+ height?: number;
+ }
+
+ export interface Options {
+ aspectRatio?: number;
+ autoCrop?: boolean;
+ autoCropArea?: number;
+ background?: boolean;
+ center?: boolean;
+ checkCrossOrigin?: boolean;
+ checkOrientation?: boolean;
+ crop?(event: CustomEvent): void;
+ cropBoxMovable?: boolean;
+ cropBoxResizable?: boolean;
+ cropend?(event: CustomEvent): void;
+ cropmove?(event: CustomEvent): void;
+ cropstart?(event: CustomEvent): void;
+ data?: Data;
+ dragMode?: DragMode;
+ guides?: boolean;
+ highlight?: boolean;
+ initialAspectRatio?: number;
+ minCanvasHeight?: number;
+ minCanvasWidth?: number;
+ minContainerHeight?: number;
+ minContainerWidth?: number;
+ minCropBoxHeight?: number;
+ minCropBoxWidth?: number;
+ modal?: boolean;
+ movable?: boolean;
+ preview?: Element | Element[] | NodeList | string;
+ ready?(event: CustomEvent): void;
+ responsive?: boolean;
+ restore?: boolean;
+ rotatable?: boolean;
+ scalable?: boolean;
+ toggleDragModeOnDblclick?: boolean;
+ viewMode?: ViewMode;
+ wheelZoomRatio?: number;
+ zoom?(event: CustomEvent): void;
+ zoomOnTouch?: boolean;
+ zoomOnWheel?: boolean;
+ zoomable?: boolean;
+ }
+}
+
+declare class Cropper {
+ constructor(element: HTMLImageElement | HTMLCanvasElement, options?: Cropper.Options);
+ clear(): Cropper;
+ crop(): Cropper;
+ destroy(): Cropper;
+ disable(): Cropper;
+ enable(): Cropper;
+ getCanvasData(): Cropper.CanvasData;
+ getContainerData(): Cropper.ContainerData;
+ getCropBoxData(): Cropper.CropBoxData;
+ getCroppedCanvas(options?: Cropper.GetCroppedCanvasOptions): HTMLCanvasElement;
+ getData(rounded?: boolean): Cropper.Data;
+ getImageData(): Cropper.ImageData;
+ move(offsetX: number, offsetY?: number): Cropper;
+ moveTo(x: number, y?: number): Cropper;
+ replace(url: string, onlyColorChanged?: boolean): Cropper;
+ reset(): Cropper;
+ rotate(degree: number): Cropper;
+ rotateTo(degree: number): Cropper;
+ scale(scaleX: number, scaleY?: number): Cropper;
+ scaleX(scaleX: number): Cropper;
+ scaleY(scaleY: number): Cropper;
+ setAspectRatio(aspectRatio: number): Cropper;
+ setCanvasData(data: Cropper.SetCanvasDataOptions): Cropper;
+ setCropBoxData(data: Cropper.SetCropBoxDataOptions): Cropper;
+ setData(data: Cropper.SetDataOptions): Cropper;
+ setDragMode(dragMode: Cropper.DragMode): Cropper;
+ zoom(ratio: number): Cropper;
+ zoomTo(ratio: number, pivot?: {x: number; y: number}): Cropper;
+ static noConflict(): Cropper;
+ static setDefaults(options: Cropper.Options): void;
+}
+
+declare module 'cropperjs' {
+ export default Cropper;
+}