Open falsandtru opened 9 years ago
What should the emit for this look like?
I want this syntax and emit compatible with es6 modules.
namespace NS {
export {foo}
}
var NS;
(function (NS) {
NS.foo = foo;
})(NS || (NS = {}));
use case
export default A
const Package = {
Msg,
Proxy: Proxy, // tslint bug. https://github.com/palantir/tslint/issues/684
Tick: Tick
};
function A<T>() {
return new ArchStream<T>();
}
namespace A {
export const Msg = Package.Msg; // => export {Msg}
export const Proxy = Package.Proxy; // => export {Proxy}
export const Tick = Package.Tick; // => export {Tick}
}
I have the same problem like above:
export namespace HomePage {
export namespace Action {
export namespace ActionTypes {
export const OPEN_API_REQUEST = '@@homePage/OPEN_API_REQUEST'; --> this is invalid. :(
}
}
}
es6 modules can export module elements without declaration.
Namespaces are not.
Namespaces should support non-declaration export.
related: https://github.com/Microsoft/TypeScript/issues/5175