It seems that you can't do this anymore in TypeScript 0.9:
declare module "mymodule" {
export function(): any;
}
Is there a way of creating typings that allow to call the exported module in 0.9?
Notice that the exported function doesn't have a name. That's the way to declare callable modules in previous versions of typescript, because there are a lot of node modules exporting just a function.
The change appears deliberate, and there is no longer a way to do that:
The ‘module’ keyword no longer creates a type
Description: In 0.9.0, a clearer distinction is made between roles of namespaces, types, and values. Modules now contribute only to namespaces and values and will no longer contribute a type.
Reason: This simplification of the role of modules allow modules to now extend classes and functions more easily.
From: http://blogs.msdn.com/b/typescript/archive/2013/04/22/announcing-0-9-early-previews.aspx
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