I npm installed both THREE JS and the Collada Loader npm i three --save npm i three-collada-loader --save npm install @types/three --save
I import THEE with no problem import * as THREE from 'three';
But I am not able to import the Collada loader. I’ve tried:
import { ColladaLoader } from 'three-collada-loader';
import { ColladaLoader } from 'three-collada-loader/index';
import * as ColladaLoader from 'three-collada-loader';
But my constructor does not recognize the class constructor(private colladaLoader: ColladaLoader){};
gets a red undeline in VS Code
Sorry, I did not knew they included the type definitions from colladaloader inside the @types/three type definitions.
You can import it with: import {ColladaLoader} from "three";
but I think the type definitions are buggy. I get undefined all the time. I think the type definitions should point to three-collada-loader instead of three
There are errors in the type definitions i would guess. All methods from the type definitions are shown with typescript but I get errors in the console when using ColladaLoader.