I have a JS project where I manually define type declaration files in a separate directory. Previously I was using typedoc v0.19.2 and it generated documentation beautifully, using this typedoc config:
{
"out": "docs",
"excludeExternals": true,
"includeDeclarations": true,
"mode": "file"
}
My type declaration files mostly add type info onto the global scope, like:
declare global {
namespace something {
...
}
}
I'm now using typedoc v0.20.11 and it doesn't seem to be noticing anything on the global scope. I realize there were some major changes in v0.20.0 but was really hoping there would be functional parity buried in here somewhere for this specific use-case (manually defined type declaration directory, where the declarations take advantage of the global scope and aren't necessary declaring new modules). Any guidance would be much appreciated! Here is my current typedoc config (not working):
{
"out": "docs",
"excludeExternals": true,
"entryPoints": ["types/index.d.ts"],
"tsconfig": "typdoc-tsconfig.json",
"readme": "none"
}
(have also tried using the "expand" entryPointStrategy
with just the "types" directory -> this seems like it makes more sense for my use case, but still doesn't seem to work).
and typedoc-tsconfig.json
:
{
"include": ["types"]
}
I solved this issue using a typedoc plugin lib made specifically for this purpose, typedoc-plugin-not-exported. This flawlessly addresses this exact problem. Exposing types on the global scope isn't technically export
ing them, and so the updated version of typedoc (I'm thinking >=0.20.0) won't include them. This plugin library fixes that.