The way to do so in TS is usually looking like this:
// This part is augmenting the module for the rest of your app
declare module "@babylonjs/core/.../arcRotateCamera" {
export interface ArcRotateCamera {
moveTargetTo(tgtObj: any): void;
}
}
// This part is the related implementation
ArcRotateCamera.prototype.moveTargetTo = function (tgtObj) {
...
};
I added /cameras/ instead of /…/ because that gave me an error because the module couldn’t be found.
So with cameras that was resolved.
However in my main.ts file I still get this:
I would expect to have something as this in my code file where I’m importing from…
// CODE A
ArcRotateCamera.prototype.moveTargetTo = function (tgtObj: Mesh) {
console.log(tgtObj.position);
// camera transition here based on the target object
};
And this in my main file where I import to:
// CODE B
newCam.moveTargetTo(target)
But as it’s not exported in code A, It’s not recognized in code B