3cp / namespace-bug

dts-bundle-generator namespace bug

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run

npm run build

Output

> namespace-bug@0.0.1 build
> dts-bundle-generator -o dist/index.d.ts src/index.ts

Compiling input files...
Processing src/index.ts
Writing src/index.ts -> dist/index.d.ts
Checking generated files...
dist/index.d.ts(9,36): error TS2503: Cannot find namespace 'Foo'.
dist/index.d.ts(9,47): error TS2503: Cannot find namespace 'Foo'.

Error: Compiled with errors

src/foo.ts defined two types, src/index.ts imports foo.ts as a namespace import * as Foo.

The generated dist/index.d.ts has missing namespace Foo. Although the two types Foo1 and Foo2 were correctly bundled.

The Foo.Foo1 and Foo.Foo2 in generated file cause runtime errors.

// Generated by dts-bundle-generator v6.13.0

export interface Foo1 {
    name: string;
}
export interface Foo2 {
    name: string;
}
export declare function bar(input: Foo.Foo1): Foo.Foo2;

export {};

About

dts-bundle-generator namespace bug


Languages

Language:TypeScript 100.0%