Cannot reference classes from interfaces after upgrading to VS2017

89 views Asked by At

I get Cannot find name 'x' in typescript interface files when they reference classes in the same module, but are in a different file.

Example:

MyClass.ts

module MyModule
{
    export class MyClass
    {
        constructor()
        {

        }
    }
}

MyInterface.d.ts

declare module MyModule
{
    export interface MyInterface
    {
        Test: MyClass;
    }
}

This shows Cannot find name 'MyClass', however it is highlighted blue as if it knows what it is. VS successfully builds, however the errors are shown in the error window. This used to be fine before upgrading from VS2015. What am I doing wrong?

0

There are 0 answers