Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript usage seems a little cumbersome #2

Open
ammulder opened this issue Jun 19, 2017 · 1 comment
Open

TypeScript usage seems a little cumbersome #2

ammulder opened this issue Jun 19, 2017 · 1 comment

Comments

@ammulder
Copy link

ammulder commented Jun 19, 2017

This is the best I can come up with:

import * as CreateSTLLoader from "three-stl-loader";
import * as THREE from "three"; // For the STLLoader
...
CreateSTLLoader(THREE);
let loader = new (<any>THREE).STLLoader();

I'm afraid I'm not sure whether I'm overlooking something, or what would be involved in making a better solution if I'm not. For what it's worth, I'm using @types/three for TypeScript definitions of Three.js itself.

@data-doge
Copy link
Contributor

hmm, i don't like that THREE magically gets access to an STLLoader fxn after CreateSTLLoader is called.

in your example, it's no problem. but in a larger file, it could become less clear where THREE's STLLoader came from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants