Open fuzzyfelts opened 6 years ago
Similar edge case,
export { value as anotherName } from './some-file'
Will generate
export const value: number
instead of
export const anotherName: number
Hey did you guys find a solution for this?
Better off writing something of our own at this point...
Hahaha yeah this is my first time working with declaration files so I'm surprised there's no automated way of creating these that are... more robust.
@shanehsu I figured out a workaround that's not too bad using namespaces. You would modify the above example as...
mammals.ts
export namespace mammals {
export class Monkey { }
export class Lion { }
export class Tiger { }
}
index.ts
export { mammals } from './mammals';
This actually feels nicer as we don't need to import * as just to export again
Hi,
I am trying to use dts-bundle to export a bundle as a module library. I am re-exporting all the exports from another file, and while this works without bundling it doesn't seem to when bundled.
My question is really 2-fold.
1) Is this a gap/bug in the dts-bundle library? 2) What should the bundle.d.ts look like?
This is my minimal example. Consider I am trying to publish an 'animals' npm package. It's very simple consisting of the following.
mammals.ts
index.ts
I want to use it as follows within some other code in another module somewhere
zoo.ts
If you create a bundle this using the command
You get the file
bundle.d.ts
which leads to a typescript error 'Cannot find name mammals'
The initial d.ts files look like this:-
mammals.d.ts
index.d.ts