TypeDoc supports a specific set of tags. Many JSDoc tags are not supported because the TypeScript compiler can infer the same information directly from code. Any tags which are not recognized will result in a warning being emitted. TypeDoc will still parse the documentation comment, using context clues to determine the likely intended tag type.
TypeDoc supports defining what tags are supported through either a tsdoc.json file or via the
--blockTags, --inlineTags, and --modifierTags options. If defined in a tsdoc.json file,
the file must be placed alongside tsconfig.json. See the
TSDoc documentation for details on the file format.
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/tsdoc/v0/tsdoc.schema.json",
"extends": ["typedoc/tsdoc.json"],
"noStandardTags": false,
"tagDefinitions": [
{
"tagName": "@customTag",
"syntaxKind": "modifier"
}
]
}
Block tags are tags that are associated with the following text. They can be
used to divide documentation into sections (@remarks),
modify how the reflection is organized (@group) or provide
examples for how to use the export (@example).
/**
* Summary
*
* @remarks
* Additional details
*
* @example
* ```ts
* factorial(3) // => 6
* ```
*/
@author@category, @categoryDescription, @showCategories, @hideCategories@defaultValue, @default@deprecated@document@example@expandType@group, @groupDescription, @showGroups, @hideGroups, @disableGroups@import@inlineType@license@mergeModuleWith@module@param, @this@preventExpand@preventInline@privateRemarks@property, @prop@remarks@returns, @return@see@since@sortStrategy@summary@template@throws@typeParam@type, @yields, @jsx, @typedef, @extends, @augments, @satisfies, @callbackModifier tags have no associated content and serve only to specify some special
behavior for how the reflection is processed by setting some binary flag. For
example, @hidden will remove a reflection from the
documentation while @internal will mark the reflection
as internal for use with
--visibilityFilters or
--excludeInternal.
/**
* Summary
*
* @alpha
* @interface
*/
export type Foo = { a: string };
@abstract@alpha@beta@class@enum@event@eventProperty@expand@experimental@function@hidden@hideconstructor@ignore@inline@interface@internal@namespace@overload@override@packageDocumentation@primaryExport@private@protected@public@readonly@sealed@useDeclaredType@virtualInline tags are used to mark text within a paragraph for processing by TypeDoc. The most important ones are the
@link and @inheritDoc tags.
/**
* Comment with a {@link Foo} to this type.
*/
export type Foo = { a: string };
If your project uses TypeScript to type check JavaScript, TypeDoc will pick up
type aliases and interfaces defined with @typedef and @callback. See the
TypeScript handbook
for details.
In comments for @typedef and @callback block tags and modifier tags cannot be
included due to TypeScript's decision to permit multiple @typedef declarations
within a single comment resulting in the TypeScript defined comment content not including
any additional non-braced tags. For this reason, TypeDoc will recognize modifier
tags with inline tag syntax and no content as modifier tags as a special case.
The following comment will be parsed as if Foo had a modifier @interface tag:
/**
* @typedef {{ x: string }} Foo Foo docs
* {@interface}
*/