Description
TypeDoc 0.28 is now in beta! 🎉
Please try it out and report any issues in new issues:
npm install --save-dev typedoc@beta
The full release is planned for 2025-03-14.
This release includes a major refactor to support a typedoc/browser
import suitable for use in frontend code which interacts with TypeDoc's JSON output and an updated search dialog which behaves better on mobile devices.
Default Theme Changes
@phoneticallySAARTHaK rebuilt TypeDoc's search dialog, resulting in an implementation which behaves much better on mobile devices and improved accessibility for screen readers.
Browser Entrypoint
TypeDoc's main entry point uses many node APIs during conversion making it unsuitable for usage in the browser. With this release, TypeDoc also provides typedoc/browser
and typedoc/browser/(lang)
entry points which can be used in a browser bundle which needs to parse TypeDoc's JSON output.
import {
ConsoleLogger,
Deserializer,
FileRegistry,
setTranslations,
} from "typedoc/browser";
// Similar paths are available for ja, ko, zh
import translations from "typedoc/browser/en";
// Before doing anything with TypeDoc, it should be configured with translations
setTranslations(translations);
const projectJson = await fetch("...").then(r => r.json());
const logger = new ConsoleLogger();
const deserializer = new Deserializer(logger);
const project = deserializer.reviveProject("API Docs", projectJson, {
projectRoot: "/",
registry: new FileRegistry(),
});
// Now we can use TypeDoc's models to more easily analyze the json
console.log(project.getChildByName("SomeClass.property"));
console.log(project.getChildByName("SomeClass.property").type.toString());
Change Log
Breaking Changes
- TypeDoc now expects all input globs paths to be specified with
/
path separators, Unable to doc file located in a dir with[]
#2825. - TypeDoc's
--entryPointStrategy merge
mode now requires JSON from at least version 0.28.0. - Removed
jp
translations fromlang
, to migrate switch toja
. - File name references in
intentionallyNotExported
now use a package name/package relative path instead of an absolute path for matching. - The
source-order
sort ordering now considers package names / package relative paths instead of using the absolute paths to a file.
API Breaking Changes
Path
andPathArray
parameter types now always contain normalized paths.- Introduced a
Router
which is used for URL creation.Reflection.url
,
Reflection.anchor
, andReflection.hasOwnDocument
have been removed. Deserializer.reviveProject(s)
no longer accepts an option to add project documents.Deserializer.reviveProjects
now requires analwaysCreateEntryPointModule
option.Comment.serializeDisplayParts
no longer requires a serializer argument.ReflectionSymbolId.fileName
has been removed, TypeDoc now stores a combination of a package name and package relative path instead.- Removed
DeclarationReflection.relevanceBoost
attribute which was added for plugins, but never used. i18n
proxy is no longer passed to many functions, instead, referencei18n
exported from the module directly.ReflectionKind.singularString
andReflectionKind.pluralString
now returns translated strings.
The methods onInternationalization
to do this previously have been removed.- The HTML output structure for the search box has changed to support the new modal.
Features
- Add support for TypeScript 5.8.x
- The search modal in the HTML output has been rewritten to provide better mobile support
- Added a
--router
option which can be used to modify TypeDoc's output folder
structure. This can be extended with plugins, Support for custom output directory structure #2111. - Introduced the
@primaryExport
modifier tag to provide more fine grained
control over export conversion order, Feature / Observation: Order matters in files processed regarding reflection generation for ambient namespace re-exports. #2856 - Introduced
packagesRequiringDocumentation
option forvalidation.notDocumented
, TypeDoc will expect comments to be present for symbols in the specified packages. - TypeDoc now exports a
typedoc/browser
entrypoint for parsing and using serialized JSON files, Runtime traversal utils for browser usage #2528.
Bug Fixes
- TypeDoc will now only create references for symbols re-exported from modules.
- Variable-functions will now prefer placing the comment on the signature if there is only one signature present, #2521 changed the behavior of documented arrow function #2824.
- User filter settings will no longer sometimes cause the search to have fewer visible results than expected.