Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsJul 3, 2026·2 min de lectura

TypeDoc — Documentation Generator for TypeScript Projects

TypeDoc generates API reference documentation from TypeScript source code, producing navigable HTML or JSON output from JSDoc comments and type annotations.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
TypeDoc Overview
Comando de instalación directa
npx -y tokrepo@latest install f1774375-7679-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

TypeDoc reads TypeScript source files and produces structured API documentation. It extracts type information from the compiler, combines it with JSDoc comments, and renders navigable HTML pages or JSON output suitable for further processing.

What TypeDoc Does

  • Parses TypeScript source code using the TypeScript compiler API
  • Extracts classes, interfaces, functions, enums, and type aliases with full type information
  • Renders HTML documentation with search, navigation sidebar, and cross-referenced links
  • Supports JSDoc and TSDoc comment tags for descriptions, parameters, and examples
  • Outputs JSON for integration with custom documentation pipelines

Architecture Overview

TypeDoc operates in three phases: conversion, resolution, and rendering. The converter uses the TypeScript compiler to build a reflection model of all exported symbols. The resolver links cross-references between types. The renderer serializes the model to HTML (default theme) or JSON. Plugins can hook into each phase to customize behavior.

Self-Hosting & Configuration

  • Install: npm install typedoc --save-dev
  • Configure via typedoc.json or CLI flags for entry points, output directory, and theme
  • Set entryPoints to your package's public API files
  • Use --plugin to add themes or custom output formats
  • Integrate into CI with npx typedoc --treatWarningsAsErrors

Key Features

  • Understands TypeScript generics, conditional types, mapped types, and template literals
  • Supports monorepo documentation with multiple entry points and packages mode
  • Extensible plugin system for custom themes, output formats, and converters
  • Markdown support in comments with code blocks and cross-reference links
  • Automatic categorization and grouping of exported members

Comparison with Similar Tools

  • JSDoc — works with plain JavaScript, limited TypeScript type inference
  • TSDoc — a comment spec, not a generator; TypeDoc supports TSDoc tags
  • API Extractor — Microsoft tool focused on API reports and .d.ts rollups, not full HTML docs
  • Docusaurus — general docs site; TypeDoc can export into Docusaurus via plugins

FAQ

Q: Does TypeDoc work with JavaScript files? A: It works best with TypeScript. For JavaScript, use JSDoc annotations and enable allowJs in your tsconfig.

Q: Can I customize the output theme? A: Yes. Use community themes or create a custom theme plugin that overrides the default renderer.

Q: How do I document internal/private members? A: Use the @internal tag and the --excludeInternal flag, or control visibility with @public/@private tags.

Q: Does it support monorepos? A: Yes. Use the --entryPointStrategy packages option to generate docs for multiple packages in one site.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados