Closed PhilippCh closed 5 years ago
I am able to use it with webpack imports-loader workaround in Angular 6 project:
import * as THREE from 'three';
import 'imports-loader?THREE=three,exports=>undefined,this=>THREE!three.meshline/src/THREE.MeshLine';
const material = new (THREE as any).MeshLineMaterial();
const line = new (THREE as any).MeshLine();
I would really like native TypeScript support as a feature! Are there any plans to implement that?
I'll consider that for the next version! Thanks for your comment
I did a typescript port at https://github.com/AlexVestin/THREE.MeshLine/blob/master/src/THREE.MeshLine.ts if that is of any use. I haven't really tested it thoroughly (and I left some comments marked TODO where I wasn't sure of the right implementation), but it's working for my use-case.
The result of many hours of research to quickly get it running, while writing only 1 line. Write the ambient type declaration
In my case I have file typings.d.ts
in my Angular project and write there next line:
declare module 'three.meshline';
And import all like this:
import { MeshLine, MeshLineMaterial } from 'three.meshline'
Hope it would be helpfull!
Hi there,
do you plan on supporting TypeScript anytime soon? I'd love to use the library in an Angular 7 project, but AFAIK that's not possible at the moment.
Cheers Philipp