I want to get some info from an image that i load using new image() with typescript. I try this code:
width;
heigth;
init(){
let image = new Image();
image.src = "url";
image.onload((event) => {
this.width = event.width;
this.heigth = event.heigth;
})
}
But i get this error:
void' is not assignable to parameter of type 'Event'. Property 'bubbles' is missing in type '() => void'
I search examples on how to use this event but i can't find anything.