I am struggling with a particular issue and finding it difficult to search for a solution. Here is the problem: I have created a TypeScript class that I am exporting:
class MyAPIClass {
myMethod(one:number) : void;
secondMethod(text:string) : number;
}
export = MyAPIClass;
Now, I want to use this class in another TypeScript project of mine:
import MyAPIClass = require('../path/MyAPIClass');
let myClass = new MyAPIClass();
myClass.myMethod(1);
Everything works as expected, however, I am not getting the "typings" support. My editor is not recognizing the types from the imported file. Additionally, I am unable to specify the type like this:
let myClass : MyAPIClass = new MyAPIClass();
Is there a way to properly import the typings as well?