I am creating a typings.d.ts file for a module that has no typings. However it would be good to get access to some of the types inside the declaration.
This seems to be not possible when I use the export =
declare module 'test' {
export = class Test {
}
export interface ITestObj { // this gives an error because of the above export
key : string;
secret : string;
}
}
Is there another way in which I can structure my typings file so I can also export the types as well.
NOTE:
The above structure of export = class Test is required as that is how the module is working.
You asked:
Is there another way in which I can structure my typings file so I can also export the types as well? The above structure of
export = class Testis required as that is how the module is working.
Unfortunately, what you want is not supported. From the docs:
The
export =syntax specifies a single object that is exported from the module.
In other words, if the module uses export =, then the module can export only one object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With