Currently, I am working on a Canvas using the Konva library and found that I needed to add an extension to the Konva.Line prototype. This was necessary because when using getAbsolutePosition(), you only receive relative y values of Lines:
Object.defineProperty(Konva.Line.prototype, "absY", {
value: function() {
return this.getSelfRect().y + this.y()
},
writable: true,
configurable: true,
});
Although this code functions correctly, in my IDE (WebStorm), the ".absY()" call always appears red because TypeScript is not aware of this type.
How can I resolve this issue within a SvelteKit Project?
I understand that this may not be considered good practice, but I have become accustomed to Kotlin π
I have already attempted to include
declare namespace Konva {
interface Line {
absY: () => number;
}
}
in the app.d.ts file, however this did not provide a solution and the IDE still shows "Unused interface Line"