I'm having a problem with import and module in typescript 2.4.1. I have two files:
testAdd.ts:
module mymodule {
export class myClassAdd {
static add(left: number, right: number): number {
return left + right;
}
}
}
testCallAdd.ts:
//import 'someLibrary';
module mymodule {
export class myClassCallAdd {
static callAdd(): void {
let result: number = mymodule.myClassAdd.add(3, 4); //error here
}
}
}
This code as it is now compiles fine. I've found that if I try to import some library using the import keyword, I start to get errors. In testCallAdd.ts, if I uncomment the import on the first line, I get an error that says myClassAdd does not exist on type typeof mymodule
I don't understand why I'm getting this error or how to fix it. The import statement seems to be doing something to prevent the compiler from seeing testAdd.ts. Can someone explain what went wrong and how to fix it?
This came about because I have an angular site that works fine, but I want to test it using jasmine. I can't figure out how to set it up so that both the angular piece and the unit tests have access to the code.