Closed battall closed 1 month ago
i think i made it work but dont know if its a good practise or not, updated global.d.ts; before i was getting error like "Subsequent variable declarations must have the same type", and removed const pc : typeof _pc;
import * as pc from "playcanvas";
import VehicleWheel from "./Scripts/Vehicle/vehicle-wheel.js";
declare global {
namespace pc {
class ScriptComponent {
VehicleWheel?: InstanceType<typeof VehicleWheel>;
}
}
}
export {};
I was also getting this error:
Cannot redeclare block-scoped variable 'pc'.ts(2451) playcanvas.d.ts(40514, 21): 'pc' was also declared here.
and removing const pc : typeof _pc;
this line helped me to get rid of the error.
If you pull latest, this is now fixed. Feel free to reopen if you still have problems.
For example;
note: i am a typescript noob so