0

I have some Typescript code:

module MyModule {
    export class MyClass {
        static MyStaticMember : string;
    }
}

and I want to access it from a separately compiled file. I've tried:

MyModule.MyClass.MyStaticMember

but that gives an error:

error TS2094: The property MyClass does not exist on the value of type 'type MyModule'

How can I access this member variable?

David
  • 123
  • 7

1 Answers1

0

Somewhere in this file or the other one, you have a top-level import or export. This turns your file into an external module, which means that separate declarations MyModule create new modules instead of merging together.

See also

Community
  • 1
  • 1
Ryan Cavanaugh
  • 209,514
  • 56
  • 272
  • 235