-
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
The bug
Hi, I was working on a TypeScript project where I have a merged declaration of an interface and a namespace. This essentially means that the interface seemingly has static methods. This can be done with the following:
//test1.ts
interface Test1 {
property: number
}
namespace Test1 {
export function func() {
console.log("hello world");
}
}
export default Test1;But for some reason, ctix produces a "type" export which then discards the namespace:
//barrel.ts
export { default as Test1 } from "./test1";It seems that ctix looks at the first occurrence of the name Test, and does logic based on that, because if I flip the order of declarations in the code:
//test2.ts
namespace Test2 {
export function func() {
console.log("hello world");
}
}
interface Test2 {
property: number
}
export default Test2;then the resulting file will contain a regular export:
//barrel.ts
export { default as Test2 } from "./test2";Expected output
Since I have both a namespace and an interface, I'd like to keep both, so the expected output for any of the two test cases would be a regular export:
//barrel.ts
export { default as Test1 } from "./test1";
export { default as Test2 } from "./test2";Actual output
//barrel.ts
export { type default as Test1 } from "./test1";
export { default as Test2 } from "./test2";Here is the above in a .zip for easier testing: test.zip
Metadata
Metadata
Assignees
Labels
No labels