I'm having trouble creating a custom TypeScript declaration file for my JavaScript library. Here is a simplified version of the code:
App.ts:
/// <reference path="types.d.ts" />
MyMethods.doSomething() // error: Cannot resolve symbol "MyMethods"
Types.d.ts:
interface MyMethods {
doSomething();
}
declare var MyMethods: MyMethods;
I'm confused as to why this basic declaration file isn't working. In Visual Studio 2015 + Resharper, MyMethods
in App.ts shows up in red with an error message saying Cannot resolve symbol "MyMethods".
What's even stranger is that the project compiles successfully and the output functions correctly. Am I missing something?
Edit: When I disable Resharper, no errors are highlighted. Could this just be a bug?