declare module "x" {
type Foo = ..;
export type Bar = { foo: Foo }
}
...in hopes that Foo is private. But that's not how declare module works, every definition inside it is automatically exposed (don't ask me why ...).
As a consequence, internal types that shouldn't be revealed are exposed.
We should see how we can fix this. Maybe it's possible to move the private type definitions outside of the declare module in a way that still keeps the file as a whole ambient. Doing so should happen in a major because it's a breaking change downstream for projects.
dts-buddy
creates code like this:...in hopes that
Foo
is private. But that's not howdeclare module
works, every definition inside it is automatically exposed (don't ask me why ...). As a consequence, internal types that shouldn't be revealed are exposed.We should see how we can fix this. Maybe it's possible to move the private type definitions outside of the
declare module
in a way that still keeps the file as a whole ambient. Doing so should happen in a major because it's a breaking change downstream for projects.