plugins/processor.mjs) hooks into two TypeDoc lifecycle events to reshape the reflection tree and produce a machine-readable type map.
Full source
Behaviours
Accessor-to-property conversion
Accessor-to-property conversion
Fires on After this transformation, downstream partials treat the accessor identically to any other property.
Converter.EVENT_RESOLVE_BEGIN, before TypeDoc renders any output.TypeDoc models getter/setter pairs as Accessor reflections with getSignature and setSignature children. For documentation purposes these are simpler to present as plain properties, so the plugin mutates each accessor in place:- Sets
accessor.kindtoReflectionKind.Property. - If a
getSignatureis present, copies itstypeandcommentonto the accessor — the return type of the getter becomes the property type. - Otherwise, if only a
setSignatureis present, copies the type of the setter’s first parameter and its comment.
Namespace merging (export= flattening)
Namespace merging (export= flattening)
Also on
EVENT_RESOLVE_BEGIN, the plugin finds every Namespace reflection whose name is exactly "export=" and merges it into its parent reflection using context.project.mergeReflections.webpack’s type declarations use the CommonJS export = pattern, which TypeDoc represents as a nested namespace called export=. Without this step every exported member would be buried one level deeper than expected.Type-map generation
Type-map generation
Fires on The resulting object is written to Example output:
Renderer.EVENT_END, after all output files have been written.The plugin walks every reflection in the project and builds a JSON object whose keys are fully-qualified type names (e.g. "Compiler.hooks") and whose values are the corresponding HTML page URLs.Filtering rules — a reflection is included only when all of the following hold:- Its name is not
"export="or"__type"(internal TypeDoc artifacts). - Its kind is not
ReflectionKind.Reference(re-export aliases that duplicate real types). - The renderer’s router can produce a URL for it (
router.hasUrl(ref)).
.md paths; the plugin replaces the .md extension with .html so the map is valid for the deployed documentation site.type-map.json inside the configured output directory.