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
@group
, @groupDescription
, @showGroups
, @hideGroups
@import
@license
@mergeModuleWith
@module
@param
@privateRemarks
@property
, @prop
@remarks
@returns
, @return
@see
@since
@summary
@template
@throws
@typeParam
@type
, @yields
, @jsx
, @typedef
, @extends
, @augments
, @satisfies
, @callback
Modifier 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
.
@abstract
@alpha
@beta
@class
@enum
@event
@eventProperty
@expand
@experimental
@hidden
@hideconstructor
@ignore
@inline
@interface
@internal
@namespace
@overload
@override
@packageDocumentation
@private
@protected
@public
@readonly
@sealed
@useDeclaredType
@virtual
Inline tags are used to mark text within a paragraph for processing by TypeDoc. The most important ones are the
@link
and @inheritDoc
tags.
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.