Closed mobileben closed 4 years ago
Got the same problem, I'm now trying to build a custom TypeScript version of the library
This is unrelated to TypeScript - you're getting is not a constructor
because your variable is undefined
. It's a default export rather than a named export:
import Impetus from 'impetus';
I'm new to the Javascript/Typescript game. This library looked useful and was looking to incorporate it into a Typescript project, but, due to my inexperience with integrating modules that aren't Typescript and don't have a declaration file, I am having difficulty getting this integrated. I've tried to import this via
When run, I'll get a
Uncaught TypeError: impetus_1.Impetus is not a constructor
. When looking at thedist
code, I do see that it ends up creating avar Impetus = function Impetus(_ref)
.So admittedly it isn't clear to me how that would translate to a class.
Are there any plans to add in Typescript support?
I'm considering just dropping this into a
.ts
file, since it is relatively small.