I'm facing a little difficulty with implementing cropperjs in my project. Despite my efforts, I keep encountering the error mentioned above.
Could you please take a look at my code?
module view.pages.controllers {
export class CropToolController {
public static $inject = ["Cropper"];
constructor(
private Cropper: cropperjs.Cropper
) {
var image = document.getElementById('image');
var cropper = new Cropper(image, {
aspectRatio: 16 / 9,
crop: function(e) {
console.log(e.detail.x);
console.log(e.detail.y);
console.log(e.detail.width);
console.log(e.detail.height);
}
});
}
private getFileUrl(id: string) {
return this.$urlHelper.getAssetUrl(id);
}
}}
I don't see any errors in the definition file, but maybe I'm missing something
export class Cropper {
constructor(element: HTMLImageElement, options: CropperOptions);
crop(): void;
reset(): void;
...}
Does anyone have an idea of what mistake I might be making here? Thank you