0

I'm attempting to create a definition file for an API provided by a third party (Skuid) and have run into an issue representing skuid.ui.Editor where Editor is a class defined somewhere else by Skuid. How would I inform the typescript compiler that new skuid.ui.Editor() is indeed valid?

1 Answers1

0

You would normally write something like this:

declare namespace skuid.ui {
    class Editor {
        constructor();
        // Methods and properties here
    }
}
Ryan Cavanaugh
  • 209,514
  • 56
  • 272
  • 235
  • That did the trick, thanks! I hadn't previously heard of the "namespace" keyword, something new to look into. – patrickjtoy Dec 02 '15 at 17:48
  • Note that `declare namepsace skuid.ui` is exactly the same as `declare module skuid.ui` -- you may see `module` used more often in older declaration files – Ryan Cavanaugh Dec 02 '15 at 18:06