@types/cropperjs
Advanced tools
Comparing version 0.0.11-alpha to 0.0.12-alpha
227
index.d.ts
@@ -6,4 +6,3 @@ // Type definitions for cropperjs | ||
declare module cropperjs { | ||
declare namespace cropperjs { | ||
export enum CropperViewMods { | ||
@@ -315,140 +314,140 @@ CropBoxIsJustWithInTheContainer = 0, | ||
} | ||
export class Cropper { | ||
constructor(element: HTMLImageElement, options: CropperOptions); | ||
/** | ||
* Show the crop box manually. | ||
*/ | ||
crop(): void; | ||
} | ||
/** | ||
* Clear the crop box. | ||
*/ | ||
reset(): void; | ||
declare class cropperjs { | ||
constructor(element: HTMLImageElement, options: cropperjs.CropperOptions); | ||
/** | ||
* Show the crop box manually. | ||
*/ | ||
crop(): void; | ||
/** | ||
* Replace the image's src and rebuild the cropper. | ||
* @param url A new image url | ||
*/ | ||
replace(url: string): void; | ||
/** | ||
* Clear the crop box. | ||
*/ | ||
reset(): void; | ||
/** | ||
* Enable (unfreeze) the cropper. | ||
*/ | ||
enable(): void; | ||
/** | ||
* Replace the image's src and rebuild the cropper. | ||
* @param url A new image url | ||
*/ | ||
replace(url: string): void; | ||
/** | ||
* Disable (freeze) the cropper | ||
*/ | ||
disable(): void; | ||
/** | ||
* Enable (unfreeze) the cropper. | ||
*/ | ||
enable(): void; | ||
/** | ||
* Destroy the cropper and remove the instance from the image. | ||
*/ | ||
destroy(): void; | ||
/** | ||
* Disable (freeze) the cropper | ||
*/ | ||
disable(): void; | ||
/** | ||
* Move the canvas (image wrapper) with relative offsets. | ||
* @param offsetX Moving size (px) in the horizontal direction. | ||
* @param offsetY Moving size (px) in the vertical direction. | ||
* If not present, its default value is offsetX. | ||
*/ | ||
move(offsetX: number, offsetY?: number): void; | ||
/** | ||
* Destroy the cropper and remove the instance from the image. | ||
*/ | ||
destroy(): void; | ||
/** | ||
* Move the canvas (image wrapper) to an absolute point. | ||
* @param x The left value of the canvas | ||
* @param y The top value of the canvas | ||
* If not present, its default value is x. | ||
*/ | ||
moveTo(x: number, y?: number): void; | ||
/** | ||
* Move the canvas (image wrapper) with relative offsets. | ||
* @param offsetX Moving size (px) in the horizontal direction. | ||
* @param offsetY Moving size (px) in the vertical direction. | ||
* If not present, its default value is offsetX. | ||
*/ | ||
move(offsetX: number, offsetY?: number): void; | ||
/** | ||
* Zoom the canvas (image wrapper) with a relative ratio. | ||
* Zoom in: requires a positive number (ratio > 0) | ||
* Zoom out: requires a negative number (ratio < 0) | ||
*/ | ||
zoom(ratio: number): void; | ||
/** | ||
* Move the canvas (image wrapper) to an absolute point. | ||
* @param x The left value of the canvas | ||
* @param y The top value of the canvas | ||
* If not present, its default value is x. | ||
*/ | ||
moveTo(x: number, y?: number): void; | ||
/** | ||
* Rotate the canvas (image wrapper) with a relative degree. | ||
* Rotate right: requires a positive number (degree > 0) | ||
* Rotate left: requires a negative number (degree < 0) | ||
*/ | ||
rotate(degree: number): void; | ||
/** | ||
* Zoom the canvas (image wrapper) with a relative ratio. | ||
* Zoom in: requires a positive number (ratio > 0) | ||
* Zoom out: requires a negative number (ratio < 0) | ||
*/ | ||
zoom(ratio: number): void; | ||
/** | ||
* Clear the crop box. | ||
*/ | ||
clear(): void; | ||
/** | ||
* Rotate the canvas (image wrapper) with a relative degree. | ||
* Rotate right: requires a positive number (degree > 0) | ||
* Rotate left: requires a negative number (degree < 0) | ||
*/ | ||
rotate(degree: number): void; | ||
/** | ||
* Output the cropped area position and size data (base on the original image). | ||
*/ | ||
getData(rounded?: boolean): Data; | ||
/** | ||
* Clear the crop box. | ||
*/ | ||
clear(): void; | ||
/** | ||
* Change the cropped area position and size with new data (base on the original image). | ||
*/ | ||
setData(data: Data): void; | ||
/** | ||
* Output the cropped area position and size data (base on the original image). | ||
*/ | ||
getData(rounded?: boolean): cropperjs.Data; | ||
/** | ||
* Output the container size data. | ||
*/ | ||
getContainerData(): ContainerData; | ||
/** | ||
* Change the cropped area position and size with new data (base on the original image). | ||
*/ | ||
setData(data: cropperjs.Data): void; | ||
/** | ||
* Output the image position, size and other related data. | ||
*/ | ||
getImageData(): ImageData; | ||
/** | ||
* Output the container size data. | ||
*/ | ||
getContainerData(): cropperjs.ContainerData; | ||
/** | ||
* Output the canvas (image wrapper) position and size data. | ||
*/ | ||
getCanvasData(): CanvasData & { | ||
/** | ||
* the natural width of the canvas (read only) | ||
*/ | ||
naturalWidth: number; | ||
/** | ||
* the natural height of the canvas (read only) | ||
*/ | ||
naturalHeight: number; | ||
}; | ||
/** | ||
* Output the image position, size and other related data. | ||
*/ | ||
getImageData(): cropperjs.ImageData; | ||
/** | ||
* Output the canvas (image wrapper) position and size data. | ||
*/ | ||
getCanvasData(): cropperjs.CanvasData & { | ||
/** | ||
* Change the canvas (image wrapper) position and size with new data. | ||
* the natural width of the canvas (read only) | ||
*/ | ||
setCanvasData(data: CanvasData): void; | ||
naturalWidth: number; | ||
/** | ||
* Output the crop box position and size data. | ||
* the natural height of the canvas (read only) | ||
*/ | ||
getCropBoxData(): CropBoxData; | ||
naturalHeight: number; | ||
}; | ||
/** | ||
* Change the crop box position and size with new data. | ||
*/ | ||
setCropBoxData(data: CropBoxData): void; | ||
/** | ||
* Change the canvas (image wrapper) position and size with new data. | ||
*/ | ||
setCanvasData(data: cropperjs.CanvasData): void; | ||
/** | ||
* Get a canvas drawn the cropped image. | ||
*/ | ||
getCroppedCanvas(options?: CroppedCanvasOptions): HTMLCanvasElement; | ||
/** | ||
* Output the crop box position and size data. | ||
*/ | ||
getCropBoxData(): cropperjs.CropBoxData; | ||
/** | ||
* Change the aspect ratio of the crop box. | ||
*/ | ||
setAspectRatio(aspectRatio: number): void; | ||
/** | ||
* Change the crop box position and size with new data. | ||
*/ | ||
setCropBoxData(data: cropperjs.CropBoxData): void; | ||
/** | ||
* Change the drag mode. | ||
*/ | ||
setDragMode(mode?: 'none' | 'crop' | 'move'): void; | ||
/** | ||
* Get a canvas drawn the cropped image. | ||
*/ | ||
getCroppedCanvas(options?: cropperjs.CroppedCanvasOptions): HTMLCanvasElement; | ||
} | ||
/** | ||
* Change the aspect ratio of the crop box. | ||
*/ | ||
setAspectRatio(aspectRatio: number): void; | ||
/** | ||
* Change the drag mode. | ||
*/ | ||
setDragMode(mode?: 'none' | 'crop' | 'move'): void; | ||
} | ||
declare module "cropperjs" { | ||
const Cropper: typeof cropperjs.Cropper; | ||
export = Cropper; | ||
} | ||
export = cropperjs; | ||
export as namespace Cropper; | ||
{ | ||
"name": "@types/cropperjs", | ||
"version": "0.0.11-alpha", | ||
"version": "0.0.12-alpha", | ||
"description": "TypeScript definitions for cropperjs", | ||
@@ -8,2 +8,6 @@ "main": "", | ||
"author": "Stepan Mikhaylyuk <https://github.com/stepancar>", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
}, | ||
"license": "MIT", | ||
@@ -10,0 +14,0 @@ "typings": "index.d.ts", |
@@ -11,9 +11,9 @@ # Installation | ||
Additional Details | ||
* Last updated: Wed, 25 May 2016 04:20:04 GMT | ||
* File structure: OldUMD | ||
* Last updated: Fri, 01 Jul 2016 18:42:20 GMT | ||
* File structure: UMD | ||
* Library Dependencies: none | ||
* Module Dependencies: none | ||
* Global values: cropperjs | ||
* Global values: cropperjs, Cropper | ||
# Credits | ||
These definitions were written by Stepan Mikhaylyuk <https://github.com/stepancar>. |
@@ -13,13 +13,12 @@ { | ||
"sourceBranch": "types-2.0", | ||
"kind": "OldUMD", | ||
"kind": "UMD", | ||
"globals": [ | ||
"cropperjs" | ||
"cropperjs", | ||
"Cropper" | ||
], | ||
"declaredModules": [ | ||
"cropperjs" | ||
], | ||
"declaredModules": [], | ||
"files": [ | ||
"index.d.ts" | ||
], | ||
"contentHash": "3c7e47984db5a5996a3ef231588d6c5b16132b8c7a88c60900f86f00a8e19a97" | ||
"contentHash": "93575c3fba3c9124fc2f8f75f2926c1a5c58ddcea4fe541e5d2ec40d7a10be30" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
0
13492
447