well on first look it does look like it should work, but in typescript it’s sometimes the little nuances
This is happening because of the way we export out declarations. This will work:
import { UniversalCamera } from "babylonjs";
declare module "babylonjs/Cameras/universalCamera" {
export interface UniversalCamera {
moveTo: (...args: any[]) => any;
}
}
UniversalCamera.prototype.moveTo = (...args: any[]) => {
console.log(args);
};
And this will work as well:
import { UniversalCamera } from "babylonjs";
declare module "babylonjs" {
interface TouchCamera {
moveTo: (...args: any[]) => any;
}
}
UniversalCamera.prototype.moveTo = (...args: any[]) => {
console.log(args);
};