Clarification of comments in module-class.d.ts
As someone learning about TypeScript declaration files, I was surprised by this comment in the module-class.d.ts template:
Note that ES6 modules cannot directly export class objects.
That left me curious about the meaning of the comment, particularly with respect to this type of module:
// SomeClass.js
export default class SomeClass {
// etc.
}
Is this comment referring to some limitation of ES modules? Or is it referring to the behavior of TypeScript declaration files?
I'd be happy to help clarify the comments in the templates if someone can help me understand specifically what they mean.
This should probably be a separate issue, but I'm also struck by this syntax in the templates:
// This file should be imported using the CommonJS-style:
import x = require('someLibrary');
I opened #753 suggesting a correction to this same syntax elsewhere in the docs. But seeing it again in the template I'm wondering if it is TypeScript specific syntax (I don't see the same mix of import and require used on the module doc).
I now see the export = and import = syntax documented (and I'm scared). Perhaps it would be clearer to say "This file should be imported using the TypeScript specific style" (instead of CommonJS-style).