timocov / dts-bundle-generator

A tool to generate a single bundle of dts with types tree-shaking
MIT License
745 stars 38 forks source link

Namespaced imports/exports don't generate a namespace if they are exported via name #299

Closed timocov closed 7 months ago

timocov commented 7 months ago

Bug report

Input code

// index.ts
export { NsName } from './ns';

// ns.ts
export * as NsName from './types';

// types.ts
export type Str = string;

Expected output

type Str = string;
declare namespace NsName {
    export { Str };
}
export { NsName };
export {};

Actual output

type Str = string;
export {};