No type declarations for loadAsync.
Hillzkred opened this issue · 5 comments
Hillzkred commented
Using the loadAsync method throws an error in the IDE.
const handleUpload = async (event: ChangeEvent<HTMLInputElement>) => {
const IfcFileFromEvent = event.target.files as FileList;
const url = URL.createObjectURL(IfcFileFromEvent[0]);
await ifcLoader
.loadAsync(url)
.then((model: SetStateAction<IFCModel | null>) => scene.add(model));
};
agviegas commented
Hi, how are you instantiating the ifcLoader?
Hillzkred commented
Hi, how are you instantiating the ifcLoader?
Hello, I'm instantiating it like this:
const ifcLoader = new IFCLoader();
This code works, I'm just getting some type errors.
const ifcLoader = new IFCLoader();
const handleUpload = async (event: ChangeEvent<HTMLInputElement>) => {
const IfcFileFromEvent = event.target.files as FileList;
const url = URL.createObjectURL(IfcFileFromEvent[0]);
await ifcLoader
.loadAsync(url)
.then((model: SetStateAction<IFCModel | null>) => scene.add(model));
};
agviegas commented
Hmm, looks strange, but it works for me 🤔 Maybe you need to import the types of Three.js?
Hillzkred commented
agviegas commented
Does your version of three match the version of three that the library depends on?