- How you use it
- cli_tool
- What it can do
- installs software · network
- What's inside
The option
| Option | Acli_tool · v0.28.20TypeDoc CLI |
|---|---|
| How you use it | cli_tool |
| What it can do | installs software · network |
| What's inside |
What this thread does
Use TypeDoc for source-to-HTML reference docs, or API Extractor plus API Documenter when you also need a reviewed public API contract.
Do first: confirm the public exports of src/index.ts; see TypeDoc input options.
What changed
- The current TypeDoc release page identifies the release in the table below; compare your pinned generator before adopting old tutorial configuration.
- TypeDoc's TSDoc guidance distinguishes its permissive comment parser from API Extractor's stricter TSDoc handling. Comments that render in one tool need not pass the other.
How to generate the docs
1. Choose the public entry point, usually src/index.ts, and export the symbols readers should see. Put comments on declarations using /** ... */; document parameters, return values, examples and deprecations. Treat the public exports as the reference boundary, not every source file. 2. For TypeDoc, install a reviewed pin of typedoc with a compatible typescript. A minimal typedoc.json is {"entryPoints":["src/index.ts"],"out":"docs/api","validation":{"invalidLink":true,"notDocumented":true},"treatWarningsAsErrors":true}. Run pnpm exec typedoc --options typedoc.json. See configuration and validation for these options. Review undocumented-symbol warnings before enabling the gate across a large legacy library. 3. For TypeDoc custom tags, put tsdoc.json beside the tsconfig the tool loads, extending typedoc/tsdoc.json and defining any extra tags. This is parser configuration, not the place for output folders or entry points. For multiple packages, use packages mode: entryPointStrategy is packages, root entryPoints selects package directories, and packageOptions.entryPoints can select src/index.ts within each package. Keep each package's compiler settings correct. 4. For API Extractor, install @microsoft/api-extractor and @microsoft/api-documenter; run pnpm exec api-extractor init. Build declarations first with the project's compiler configuration. Set mainEntryPointFilePath to the emitted public .d.ts, not a source .ts, enable docModel.enabled, and enable apiReport.enabled if API review is wanted. The invocation guide supplies the setup steps. 5. For that branch, use tsdoc.json extending @microsoft/api-extractor/extends/tsdoc-base.json, as in the official TSDoc config. Generate and review the initial API report with pnpm exec api-extractor run --local; commit an accepted report. In CI use pnpm exec api-extractor run so unexpected API report changes fail instead of silently updating the accepted baseline. See API report setup. 6. Generate Markdown from the doc model with pnpm exec api-documenter markdown --input-folder temp --output-folder docs/api. The doc-generation guide explains .api.json inputs and cross-package links. API Extractor alone does not produce a finished reference site. 7. In CI, install the frozen lockfile, run typecheck/declaration build, run the chosen documentation command with warnings enforced, and retain the rendered output as a review artifact. If generated docs are tracked, regenerate them and fail on a diff. Review and approve output before deployment.
Versions and licences
As of November 2026, TypeDoc is identified by its release page; Microsoft tool numbers below are pinned official repository manifest snapshots, not registry dist-tags.
| Tool | Version and licence | Official source |
|---|---|---|
| TypeDoc | 0.28.20; Apache-2.0 | Release, manifest |
| API Extractor | 7.60.1; MIT | Manifest |
| API Documenter | 7.30.20; MIT | Manifest |
Current manifests: API Extractor, API Documenter.
When to pick which
| Option | Pick when | Not for |
|---|---|---|
| TypeDoc | You want a browsable HTML reference directly from source | Enforcing an accepted public API report by itself |
| API Extractor + API Documenter | You ship a library and need API review plus declaration-based reference content | Skipping declaration emit or expecting a polished hosted site automatically |
What breaks
If output is empty, check the configured entry points and exports. Stripped declaration comments remove the material API Extractor needs. Unknown tags can indicate a misspelling or unsupported/custom tag configuration; check the selected parser and tsdoc.json. Broken links can be warnings until CI explicitly treats them as errors.
Diagnostic: ae-forgotten-export
The official diagnostic means a public signature refers to a declaration outside the exported API surface. Export the intended public type or redesign the signature; adding a prose comment does not repair an inaccessible type.
What to test
Check one generic function, overload, re-export, interface, deprecated member, custom tag and cross-package link. Seed an invalid link to confirm CI fails, then remove it. Inspect actual HTML/Markdown, confirm private/internal members are excluded as intended, and compile examples separately. A green generator run cannot prove example code works.
Community evidence
- TypeDoc issue 2190, reported by ilg-ul on 4 March 2023, documents project metadata being picked up from an unexpected nested manifest; maintainer Gerrit0 explains package-mode behaviour in the discussion. It is historical context, not a claim the current release still has that bug.
- In TypeDoc discussion issue 2868, Gerrit0 explains browser-facing JSON support and changes to the default theme. This is maintainer evidence about capabilities, not an independent comparison showing superior documentation quality.
Pitfalls
Do not let an agent invent API descriptions from function names. Avoid disabling all warnings to get a green build. A tsdoc.json shared by several tools needs compatible tag definitions; a tag being parsed does not ensure a theme renders it. API Extractor uses its own compiler engine, so consult its invocation guide when toolchain typings disagree.
A prompt for your agent
Your training data may predate the installed documentation tools. Read the linked official configuration, TSDoc and invocation pages; do not guess flags. Inspect the public exports and compiler settings. Pick source-to-HTML or declaration-to-doc-model deliberately, add a minimal configuration and a CI gate, and show generated examples, links and internal-member filtering. Preserve comments and never fabricate behavioural guarantees.
Limits
Untested documentation workflow. Community evidence is mainly maintainer discussion and historical bug reports; there is no independent head-to-head trial here. Verify registry availability and compatibility before installing the repository snapshot versions.
Started from a post by @ilg-ul, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.